diff --git a/src/__tests__/path_validation.spec.ts b/src/__tests__/path_validation.spec.ts index 27853f5..960bbf3 100644 --- a/src/__tests__/path_validation.spec.ts +++ b/src/__tests__/path_validation.spec.ts @@ -9,13 +9,13 @@ const expectedManualIllegalChars: string[] = [ "/", "\\", "?", - "%", "*", ":", "|", '"', "<", ">", + "\u0000", ]; describe("replaceIllegalChars() removes all expected characters", () => { diff --git a/src/util.ts b/src/util.ts index 2b6bc84..49d1850 100644 --- a/src/util.ts +++ b/src/util.ts @@ -91,7 +91,7 @@ export const unicodeSlug = (str: string, savedAt: string) => { }; export const replaceIllegalChars = (str: string): string => { - return str.replaceAll(ILLEGAL_CHAR_REGEX, REPLACEMENT_CHAR); + return str.replace(ILLEGAL_CHAR_REGEX, REPLACEMENT_CHAR); }; export function formatDate(date: string, format: string): string {