You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
527 B
16 lines
527 B
var cloneArrayBuffer = require('./_cloneArrayBuffer'); |
|
|
|
/** |
|
* Creates a clone of `typedArray`. |
|
* |
|
* @private |
|
* @param {Object} typedArray The typed array to clone. |
|
* @param {boolean} [isDeep] Specify a deep clone. |
|
* @returns {Object} Returns the cloned typed array. |
|
*/ |
|
function cloneTypedArray(typedArray, isDeep) { |
|
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; |
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); |
|
} |
|
|
|
module.exports = cloneTypedArray;
|
|
|