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

x/fsrouter/deps.ts>http.acceptsLanguages

A file system based router for Deno.
Go to Latest
function http.acceptsLanguages
import { http } from "https://deno.land/x/fsrouter@2.11.1/deps.ts";
const { acceptsLanguages } = http;

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.

Returns

string[]

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
...langs: string[]

Returns

string | undefined