npm.io
0.1.2 • Published 8 years ago

copy-data

Licence
ISC
Version
0.1.2
Deps
0
Size
36 kB
Vulns
0
Weekly
0
npm install copy-data --save

Example

const copy = require('copy-data');
const obj = {
  coffee: ['iced', 'double', 'soy', 'vanilla'],
  nachos: true,
  pizza: 5,
  salad: null,
  sushi: 'always'
};

const objCopy = copy.object(obj);
console.log(obj === objCopy) // false

Included methods:

copy.array(arr);
copy.func(func);
copy.object(obj);
copy.string(string); // Still renders true, but I think it is because it checks value instead of memory location

Keywords