From c9fece38c8dc872303fd0f5d6bf0ffc44bea7f4f Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 5 Apr 2019 22:18:16 +0200 Subject: util: change inspect compact and breakLength default This changes the `compact` default from `true` to `3`. That mode changes arrays to be grouped together, it alignes multiple small entries on a single line in similar to `compact` true but only for the most inner three depth levels and the closing brackets are always on the same indentation as the openeing of the object instead of at the same line as another property. Big strings will be naturally broken into multiple lines instead of having one huge line that is not well readable. The output size mainly stays the same that way while it will be smaller in case of big arrays. Increasing the `breakLength` to 80 adjusts for most terminals that support at least 80 characters in a single line and improves the general output that way. A lot of calculations use the `breakLength` to determine the concrete behavior. PR-URL: https://github.com/nodejs/node/pull/27109 Reviewed-By: Anna Henningsen Reviewed-By: Minwoo Jung Reviewed-By: James M Snell Reviewed-By: Matteo Collina --- lib/internal/util/inspect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/internal/util/inspect.js') diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 5439c27d25..a31ee5b8eb 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -95,8 +95,8 @@ const inspectDefaultOptions = Object.seal({ customInspect: true, showProxy: false, maxArrayLength: 100, - breakLength: 60, - compact: true, + breakLength: 80, + compact: 3, sorted: false, getters: false }); -- cgit v1.2.3