forked from svrjs/svrjs
Changed invalid regex error message
This commit is contained in:
parent
0ed74bc55d
commit
17def48271
1 changed files with 1 additions and 1 deletions
2
svr.js
2
svr.js
|
@ -543,7 +543,7 @@ function getOS() {
|
|||
|
||||
function createRegex(regex, isPath) {
|
||||
var regexStrMatch = regex.match(/^\/((?:\\.|[^\/\\])*)\/([a-zA-Z0-9]*)$/);
|
||||
if (!regexStrMatch) throw new Error("Invalid regex!");
|
||||
if (!regexStrMatch) throw new Error("Invalid regular expression: " + regex);
|
||||
var searchString = regexStrMatch[1];
|
||||
var modifiers = regexStrMatch[2];
|
||||
if (isPath && !modifiers.match(/i/i) && os.platform() == "win32") modifiers += "i";
|
||||
|
|
Reference in a new issue