From b600fd9324c889f61fbc3ee4d4bf0d394f322269 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 18 Mar 2023 23:16:41 +0000 Subject: [PATCH] Add fix to allow for different types of slash to be supported Maybe updating glob broke it for Windows --- scripts/types-absolute-fixer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/types-absolute-fixer.ts b/scripts/types-absolute-fixer.ts index 43a338f20d..f2474ab893 100644 --- a/scripts/types-absolute-fixer.ts +++ b/scripts/types-absolute-fixer.ts @@ -9,7 +9,7 @@ for (const file of files) { from: /"@[a-z/-]*"/gi, to: (match) => { const matchSlug = match.replace(/['"]+/g, "").replace(/[@]+/g, "").trim(); - const levelCount = file.split("/").length - 2; + const levelCount = file.split(/[\/\\]/).length - 2; const backLevels = Array(levelCount).fill("../").join(""); return `"${backLevels}${matchSlug}"`;