Narnia Produced Magic

    @hankychung/deep-copy

    1.0.9 • Public • Published

    description

    a tool for copying object/array in a real deep way

    usage

    npm i @hankychung/deep-copy -D
    
    import deepCopy from '@hankychung/deep-copy'
    
    let a = {
      age: 1,
      jobs: {
        first: "Fir"
      },
      lang: [
        {
          name: 'usa'
        },
        {
          name: 'cn'
        }
      ],
      arr: [
        [
          {
            value: '1'
          }
        ],
        [
          {
            value: '2'
          }
        ],
      ]
    };
    
    let dc = deepCopy(a)
    

    params

    example: deepCopy(input)

    input

    type: object, array

    desc: things you want to copy

    return: things that have been copied and have no any relationship with the source

    Install

    npm i @hankychung/deep-copy

    DownloadsWeekly Downloads

    2

    Version

    1.0.9

    License

    ISC

    Unpacked Size

    3.82 kB

    Total Files

    6

    Last publish

    Collaborators

    • hankychung