(url: string)
| 354 | } |
| 355 | |
| 356 | private parseAppUrl(url: string) { |
| 357 | if (DOUBLE_SLASH_REGEX.test(url)) { |
| 358 | throw new Error(`Bad Path - URL cannot start with double slashes: ${url}`); |
| 359 | } |
| 360 | |
| 361 | let prefixed = url.charAt(0) !== '/'; |
| 362 | if (prefixed) { |
| 363 | url = '/' + url; |
| 364 | } |
| 365 | let match = this.urlCodec.parse(url, this.getServerBase()); |
| 366 | if (typeof match === 'string') { |
| 367 | throw new Error(`Bad URL - Cannot parse URL: ${url}`); |
| 368 | } |
| 369 | let path = |
| 370 | prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname; |
| 371 | this.$$path = this.urlCodec.decodePath(path); |
| 372 | this.$$search = this.urlCodec.decodeSearch(match.search); |
| 373 | this.$$hash = this.urlCodec.decodeHash(match.hash); |
| 374 | |
| 375 | // make sure path starts with '/'; |
| 376 | if (this.$$path && this.$$path.charAt(0) !== '/') { |
| 377 | this.$$path = '/' + this.$$path; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | /** |
| 382 | * Registers listeners for URL changes. This API is used to catch updates performed by the |
no test coverage detected