-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: import a plugin from manifest.json. Closes #358
- Loading branch information
1 parent
21a518c
commit 90e360b
Showing
2 changed files
with
2 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
export const ALLOW_EXT_FILES = /^(.+\.(html|js|ts)|manifest.json)$/; | ||
export const ALLOW_CODE_FILES = /^(.+\.(js|ts))$/; | ||
export const ALLOW_UI_FILES = /^(.+\.html)$/; | ||
|
||
export function sanitizeFileName(input: string): string { | ||
const illegalRe = /[\/\?<>\\:\*\|":]/g; | ||
const controlRe = /[\x00-\x1f\x80-\x9f]/g; | ||
const reservedRe = /^\.+$/; | ||
const windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; | ||
const windowsTrailingRe = /[\. ]+$/; | ||
|
||
return input | ||
.replace(illegalRe, "") | ||
.replace(controlRe, "") | ||
.replace(reservedRe, "") | ||
.replace(windowsReservedRe, "") | ||
.replace(windowsTrailingRe, ""); | ||
} |