util: refactor inspecting long lines · nodejs/node@9ced334 · GitHub
Skip to content

Commit 9ced334

Browse files
committed
util: refactor inspecting long lines
Using the `util.inspect` `compact` mode set to something else than `true` resulted in breaking long lines in case the line would exceed the `breakLength` option and if it contained whitespace and or new lines. It turned out that this behavior was less useful than originally expected and it is now changed to only break on line breaks if the `breakLength` option is exceeded for the inspected string. This should be align better with the user expectation than the former behavior. PR-URL: #28055 Fixes: #27690 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 56b150b commit 9ced334

2 files changed

Lines changed: 22 additions & 79 deletions

File tree

lib/internal/util/inspect.js

Lines changed: 6 additions & 33 deletions

test/parallel/test-util-inspect.js

Lines changed: 16 additions & 46 deletions

0 commit comments

Comments
 (0)