Skip to content

Commit a2aa2f7

Browse files
TrottMylesBorins
authored andcommitted
lib: refactor bootstrap_node.js regular expression
* use `+` instead of `*` where one-or-more is required * switch from String.prototype.match() to RegExp.prototype.test() PR-URL: #10749 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Jackson Tian <[email protected]>
1 parent 243652a commit a2aa2f7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/internal/bootstrap_node.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,7 @@
367367
}
368368

369369
function isDebugBreak() {
370-
return process.execArgv.some((arg) => {
371-
return arg.match(/^--debug-brk(=[0-9]*)?$/);
372-
});
370+
return process.execArgv.some((arg) => /^--debug-brk(=[0-9]+)?$/.test(arg));
373371
}
374372

375373
function run(entryFunction) {

0 commit comments

Comments
 (0)