MCPcopy
hub / github.com/Doorman11991/smallcode / getMimeType

Function getMimeType

src/session/images.js:82–93  ·  view source on GitHub ↗
(ext)

Source from the content-addressed store, hash-verified

80}
81
82function getMimeType(ext) {
83 const types = {
84 '.png': 'image/png',
85 '.jpg': 'image/jpeg',
86 '.jpeg': 'image/jpeg',
87 '.gif': 'image/gif',
88 '.webp': 'image/webp',
89 '.bmp': 'image/bmp',
90 '.svg': 'image/svg+xml',
91 };
92 return types[ext] || 'image/png';
93}
94
95/**
96 * Detect if input is just a file path (from drag-and-drop into terminal).

Callers 1

extractImagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected