MCPcopy Index your code
hub / github.com/tinyhttp/tinyhttp / normalizeType

Function normalizeType

packages/res/src/util.ts:3–4  ·  view source on GitHub ↗
(type: string)

Source from the content-addressed store, hash-verified

1import * as mime from 'es-mime-types'
2
3export const normalizeType = (type: string) =>
4 ~type.indexOf('/') ? acceptParams(type) : { value: mime.lookup(type), params: {} }
5
6export function acceptParams(str: string, index?: number) {
7 const parts = str.split(/ *; */)

Callers 2

formatResponseFunction · 0.90
normalizeTypesFunction · 0.70

Calls 1

acceptParamsFunction · 0.85

Tested by

no test coverage detected