()
| 695 | } |
| 696 | |
| 697 | parseRootSegment(): UrlSegmentGroup { |
| 698 | // Consume all leading slashes. Multiple consecutive leading slashes (e.g. `///path`) |
| 699 | // are not meaningful and would otherwise produce a `//path`-style serialized URL, |
| 700 | // which browsers interpret as protocol-relative (resolving to a different origin) |
| 701 | // and reject with a SecurityError when passed to `history.pushState`/`replaceState`. |
| 702 | while (this.consumeOptional('/')) {} |
| 703 | |
| 704 | if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) { |
| 705 | return new UrlSegmentGroup([], {}); |
| 706 | } |
| 707 | |
| 708 | // The root segment group never has segments |
| 709 | return new UrlSegmentGroup([], this.parseChildren()); |
| 710 | } |
| 711 | |
| 712 | parseQueryParams(): Params { |
| 713 | const params: Params = {}; |
no test coverage detected