Skip to main content
Module

x/workers_middleware/content-negotiation.ts>acceptsEncodings

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

Determines if a request body content encoding is acceptable to this endpoint.

Type Parameters

T extends string
TS extends readonly T[]

Parameters

encodings: TS

The body encodings acceptable to this endpoint.

Returns

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