UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

10 lines (9 loc) 534 B
import type { AnyCaller } from "./function.js"; /** List of file types in `extension: mime` format. */ export type FileTypes = { [extension: string]: string; }; /** Get the file extension from a file path, or return `undefined` if the input has no extension. */ export declare function getFileExtension(file: string): string | undefined; /** Get the file extension from a file path, or throw `RequiredError` if the input has no extension. */ export declare function requireFileExtension(file: string, caller?: AnyCaller): string;