* When possible, merges the primary outlet child into the parent `UrlSegmentGroup`. * * When a segment group has only one child which is a primary outlet, merges that child into the * parent. That is, the child segment group's segments are merged into the `s` and the child's * children become th
(s: UrlSegmentGroup)
| 873 | * group into the parent. |
| 874 | */ |
| 875 | function mergeTrivialChildren(s: UrlSegmentGroup): UrlSegmentGroup { |
| 876 | if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) { |
| 877 | const c = s.children[PRIMARY_OUTLET]; |
| 878 | return new UrlSegmentGroup(s.segments.concat(c.segments), c.children); |
| 879 | } |
| 880 | |
| 881 | return s; |
| 882 | } |
| 883 | |
| 884 | export function isUrlTree(v: any): v is UrlTree { |
| 885 | return v instanceof UrlTree; |
no outgoing calls
no test coverage detected