copy-data

0.1.2 • Public • Published
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

Readme

Keywords

Package Sidebar

Install

npm i copy-data

Weekly Downloads

6

Version

0.1.2

License

ISC

Unpacked Size

36.8 kB

Total Files

4

Last publish

Collaborators

  • nitrogen