index.mjs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. export const mimes = {
  2. "ez": "application/andrew-inset",
  3. "aw": "application/applixware",
  4. "atom": "application/atom+xml",
  5. "atomcat": "application/atomcat+xml",
  6. "atomdeleted": "application/atomdeleted+xml",
  7. "atomsvc": "application/atomsvc+xml",
  8. "dwd": "application/atsc-dwd+xml",
  9. "held": "application/atsc-held+xml",
  10. "rsat": "application/atsc-rsat+xml",
  11. "bdoc": "application/bdoc",
  12. "xcs": "application/calendar+xml",
  13. "ccxml": "application/ccxml+xml",
  14. "cdfx": "application/cdfx+xml",
  15. "cdmia": "application/cdmi-capability",
  16. "cdmic": "application/cdmi-container",
  17. "cdmid": "application/cdmi-domain",
  18. "cdmio": "application/cdmi-object",
  19. "cdmiq": "application/cdmi-queue",
  20. "cu": "application/cu-seeme",
  21. "mpd": "application/dash+xml",
  22. "davmount": "application/davmount+xml",
  23. "dbk": "application/docbook+xml",
  24. "dssc": "application/dssc+der",
  25. "xdssc": "application/dssc+xml",
  26. "es": "application/ecmascript",
  27. "ecma": "application/ecmascript",
  28. "emma": "application/emma+xml",
  29. "emotionml": "application/emotionml+xml",
  30. "epub": "application/epub+zip",
  31. "exi": "application/exi",
  32. "fdt": "application/fdt+xml",
  33. "pfr": "application/font-tdpfr",
  34. "geojson": "application/geo+json",
  35. "gml": "application/gml+xml",
  36. "gpx": "application/gpx+xml",
  37. "gxf": "application/gxf",
  38. "gz": "application/gzip",
  39. "hjson": "application/hjson",
  40. "stk": "application/hyperstudio",
  41. "ink": "application/inkml+xml",
  42. "inkml": "application/inkml+xml",
  43. "ipfix": "application/ipfix",
  44. "its": "application/its+xml",
  45. "jar": "application/java-archive",
  46. "war": "application/java-archive",
  47. "ear": "application/java-archive",
  48. "ser": "application/java-serialized-object",
  49. "class": "application/java-vm",
  50. "js": "application/javascript",
  51. "mjs": "application/javascript",
  52. "json": "application/json",
  53. "map": "application/json",
  54. "json5": "application/json5",
  55. "jsonml": "application/jsonml+json",
  56. "jsonld": "application/ld+json",
  57. "lgr": "application/lgr+xml",
  58. "lostxml": "application/lost+xml",
  59. "hqx": "application/mac-binhex40",
  60. "cpt": "application/mac-compactpro",
  61. "mads": "application/mads+xml",
  62. "webmanifest": "application/manifest+json",
  63. "mrc": "application/marc",
  64. "mrcx": "application/marcxml+xml",
  65. "ma": "application/mathematica",
  66. "nb": "application/mathematica",
  67. "mb": "application/mathematica",
  68. "mathml": "application/mathml+xml",
  69. "mbox": "application/mbox",
  70. "mscml": "application/mediaservercontrol+xml",
  71. "metalink": "application/metalink+xml",
  72. "meta4": "application/metalink4+xml",
  73. "mets": "application/mets+xml",
  74. "maei": "application/mmt-aei+xml",
  75. "musd": "application/mmt-usd+xml",
  76. "mods": "application/mods+xml",
  77. "m21": "application/mp21",
  78. "mp21": "application/mp21",
  79. "mp4s": "application/mp4",
  80. "m4p": "application/mp4",
  81. "doc": "application/msword",
  82. "dot": "application/msword",
  83. "mxf": "application/mxf",
  84. "nq": "application/n-quads",
  85. "nt": "application/n-triples",
  86. "cjs": "application/node",
  87. "bin": "application/octet-stream",
  88. "dms": "application/octet-stream",
  89. "lrf": "application/octet-stream",
  90. "mar": "application/octet-stream",
  91. "so": "application/octet-stream",
  92. "dist": "application/octet-stream",
  93. "distz": "application/octet-stream",
  94. "pkg": "application/octet-stream",
  95. "bpk": "application/octet-stream",
  96. "dump": "application/octet-stream",
  97. "elc": "application/octet-stream",
  98. "deploy": "application/octet-stream",
  99. "exe": "application/octet-stream",
  100. "dll": "application/octet-stream",
  101. "deb": "application/octet-stream",
  102. "dmg": "application/octet-stream",
  103. "iso": "application/octet-stream",
  104. "img": "application/octet-stream",
  105. "msi": "application/octet-stream",
  106. "msp": "application/octet-stream",
  107. "msm": "application/octet-stream",
  108. "buffer": "application/octet-stream",
  109. "oda": "application/oda",
  110. "opf": "application/oebps-package+xml",
  111. "ogx": "application/ogg",
  112. "omdoc": "application/omdoc+xml",
  113. "onetoc": "application/onenote",
  114. "onetoc2": "application/onenote",
  115. "onetmp": "application/onenote",
  116. "onepkg": "application/onenote",
  117. "oxps": "application/oxps",
  118. "relo": "application/p2p-overlay+xml",
  119. "xer": "application/patch-ops-error+xml",
  120. "pdf": "application/pdf",
  121. "pgp": "application/pgp-encrypted",
  122. "asc": "application/pgp-signature",
  123. "sig": "application/pgp-signature",
  124. "prf": "application/pics-rules",
  125. "p10": "application/pkcs10",
  126. "p7m": "application/pkcs7-mime",
  127. "p7c": "application/pkcs7-mime",
  128. "p7s": "application/pkcs7-signature",
  129. "p8": "application/pkcs8",
  130. "ac": "application/pkix-attr-cert",
  131. "cer": "application/pkix-cert",
  132. "crl": "application/pkix-crl",
  133. "pkipath": "application/pkix-pkipath",
  134. "pki": "application/pkixcmp",
  135. "pls": "application/pls+xml",
  136. "ai": "application/postscript",
  137. "eps": "application/postscript",
  138. "ps": "application/postscript",
  139. "provx": "application/provenance+xml",
  140. "cww": "application/prs.cww",
  141. "pskcxml": "application/pskc+xml",
  142. "raml": "application/raml+yaml",
  143. "rdf": "application/rdf+xml",
  144. "owl": "application/rdf+xml",
  145. "rif": "application/reginfo+xml",
  146. "rnc": "application/relax-ng-compact-syntax",
  147. "rl": "application/resource-lists+xml",
  148. "rld": "application/resource-lists-diff+xml",
  149. "rs": "application/rls-services+xml",
  150. "rapd": "application/route-apd+xml",
  151. "sls": "application/route-s-tsid+xml",
  152. "rusd": "application/route-usd+xml",
  153. "gbr": "application/rpki-ghostbusters",
  154. "mft": "application/rpki-manifest",
  155. "roa": "application/rpki-roa",
  156. "rsd": "application/rsd+xml",
  157. "rss": "application/rss+xml",
  158. "rtf": "application/rtf",
  159. "sbml": "application/sbml+xml",
  160. "scq": "application/scvp-cv-request",
  161. "scs": "application/scvp-cv-response",
  162. "spq": "application/scvp-vp-request",
  163. "spp": "application/scvp-vp-response",
  164. "sdp": "application/sdp",
  165. "senmlx": "application/senml+xml",
  166. "sensmlx": "application/sensml+xml",
  167. "setpay": "application/set-payment-initiation",
  168. "setreg": "application/set-registration-initiation",
  169. "shf": "application/shf+xml",
  170. "siv": "application/sieve",
  171. "sieve": "application/sieve",
  172. "smi": "application/smil+xml",
  173. "smil": "application/smil+xml",
  174. "rq": "application/sparql-query",
  175. "srx": "application/sparql-results+xml",
  176. "gram": "application/srgs",
  177. "grxml": "application/srgs+xml",
  178. "sru": "application/sru+xml",
  179. "ssdl": "application/ssdl+xml",
  180. "ssml": "application/ssml+xml",
  181. "swidtag": "application/swid+xml",
  182. "tei": "application/tei+xml",
  183. "teicorpus": "application/tei+xml",
  184. "tfi": "application/thraud+xml",
  185. "tsd": "application/timestamped-data",
  186. "toml": "application/toml",
  187. "trig": "application/trig",
  188. "ttml": "application/ttml+xml",
  189. "ubj": "application/ubjson",
  190. "rsheet": "application/urc-ressheet+xml",
  191. "td": "application/urc-targetdesc+xml",
  192. "vxml": "application/voicexml+xml",
  193. "wasm": "application/wasm",
  194. "wgt": "application/widget",
  195. "hlp": "application/winhlp",
  196. "wsdl": "application/wsdl+xml",
  197. "wspolicy": "application/wspolicy+xml",
  198. "xaml": "application/xaml+xml",
  199. "xav": "application/xcap-att+xml",
  200. "xca": "application/xcap-caps+xml",
  201. "xdf": "application/xcap-diff+xml",
  202. "xel": "application/xcap-el+xml",
  203. "xns": "application/xcap-ns+xml",
  204. "xenc": "application/xenc+xml",
  205. "xhtml": "application/xhtml+xml",
  206. "xht": "application/xhtml+xml",
  207. "xlf": "application/xliff+xml",
  208. "xml": "application/xml",
  209. "xsl": "application/xml",
  210. "xsd": "application/xml",
  211. "rng": "application/xml",
  212. "dtd": "application/xml-dtd",
  213. "xop": "application/xop+xml",
  214. "xpl": "application/xproc+xml",
  215. "xslt": "application/xml",
  216. "xspf": "application/xspf+xml",
  217. "mxml": "application/xv+xml",
  218. "xhvml": "application/xv+xml",
  219. "xvml": "application/xv+xml",
  220. "xvm": "application/xv+xml",
  221. "yang": "application/yang",
  222. "yin": "application/yin+xml",
  223. "zip": "application/zip",
  224. "3gpp": "video/3gpp",
  225. "adp": "audio/adpcm",
  226. "amr": "audio/amr",
  227. "au": "audio/basic",
  228. "snd": "audio/basic",
  229. "mid": "audio/midi",
  230. "midi": "audio/midi",
  231. "kar": "audio/midi",
  232. "rmi": "audio/midi",
  233. "mxmf": "audio/mobile-xmf",
  234. "mp3": "audio/mpeg",
  235. "m4a": "audio/mp4",
  236. "mp4a": "audio/mp4",
  237. "mpga": "audio/mpeg",
  238. "mp2": "audio/mpeg",
  239. "mp2a": "audio/mpeg",
  240. "m2a": "audio/mpeg",
  241. "m3a": "audio/mpeg",
  242. "oga": "audio/ogg",
  243. "ogg": "audio/ogg",
  244. "spx": "audio/ogg",
  245. "opus": "audio/ogg",
  246. "s3m": "audio/s3m",
  247. "sil": "audio/silk",
  248. "wav": "audio/wav",
  249. "weba": "audio/webm",
  250. "xm": "audio/xm",
  251. "ttc": "font/collection",
  252. "otf": "font/otf",
  253. "ttf": "font/ttf",
  254. "woff": "font/woff",
  255. "woff2": "font/woff2",
  256. "exr": "image/aces",
  257. "apng": "image/apng",
  258. "avif": "image/avif",
  259. "bmp": "image/bmp",
  260. "cgm": "image/cgm",
  261. "drle": "image/dicom-rle",
  262. "emf": "image/emf",
  263. "fits": "image/fits",
  264. "g3": "image/g3fax",
  265. "gif": "image/gif",
  266. "heic": "image/heic",
  267. "heics": "image/heic-sequence",
  268. "heif": "image/heif",
  269. "heifs": "image/heif-sequence",
  270. "hej2": "image/hej2k",
  271. "hsj2": "image/hsj2",
  272. "ief": "image/ief",
  273. "jls": "image/jls",
  274. "jp2": "image/jp2",
  275. "jpg2": "image/jp2",
  276. "jpeg": "image/jpeg",
  277. "jpg": "image/jpeg",
  278. "jpe": "image/jpeg",
  279. "jph": "image/jph",
  280. "jhc": "image/jphc",
  281. "jpm": "image/jpm",
  282. "jpx": "image/jpx",
  283. "jpf": "image/jpx",
  284. "jxr": "image/jxr",
  285. "jxra": "image/jxra",
  286. "jxrs": "image/jxrs",
  287. "jxs": "image/jxs",
  288. "jxsc": "image/jxsc",
  289. "jxsi": "image/jxsi",
  290. "jxss": "image/jxss",
  291. "ktx": "image/ktx",
  292. "ktx2": "image/ktx2",
  293. "png": "image/png",
  294. "btif": "image/prs.btif",
  295. "pti": "image/prs.pti",
  296. "sgi": "image/sgi",
  297. "svg": "image/svg+xml",
  298. "svgz": "image/svg+xml",
  299. "t38": "image/t38",
  300. "tif": "image/tiff",
  301. "tiff": "image/tiff",
  302. "tfx": "image/tiff-fx",
  303. "webp": "image/webp",
  304. "wmf": "image/wmf",
  305. "disposition-notification": "message/disposition-notification",
  306. "u8msg": "message/global",
  307. "u8dsn": "message/global-delivery-status",
  308. "u8mdn": "message/global-disposition-notification",
  309. "u8hdr": "message/global-headers",
  310. "eml": "message/rfc822",
  311. "mime": "message/rfc822",
  312. "3mf": "model/3mf",
  313. "gltf": "model/gltf+json",
  314. "glb": "model/gltf-binary",
  315. "igs": "model/iges",
  316. "iges": "model/iges",
  317. "msh": "model/mesh",
  318. "mesh": "model/mesh",
  319. "silo": "model/mesh",
  320. "mtl": "model/mtl",
  321. "obj": "model/obj",
  322. "stpz": "model/step+zip",
  323. "stpxz": "model/step-xml+zip",
  324. "stl": "model/stl",
  325. "wrl": "model/vrml",
  326. "vrml": "model/vrml",
  327. "x3db": "model/x3d+fastinfoset",
  328. "x3dbz": "model/x3d+binary",
  329. "x3dv": "model/x3d-vrml",
  330. "x3dvz": "model/x3d+vrml",
  331. "x3d": "model/x3d+xml",
  332. "x3dz": "model/x3d+xml",
  333. "appcache": "text/cache-manifest",
  334. "manifest": "text/cache-manifest",
  335. "ics": "text/calendar",
  336. "ifb": "text/calendar",
  337. "coffee": "text/coffeescript",
  338. "litcoffee": "text/coffeescript",
  339. "css": "text/css",
  340. "csv": "text/csv",
  341. "html": "text/html",
  342. "htm": "text/html",
  343. "shtml": "text/html",
  344. "jade": "text/jade",
  345. "jsx": "text/jsx",
  346. "less": "text/less",
  347. "markdown": "text/markdown",
  348. "md": "text/markdown",
  349. "mml": "text/mathml",
  350. "mdx": "text/mdx",
  351. "n3": "text/n3",
  352. "txt": "text/plain",
  353. "text": "text/plain",
  354. "conf": "text/plain",
  355. "def": "text/plain",
  356. "list": "text/plain",
  357. "log": "text/plain",
  358. "in": "text/plain",
  359. "ini": "text/plain",
  360. "dsc": "text/prs.lines.tag",
  361. "rtx": "text/richtext",
  362. "sgml": "text/sgml",
  363. "sgm": "text/sgml",
  364. "shex": "text/shex",
  365. "slim": "text/slim",
  366. "slm": "text/slim",
  367. "spdx": "text/spdx",
  368. "stylus": "text/stylus",
  369. "styl": "text/stylus",
  370. "tsv": "text/tab-separated-values",
  371. "t": "text/troff",
  372. "tr": "text/troff",
  373. "roff": "text/troff",
  374. "man": "text/troff",
  375. "me": "text/troff",
  376. "ms": "text/troff",
  377. "ttl": "text/turtle",
  378. "uri": "text/uri-list",
  379. "uris": "text/uri-list",
  380. "urls": "text/uri-list",
  381. "vcard": "text/vcard",
  382. "vtt": "text/vtt",
  383. "yaml": "text/yaml",
  384. "yml": "text/yaml",
  385. "3gp": "video/3gpp",
  386. "3g2": "video/3gpp2",
  387. "h261": "video/h261",
  388. "h263": "video/h263",
  389. "h264": "video/h264",
  390. "m4s": "video/iso.segment",
  391. "jpgv": "video/jpeg",
  392. "jpgm": "image/jpm",
  393. "mj2": "video/mj2",
  394. "mjp2": "video/mj2",
  395. "ts": "video/mp2t",
  396. "mp4": "video/mp4",
  397. "mp4v": "video/mp4",
  398. "mpg4": "video/mp4",
  399. "mpeg": "video/mpeg",
  400. "mpg": "video/mpeg",
  401. "mpe": "video/mpeg",
  402. "m1v": "video/mpeg",
  403. "m2v": "video/mpeg",
  404. "ogv": "video/ogg",
  405. "qt": "video/quicktime",
  406. "mov": "video/quicktime",
  407. "webm": "video/webm"
  408. };
  409. export function lookup(extn) {
  410. let tmp = ('' + extn).trim().toLowerCase();
  411. let idx = tmp.lastIndexOf('.');
  412. return mimes[!~idx ? tmp : tmp.substring(++idx)];
  413. }