Does a deep copy of an array or object with an optional interceptor


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
9455Aug 8, 2019Jul 14, 2015Minified + gzip package size for abacus-clone in KB



Creates a deep copy of an array or object such that modifying any level of the copy will not change anything on the original

The interceptor function is called on every property of the object passed including the object itself. It must return a value. If no interceptor function is passed, a default interceptor that results in a deep clone is used.


interceptor(value, key)

(value, key) => {
  if(key === 'money')
    return value * 2;
  return value;

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.