mockttp
Version:
Mock HTTP server for testing HTTP clients and stubbing webservices
22 lines • 1.1 kB
TypeScript
import { Destination } from '../types';
export declare const isAbsoluteUrl: (url: string) => boolean;
export declare const isRelativeUrl: (url: string) => boolean;
export declare const isAbsoluteProtocollessUrl: (url: string) => boolean;
export declare const getUrlWithoutProtocol: (url: string) => string;
export declare const getHostFromAbsoluteUrl: (url: string) => string;
export declare const getPathFromAbsoluteUrl: (url: string) => string;
export declare const getDefaultPort: (protocol: string) => 443 | 80;
export declare const getEffectivePort: (url: {
protocol: string | null;
port: string | null;
}) => number;
export declare const getDestination: (protocol: string, host: string) => Destination;
export declare const normalizeHost: (protocol: string, host: string) => string;
/**
* Normalizes URLs to the form used when matching them.
*
* This accepts URLs in all three formats: relative, absolute, and protocolless-absolute,
* and returns them in the same format but normalized.
*/
export declare const normalizeUrl: (url: string) => string;
//# sourceMappingURL=url.d.ts.map