From db08af1167f6bc9b40c04731928738c256bd443b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E?= Date: Sun, 22 Oct 2023 19:01:07 +0800 Subject: [PATCH] fix(route): util/globToRegex backslash handling --- src/util/globToRegex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/globToRegex.ts b/src/util/globToRegex.ts index dbd903d..9966835 100644 --- a/src/util/globToRegex.ts +++ b/src/util/globToRegex.ts @@ -18,7 +18,7 @@ export default function globToRegex(glob: string): RegExp { switch (c) { case '\\': { i += 1; - const char = i === glob.length ? c : glob[i + 1]; + const char = i === glob.length ? c : glob[i]; tokens.push(syntaxChars.has(char) ? `\\${char}` : char); break; }