From d7438aa2414fc2a66587ad7fdfb184c4e0f17ee8 Mon Sep 17 00:00:00 2001 From: Superchupu <53496941+SuperchupuDev@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:40:02 +0200 Subject: [PATCH] fix absolute path check --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 47a506e..4d3cf54 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,7 +38,8 @@ function normalizePattern( result += '/**'; } - if (path.isAbsolute(result)) { + // TODO: use a better regex for this + if (path.isAbsolute(result.replace(/\\/g, ''))) { result = posix.relative(cwd, result); } else { result = posix.normalize(result);