main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
527 bytes
|
Line | |
---|
1 | var cloneArrayBuffer = require('./_cloneArrayBuffer');
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Creates a clone of `typedArray`.
|
---|
5 | *
|
---|
6 | * @private
|
---|
7 | * @param {Object} typedArray The typed array to clone.
|
---|
8 | * @param {boolean} [isDeep] Specify a deep clone.
|
---|
9 | * @returns {Object} Returns the cloned typed array.
|
---|
10 | */
|
---|
11 | function cloneTypedArray(typedArray, isDeep) {
|
---|
12 | var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
---|
13 | return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
---|
14 | }
|
---|
15 |
|
---|
16 | module.exports = cloneTypedArray;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.