deep-clone-fn
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i deep-clone-fn

Weekly Downloads

415

Version

1.1.0

License

MIT

Unpacked Size

15.2 kB

Total Files

7

Last publish

Collaborators

  • leondreamed