diff --git a/package.json b/package.json index 3650bb0b..191c8154 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "debug", - "version": "3.2.6", + "version": "3.2.7", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" 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.