Urara-Blog/node_modules/.pnpm-store/v3/files/1e/3318af13a6a26f1612e375d023e534a250c00a69f620e4d57ac72b51e24e816954d455d1a4bc394b720e8ee12ca957a5a2015094d3d8543f92fcc5a8fc9a35
2022-08-14 01:14:53 +08:00

20 lines
454 B
Text

/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;