@settlemint/sdk-utils
Version:
Shared utilities and helper functions for SettleMint SDK modules
19 lines • 718 B
TypeScript
//#region src/url.d.ts
/**
* Extracts the base URL before a specific segment in a URL.
*
* @param baseUrl - The base URL to extract the path from
* @param pathSegment - The path segment to start from
* @returns The base URL before the specified segment
* @example
* ```typescript
* import { extractBaseUrlBeforeSegment } from "@settlemint/sdk-utils/url";
*
* const baseUrl = extractBaseUrlBeforeSegment("https://example.com/api/v1/subgraphs/name/my-subgraph", "/subgraphs");
* // Returns: "https://example.com/api/v1"
* ```
*/
declare function extractBaseUrlBeforeSegment(baseUrl: string, pathSegment: string): string;
//#endregion
export { extractBaseUrlBeforeSegment };
//# sourceMappingURL=url.d.ts.map