From f53962e944a87e6ca9bb622a2a12dffc22a9bb5a Mon Sep 17 00:00:00 2001 From: Ya Zhuang Date: Fri, 22 Sep 2017 06:26:33 +0800 Subject: [PATCH 1/2] remove ReDoS regexp in %o formatter (#504) --- src/node.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index af612976..b15109c9 100644 --- a/src/node.js +++ b/src/node.js @@ -85,7 +85,9 @@ function useColors() { exports.formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) - .replace(/\s*\n\s*/g, ' '); + .split('\n').map(function(str) { + return str.trim() + }).join(' '); }; /** From 13abeae468fea297d0dccc50bc55590809241083 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Fri, 22 Sep 2017 15:32:23 +0200 Subject: [PATCH 2/2] Release 2.6.9 --- CHANGELOG.md | 5 +++++ component.json | 2 +- package.json | 2 +- src/inspector-log.js | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/inspector-log.js diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a270cd..eadaa189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + 2.6.8 / 2017-05-18 ================== diff --git a/component.json b/component.json index 94cd36d8..9de26410 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "debug", "repo": "visionmedia/debug", "description": "small debugging utility", - "version": "2.6.8", + "version": "2.6.9", "keywords": [ "debug", "log", diff --git a/package.json b/package.json index df863517..dc787ba7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "debug", - "version": "2.6.8", + "version": "2.6.9", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" diff --git a/src/inspector-log.js b/src/inspector-log.js new file mode 100644 index 00000000..60ea6c04 --- /dev/null +++ b/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy