Skip to content

Commit

Permalink
util: change default value of maxStringLength to 10000
Browse files Browse the repository at this point in the history
  • Loading branch information
rosaxxny committed Apr 9, 2020
1 parent 7251e8c commit dcb0c8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ changes:
negative to show no elements. **Default:** `100`.
* `maxStringLength` {integer} Specifies the maximum number of characters to
include when formatting. Set to `null` or `Infinity` to show all elements.
Set to `0` or negative to show no characters. **Default:** `Infinity`.
Set to `0` or negative to show no characters. **Default:** `10000`.
* `breakLength` {integer} The length at which input values are split across
multiple lines. Set to `Infinity` to format the input as a single line
(in combination with `compact` set to `true` or any number >= `1`).
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const inspectDefaultOptions = ObjectSeal({
customInspect: true,
showProxy: false,
maxArrayLength: 100,
maxStringLength: Infinity,
maxStringLength: 10000,
breakLength: 80,
compact: 3,
sorted: false,
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2782,6 +2782,7 @@ assert.strictEqual(

{
const x = 'a'.repeat(1e6);
assert(util.inspect(x).endsWith('... 990000 more characters'));
assert.strictEqual(
util.inspect(x, { maxStringLength: 4 }),
"'aaaa'... 999996 more characters"
Expand Down

0 comments on commit dcb0c8a

Please sign in to comment.