Skip to content

Commit c8d9ce3

Browse files
committed
docs: add new functionality to docs
1 parent 81b28bd commit c8d9ce3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# clone-deep [![NPM version](https://img.shields.io/npm/v/clone-deep.svg?style=flat)](https://www.npmjs.com/package/clone-deep) [![NPM monthly downloads](https://img.shields.io/npm/dm/clone-deep.svg?style=flat)](https://npmjs.org/package/clone-deep) [![NPM total downloads](https://img.shields.io/npm/dt/clone-deep.svg?style=flat)](https://npmjs.org/package/clone-deep) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/clone-deep.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/clone-deep)
22

3-
> Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives.
3+
> Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. Supports circular objects clonning.
44
55
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
66

@@ -19,6 +19,7 @@ const cloneDeep = require('clone-deep');
1919

2020
let obj = { a: 'b' };
2121
let arr = [obj];
22+
2223
let copy = cloneDeep(arr);
2324
obj.c = 'd';
2425

@@ -27,6 +28,12 @@ console.log(copy);
2728

2829
console.log(arr);
2930
//=> [{ a: 'b', c: 'd' }]
31+
32+
obj.e = obj;
33+
copy = cloneDeep(arr);
34+
35+
console.log(copy);
36+
//=> [{ a: 'b', c: 'd', e: {...} }] // handles circular arrays and objects cloning
3037
```
3138

3239
## Heads up!
@@ -84,9 +91,10 @@ You might also be interested in these projects:
8491
### Contributors
8592

8693
| **Commits** | **Contributor** |
87-
| --- | --- |
94+
| -- | --- |
8895
| 46 | [jonschlinkert](https://github.com/jonschlinkert) |
89-
| 2 | [yujunlong2000](https://github.com/yujunlong2000) |
96+
| 2 | [yujunlong2000](https://github.com/yujunlong2000) |
97+
| 5 | [emahuni](https://github.com/emahuni) |
9098

9199
### Author
92100

0 commit comments

Comments
 (0)