From e94b72e41e846206e6ff8a062eb9e967539f4c04 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 Nov 2016 22:25:57 -0800 Subject: [PATCH] tools: remove unneeded escaping in generate.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `-` 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 Reviewed-By: Prince John Wesley Reviewed-By: Michaƫl Zasso --- tools/doc/generate.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/doc/generate.js b/tools/doc/generate.js index 077e740432c837..31b23c52a08ba7 100644 --- a/tools/doc/generate.js +++ b/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=/, ''); } });