(file: UserFile)
| 177 | } |
| 178 | |
| 179 | export function inferAttachmentMimeType(file: UserFile): string { |
| 180 | const explicitType = file.type?.trim().toLowerCase() |
| 181 | if (explicitType && explicitType !== 'application/octet-stream') { |
| 182 | return explicitType |
| 183 | } |
| 184 | |
| 185 | const inferred = getMimeTypeFromExtension(getFileExtension(file.name)) |
| 186 | return inferred.toLowerCase() |
| 187 | } |
| 188 | |
| 189 | function isTextDocumentMimeType(mimeType: string): boolean { |
| 190 | return ( |
no test coverage detected