Library for fastest array cloning or copy objects with similar structures
npm install fastest-cloneThis library can 200X times faster than lodash (benchmark) make deep copies of an array or objects with similar structure in JavaScript
javascript
// array of SAME STRUCTURED object
var sourceArray = [{ f1 : ..., f2: ... }, ...];
`You can use built-in array clone function:
`javascript
var clonedArray = FastClone.cloneArray(sourceArray);
`
or object clone constructor factory:
`javascript
// creating deep clone constructor function
var Clone = FastClone.factory(sourceArray[0]);
var clonedArray = sourceArray.map(function(item) {
// you can add here custom logic
return new Clone(item);
});
`
$3
In a browser:
`html
`
Using npm:
`
npm install fastest-clone
``Copyright (c) 2016 Ivan Volovikov
Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php