|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
507 bytes
|
| Line | |
|---|
| 1 | var cloneArrayBuffer = require('./_cloneArrayBuffer');
|
|---|
| 2 |
|
|---|
| 3 | /**
|
|---|
| 4 | * Creates a clone of `dataView`.
|
|---|
| 5 | *
|
|---|
| 6 | * @private
|
|---|
| 7 | * @param {Object} dataView The data view to clone.
|
|---|
| 8 | * @param {boolean} [isDeep] Specify a deep clone.
|
|---|
| 9 | * @returns {Object} Returns the cloned data view.
|
|---|
| 10 | */
|
|---|
| 11 | function cloneDataView(dataView, isDeep) {
|
|---|
| 12 | var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|---|
| 13 | return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | module.exports = cloneDataView;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.