diff options
Diffstat (limited to 'school/node_modules/lodash/_cloneArrayBuffer.js')
-rw-r--r-- | school/node_modules/lodash/_cloneArrayBuffer.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/school/node_modules/lodash/_cloneArrayBuffer.js b/school/node_modules/lodash/_cloneArrayBuffer.js new file mode 100644 index 0000000..c3d8f6e --- /dev/null +++ b/school/node_modules/lodash/_cloneArrayBuffer.js @@ -0,0 +1,16 @@ +var Uint8Array = require('./_Uint8Array'); + +/** + * 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; +} + +module.exports = cloneArrayBuffer; |