MCPcopy
hub / github.com/anomalyco/models.dev / normalizeRoute

Function normalizeRoute

packages/web/src/render.tsx:131–136  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

129export const Rendered = RenderedPages.get("/")!.html;
130
131export function normalizeRoute(pathname: string) {
132 if (pathname !== "/" && pathname.endsWith("/")) {
133 return pathname.slice(0, -1);
134 }
135 return pathname;
136}
137
138export function getRenderedPage(pathname: string) {
139 return RenderedPages.get(normalizeRoute(pathname));

Callers 2

getRenderedPageFunction · 0.85
addPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected