(depth = 0)
| 724 | } |
| 725 | |
| 726 | private parseChildren(depth = 0): {[outlet: string]: UrlSegmentGroup} { |
| 727 | if (depth > 50) { |
| 728 | throw new RuntimeError( |
| 729 | RuntimeErrorCode.UNPARSABLE_URL, |
| 730 | (typeof ngDevMode === 'undefined' || ngDevMode) && 'URL is too deep', |
| 731 | ); |
| 732 | } |
| 733 | if (this.remaining === '') { |
| 734 | return {}; |
| 735 | } |
| 736 | |
| 737 | this.consumeOptional('/'); |
| 738 | |
| 739 | const segments: UrlSegment[] = []; |
| 740 | if (!this.peekStartsWith('(')) { |
| 741 | segments.push(this.parseSegment()); |
| 742 | } |
| 743 | |
| 744 | while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) { |
| 745 | this.capture('/'); |
| 746 | segments.push(this.parseSegment()); |
| 747 | } |
| 748 | |
| 749 | let children: {[outlet: string]: UrlSegmentGroup} = {}; |
| 750 | if (this.peekStartsWith('/(')) { |
| 751 | this.capture('/'); |
| 752 | children = this.parseParens(true, depth); |
| 753 | } |
| 754 | |
| 755 | let res: {[outlet: string]: UrlSegmentGroup} = {}; |
| 756 | if (this.peekStartsWith('(')) { |
| 757 | res = this.parseParens(false, depth); |
| 758 | } |
| 759 | |
| 760 | if (segments.length > 0 || Object.keys(children).length > 0) { |
| 761 | res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children); |
| 762 | } |
| 763 | |
| 764 | return res; |
| 765 | } |
| 766 | |
| 767 | // parse a segment with its matrix parameters |
| 768 | // ie `name;k1=v1;k2` |
no test coverage detected