fast-deep-copy

1.0.0 • Public • Published

fast-deep-copy

Only 20 lines code! no deps!

Useage:

    npm install -S fast-deep-copy
 
    import { deepCopy } from 'fast-deep-copy'
 
    let a = { dataA: 10, b: null };
    let b = { dataB: 20, a: null };
    a.b = b;
    b.a = a;
 
    let newA = deepCopy(a);
    console.log(newA.dataA === 10);     //true
    console.log(newA.b.dataB === 20);   //true
    console.log(newA.b.a === newA);     //true

Package Sidebar

Install

npm i fast-deep-copy

Weekly Downloads

1,781

Version

1.0.0

License

ISC

Last publish

Collaborators

  • 625335512