Skip to content

Commit

Permalink
Merge pull request #53 from DrakaSAN/master
Browse files Browse the repository at this point in the history
fix: Replace folder separator by - in file name generation
  • Loading branch information
phodal authored Jun 26, 2024
2 parents 9e4426c + 3e68882 commit 8fc846f
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 8fc846f

Please sign in to comment.