💾 Archived View for iich.space › src › modules › mission-control › mime.ts captured on 2021-12-17 at 13:26:06.

View Raw

More Information

⬅️ Previous capture (2021-12-03)

➡️ Next capture (2022-03-01)

-=-=-=-=-=-=-

export const MimeTypes: Record<string, string> = {
  '': 'application/octet-stream',
  '.gif': 'image/gif',
  '.jpeg': 'image/jpeg',
  '.jpg': 'image/jpeg',
  '.mp3': 'audio/mpeg',
  '.mp4': 'video/mp4',
  '.ogg': 'audio/vorbis',
  '.png': 'image/png',
  '.svg': 'image/svg+xml',
  '.ts': 'text/plain',
  '.txt': 'text/plain',
  '.webp': 'image/webp',
};

export const getMimeType = (extension: string): string => {
  if (MimeTypes[extension] !== undefined) {
    return MimeTypes[extension];
  }

  return MimeTypes[''];
};