| 1 | export const SUPPORTED_IMAGE_MIME_TYPES = new Set(['image/png', 'image/jpeg', 'image/jpg', 'image/webp']) |
| 2 | |
| 3 | export function normalizeImageMimeType(value: unknown): string { |
| 4 | const mimeType = typeof value === 'string' ? value.trim().toLowerCase() : '' |
| 5 | return mimeType === 'image/jpg' ? 'image/jpeg' : mimeType |
| 6 | } |
| 7 | |
| 8 | export function isSupportedImageMimeType(value: unknown): boolean { |
| 9 | const mimeType = typeof value === 'string' ? value.trim().toLowerCase() : '' |
| 10 | return SUPPORTED_IMAGE_MIME_TYPES.has(mimeType) |
| 11 | } |
| 12 |