contentTypes
import { contentTypes } from "https://raw.githubusercontent.com/worker-tools/middleware/master/index.ts";
Performs content negotiation over the content type of the response.
function contentTypes<T extends string, TS extends readonly T[]>(types: TS): <X extends Context>(ax: Awaitable<X>) => Promise<X & ContentType<TS[number]>>;
§
contentTypes<T extends string, TS extends readonly T[]>(types: TS): <X extends Context>(ax: Awaitable<X>) => Promise<X & ContentType<TS[number]>>
[src]