mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
16
.internal/cloneTypedArray.js
Normal file
16
.internal/cloneTypedArray.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import cloneArrayBuffer from './.internal/cloneArrayBuffer.js';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
function cloneTypedArray(typedArray, isDeep) {
|
||||
const buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
||||
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
||||
}
|
||||
|
||||
export default cloneTypedArray;
|
||||
Reference in New Issue
Block a user