(pathname)
| 42 | } |
| 43 | |
| 44 | export 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 | |
| 53 | export function patchFetchForBasePath() { |
| 54 | if (window.__FR_FETCH_BASEPATCH__) return; |