(mime: string)
| 11 | const IMAGES_DIR = 'generated-images'; |
| 12 | |
| 13 | function mimeToExt(mime: string): string { |
| 14 | const map: Record<string, string> = { |
| 15 | 'image/png': 'png', |
| 16 | 'image/jpeg': 'jpg', |
| 17 | 'image/webp': 'webp', |
| 18 | 'image/gif': 'gif', |
| 19 | }; |
| 20 | return map[mime] || 'png'; |
| 21 | } |
| 22 | |
| 23 | /** Build an accessible URL for a file stored via session-data API */ |
| 24 | function buildFileUrl(filePath: string): string { |
no outgoing calls
no test coverage detected