Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

component-clone

component128.7k0.2.3

Object clone supporting date, regexp, array and object types.

readme

clone

Object clone supporting date, regexp, array and object types.

Example

var obj = clone({
  a: 'b',
  c: [
    new Date(),
    'tobi',
    'jane'
  ]
})

API

clone(obj)

Clones obj recursively and returns it.

License

MIT

changelog

0.2.3 / 2016-07-21

  • use safer Object.prototype.hasOwnProperty

0.2.2 / 2014-03-06

  • fix require() call again

0.2.1 / 2014-03-01

  • make clone work in all environments FOR REAL
  • change npm name to component-clone

0.2.0 / 2014-01-27

  • make clone work in all environments

0.1.1 / 2014-01-07

  • add repo field to component.json
  • add tests around cloning functions
  • package: fixed package.json

0.1.0 / 2012-10-18

  • initial release