lamers-mime
Version:
Minimalist MIME type mapping package
14 lines (13 loc) • 542 B
TypeScript
/**
* This function returns the MIME type of a file based on its extension.
* If the MIME type is not found, it returns 'application/octet-stream'.
* @param {string} filename - The name of the file.
*/
declare function mimeType(filename: string): string;
/**
* This function returns the extension(s) of a file based on its MIME type.
* If the extension is not found, it returns null.
* @param {string} mime - The MIME type of the file.
*/
declare function extension(mime: string): string[] | null;
export { mimeType, extension };