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

Function getBasePathFromLocation

public/js/sharedDropView.js:158–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156 }
157
158 function getBasePathFromLocation() {
159 try {
160 let p = String(window.location.pathname || '');
161 p = p.replace(/\/api\/folder\/shareFolder\.php$/i, '');
162 p = p.replace(/\/+$/, '');
163 if (!p || p === '/') return '';
164 if (!p.startsWith('/')) p = '/' + p;
165 return p;
166 } catch (e) {
167 return '';
168 }
169 }
170
171 function withBasePath(path) {
172 const base = getBasePathFromLocation();

Callers 1

withBasePathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected