@@ -44,9 +44,9 @@ stringify(circular, ['a', 'b'], 2)
44
44
45
45
* ` bigint ` {boolean} If ` true ` , bigint values are converted to a number. Otherwise
46
46
they are ignored. ** Default:** ` true ` .
47
- * ` circularValue ` {string|null|undefined} Define the value for circular
48
- references. Circular values are not serialized, if set to ` undefined ` .
49
- ** Default:** ` [Circular] ` .
47
+ * ` circularValue ` {string|null|undefined} Defines the value for circular
48
+ references. Set to ` undefined ` , circular properties are not serialized (array
49
+ entries are replaced with ` null ` ). ** Default:** ` [Circular] ` .
50
50
* ` deterministic ` {boolean} If ` true ` , guarantee a deterministic key order
51
51
instead of relying on the insertion order. ** Default:** ` true ` .
52
52
* ` maximumBreadth ` {number} Maximum number of entries to serialize per object
@@ -93,10 +93,10 @@ console.log(stringified)
93
93
94
94
## Differences to JSON.stringify
95
95
96
- 1 . Replace circular structures with the string ` [Circular] ` (the value may be changed).
97
- 1 . Sorted keys instead of using the insertion order (it is possible to deactivate this).
98
- 1 . BigInt values are stringified as regular number instead of throwing a TypeError.
99
- 1 . Boxed primitives (e.g., ` Number(5) ` ) are not unboxed and are handled as
96
+ 1 . _ Circular values _ are replaced with the string ` [Circular] ` (the value may be changed).
97
+ 1 . _ Object keys _ are sorted instead of using the insertion order (it is possible to deactivate this).
98
+ 1 . _ BigInt _ values are stringified as regular number instead of throwing a TypeError.
99
+ 1 . _ Boxed primitives _ (e.g., ` Number(5) ` ) are not unboxed and are handled as
100
100
regular object.
101
101
102
102
Those are the only differences to ` JSON.stringify() ` . This is a side effect free
@@ -105,8 +105,8 @@ with `JSON.stringify()`.
105
105
106
106
## Performance / Benchmarks
107
107
108
- Currently this is by far the fastest known stable stringify implementation.
109
- This is especially important for big objects and TypedArrays.
108
+ Currently this is by far the fastest known stable (deterministic) stringify
109
+ implementation. This is especially important for big objects and TypedArrays.
110
110
111
111
(Dell Precision 5540, i7-9850H CPU @ 2.60GHz, Node.js 16.11.1)
112
112
0 commit comments