(basePath: string, url: string)
| 314 | } |
| 315 | |
| 316 | function _stripBasePath(basePath: string, url: string): string { |
| 317 | if (!basePath || !url.startsWith(basePath)) { |
| 318 | return url; |
| 319 | } |
| 320 | const strippedUrl = url.substring(basePath.length); |
| 321 | if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) { |
| 322 | return strippedUrl; |
| 323 | } |
| 324 | return url; |
| 325 | } |
| 326 | |
| 327 | function _stripIndexHtml(url: string): string { |
| 328 | return url.replace(/\/index\.html$/, ''); |