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>
This commit is contained in:
parent
a6b049103a
commit
fe1dcb5873
@ -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…
x
Reference in New Issue
Block a user