/nanoclone

145B to deep clone JavaScript objects

Primary LanguageJavaScriptMIT LicenseMIT

nanoclone

Only 145B to deep clone JavaScript objects

Is it small enough?

See comparison with the most popular clone npm package with 236M downloads Compare with clone package

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