UNPKG

906 BTypeScriptView Raw
1/**
2 * Parses string form of URL into an object
3 * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
4 * // intentionally using regex and not <a/> href parsing trick because React Native and other
5 * // environments where DOM might not be available
6 * @returns parsed URL object
7 */
8export declare function parseUrl(url: string): {
9 host?: string;
10 path?: string;
11 protocol?: string;
12 relative?: string;
13};
14/**
15 * Strip the query string and fragment off of a given URL or path (if present)
16 *
17 * @param urlPath Full URL or path, including possible query string and/or fragment
18 * @returns URL or path without query string or fragment
19 */
20export declare function stripUrlQueryAndFragment(urlPath: string): string;
21/**
22 * Returns number of URL segments of a passed string URL.
23 */
24export declare function getNumberOfUrlSegments(url: string): number;
25//# sourceMappingURL=url.d.ts.map
\No newline at end of file