Revert "util: use blue on non-windows systems for number/bigint"

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 <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
Ruben Bridgewater 2018-03-09 14:44:04 +01:00 committed by Anna Henningsen
parent 2e376184f2
commit 1329844a08
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9
2 changed files with 3 additions and 5 deletions

View File

@ -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',

View File

@ -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 };