1.1.0 • Published 2 years ago

deep-clone-fn v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

deep-clone-fn

A modification of Sindre Sorhus's excellent mimic-fn for deep cloning functions.

Installation

npm install deep-clone-fn

Usage

import deepCloneFunction from 'deep-clone-fn';

function f(x) {
  return x;
}

f.myProperty = { foo: 'bar' };

const g = deepCloneFunction(f);

f.myProperty.foo = 'baz';

console.log(g.myProperty); // { foo: 'bar' }
console.log(g('foo')); // foo
1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago