1.0.9 • Published 4 years ago

@hankychung/deep-copy v1.0.9

Weekly downloads
10
License
ISC
Repository
-
Last release
4 years ago

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

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago