From aa012aab59f3a41a58a4da97dea781d08ed6f06c Mon Sep 17 00:00:00 2001 From: Vladimir Boretskyi Date: Mon, 23 Sep 2019 02:04:21 +0300 Subject: [PATCH] Redo weak equality check so we can colorize null in safe mode (#257) --- lib/colors.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/colors.js b/lib/colors.js index 7ca90fa..0c1089f 100644 --- a/lib/colors.js +++ b/lib/colors.js @@ -105,7 +105,8 @@ function applyStyle() { var args = Array.prototype.slice.call(arguments); var str = args.map(function(arg) { - if (arg !== undefined && arg.constructor === String) { + // Use weak equality check so we can colorize null in safe mode + if (arg != undefined && arg.constructor === String) { return arg; } else { return util.inspect(arg);