Skip to content

Commit

Permalink
Removal of all punctuations from filename #875
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Oct 23, 2024
1 parent 8b05da5 commit b18f5e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/Sanitize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const illegalRe = /[/?<>\\:*|"!]/g;
const illegalRe = /[/?<>\\:*|"!.,;{}[\]()_+=~`@#$%^&]/g;
// eslint-disable-next-line no-control-regex
const controlRe = /[\x00-\x1f\x80-\x9f]/g;
const reservedRe = /^\.+$/;
Expand All @@ -9,6 +9,7 @@ function sanitize(input: string, replacement: string) {
if (typeof input !== 'string') {
throw new Error('Input must be string');
}

const sanitized = input
.replace(illegalRe, replacement)
.replace(controlRe, replacement)
Expand Down

0 comments on commit b18f5e1

Please sign in to comment.