UNPKG

1.23 kBTypeScriptView Raw
1type PartialURL = {
2 host?: string;
3 path?: string;
4 protocol?: string;
5 relative?: string;
6 search?: string;
7 hash?: string;
8};
9/**
10 * Parses string form of URL into an object
11 * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
12 * // intentionally using regex and not <a/> href parsing trick because React Native and other
13 * // environments where DOM might not be available
14 * @returns parsed URL object
15 */
16export declare function parseUrl(url: string): PartialURL;
17/**
18 * Strip the query string and fragment off of a given URL or path (if present)
19 *
20 * @param urlPath Full URL or path, including possible query string and/or fragment
21 * @returns URL or path without query string or fragment
22 */
23export declare function stripUrlQueryAndFragment(urlPath: string): string;
24/**
25 * Returns number of URL segments of a passed string URL.
26 */
27export declare function getNumberOfUrlSegments(url: string): number;
28/**
29 * Takes a URL object and returns a sanitized string which is safe to use as span name
30 * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data
31 */
32export declare function getSanitizedUrlString(url: PartialURL): string;
33export {};
34//# sourceMappingURL=url.d.ts.map
\No newline at end of file