* Parses the provided URL, and sets the current URL to the parsed result. * * @param url The URL string.
(url: string)
| 420 | * @param url The URL string. |
| 421 | */ |
| 422 | $$parse(url: string) { |
| 423 | let pathUrl: string | undefined; |
| 424 | if (url.startsWith('/')) { |
| 425 | pathUrl = url; |
| 426 | } else { |
| 427 | // Remove protocol & hostname if URL starts with it |
| 428 | pathUrl = this.stripBaseUrl(this.getServerBase(), url); |
| 429 | } |
| 430 | if (typeof pathUrl === 'undefined') { |
| 431 | throw new Error(`Invalid url "${url}", missing path prefix "${this.getServerBase()}".`); |
| 432 | } |
| 433 | |
| 434 | this.parseAppUrl(pathUrl); |
| 435 | |
| 436 | this.$$path ||= '/'; |
| 437 | this.composeUrls(); |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Parses the provided URL and its relative URL. |
no test coverage detected