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

Function withBase

public/js/basePath.js:35–42  ·  view source on GitHub ↗
(urlOrPath)

Source from the content-addressed store, hash-verified

33}
34
35export function withBase(urlOrPath) {
36 const base = getBasePath();
37 const s = String(urlOrPath || '');
38 if (!base) return s;
39 if (!s.startsWith('/')) return s;
40 if (s === base || s.startsWith(base + '/')) return s;
41 return base + s;
42}
43
44export function stripBase(pathname) {
45 const base = getBasePath();

Callers 15

upload.jsFile · 0.85
buildInternalLinkFunction · 0.85
createAuthFileLinkFunction · 0.85
requestTransferCancelFunction · 0.85
runTransferJobFunction · 0.85
sanitizeLogoUrlFunction · 0.85
postFunction · 0.85
refreshFunction · 0.85
loadSourcesFunction · 0.85

Calls 1

getBasePathFunction · 0.85

Tested by

no test coverage detected