UNPKG

mini-url

Version:
27 lines (26 loc) 721 B
import * as T from "./_types"; import parts from "./url/parts"; declare const cache: { [x: string]: T.URL; }; export { T as Types }; export { parts, cache }; /** * @description * Creates a browser style URL object. * See: https://developer.mozilla.org/en-US/docs/Web/API/URL * * @example * parse("http//google.ca") // { protocol: "http", hostname: "google", ... } * * @param url The url string to parse. * @param base The base part of the url to resolve from. */ export declare function parse(url: string, base?: string): T.URL; /** * @description * Converts a URL like object into an href. * * @param parsed A parsed url object containing. */ export declare function stringify(parsed: T.URL): string;