📦 EqualifyEverything / equalify-v2-api

📄 getMimeType.ts · 15 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15export const getMimeType = (extension) => mimeTypesDict[extension];
export const getMimeExtension = (type) => Object.entries(mimeTypesDict).find(([, value]) => value === type)[0];

const mimeTypesDict = {
    jpg: 'image/jpeg',
    jpeg: 'image/jpeg',
    png: 'image/png',
    gif: 'image/gif',
    svg: 'image/svg+xml',
    bmp: 'image/bmp',
    heic: 'image/heic',
    heif: 'image/heif',
    mp4: 'video/mp4',
    mov: 'video/quicktime',
};