From ffcb15ba96f6ccd4de4368c94cb7c36142c0a64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 16 Apr 2026 16:10:16 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E6=94=AF=E6=8C=81=E5=AF=B9=E9=80=9A=E9=85=8D?= =?UTF-8?q?=E7=AC=A6=E8=B7=AF=E5=BE=84=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/validate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/validate.ts b/src/utils/validate.ts index e2886e4..e6a75e6 100644 --- a/src/utils/validate.ts +++ b/src/utils/validate.ts @@ -6,9 +6,10 @@ */ export function isPathMatch(pattern: string, path: string) { const regexPattern = pattern - .replace(/\//g, '\\/') + .replace(/([.+^${}()|\[\]\\])/g, '\\$1') .replace(/\*\*/g, '__DOUBLE_STAR__') .replace(/\*/g, '[^\\/]*') + .replace(/\?/g, '[^\\/]') .replace(/__DOUBLE_STAR__/g, '.*'); const regex = new RegExp(`^${regexPattern}$`); return regex.test(path);