@amadeus-it-group/kassette
Version:
Development server, used mainly for testing, which proxies requests and is able to easily manage local mocks.
16 lines (15 loc) • 620 B
TypeScript
import { URL } from 'url';
/** splits the `url` path portion into an array of path parts */
export declare const splitPath: (path: string) => string[];
/** returns the array of path parts of the given Node.js `url` */
export declare const getPathParts: ({ pathname }: URL) => string[];
export interface URLSpec {
/** including the `:` */
protocol: string;
hostname: string;
port?: string | null | undefined;
pathname?: string;
search?: string;
}
/** builds an URL from the given `URLSpec` object */
export declare const build: ({ protocol, hostname, port, pathname, search }: URLSpec) => string;