Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/workers_middleware/content-negotiation.ts>contentEncodings

Placeholder for Worker-based middleware solution
Latest
function contentEncodings
import { contentEncodings } from "https://deno.land/x/workers_middleware@v0.1.0-pre.36/content-negotiation.ts";

Performs content negotiation over the content encoding of the response.

Type Parameters

T extends string
TS extends readonly T[]

Parameters

encodings: TS

The encodings provided by this endpoint.

Returns

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