Skip to content

alice-em/copy-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm install copy-data --save

Example

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

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

Included methods:

copyArray(item);
copyFunction(item);
copyObject(item);
copyDeepObject(item);
copyString(item);
// Still renders true, but I think it is because it checks value instead of memory location

About

A module to use to copy data for React, so you can then mutate them into ninja turtles or x-men.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published