@tanstack/router-core 1.130.2 → 1.130.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -710,11 +710,9 @@ class RouterCore {
710
710
  return updated;
711
711
  };
712
712
  this.getMatch = (matchId) => {
713
- return [
714
- ...this.state.cachedMatches,
715
- ...this.state.pendingMatches ?? [],
716
- ...this.state.matches
717
- ].find((d) => d.id === matchId);
713
+ var _a;
714
+ const findFn = (d) => d.id === matchId;
715
+ return this.state.cachedMatches.find(findFn) ?? ((_a = this.state.pendingMatches) == null ? void 0 : _a.find(findFn)) ?? this.state.matches.find(findFn);
718
716
  };
719
717
  this.loadMatches = async ({
720
718
  location,
@@ -1281,7 +1279,10 @@ class RouterCore {
1281
1279
  return true;
1282
1280
  }
1283
1281
  const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3;
1284
- return !(d.status !== "error" && Date.now() - d.updatedAt < gcTime);
1282
+ const isError = d.status === "error";
1283
+ if (isError) return true;
1284
+ const isStale = Date.now() - d.updatedAt >= gcTime;
1285
+ return isStale;
1285
1286
  };
1286
1287
  this.clearCache({ filter });
1287
1288
  };