From 4e2150207c568adb9ead8f4c4528016081c88020 Mon Sep 17 00:00:00 2001 From: Josh Junon Date: Thu, 19 Nov 2020 13:14:31 +0100 Subject: [PATCH] fix regression --- src/node.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index dbbb5f10..1e6a5f16 100644 --- a/src/node.js +++ b/src/node.js @@ -160,7 +160,10 @@ var formatters = module.exports.formatters; formatters.o = function (v) { this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, ' '); + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(function (str) { return str.trim(); }) + .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed.