@tanstack/router-core 1.130.6 → 1.130.8

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.
@@ -541,7 +541,7 @@ class RouterCore {
541
541
  pendingMatches,
542
542
  // If a cached moved to pendingMatches, remove it from cachedMatches
543
543
  cachedMatches: s.cachedMatches.filter(
544
- (d) => !pendingMatches.find((e) => e.id === d.id)
544
+ (d) => !pendingMatches.some((e) => e.id === d.id)
545
545
  )
546
546
  }));
547
547
  };
@@ -587,13 +587,13 @@ class RouterCore {
587
587
  const previousMatches = s.matches;
588
588
  const newMatches = s.pendingMatches || s.matches;
589
589
  exitingMatches = previousMatches.filter(
590
- (match) => !newMatches.find((d) => d.id === match.id)
590
+ (match) => !newMatches.some((d) => d.id === match.id)
591
591
  );
592
592
  enteringMatches = newMatches.filter(
593
- (match) => !previousMatches.find((d) => d.id === match.id)
593
+ (match) => !previousMatches.some((d) => d.id === match.id)
594
594
  );
595
595
  stayingMatches = previousMatches.filter(
596
- (match) => newMatches.find((d) => d.id === match.id)
596
+ (match) => newMatches.some((d) => d.id === match.id)
597
597
  );
598
598
  return {
599
599
  ...s,
@@ -722,9 +722,9 @@ class RouterCore {
722
722
  }
723
723
  };
724
724
  const resolvePreload = (matchId) => {
725
- return !!(allPreload && !this.state.matches.find((d) => d.id === matchId));
725
+ return !!(allPreload && !this.state.matches.some((d) => d.id === matchId));
726
726
  };
727
- if (!this.isServer && this.state.matches.find((d) => d._forcePending)) {
727
+ if (!this.isServer && this.state.matches.some((d) => d._forcePending)) {
728
728
  triggerOnReady();
729
729
  }
730
730
  const handleRedirectAndNotFound = (match, err) => {
@@ -1074,7 +1074,7 @@ class RouterCore {
1074
1074
  updateMatch(matchId, (prev) => ({
1075
1075
  ...prev,
1076
1076
  loaderPromise: createControlledPromise(),
1077
- preload: !!preload && !this.state.matches.find((d) => d.id === matchId)
1077
+ preload: !!preload && !this.state.matches.some((d) => d.id === matchId)
1078
1078
  }));
1079
1079
  const runLoader = async () => {
1080
1080
  var _a2, _b2, _c2, _d2;
@@ -1272,8 +1272,8 @@ class RouterCore {
1272
1272
  const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3;
1273
1273
  const isError = d.status === "error";
1274
1274
  if (isError) return true;
1275
- const isStale = Date.now() - d.updatedAt >= gcTime;
1276
- return isStale;
1275
+ const gcEligible = Date.now() - d.updatedAt >= gcTime;
1276
+ return gcEligible;
1277
1277
  };
1278
1278
  this.clearCache({ filter });
1279
1279
  };