@@ -23,8 +23,7 @@ export function containsTree(container: UrlTree, containee: UrlTree, exact: bool
2323
2424function equalSegments ( container : UrlSegment , containee : UrlSegment ) : boolean {
2525 if ( ! equalPath ( container . pathsWithParams , containee . pathsWithParams ) ) return false ;
26- if ( Object . keys ( container . children ) . length !== Object . keys ( containee . children ) . length )
27- return false ;
26+ if ( container . numberOfChildren !== containee . numberOfChildren ) return false ;
2827 for ( let c in containee . children ) {
2928 if ( ! container . children [ c ] ) return false ;
3029 if ( ! equalSegments ( container . children [ c ] , containee . children [ c ] ) ) return false ;
@@ -41,7 +40,7 @@ function containsSegmentHelper(
4140 if ( container . pathsWithParams . length > containeePaths . length ) {
4241 const current = container . pathsWithParams . slice ( 0 , containeePaths . length ) ;
4342 if ( ! equalPath ( current , containeePaths ) ) return false ;
44- if ( Object . keys ( containee . children ) . length > 0 ) return false ;
43+ if ( containee . hasChildren ( ) ) return false ;
4544 return true ;
4645
4746 } else if ( container . pathsWithParams . length === containeePaths . length ) {
@@ -56,6 +55,7 @@ function containsSegmentHelper(
5655 const current = containeePaths . slice ( 0 , container . pathsWithParams . length ) ;
5756 const next = containeePaths . slice ( container . pathsWithParams . length ) ;
5857 if ( ! equalPath ( container . pathsWithParams , current ) ) return false ;
58+ if ( ! container . children [ PRIMARY_OUTLET ] ) return false ;
5959 return containsSegmentHelper ( container . children [ PRIMARY_OUTLET ] , containee , next ) ;
6060 }
6161}
0 commit comments