Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "util: use blue on non-windows systems for number/bigint"
This reverts commit 1708af3.

Numbers are much more difficult to read in blue and it would be good
to have a consistent output throughout all OS.
  • Loading branch information
BridgeAR committed Mar 9, 2018
commit 28f7b7431dbafb3c967c9f918dbe32a97a37fc2b
5 changes: 2 additions & 3 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-stream-buffer-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };