Go to file
2022-12-02 10:23:04 +08:00
dist 完成ts类型描述 2022-12-02 10:23:04 +08:00
src add test 2017-09-23 15:26:41 +08:00
.npmignore add .npmignore 2017-09-23 15:34:41 +08:00
package-lock.json 完成ts类型描述 2022-12-02 10:23:04 +08:00
package.json 完成ts类型描述 2022-12-02 10:23:04 +08:00
readme.md add .npmignore 2017-09-23 15:34:41 +08:00
tsconfig.json 完成ts类型描述 2022-12-02 10:23:04 +08:00

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