Repository navigation
Expand file tree
/
Copy pathnormalizeMimeType.ts
More file actions
97 lines (96 loc) · 2.91 KB
/
Copy pathnormalizeMimeType.ts
File metadata and controls
97 lines (96 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
function normalizeMimeType(mime: string) {
switch (mime) {
case "audio/x-wav":
return "audio/wav";
case "audio/vnd.wave":
return "audio/wav";
case "application/ogg":
return "audio/ogg";
case "application/x-gzip":
return "application/gzip";
case "application/zst":
return "application/zstd";
case "application/x-zstd":
return "application/zstd";
case "image/x-icns":
return "image/icns";
case "image/x-icon":
return "image/vnd.microsoft.icon";
case "image/vtf":
return "image/x-vtf";
case "image/aseprite":
return "image/x-aseprite";
case "application/x-aseprite":
return "image/x-aseprite";
case "image/qoi":
return "image/x-qoi";
case "video/bink":
return "video/vnd.radgamettools.bink";
case "video/binka":
return "audio/vnd.radgamettools.bink";
case "video/brstm":
return "audio/brstm";
case "audio/x-quicktime":
return "video/quicktime";
case "audio/x-flo":
return "audio/flo";
case "application/x-flo":
return "audio/flo";
case "application/x-lharc":
return "application/x-lzh-compressed";
case "application/lha":
return "application/x-lzh-compressed";
case "application/x-lha":
return "application/x-lzh-compressed";
case "application/x-lzh":
return "application/x-lzh-compressed";
case "application/x-mtga":
return "application/vnd.sqlite3";
case "application/x-itunes-itdb":
return "application/vnd.sqlite3"; // Not required, but just in case
case "audio/x-flac":
return "audio/flac";
case "application/font-sfnt":
return "font/ttf";
case "application/x-font-ttf":
return "font/ttf"; // both TTF & OTF
case "application/x-font-opentype":
return "font/otf";
case "application/font-woff":
return "font/woff";
case "application/x-font-woff":
return "font/woff";
case "application/font-woff2":
return "font/woff2";
case "application/x-font-woff2":
return "font/woff2";
case "application/musicxml":
return "application/vnd.recordare.musicxml+xml";
case "application/musicxml+xml":
return "application/vnd.recordare.musicxml+xml";
case "text/mathml":
return "application/mathml+xml";
case "text/json":
return "application/json";
case "text/x-json":
return "application/json";
case "text/json5":
return "application/json5";
case "application/x-json5":
return "application/json5";
case "video/x-ms-wmv":
return "video/x-ms-asf";
case "application/x-ndjson":
return "application/jsonl";
case "text/fb2":
return "application/x-fictionbook+xml";
case "video/qoa":
return "audio/x-qoa";
case "application/elf":
return "application/x-elf";
case "video/MP2T":
return "video/mp2t";
}
return mime;
}
export default normalizeMimeType;