UNPKG

pagespeed-quest

Version:

A framework for efficient web front-end speed improvement

27 lines (26 loc) 887 B
export type HttpHeaders = { [key: string]: string; }; /** * Remove IgnoreParams from URL * Default: ts (timestamp) assumed different for each request * @param url * @returns */ export declare function normalizeUrl(url: string | URL): URL; /** * Convert URL to content file path * For example: * https://example.com/foo/bar.html?hoge=123 -> example.com/foo/bar~hoge=123.html * - Add directory index (index.html) if URL ends with slash * - Shorten too long basename with short hash * - Ignore dynamic params for example: ts=123 * @param url * @returns */ export declare function requestContentFilePath(method: string, url: string | URL): string; export declare function parseContentTypeHeader(contentType: string): { mime: string; charset: string; }; export declare function stringifyContentTypeHeader(mime?: string, charset?: string, original?: string): string;