@tanstack/react-router 1.112.8 → 1.112.9

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.
@@ -304,7 +304,7 @@ class Router {
304
304
  };
305
305
  this.buildLocation = (opts) => {
306
306
  const build = (dest = {}, matchedRoutesResult) => {
307
- var _a, _b, _c, _d, _e, _f;
307
+ var _a, _b, _c, _d, _e, _f, _g;
308
308
  const fromMatches = dest._fromLocation ? this.matchRoutes(dest._fromLocation, { _buildLocation: true }) : this.state.matches;
309
309
  const fromMatch = dest.from != null ? fromMatches.find(
310
310
  (d) => matchPathname(this.basepath, trimPathRight(d.pathname), {
@@ -324,10 +324,10 @@ class Router {
324
324
  );
325
325
  let pathname;
326
326
  if (dest.to) {
327
- const resolvePathTo = (fromMatch == null ? void 0 : fromMatch.fullPath) || this.latestLocation.pathname;
327
+ const resolvePathTo = (fromMatch == null ? void 0 : fromMatch.fullPath) || ((_d = last(fromMatches)) == null ? void 0 : _d.fullPath) || this.latestLocation.pathname;
328
328
  pathname = this.resolvePathWithBase(resolvePathTo, `${dest.to}`);
329
329
  } else {
330
- const fromRouteByFromPathRouteId = this.routesById[(_d = stayingMatches == null ? void 0 : stayingMatches.find((route) => {
330
+ const fromRouteByFromPathRouteId = this.routesById[(_e = stayingMatches == null ? void 0 : stayingMatches.find((route) => {
331
331
  const interpolatedPath = interpolatePath({
332
332
  path: route.fullPath,
333
333
  params: (matchedRoutesResult == null ? void 0 : matchedRoutesResult.routeParams) ?? {},
@@ -335,13 +335,13 @@ class Router {
335
335
  }).interpolatedPath;
336
336
  const pathname2 = joinPaths([this.basepath, interpolatedPath]);
337
337
  return pathname2 === fromPath;
338
- })) == null ? void 0 : _d.id];
338
+ })) == null ? void 0 : _e.id];
339
339
  pathname = this.resolvePathWithBase(
340
340
  fromPath,
341
341
  (fromRouteByFromPathRouteId == null ? void 0 : fromRouteByFromPathRouteId.to) ?? fromPath
342
342
  );
343
343
  }
344
- const prevParams = { ...(_e = last(fromMatches)) == null ? void 0 : _e.params };
344
+ const prevParams = { ...(_f = last(fromMatches)) == null ? void 0 : _f.params };
345
345
  let nextParams = (dest.params ?? true) === true ? prevParams : {
346
346
  ...prevParams,
347
347
  ...functionalUpdate(dest.params, prevParams)
@@ -362,7 +362,7 @@ class Router {
362
362
  decodeCharMap: this.pathParamsDecodeCharMap
363
363
  }).interpolatedPath;
364
364
  let search = fromSearch;
365
- if (opts._includeValidateSearch && ((_f = this.options.search) == null ? void 0 : _f.strict)) {
365
+ if (opts._includeValidateSearch && ((_g = this.options.search) == null ? void 0 : _g.strict)) {
366
366
  let validatedSearch = {};
367
367
  matchedRoutesResult == null ? void 0 : matchedRoutesResult.matchedRoutes.forEach((route) => {
368
368
  try {