Skip to content

Commit

Permalink
fix: Replace folder separator by - in file name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
DrakaSAN committed Jun 25, 2024
1 parent 9e4426c commit 3e68882
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function generateFileName (originFileName) {
}

return normalizedFileName
.replace(/[\s_-]+/g, '-') // swap any length of whitespace, underscore, hyphen characters with a single _
.replace(/[\s_-]+/g, '-') // swap any length of whitespace, underscore, hyphen characters with a single -
.replace(/\\/g, '-') // swap Windows directory separator by -
.replace(/\//g, '-') // swap macOS / Linux directory separator by -
.replace(/^-+|-+$/g, '') // remove leading, trailing -
.replace(//g, '')
.replace(//g, '')
Expand Down

0 comments on commit 3e68882

Please sign in to comment.