Skip to content

Commit 46f509c

Browse files
authored
Use a higher depth and edge limit to avoid breaking people (#58)
1 parent 49a6ea2 commit 46f509c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var replacerStack = []
1111

1212
function defaultOptions () {
1313
return {
14-
depthLimit: 10,
15-
edgesLimit: 20
14+
depthLimit: Number.MAX_SAFE_INTEGER,
15+
edgesLimit: Number.MAX_SAFE_INTEGER
1616
}
1717
}
1818

readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ function replacer(key, value) {
3535
}
3636

3737
// those are also defaults limits when no options object is passed into safeStringify
38+
// configure it to lower the limit.
3839
const options = {
39-
depthLimit: 10,
40-
edgesLimit: 20,
40+
depthLimit: Number.MAX_SAFE_INTEGER,
41+
edgesLimit: Number.MAX_SAFE_INTEGER
4142
};
4243

4344
const serialized = safeStringify(o, replacer, 2, options)
@@ -166,4 +167,4 @@ MIT
166167
[`space`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The%20space%20argument
167168
[`toJSON`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior
168169
[benchmark]: https://github.com/epoberezkin/fast-json-stable-stringify/blob/67f688f7441010cfef91a6147280cc501701e83b/benchmark
169-
[JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
170+
[JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

0 commit comments

Comments
 (0)