Skip to content

Commit 1708af3

Browse files
committed
util: use blue on non-windows systems for number/bigint
PR-URL: #18925 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent da886d9 commit 1708af3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/util.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ inspect.colors = Object.assign(Object.create(null), {
339339
});
340340

341341
// Don't use 'blue' not visible on cmd.exe
342+
const windows = process.platform === 'win32';
342343
inspect.styles = Object.assign(Object.create(null), {
343344
'special': 'cyan',
344-
'number': 'yellow',
345-
'bigint': 'yellow',
345+
'number': windows ? 'yellow' : 'blue',
346+
'bigint': windows ? 'yellow' : 'blue',
346347
'boolean': 'yellow',
347348
'undefined': 'grey',
348349
'null': 'bold',

test/parallel/test-stream-buffer-list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ assert.deepStrictEqual(list, new BufferList());
3434

3535
const tmp = util.inspect.defaultOptions.colors;
3636
util.inspect.defaultOptions = { colors: true };
37+
const color = util.inspect.colors[util.inspect.styles.number];
3738
assert.strictEqual(
3839
util.inspect(list),
39-
'BufferList { length: \u001b[33m0\u001b[39m }');
40+
`BufferList { length: \u001b[${color[0]}m0\u001b[${color[1]}m }`);
4041
util.inspect.defaultOptions = { colors: tmp };

0 commit comments

Comments
 (0)