Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf53962e

Browse files
zhuangyaTooTallNate
authored andcommitted
remove ReDoS regexp in %o formatter (#504)
1 parent52e1f21 commitf53962e

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
@@ -85,7 +85,9 @@ function useColors() {
8585
exports.formatters.o=function(v){
8686
this.inspectOpts.colors=this.useColors;
8787
returnutil.inspect(v,this.inspectOpts)
88-
.replace(/\s*\n\s*/g,' ');
88+
.split('\n').map(function(str){
89+
returnstr.trim()
90+
}).join(' ');
8991
};
9092

9193
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp