1234567891011121314151617181920212223242526 |
- var objectProto = Object.prototype;
- var hasOwnProperty = objectProto.hasOwnProperty;
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
-
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
- module.exports = initCloneArray;
|