Javascript deep cloning, so pointers are lost.
package.json
{
"dependencies": {
"js-deep-cloning": "latest"
}
}
After that (with Yarn):
yarn install
Or with NPM:
npm install
And finally you can use it in your project:
import { deepClone } from "js-deep-cloning"
const student = {
id: 1,
name: "Jack",
items: ["pen", "rubber", "textbook", "tablet"],
examDate: new Date(),
classmates: [
{
id: 2,
name: "John",
items: null,
examDate: new Date()
},
{
id: 2,
name: "James",
items: ["pencil", "laptop"],
exams: [new Date(), new Date()]
}
],
university: null
}
const studentData = deepClone(student)
Everybody can contribute
Build your code:
yarn build
Run tests:
yarn test
Generate test coverage:
yarn test:coverage
Run ESLint:
yarn lint
Please before opening a PR for this package - run tests and eslint and fix the errors in your code.
MIT