From 1708af369ba4cdfbc9f3eadd657508498b8489a3 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Wed, 21 Feb 2018 20:45:57 -0600 Subject: [PATCH] util: use blue on non-windows systems for number/bigint PR-URL: https://github.com/nodejs/node/pull/18925 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- lib/util.js | 5 +++-- test/parallel/test-stream-buffer-list.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/util.js b/lib/util.js index a019036ede6516..df117782ca962c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -339,10 +339,11 @@ 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': 'yellow', - 'bigint': 'yellow', + 'number': windows ? 'yellow' : 'blue', + 'bigint': windows ? 'yellow' : 'blue', '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 c151154afa3d01..05804cdc50852f 100644 --- a/test/parallel/test-stream-buffer-list.js +++ b/test/parallel/test-stream-buffer-list.js @@ -34,7 +34,8 @@ 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[33m0\u001b[39m }'); + `BufferList { length: \u001b[${color[0]}m0\u001b[${color[1]}m }`); util.inspect.defaultOptions = { colors: tmp };