https://github.com/viktor-maksimov/js-deep-cloning
Deep cloning, so the pointers are lost.
https://github.com/viktor-maksimov/js-deep-cloning
angular cloning deep-clone deep-clone-objects ecmascript es6 javascript object reactjs structured-clone typescript vuejs
Last synced: about 21 hours ago
JSON representation
Deep cloning, so the pointers are lost.
- Host: GitHub
- URL: https://github.com/viktor-maksimov/js-deep-cloning
- Owner: viktor-maksimov
- License: mit
- Created: 2022-01-30T17:13:31.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-04T21:24:42.000Z (over 3 years ago)
- Last Synced: 2025-05-27T22:06:17.331Z (30 days ago)
- Topics: angular, cloning, deep-clone, deep-clone-objects, ecmascript, es6, javascript, object, reactjs, structured-clone, typescript, vuejs
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Javascript Deep Cloning
Javascript deep cloning, so pointers are lost.
## Usage
### Install the package
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)
```## Contribution
Everybody can contribute
### Useful commands (examples with yarn)
Build your code:
```
yarn build
```Run tests:
```
yarn test
```Generate test coverage:
```
yarn test:coverage
```Run ESLint:
```
yarn lint
```### Important
Please before opening a PR for this package - run tests and eslint and fix the errors in your code.
## License
MIT