rittenhop-ghost/versions/5.94.2/node_modules/nanoclone
2024-09-23 19:05:38 -04:00
..
src adding local files for running this....locally 2024-09-23 19:05:38 -04:00
.eslintrc.js adding local files for running this....locally 2024-09-23 19:05:38 -04:00
.size-limit adding local files for running this....locally 2024-09-23 19:05:38 -04:00
.travis.yml adding local files for running this....locally 2024-09-23 19:05:38 -04:00
index.js adding local files for running this....locally 2024-09-23 19:05:38 -04:00
LICENSE adding local files for running this....locally 2024-09-23 19:05:38 -04:00
package.json adding local files for running this....locally 2024-09-23 19:05:38 -04:00
README.md adding local files for running this....locally 2024-09-23 19:05:38 -04:00
rollup.config.js adding local files for running this....locally 2024-09-23 19:05:38 -04:00

nanoclone

license npm
Only 300B to deep clone JavaScript objects

Is it small enough?

See the size of the most popular clone npm package with 250M+ downloads image
And nanoclone size:
image

Supported

  • Primitives
  • Arrays
  • Plain objects
  • DOM Nodes
  • Date instances
  • RegExp instances
  • Maps
  • Sets
  • Circular structures

Installation

yarn add nanoclone
npm install nanoclone

Usage

import clone from 'nanoclone'

let a = {
  num: 2,
  arr: [1, 2, 3],
  nested: {
    obj: {
      a: 0
    }
  }
}

let b = clone(a)

License

MIT