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

Function getBasePathFromLocation

public/js/sharedFolderView.js:291–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289 }
290
291 function getBasePathFromLocation() {
292 try {
293 let p = String(window.location.pathname || '');
294 p = p.replace(/\/api\/folder\/shareFolder\.php$/i, '');
295 p = p.replace(/\/+$/, '');
296 if (!p || p === '/') return '';
297 if (!p.startsWith('/')) p = '/' + p;
298 return p;
299 } catch (e) {
300 return '';
301 }
302 }
303
304 function withBasePath(path) {
305 const base = getBasePathFromLocation();

Callers 1

withBasePathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected