MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / parseUrl

Function parseUrl

packages/backend/src/bitbucket.ts:204–210  ·  view source on GitHub ↗

* Parse the url into a path and query parameters to be used with the api client (openapi-fetch)

(url: string)

Source from the content-addressed store, hash-verified

202 * Parse the url into a path and query parameters to be used with the api client (openapi-fetch)
203 */
204function parseUrl(url: string): { path: string; query: Record<string, string>; } {
205 const fullUrl = new URL(url);
206 const path = fullUrl.pathname.replace(/^\/\d+(\.\d+)*/, ''); // remove version number in the beginning of the path
207 const query = Object.fromEntries(fullUrl.searchParams);
208 logger.debug(`Parsed url ${url} into path ${path} and query ${JSON.stringify(query)}`);
209 return { path, query };
210}
211
212
213async function cloudGetReposForWorkspace(client: BitbucketClient, workspaces: string[]): Promise<{repos: CloudRepository[], warnings: string[]}> {

Callers 1

getPaginatedCloudFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected