x/oak/deps.ts

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Very Popular
Go to Latest
function acceptsLanguages
import { acceptsLanguages } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v11.1.0/deps.ts?s=acceptsLanguages";

Returns an array of languages accepted by the request, in order of preference. If there are no languages supplied in the request, then ["*"] is returned, imply any language is accepted.

Parameters

request: Request[src]

Returns

string[][src]

For a given set of languages, return the best match accepted in the request. If no languages match, then the function returns undefined.

Parameters

request: Request[src]
...langs: string[][src]

Returns

string | undefined[src]