@antv/layout
Version:
graph layout algorithm
39 lines (31 loc) • 1.02 kB
JavaScript
/** Used for built-in method references. */
var _initCloneArray;
var hasRequired_initCloneArray;
function require_initCloneArray () {
if (hasRequired_initCloneArray) return _initCloneArray;
hasRequired_initCloneArray = 1;
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;
}
_initCloneArray = initCloneArray;
return _initCloneArray;
}
export { require_initCloneArray as __require };
//# sourceMappingURL=_initCloneArray.js.map