UNPKG

vary

Version:

Manipulate the HTTP Vary header

29 lines (28 loc) • 838 B
/*! * vary * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * A response with methods for reading and setting headers. */ export interface Response { getHeader(name: string): string | number | readonly string[] | undefined; setHeader(name: string, value: string): unknown; } /** * Append one or more fields to a Vary header. */ export declare function append(header: string, field: string | readonly string[]): string; /** * Format field names as a Vary header. */ export declare function format(fields: readonly string[]): string; /** * Parse the non-empty members of a Vary header. */ export declare function parse(header: string): string[]; /** * Add one or more fields to a response's Vary header. */ export declare function vary(res: Response, field: string | readonly string[]): void;