fast-content-type-parse
Version:
Parse HTTP Content-Type header according to RFC 7231
23 lines (17 loc) • 571 B
TypeScript
interface ContentType {
type: string;
parameters: Record<string, string>;
}
interface FastContentTypeParse {
parse: (header: string) => ContentType;
safeParse: (header: string) => ContentType;
defaultContentType: ContentType;
}
declare namespace fastContentTypeParse {
export function parse (header: string): ContentType
export function safeParse (header: string): ContentType
export const defaultContentType: ContentType
const fastContentTypeParse: FastContentTypeParse
export { fastContentTypeParse as default }
}
export = fastContentTypeParse