@tanstack/react-router 1.112.7 → 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.
- package/dist/cjs/router.cjs +6 -6
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +6 -6
- package/dist/esm/router.js.map +1 -1
- package/package.json +3 -3
- package/src/router.ts +3 -1
package/dist/cjs/router.cjs
CHANGED
|
@@ -306,7 +306,7 @@ class Router {
|
|
|
306
306
|
};
|
|
307
307
|
this.buildLocation = (opts) => {
|
|
308
308
|
const build = (dest = {}, matchedRoutesResult) => {
|
|
309
|
-
var _a, _b, _c, _d, _e, _f;
|
|
309
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
310
310
|
const fromMatches = dest._fromLocation ? this.matchRoutes(dest._fromLocation, { _buildLocation: true }) : this.state.matches;
|
|
311
311
|
const fromMatch = dest.from != null ? fromMatches.find(
|
|
312
312
|
(d) => routerCore.matchPathname(this.basepath, routerCore.trimPathRight(d.pathname), {
|
|
@@ -326,10 +326,10 @@ class Router {
|
|
|
326
326
|
);
|
|
327
327
|
let pathname;
|
|
328
328
|
if (dest.to) {
|
|
329
|
-
const resolvePathTo = (fromMatch == null ? void 0 : fromMatch.fullPath) || this.latestLocation.pathname;
|
|
329
|
+
const resolvePathTo = (fromMatch == null ? void 0 : fromMatch.fullPath) || ((_d = routerCore.last(fromMatches)) == null ? void 0 : _d.fullPath) || this.latestLocation.pathname;
|
|
330
330
|
pathname = this.resolvePathWithBase(resolvePathTo, `${dest.to}`);
|
|
331
331
|
} else {
|
|
332
|
-
const fromRouteByFromPathRouteId = this.routesById[(
|
|
332
|
+
const fromRouteByFromPathRouteId = this.routesById[(_e = stayingMatches == null ? void 0 : stayingMatches.find((route) => {
|
|
333
333
|
const interpolatedPath = routerCore.interpolatePath({
|
|
334
334
|
path: route.fullPath,
|
|
335
335
|
params: (matchedRoutesResult == null ? void 0 : matchedRoutesResult.routeParams) ?? {},
|
|
@@ -337,13 +337,13 @@ class Router {
|
|
|
337
337
|
}).interpolatedPath;
|
|
338
338
|
const pathname2 = routerCore.joinPaths([this.basepath, interpolatedPath]);
|
|
339
339
|
return pathname2 === fromPath;
|
|
340
|
-
})) == null ? void 0 :
|
|
340
|
+
})) == null ? void 0 : _e.id];
|
|
341
341
|
pathname = this.resolvePathWithBase(
|
|
342
342
|
fromPath,
|
|
343
343
|
(fromRouteByFromPathRouteId == null ? void 0 : fromRouteByFromPathRouteId.to) ?? fromPath
|
|
344
344
|
);
|
|
345
345
|
}
|
|
346
|
-
const prevParams = { ...(
|
|
346
|
+
const prevParams = { ...(_f = routerCore.last(fromMatches)) == null ? void 0 : _f.params };
|
|
347
347
|
let nextParams = (dest.params ?? true) === true ? prevParams : {
|
|
348
348
|
...prevParams,
|
|
349
349
|
...routerCore.functionalUpdate(dest.params, prevParams)
|
|
@@ -364,7 +364,7 @@ class Router {
|
|
|
364
364
|
decodeCharMap: this.pathParamsDecodeCharMap
|
|
365
365
|
}).interpolatedPath;
|
|
366
366
|
let search = fromSearch;
|
|
367
|
-
if (opts._includeValidateSearch && ((
|
|
367
|
+
if (opts._includeValidateSearch && ((_g = this.options.search) == null ? void 0 : _g.strict)) {
|
|
368
368
|
let validatedSearch = {};
|
|
369
369
|
matchedRoutesResult == null ? void 0 : matchedRoutesResult.matchedRoutes.forEach((route) => {
|
|
370
370
|
try {
|