Skip to content

Commit

Permalink
fix: remove ReDoS regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuangya committed Sep 21, 2017
1 parent 47747f3 commit 42a6ae0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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(' ');
};

/**
Expand Down

0 comments on commit 42a6ae0

Please sign in to comment.