(file: File)
| 1294 | } |
| 1295 | |
| 1296 | export function isFileTypeAllowed(file: File): boolean { |
| 1297 | const allowed = getAllowedExtensions(); |
| 1298 | if (!allowed) return true; |
| 1299 | |
| 1300 | const dotIndex = file.name.lastIndexOf("."); |
| 1301 | if (dotIndex < 1 || dotIndex === file.name.length - 1) return false; |
| 1302 | |
| 1303 | const ext = file.name.slice(dotIndex + 1).toLowerCase(); |
| 1304 | return allowed.has(ext); |
| 1305 | } |
| 1306 | |
| 1307 | function getFilenameExtension(filename: string): string | undefined { |
| 1308 | const dotIndex = filename.lastIndexOf("."); |
no test coverage detected