fix: Fixed issue where exporting multiple files with the same name would error

This commit is contained in:
Aman Harwara
2023-10-31 16:43:02 +05:30
parent d1c295751d
commit f408950aa4
3 changed files with 33 additions and 25 deletions

View File

@@ -19,9 +19,9 @@ function zippableFileName(name: string, suffix = '', format = 'txt'): string {
return sanitizedName.slice(0, maxFileNameLength - nameEnd.length) + nameEnd
}
export function parseAndCreateZippableFileName(name: string) {
export function parseAndCreateZippableFileName(name: string, suffix = '') {
const { name: parsedName, ext } = parseFileName(name)
return zippableFileName(parsedName, '', ext)
return zippableFileName(parsedName, suffix, ext)
}
type ZippableData = {