MCPcopy
hub / github.com/lodash/lodash / cloneArrayBuffer

Function cloneArrayBuffer

lodash.js:4617–4621  ·  view source on GitHub ↗

* Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer.

(arrayBuffer)

Source from the content-addressed store, hash-verified

4615 * @returns {ArrayBuffer} Returns the cloned array buffer.
4616 */
4617 function cloneArrayBuffer(arrayBuffer) {
4618 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
4619 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
4620 return result;
4621 }
4622
4623 /**
4624 * Creates a clone of `dataView`.

Callers 3

cloneDataViewFunction · 0.85
cloneTypedArrayFunction · 0.85
initCloneByTagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected