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