MCPcopy Create free account
hub / github.com/Forward-Future/loopy / stripBasePath

Function stripBasePath

loop-library/worker/src/auth-votes.js:482–489  ·  view source on GitHub ↗
(pathname, basePath)

Source from the content-addressed store, hash-verified

480 return segments.length ? `/${segments.join("/")}` : "";
481}
482
483function stripBasePath(pathname, basePath) {
484 const normalized = normalizeBasePath(basePath);
485 if (pathname === normalized || pathname === `${normalized}/`) return "/";
486 if (normalized && pathname.startsWith(`${normalized}/`)) {
487 return pathname.slice(normalized.length);
488 }
489 return pathname;
490}
491
492async function signedValue(payload, secret) {

Callers 1

handleAuthVoteRouteFunction · 0.70

Calls 1

normalizeBasePathFunction · 0.85

Tested by

no test coverage detected