UNPKG

@adonis-agora/media

Version:

Media-library for AdonisJS — owner collections (MIME whitelist, single-file replace, ordering), image conversions (eager/lazy), pluggable content transformers (HLS video via mediabunny, metadata probe, image blur-up placeholder), and column attachments, a

12 lines • 987 B
/** * Resolve the MIME type an upload path records. Shared by every declared-type gate — `attach` / * `attachExisting`, the TUS `POST` and direct-upload `initiate` — so a declaration one path * normalizes is never rejected up front by another. The declared type stands whenever the collection * accepts it (or declares no whitelist at all). Otherwise — a bare top-level type with no `/`, or a * concrete type the whitelist rejects — fall back to the file extension: if the extension pins a * concrete MIME the collection DOES accept, that value is used (and stored on the record). Returns * `undefined` when nothing resolvable is whitelisted, which the caller reports as a rejection * listing the allowed types. `fileName` may be a full object key — only its last segment counts. */ export declare function resolveDeclaredMimeType(declared: string, fileName: string, accepted: readonly string[] | undefined): string | undefined; //# sourceMappingURL=mime_type.d.ts.map