Archived
fix: toSafeName windows forbidden symbols
This commit is contained in:
1 parent
9dac9d9795
commit
31441131c4
1 file changed
+5
-2
@@ -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"));
|
||||||
|
|||||||
Reference in new issue
Block a user