MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / joinPyPaths

Function joinPyPaths

src/resolution/frameworks/python.ts:399–404  ·  view source on GitHub ↗

`/api/v1` + `/items` → `/api/v1/items`; `/items` + `` → `/items`; `` + `` → ``.

(prefix: string, path: string)

Source from the content-addressed store, hash-verified

397
398/** `/api/v1` + `/items` → `/api/v1/items`; `/items` + `` → `/items`; `` + `` → ``. */
399function joinPyPaths(prefix: string, path: string): string {
400 const a = prefix.replace(/\/+$/, '');
401 const b = path.replace(/^\/+/, '');
402 if (!a) return b ? `/${b}` : '';
403 return b ? `${a}/${b}` : a;
404}
405
406/**
407 * The file and variable an `include_router` argument names: `items.router`

Callers 1

postExtractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected