@@ -90,7 +90,7 @@ export default abstract class Router<R extends Route> {
9090 map ( callback : MatchCallback ) {
9191 this . recognizer . map ( callback , function ( recognizer , routes ) {
9292 for ( let i = routes . length - 1 , proceed = true ; i >= 0 && proceed ; -- i ) {
93- let route = routes [ i ] ;
93+ let route = routes [ i ] ! ;
9494 let handler = route . handler as string ;
9595 recognizer . add ( routes , { as : handler } ) ;
9696 proceed = route . path === '/' || route . path === '' || handler . slice ( - 6 ) === '.index' ;
@@ -196,7 +196,7 @@ export default abstract class Router<R extends Route> {
196196 localizeMapUpdates : false ,
197197 }
198198 ) as RouteInfoWithAttributes [ ] ;
199- return routeInfosWithAttributes [ routeInfosWithAttributes . length - 1 ] ;
199+ return routeInfosWithAttributes [ routeInfosWithAttributes . length - 1 ] ! ;
200200 } ) ;
201201 }
202202
@@ -325,7 +325,7 @@ export default abstract class Router<R extends Route> {
325325 let { routeInfos } = this . state ! ;
326326 intent = new NamedTransitionIntent < R > (
327327 this ,
328- routeInfos [ routeInfos . length - 1 ] . name ,
328+ routeInfos [ routeInfos . length - 1 ] ! . name ,
329329 undefined ,
330330 [ ] ,
331331 queryParams
@@ -390,11 +390,11 @@ export default abstract class Router<R extends Route> {
390390 log ( this , transition . sequence , 'TRANSITION COMPLETE.' ) ;
391391
392392 // Resolve with the final route.
393- return routeInfos [ routeInfos . length - 1 ] . route ! ;
393+ return routeInfos [ routeInfos . length - 1 ] ! . route ! ;
394394 } catch ( e ) {
395395 if ( ! isTransitionAborted ( e ) ) {
396396 let infos = transition [ STATE_SYMBOL ] ! . routeInfos ;
397- transition . trigger ( true , 'error' , e , transition , infos [ infos . length - 1 ] . route ) ;
397+ transition . trigger ( true , 'error' , e , transition , infos [ infos . length - 1 ] ! . route ) ;
398398 transition . abort ( ) ;
399399 }
400400
@@ -448,7 +448,7 @@ export default abstract class Router<R extends Route> {
448448 let i , l , route ;
449449
450450 for ( i = 0 , l = partition . exited . length ; i < l ; i ++ ) {
451- route = partition . exited [ i ] . route ;
451+ route = partition . exited [ i ] ! . route ;
452452 delete route ! . context ;
453453
454454 if ( route !== undefined ) {
@@ -468,7 +468,7 @@ export default abstract class Router<R extends Route> {
468468
469469 try {
470470 for ( i = 0 , l = partition . reset . length ; i < l ; i ++ ) {
471- route = partition . reset [ i ] . route ;
471+ route = partition . reset [ i ] ! . route ;
472472 if ( route !== undefined ) {
473473 if ( route . _internalReset !== undefined ) {
474474 route . _internalReset ( false , transition ) ;
@@ -479,14 +479,14 @@ export default abstract class Router<R extends Route> {
479479 for ( i = 0 , l = partition . updatedContext . length ; i < l ; i ++ ) {
480480 this . routeEnteredOrUpdated (
481481 currentRouteInfos ,
482- partition . updatedContext [ i ] ,
482+ partition . updatedContext [ i ] ! ,
483483 false ,
484484 transition !
485485 ) ;
486486 }
487487
488488 for ( i = 0 , l = partition . entered . length ; i < l ; i ++ ) {
489- this . routeEnteredOrUpdated ( currentRouteInfos , partition . entered [ i ] , true , transition ! ) ;
489+ this . routeEnteredOrUpdated ( currentRouteInfos , partition . entered [ i ] ! , true , transition ! ) ;
490490 }
491491 } catch ( e ) {
492492 this . state = oldState ;
@@ -631,8 +631,8 @@ export default abstract class Router<R extends Route> {
631631 l ;
632632
633633 for ( i = 0 , l = newRouteInfos . length ; i < l ; i ++ ) {
634- let oldRouteInfo = oldRouteInfos [ i ] ,
635- newRouteInfo = newRouteInfos [ i ] ;
634+ let oldRouteInfo = oldRouteInfos [ i ] ! ,
635+ newRouteInfo = newRouteInfos [ i ] ! ;
636636
637637 if ( ! oldRouteInfo || oldRouteInfo . route !== newRouteInfo . route ) {
638638 routeChanged = true ;
@@ -652,7 +652,7 @@ export default abstract class Router<R extends Route> {
652652 }
653653
654654 for ( i = newRouteInfos . length , l = oldRouteInfos . length ; i < l ; i ++ ) {
655- routes . exited . unshift ( oldRouteInfos [ i ] ) ;
655+ routes . exited . unshift ( oldRouteInfos [ i ] ! ) ;
656656 }
657657
658658 routes . reset = routes . updatedContext . slice ( ) ;
@@ -669,19 +669,19 @@ export default abstract class Router<R extends Route> {
669669 }
670670
671671 let { routeInfos } = state ;
672- let { name : routeName } = routeInfos [ routeInfos . length - 1 ] ;
672+ let { name : routeName } = routeInfos [ routeInfos . length - 1 ] ! ;
673673 let params : Dict < unknown > = { } ;
674674
675675 for ( let i = routeInfos . length - 1 ; i >= 0 ; -- i ) {
676- let routeInfo = routeInfos [ i ] ;
676+ let routeInfo = routeInfos [ i ] ! ;
677677 merge ( params , routeInfo . params ) ;
678678 if ( routeInfo . route ! . inaccessibleByURL ) {
679679 urlMethod = null ;
680680 }
681681 }
682682
683683 if ( urlMethod ) {
684- params . queryParams = transition . _visibleQueryParams || state . queryParams ;
684+ params [ ' queryParams' ] = transition . _visibleQueryParams || state . queryParams ;
685685 let url = this . recognizer . generate ( routeName , params as Params ) ;
686686
687687 // transitions during the initial transition must always use replaceURL.
@@ -761,7 +761,7 @@ export default abstract class Router<R extends Route> {
761761
762762 let finalQueryParams : Dict < unknown > = { } ;
763763 for ( let i = 0 , len = finalQueryParamsArray . length ; i < len ; ++ i ) {
764- let qp = finalQueryParamsArray [ i ] ;
764+ let qp = finalQueryParamsArray [ i ] ! ;
765765 finalQueryParams [ qp . key ] = qp . value ;
766766 if ( transition && qp . visible !== false ) {
767767 transition . _visibleQueryParams [ qp . key ] = qp . value ;
@@ -798,7 +798,7 @@ export default abstract class Router<R extends Route> {
798798 Object . assign ( { } , newTransition [ QUERY_PARAMS_SYMBOL ] ) ,
799799 { includeAttributes, localizeMapUpdates : false }
800800 ) ;
801- newTransition ! . to = toInfos [ toInfos . length - 1 ] || null ;
801+ newTransition ! . to = toInfos [ toInfos . length - 1 ] ! || null ;
802802 }
803803 }
804804
@@ -815,7 +815,7 @@ export default abstract class Router<R extends Route> {
815815
816816 oldRouteInfoLen = oldRouteInfos . length ;
817817 for ( i = 0 ; i < oldRouteInfoLen ; i ++ ) {
818- oldHandler = oldRouteInfos [ i ] ;
818+ oldHandler = oldRouteInfos [ i ] ! ;
819819 newRouteInfo = newState . routeInfos [ i ] ;
820820
821821 if ( ! newRouteInfo || oldHandler . name !== newRouteInfo . name ) {
@@ -904,11 +904,11 @@ export default abstract class Router<R extends Route> {
904904 let routeInfos = state ! . routeInfos ;
905905
906906 if ( pivotRoute === undefined ) {
907- pivotRoute = routeInfos [ 0 ] . route ;
907+ pivotRoute = routeInfos [ 0 ] ! . route ;
908908 }
909909
910910 log ( this , 'Starting a refresh transition' ) ;
911- let name = routeInfos [ routeInfos . length - 1 ] . name ;
911+ let name = routeInfos [ routeInfos . length - 1 ] ! . name ;
912912 let intent = new NamedTransitionIntent (
913913 this ,
914914 name ,
@@ -961,7 +961,7 @@ export default abstract class Router<R extends Route> {
961961
962962 let params : Params = { } ;
963963 for ( let i = 0 , len = state . routeInfos . length ; i < len ; ++ i ) {
964- let routeInfo = state . routeInfos [ i ] ;
964+ let routeInfo = state . routeInfos [ i ] ! ;
965965 let routeParams = routeInfo . serialize ( ) ;
966966 merge ( params , routeParams ) ;
967967 }
@@ -993,12 +993,12 @@ export default abstract class Router<R extends Route> {
993993 return false ;
994994 }
995995
996- let targetHandler = targetRouteInfos [ targetRouteInfos . length - 1 ] . name ;
996+ let targetHandler = targetRouteInfos [ targetRouteInfos . length - 1 ] ! . name ;
997997 let recognizerHandlers : ParsedHandler [ ] = this . recognizer . handlersFor ( targetHandler ) ;
998998
999999 let index = 0 ;
10001000 for ( len = recognizerHandlers . length ; index < len ; ++ index ) {
1001- routeInfo = targetRouteInfos [ index ] ;
1001+ routeInfo = targetRouteInfos [ index ] ! ;
10021002 if ( routeInfo . name === routeName ) {
10031003 break ;
10041004 }
@@ -1072,11 +1072,11 @@ function routeInfosSameExceptQueryParams<R1 extends Route, R2 extends Route>(
10721072 }
10731073
10741074 for ( let i = 0 , len = routeInfos . length ; i < len ; ++ i ) {
1075- if ( routeInfos [ i ] . name !== otherRouteInfos [ i ] . name ) {
1075+ if ( routeInfos [ i ] ! . name !== otherRouteInfos [ i ] ! . name ) {
10761076 return false ;
10771077 }
10781078
1079- if ( ! paramsEqual ( routeInfos [ i ] . params , otherRouteInfos [ i ] . params ) ) {
1079+ if ( ! paramsEqual ( routeInfos [ i ] ! . params , otherRouteInfos [ i ] ! . params ) ) {
10801080 return false ;
10811081 }
10821082 }
@@ -1102,7 +1102,7 @@ function paramsEqual(params: Dict<unknown> | undefined, otherParams: Dict<unknow
11021102 }
11031103
11041104 for ( let i = 0 , len = keys . length ; i < len ; ++ i ) {
1105- let key = keys [ i ] ;
1105+ let key = keys [ i ] ! ;
11061106
11071107 if ( params [ key ] !== otherParams [ key ] ) {
11081108 return false ;
0 commit comments