Fix converting empty like pattern to regex
This commit is contained in:
1 parent
18c31ae934
commit
b1c684fc9f
1 file changed
+1
-1
@@ -226,7 +226,7 @@ function likePatternToRegExp(pat, esc = "", flags = "") {
|
|||||||
"\\_": "."
|
"\\_": "."
|
||||||
};
|
};
|
||||||
let chars = expressionParser.parseLikePattern(pat, esc);
|
let chars = expressionParser.parseLikePattern(pat, esc);
|
||||||
if (!chars.length) return new RegExp("", flags);
|
if (!chars.length) return new RegExp("^$", flags);
|
||||||
chars = chars.map(c => convChars[c] || c);
|
chars = chars.map(c => convChars[c] || c);
|
||||||
chars[0] = chars[0] === ".*" ? "" : "^" + chars[0];
|
chars[0] = chars[0] === ".*" ? "" : "^" + chars[0];
|
||||||
const l = chars.length - 1;
|
const l = chars.length - 1;
|
||||||
|
|||||||
Reference in new issue
Block a user