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}"`;