()
| 615 | } |
| 616 | |
| 617 | parseRootSegment(): UrlSegmentGroup { |
| 618 | // Consume all leading slashes. Multiple consecutive leading slashes (e.g. `///path`) |
| 619 | // are not meaningful and would otherwise produce a `//path`-style serialized URL, |
| 620 | // which browsers interpret as protocol-relative (resolving to a different origin) |
| 621 | // and reject with a SecurityError when passed to `history.pushState`/`replaceState`. |
| 622 | while (this.consumeOptional('/')) {} |
| 623 | |
| 624 | if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) { |
| 625 | return new UrlSegmentGroup([], {}); |
| 626 | } |
| 627 | |
| 628 | // The root segment group never has segments |
| 629 | return new UrlSegmentGroup([], this.parseChildren()); |
| 630 | } |
| 631 | |
| 632 | parseQueryParams(): Params { |
| 633 | const params: Params = {}; |
no test coverage detected