MCPcopy
hub / github.com/lodash/lodash / cloneTypedArray

Function cloneTypedArray

lodash.js:4668–4671  ·  view source on GitHub ↗

* 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.

(typedArray, isDeep)

Source from the content-addressed store, hash-verified

4666 * @returns {Object} Returns the cloned typed array.
4667 */
4668 function cloneTypedArray(typedArray, isDeep) {
4669 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
4670 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
4671 }
4672
4673 /**
4674 * Compares values to sort them in ascending order.

Callers 2

baseMergeDeepFunction · 0.85
initCloneByTagFunction · 0.85

Calls 1

cloneArrayBufferFunction · 0.85

Tested by

no test coverage detected