fix: toSafeName windows forbidden symbols
This commit is contained in:
@@ -5,8 +5,11 @@ import path from "path";
|
||||
const toSafeName = (name: string) => {
|
||||
return name
|
||||
.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"));
|
||||
|
||||
Reference in New Issue
Block a user