Skip to main content
Module

x/shed/index.ts>contentTypes

All Worker Tools under a single roof
Latest
function contentTypes
import { contentTypes } from "https://deno.land/x/shed@v0.1.0-pre.10/index.ts";

Performs content negotiation over the content type of the response.

Type Parameters

T extends string
TS extends readonly T[]

Parameters

types: TS

The content types provided by this endpoint.

Returns

<X extends Context>(ax: Awaitable<X>) => Promise<X & ContentType<TS[number]>>