(depth = 0)
| 644 | } |
| 645 | |
| 646 | private parseChildren(depth = 0): {[outlet: string]: UrlSegmentGroup} { |
| 647 | if (depth > 50) { |
| 648 | throw new RuntimeError( |
| 649 | RuntimeErrorCode.UNPARSABLE_URL, |
| 650 | (typeof ngDevMode === 'undefined' || ngDevMode) && 'URL is too deep', |
| 651 | ); |
| 652 | } |
| 653 | if (this.remaining === '') { |
| 654 | return {}; |
| 655 | } |
| 656 | |
| 657 | this.consumeOptional('/'); |
| 658 | |
| 659 | const segments: UrlSegment[] = []; |
| 660 | if (!this.peekStartsWith('(')) { |
| 661 | segments.push(this.parseSegment()); |
| 662 | } |
| 663 | |
| 664 | while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) { |
| 665 | this.capture('/'); |
| 666 | segments.push(this.parseSegment()); |
| 667 | } |
| 668 | |
| 669 | let children: {[outlet: string]: UrlSegmentGroup} = {}; |
| 670 | if (this.peekStartsWith('/(')) { |
| 671 | this.capture('/'); |
| 672 | children = this.parseParens(true, depth); |
| 673 | } |
| 674 | |
| 675 | let res: {[outlet: string]: UrlSegmentGroup} = {}; |
| 676 | if (this.peekStartsWith('(')) { |
| 677 | res = this.parseParens(false, depth); |
| 678 | } |
| 679 | |
| 680 | if (segments.length > 0 || Object.keys(children).length > 0) { |
| 681 | res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children); |
| 682 | } |
| 683 | |
| 684 | return res; |
| 685 | } |
| 686 | |
| 687 | // parse a segment with its matrix parameters |
| 688 | // ie `name;k1=v1;k2` |
no test coverage detected