The Wayback Machine - https://web.archive.org/web/20250407172941/https://github.com/nodejs/node/commit/e94b72e41e
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Commit e94b72e

Browse filesBrowse files
TrottMylesBorins
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 <fishrock123@rocketmail.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 5396408 commit e94b72e
Copy full SHA for e94b72e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎tools/doc/generate.js

Copy file name to clipboardexpand all lines: 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.