- Allow "'" and ban "#" in filenames. #27
- Fixed misspelling (one of #28)
This commit is contained in:
vorotamoroz
2021-12-22 19:38:00 +09:00
parent fc210de58b
commit abe613539b
5 changed files with 6 additions and 6 deletions

View File

@@ -72,7 +72,7 @@ export function resolveWithIgnoreKnownError<T>(p: Promise<T>, def: T): Promise<T
export function isValidPath(filename: string): boolean {
// eslint-disable-next-line no-control-regex
const regex = /[\u0000-\u001f]|[\\"':?<>|*]/g;
const regex = /[\u0000-\u001f]|[\\":?<>|*#]/g;
let x = filename.replace(regex, "_");
const win = /(\\|\/)(COM\d|LPT\d|CON|PRN|AUX|NUL|CLOCK$)($|\.)/gi;
const sx = (x = x.replace(win, "/_"));