(path: string)
| 7 | * Covers images, video, and audio formats used in PPTX files. |
| 8 | */ |
| 9 | export function getMimeType(path: string): string { |
| 10 | const ext = path.split('.').pop()?.toLowerCase() || '' |
| 11 | const mimeMap: Record<string, string> = { |
| 12 | png: 'image/png', |
| 13 | jpg: 'image/jpeg', |
| 14 | jpeg: 'image/jpeg', |
| 15 | gif: 'image/gif', |
| 16 | svg: 'image/svg+xml', |
| 17 | bmp: 'image/bmp', |
| 18 | tiff: 'image/tiff', |
| 19 | tif: 'image/tiff', |
| 20 | emf: 'image/x-emf', |
| 21 | wmf: 'image/x-wmf', |
| 22 | webp: 'image/webp', |
| 23 | mp4: 'video/mp4', |
| 24 | m4v: 'video/mp4', |
| 25 | webm: 'video/webm', |
| 26 | avi: 'video/x-msvideo', |
| 27 | mp3: 'audio/mpeg', |
| 28 | wav: 'audio/wav', |
| 29 | m4a: 'audio/mp4', |
| 30 | ogg: 'audio/ogg', |
| 31 | } |
| 32 | return mimeMap[ext] || 'application/octet-stream' |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Resolve a relative media path (from rels) to its canonical path in PptxFiles.media. |
no outgoing calls
no test coverage detected