From 1329844a0808705091891175a6bee58358380af6 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 9 Mar 2018 14:44:04 +0100 Subject: [PATCH] Revert "util: use blue on non-windows systems for number/bigint" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1708af369ba4cdfbc9f3eadd657508498b8489a3. Numbers are much more difficult to read in blue and it would be good to have a consistent output throughout all OS. PR-URL: https://github.com/nodejs/node/pull/19256 Refs: https://github.com/nodejs/node/pull/18925 Reviewed-By: Colin Ihrig Reviewed-By: Сковорода Никита Андреевич Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: Gibson Fahnestock --- lib/util.js | 5 ++--- test/parallel/test-stream-buffer-list.js | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/util.js b/lib/util.js index b9ad76f4ad3ebd..eabdf6c1df6d6d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -347,11 +347,10 @@ inspect.colors = Object.assign(Object.create(null), { }); // Don't use 'blue' not visible on cmd.exe -const windows = process.platform === 'win32'; inspect.styles = Object.assign(Object.create(null), { 'special': 'cyan', - 'number': windows ? 'yellow' : 'blue', - 'bigint': windows ? 'yellow' : 'blue', + 'number': 'yellow', + 'bigint': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', diff --git a/test/parallel/test-stream-buffer-list.js b/test/parallel/test-stream-buffer-list.js index 05804cdc50852f..c151154afa3d01 100644 --- a/test/parallel/test-stream-buffer-list.js +++ b/test/parallel/test-stream-buffer-list.js @@ -34,8 +34,7 @@ assert.deepStrictEqual(list, new BufferList()); const tmp = util.inspect.defaultOptions.colors; util.inspect.defaultOptions = { colors: true }; -const color = util.inspect.colors[util.inspect.styles.number]; assert.strictEqual( util.inspect(list), - `BufferList { length: \u001b[${color[0]}m0\u001b[${color[1]}m }`); + 'BufferList { length: \u001b[33m0\u001b[39m }'); util.inspect.defaultOptions = { colors: tmp };