Urara-Blog/node_modules/.pnpm-store/v3/files/f5/1c598ffd4e88e5f30639df108deb6a488222616b4b05c08dfcc655af017e365a8b162bb16f53a03580bdd40bd3d6cdd4f2e6ba68162cc96b2cea487e8d0440
2022-08-14 01:14:53 +08:00

26 lines
692 B
Text

/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = new array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
module.exports = initCloneArray;