This release is 18 versions behind 5.0.12 — the latest version of @lost-c3/lib. Jump to latest
Lost for easy making Construct 3 Addons.
This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers




JSR Score
35%
Published
4 months ago (3.3.2)
type MimeFileCollection = Record<MIMEFileType, string[]> export abstract class MIME { private static readonly Collection: MimeFileCollection = { 'text/html': ['.html'], 'application/javascript': ['.js'], 'application/json': ['.json', '.scon'], 'text/css': ['.css'], 'application/wasm': ['.wasm'], 'image/png': ['.png'], 'image/jpeg': ['.jpg', 'jpeg'], 'image/webp': ['.webp'], 'image/avif': ['.avif'], 'video/webm': ['.webm'], 'audio/mp4': ['.m4a'], 'audio/mpeg': ['.mp3'], 'audio/ogg': ['.ogg'], 'video/mp4': ['.mp4'], 'application/font-woff': ['.woff'], 'font/woff2': ['.woff2'], 'text/plain': ['.txt'], 'text/csv': ['.csv'], 'text/xml': ['.xml', '.scml'], 'image/svg+xml': ['.svg'], 'application/zip': ['.c3p'] } static getFileType(fileName: string): MIMEFileType | null { let _mimeType: MIMEFileType | null = null; for (const [mimeType, extensions] of Object.entries(this.Collection)) { extensions.forEach(ex => { if (fileName.endsWith(ex)) { _mimeType = mimeType as MIMEFileType; } }) } return _mimeType; } }