object-deep-copy

1.0.2 • Public • Published

object-deep-copy

Deep copy of primitive types, Object, Array, Date, RegExp ...

Install

npm install object-deep-copy

Usage

var clone = require('object-deep-copy')
 
// deep copy object
var obj = clone({a: {b: [{c: 5}]}})
 
// deep copy array
var arr = clone([1, 2, {a: {b: 5}}])
 
// deep copy date
var date = clone(new Date());
 
// deep copy RegExp
var original_regExp = /w3schools/i;
var regExp_copy = clone(original_regExp);

Package Sidebar

Install

npm i object-deep-copy

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • angel.s.angelov