Skip to content

Commit 38afd20

Browse files
author
Ruben Bridgewater
committed
doc: add comparator description
1 parent 9a988d0 commit 38afd20

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

readme.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ stringify(circular, ['a', 'b'], 2)
5050
circular references. Set to `undefined`, circular properties are not
5151
serialized (array entries are replaced with `null`). Set to `Error`, to throw
5252
on circular references. **Default:** `'[Circular]'`.
53-
* `deterministic` {boolean} If `true`, guarantee a deterministic key order
54-
instead of relying on the insertion order. **Default:** `true`.
53+
* `deterministic` {boolean|function} If `true` or a `Array#sort(comparator)`
54+
comparator method, guarantee a deterministic key order instead of relying on
55+
the insertion order. **Default:** `true`.
5556
* `maximumBreadth` {number} Maximum number of entries to serialize per object
5657
(at least one). The serialized output contains information about how many
5758
entries have not been serialized. Ignored properties are counted as well
@@ -63,7 +64,8 @@ stringify(circular, ['a', 'b'], 2)
6364
* `strict` {boolean} Instead of handling any JSON value gracefully, throw an
6465
error in case it may not be represented as JSON (functions, NaN, ...).
6566
Circular values and bigint values throw as well in case either option is not
66-
explicitly defined. Sets and Maps are not detected! **Default:** `false`
67+
explicitly defined. Sets and Maps are not detected as well as Symbol keys!
68+
**Default:** `false`
6769
* Returns: {function} A stringify function with the options applied.
6870

6971
```js

0 commit comments

Comments
 (0)