Browse Source

tools: remove unneeded escaping in generate.js

`-` does not need to be escaped in a regular expression outside of
character classes.

PR-URL: https://github.com/nodejs/node/pull/9781
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
e94b72e41e
  1. 14
      tools/doc/generate.js

14
tools/doc/generate.js

@ -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=/, '');
}
});

Loading…
Cancel
Save