Function
formatMimeType
(format: SupportedImageFormat)
Source from the content-addressed store, hash-verified
| 113 | } |
| 114 | |
| 115 | function formatMimeType(format: SupportedImageFormat): string { |
| 116 | switch (format) { |
| 117 | case "png": |
| 118 | return "image/png" |
| 119 | case "jpeg": |
| 120 | return "image/jpeg" |
| 121 | case "gif": |
| 122 | return "image/gif" |
| 123 | case "webp": |
| 124 | return "image/webp" |
| 125 | case "pnm": |
| 126 | return "image/pnm" |
| 127 | case "tiff": |
| 128 | return "image/tiff" |
| 129 | case "tga": |
| 130 | return "image/tga" |
| 131 | case "bmp": |
| 132 | return "image/bmp" |
| 133 | case "ico": |
| 134 | return "image/ico" |
| 135 | case "hdr": |
| 136 | return "image/hdr" |
| 137 | case "openexr": |
| 138 | return "image/openexr" |
| 139 | case "qoi": |
| 140 | return "image/qoi" |
| 141 | case "avif": |
| 142 | return "image/avif" |
| 143 | } |
| 144 | } |
Tested by
no test coverage detected