8000 fix: remove ReDoS regexp · debug-js/debug@42a6ae0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42a6ae0

Browse files
committed
fix: remove ReDoS regexp
1 parent 47747f3 commit 42a6ae0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/node.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ function useColors() {
8383
exports.formatters.o = function(v) {
8484
this.inspectOpts.colors = this.useColors;
8585
return util.inspect(v, this.inspectOpts)
86-
.replace(/\s*\n\s*/g, ' ');
86+
.split('\n').map(function(str) {
87+
return str.trim()
88+
}).join(' ');
8789
};
8890

8991
/**

0 commit comments

Comments
 (0)
0