(mime: string)
| 9 | } |
| 10 | |
| 11 | export function isImageAttachment(mime: string) { |
| 12 | return mime.startsWith("image/") && mime !== "image/svg+xml" && mime !== "image/vnd.fastbidsheet" |
| 13 | } |
| 14 | |
| 15 | export function sniffAttachmentMime(bytes: Uint8Array, fallback: string) { |
| 16 | if (startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return "image/png" |