Skip to main content

Function: getMimeFileFormat()

getMimeFileFormat<T>(mimeType, formats): T[number] | undefined

Given a MIME type, return the matching format key from the allowed set, or undefined if not found.

Type Parameters​

T​

T extends readonly ("webp" | "avif" | "3ds" | "blend" | "dae" | "dxf" | "exr" | "fcstd" | "fbx" | "gif" | "glb" | "gltf" | "hdr" | "ies" | "iges" | "jxl" | "jpg" | "mtlx" | "obj" | "pdf" | "ply" | "png" | "step" | "stl" | "svg" | "tif" | "usdz" | "zip")[]

Parameters​

mimeType​

string

formats​

T

Returns​

T[number] | undefined