GT2/GT2-Android/node_modules/lodash-es/_cloneArrayBuffer.js

17 lines
447 B
JavaScript
Raw Normal View History

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;