@@ -47,7 +47,7 @@ export class RouterEngine {
4747 #routeHelper;
4848 #cleanup = false ;
4949 #parent: RouterEngine | undefined ;
50- # resolvedHash: Hash ;
50+ resolvedHash : Hash ;
5151 /**
5252 * Gets or sets the router's identifier. This is displayed by the `RouterTracer` component.
5353 */
@@ -86,17 +86,17 @@ export class RouterEngine {
8686
8787 #routeStatusData = $derived . by ( ( ) => {
8888 const routeStatus = { } as Record < string , RouteStatus > ;
89- let noMatches = true ;
89+ let fallback = true ;
9090 for ( let routeKey of Object . keys ( this . routes ) ) {
9191 const pattern = this . #routePatterns. get ( routeKey ) ! ;
9292 const [ match , routeParams ] = this . #routeHelper. testRoute ( pattern ) ;
93- noMatches = noMatches && ( pattern . ignoreForFallback ? true : ! match ) ;
93+ fallback = fallback && ( pattern . ignoreForFallback ? true : ! match ) ;
9494 routeStatus [ routeKey ] = {
9595 match,
9696 routeParams,
9797 } ;
9898 }
99- return [ routeStatus , noMatches ] as const ;
99+ return [ routeStatus , fallback ] as const ;
100100 } ) ;
101101 /**
102102 * Gets a a record of route statuses where the keys are the route keys, and the values are
@@ -105,9 +105,9 @@ export class RouterEngine {
105105 routeStatus = $derived ( this . #routeStatusData[ 0 ] ) ;
106106 /**
107107 * Gets a boolean value that indicates whether the current URL matches none of the route
108- * patterns.
108+ * patterns, therefore enabling fallback behavior .
109109 */
110- noMatches = $derived ( this . #routeStatusData[ 1 ] ) ;
110+ fallback = $derived ( this . #routeStatusData[ 1 ] ) ;
111111 /**
112112 * Initializes a new instance of this class with the specified options.
113113 */
@@ -121,24 +121,24 @@ export class RouterEngine {
121121 throw new Error ( "The routing library hasn't been initialized. Execute init() before creating routers." ) ;
122122 }
123123 if ( isRouterEngine ( parentOrOpts ) ) {
124- this . # resolvedHash = parentOrOpts . # resolvedHash;
124+ this . resolvedHash = parentOrOpts . resolvedHash ;
125125 this . #parent = parentOrOpts ;
126126 }
127127 else {
128128 this . #parent = parentOrOpts ?. parent ;
129- this . # resolvedHash = this . #parent && parentOrOpts ?. hash === undefined ? this . #parent. # resolvedHash : resolveHashValue ( parentOrOpts ?. hash ) ;
130- if ( this . #parent && this . # resolvedHash !== this . #parent. # resolvedHash) {
129+ this . resolvedHash = this . #parent && parentOrOpts ?. hash === undefined ? this . #parent. resolvedHash : resolveHashValue ( parentOrOpts ?. hash ) ;
130+ if ( this . #parent && this . resolvedHash !== this . #parent. resolvedHash ) {
131131 throw new Error ( "The parent router's hash mode must match the child router's hash mode." ) ;
132132 }
133- if ( routingOptions . hashMode === 'multi' && this . # resolvedHash && typeof this . # resolvedHash !== 'string' ) {
133+ if ( routingOptions . hashMode === 'multi' && this . resolvedHash && typeof this . resolvedHash !== 'string' ) {
134134 throw new Error ( "The specified hash value is not valid for the 'multi' hash mode. Either don't specify a hash for path routing, or correct the hash value." ) ;
135135 }
136- if ( routingOptions . hashMode !== 'multi' && typeof this . # resolvedHash === 'string' ) {
136+ if ( routingOptions . hashMode !== 'multi' && typeof this . resolvedHash === 'string' ) {
137137 throw new Error ( "A hash path ID was given, but is only allowed when the library's hash mode has been set to 'multi'." ) ;
138138 }
139139 }
140- assertAllowedRoutingMode ( this . # resolvedHash) ;
141- this . #routeHelper = new RouteHelper ( this . # resolvedHash) ;
140+ assertAllowedRoutingMode ( this . resolvedHash ) ;
141+ this . #routeHelper = new RouteHelper ( this . resolvedHash ) ;
142142 if ( traceOptions . routerHierarchy ) {
143143 registerRouter ( this ) ;
144144 this . #cleanup = true ;
@@ -158,7 +158,7 @@ export class RouterEngine {
158158 * This is a shortcut for `location.state`.
159159 */
160160 get state ( ) {
161- return location . getState ( this . # resolvedHash) ;
161+ return location . getState ( this . resolvedHash ) ;
162162 }
163163 /**
164164 * Gets or sets the router's base path.
0 commit comments