GoScrobble/web/node_modules/lodash-es/_cloneArrayBuffer.js

17 lines
447 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
import Uint8Array from './_Uint8Array.js';
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
export default cloneArrayBuffer;