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

Function joinPyPaths

src/resolution/frameworks/python.ts:398–403  ·  view source on GitHub ↗

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

(prefix: string, path: string)

Source from the content-addressed store, hash-verified

396
397/** `/api/v1` + `/items` → `/api/v1/items`; `/items` + `` → `/items`; `` + `` → ``. */
398function joinPyPaths(prefix: string, path: string): string {
399 const a = prefix.replace(/\/+$/, '');
400 const b = path.replace(/^\/+/, '');
401 if (!a) return b ? `/${b}` : '';
402 return b ? `${a}/${b}` : a;
403}
404
405/**
406 * 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