From 4500ed85e9e3cb1be5454b238975aae20a0f21ba Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 22 Feb 2019 23:26:25 +0100 Subject: [PATCH] util: add compact depth mode This overloads the `compact` option from `util.inspect()`. If it's set to a number, it is going to align all most inner entries on the same lign if they adhere to the following: * The entries do not exceed the `breakLength` options value. * The entry is one of the local most inner levels up the the one provided in `compact`. PR-URL: https://github.com/nodejs/node/pull/26269 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- doc/api/util.md | 15 ++++++++----- lib/internal/util/inspect.js | 34 ++++++++++++++++++++-------- test/parallel/test-util-inspect.js | 36 ++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 14 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index f4ff140b6c2e28..35527f5932aac2 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -375,6 +375,9 @@ stream.write('With ES6');