swc/crates/swc_bundler/tests/.cache/deno/d6f074db169b9e962882216c1e64b0ebf737bf30.ts
2021-11-09 20:42:49 +09:00

18 lines
763 B
TypeScript

// Loaded from https://deno.land/x/tinyhttp@0.1.18/extensions/req/accepts.ts
import { Accepts } from '../../deps.ts'
import type { Req } from '../../deps.ts'
export const getAccepts = <Request extends Req = Req>(req: Request) => (...types: string[]) =>
new Accepts(req.headers).types(types)
export const getAcceptsEncodings = <Request extends Req = Req>(req: Request) => (...encodings: string[]) =>
new Accepts(req.headers).encodings(encodings)
export const getAcceptsCharsets = <Request extends Req = Req>(req: Request) => (...charsets: string[]) =>
new Accepts(req.headers).charsets(charsets)
export const getAcceptsLanguages = <Request extends Req = Req>(req: Request) => (...languages: string[]) =>
new Accepts(req.headers).languages(languages)