MCPcopy Create free account
hub / github.com/error311/FileRise / stripBase

Function stripBase

public/js/basePath.js:44–51  ·  view source on GitHub ↗
(pathname)

Source from the content-addressed store, hash-verified

42}
43
44export function stripBase(pathname) {
45 const base = getBasePath();
46 const p = String(pathname || '');
47 if (!base) return p;
48 if (p === base) return '/';
49 if (p.startsWith(base + '/')) return p.slice(base.length) || '/';
50 return p;
51}
52
53export function patchFetchForBasePath() {
54 if (window.__FR_FETCH_BASEPATCH__) return;

Callers 1

main.jsFile · 0.85

Calls 1

getBasePathFunction · 0.85

Tested by

no test coverage detected