Skip to content

Commit

Permalink
tools: remove unneeded escaping in generate.js
Browse files Browse the repository at this point in the history
`-` does not need to be escaped in a regular expression outside of
character classes.

PR-URL: #9781
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Trott authored and MylesBorins committed Dec 20, 2016
1 parent 5396408 commit e94b72e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tools/doc/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ let inputFile = null;
let nodeVersion = null;

args.forEach(function(arg) {
if (!arg.match(/^\-\-/)) {
if (!arg.match(/^--/)) {
inputFile = arg;
} else if (arg.match(/^\-\-format=/)) {
format = arg.replace(/^\-\-format=/, '');
} else if (arg.match(/^\-\-template=/)) {
template = arg.replace(/^\-\-template=/, '');
} else if (arg.match(/^\-\-node\-version=/)) {
nodeVersion = arg.replace(/^\-\-node\-version=/, '');
} else if (arg.match(/^--format=/)) {
format = arg.replace(/^--format=/, '');
} else if (arg.match(/^--template=/)) {
template = arg.replace(/^--template=/, '');
} else if (arg.match(/^--node-version=/)) {
nodeVersion = arg.replace(/^--node-version=/, '');
}
});

Expand Down

0 comments on commit e94b72e

Please sign in to comment.