swc/bundler/tests/.cache/deno/d6f074db169b9e962882216c1e64b0ebf737bf30.ts
강동윤 f8aa0509ce
fix(bundler): Fix stack overflow (#2080)
swc_bundler:
 - Prevent infinite recursions. (#1963)
2021-08-15 02:37:31 +00: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)