Skip to content

Commit 2ee3543

Browse files
Trottaddaleax
authored andcommitted
tools: remove unneeded escaping in generate.js
`-` does not need to be escaped in a regular expression outside of character classes. PR-URL: #9781 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent b763a31 commit 2ee3543

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/doc/generate.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ let inputFile = null;
1313
let nodeVersion = null;
1414

1515
args.forEach(function(arg) {
16-
if (!arg.match(/^\-\-/)) {
16+
if (!arg.match(/^--/)) {
1717
inputFile = arg;
18-
} else if (arg.match(/^\-\-format=/)) {
19-
format = arg.replace(/^\-\-format=/, '');
20-
} else if (arg.match(/^\-\-template=/)) {
21-
template = arg.replace(/^\-\-template=/, '');
22-
} else if (arg.match(/^\-\-node\-version=/)) {
23-
nodeVersion = arg.replace(/^\-\-node\-version=/, '');
18+
} else if (arg.match(/^--format=/)) {
19+
format = arg.replace(/^--format=/, '');
20+
} else if (arg.match(/^--template=/)) {
21+
template = arg.replace(/^--template=/, '');
22+
} else if (arg.match(/^--node-version=/)) {
23+
nodeVersion = arg.replace(/^--node-version=/, '');
2424
}
2525
});
2626

0 commit comments

Comments
 (0)