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

Function normalize

src/ui-server/api/index.ts:415–417  ·  view source on GitHub ↗

Drop a single trailing slash, so `/api/stats/` and `/api/stats` are one route.

(pathname: string)

Source from the content-addressed store, hash-verified

413
414/** Drop a single trailing slash, so `/api/stats/` and `/api/stats` are one route. */
415function normalize(pathname: string): string {
416 return pathname.length > 4 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;
417}
418
419function suffixAfter(route: string, prefix: string): string | null {
420 return route.startsWith(prefix) ? route.slice(prefix.length) : null;

Callers 3

handlerFunction · 0.70
resolveOneMethod · 0.50
handleFileViewMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected