mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 17:16:00 +00:00
14 lines
305 B
TypeScript
14 lines
305 B
TypeScript
export default function getFileName(
|
|
fileType: string,
|
|
fileDescriptor: { name?: string },
|
|
): string {
|
|
if (fileDescriptor.name) {
|
|
return fileDescriptor.name
|
|
}
|
|
|
|
if (fileType.split('/')[0] === 'image') {
|
|
return `${fileType.split('/')[0]}.${fileType.split('/')[1]}`
|
|
}
|
|
|
|
return 'noname'
|
|
}
|