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 committed Nov 27, 2016
1 parent a6b0491 commit fe1dcb5
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 fe1dcb5

Please sign in to comment.