copy-data
v0.1.2
Published
A module to use to copy data for React, so you can then mutate them into ninja turtles or x-men.
Readme
npm install copy-data --saveExample
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) // falseIncluded 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