esclone
v1.0.4
Published
Utility to deep copy JS ES6 types
Downloads
2
Readme
ESCLONE
A utility to deep copy ES6 types. Following are the supported types,
- Json Object
- Number
- String
- Boolean
- Map
- Set
- Date
- Array
All other types will be shallow copied.
Getting Started
- Clone the repo
- run the test using "npm test"
Prerequisites
- Node 5.4.0 and greater
Example
Install esclone using,
npm install --savedev esclone
To use in any file add impport esclone,
import esclone from "esclone";
And then use,
const rockysGrandFather = {
name: "Rockys grand father",
father: "Don't know :("
};
const rockysFather = {
name: "Rockys Father",
father: rockysGrandFather
};
const rocky = {
name: "Rocky",
father: rockysFather
};
const rockyClone = esclone(rocky);
Installing
npm install --savedev esclone
Running the tests
npm run test
Running lint
/node_modules/eslint/bin/eslint.js --ext .js ./src
Running lint in auto fix moed
/node_modules/eslint/bin/eslint.js --ext .js ./src --fix
Authors
Tushar Dhole
License
This project is licensed under the MIT License - see the LICENSE.md file for details