Skip to content

Commit 0712944

Browse files
committed
docs: option "cycles"
1 parent aa52d84 commit 0712944

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ output:
2222
{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}
2323
```
2424

25+
2526
# methods
2627

2728
``` js
@@ -32,6 +33,7 @@ var stringify = require('fast-json-stable-stringify')
3233

3334
Return a deterministic stringified string `str` from the object `obj`.
3435

36+
3537
## options
3638

3739
### cmp
@@ -80,6 +82,13 @@ which outputs:
8082
{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10}
8183
```
8284

85+
### cycles
86+
87+
Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case.
88+
89+
Without this option TypeError will be thrown.
90+
91+
8392
# install
8493

8594
With [npm](https://npmjs.org) do:
@@ -88,6 +97,7 @@ With [npm](https://npmjs.org) do:
8897
npm install fast-json-stable-stringify
8998
```
9099

100+
91101
# license
92102

93103
MIT

0 commit comments

Comments
 (0)