fix: toSafeName windows forbidden symbols

This commit is contained in:
HorizonCode committed 2026-05-03 00:08:49 +02:00
1 parent 9dac9d9795
commit 31441131c4
1 file changed
+5 -2
+5 -2
View File
@@ -5,8 +5,11 @@ import path from "path";
const toSafeName = (name: string) => { const toSafeName = (name: string) => {
return name return name
.toLowerCase() .toLowerCase()
.replace(/[^a-z0-9]/g, "_") .replace(/[<>:"/\\|?*]/g, "_")
.replace(/-+/g, "_"); .replace(/[\p{Cc}]/gu, "_")
.replace(/[\s-]+/g, "_")
.replace(/_+/g, "_")
.replace(/[. ]+$/g, "");
}; };
const themeInfo = JSON.parse(fs.readFileSync("theme.json", "utf-8")); const themeInfo = JSON.parse(fs.readFileSync("theme.json", "utf-8"));