@tanstack/router-core 1.131.37 → 1.131.38
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 +17 -33
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +17 -33
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +28 -51
package/dist/esm/router.js
CHANGED
|
@@ -928,26 +928,6 @@ class RouterCore {
|
|
|
928
928
|
}
|
|
929
929
|
return rootRouteId;
|
|
930
930
|
})();
|
|
931
|
-
const parseErrors = matchedRoutes.map((route) => {
|
|
932
|
-
var _a2;
|
|
933
|
-
let parsedParamsError;
|
|
934
|
-
const parseParams = ((_a2 = route.options.params) == null ? void 0 : _a2.parse) ?? route.options.parseParams;
|
|
935
|
-
if (parseParams) {
|
|
936
|
-
try {
|
|
937
|
-
const parsedParams = parseParams(routeParams);
|
|
938
|
-
Object.assign(routeParams, parsedParams);
|
|
939
|
-
} catch (err) {
|
|
940
|
-
parsedParamsError = new PathParamError(err.message, {
|
|
941
|
-
cause: err
|
|
942
|
-
});
|
|
943
|
-
if (opts == null ? void 0 : opts.throwOnError) {
|
|
944
|
-
throw parsedParamsError;
|
|
945
|
-
}
|
|
946
|
-
return parsedParamsError;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
return;
|
|
950
|
-
});
|
|
951
931
|
const matches = [];
|
|
952
932
|
const getParentContext = (parentMatch) => {
|
|
953
933
|
const parentMatchId = parentMatch == null ? void 0 : parentMatch.id;
|
|
@@ -999,14 +979,22 @@ class RouterCore {
|
|
|
999
979
|
decodeCharMap: this.pathParamsDecodeCharMap,
|
|
1000
980
|
parseCache: this.parsePathnameCache
|
|
1001
981
|
});
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
982
|
+
const matchId = interpolatePathResult.interpolatedPath + loaderDepsHash;
|
|
983
|
+
const existingMatch = this.getMatch(matchId);
|
|
984
|
+
const previousMatch = this.state.matches.find(
|
|
985
|
+
(d) => d.routeId === route.id
|
|
986
|
+
);
|
|
987
|
+
const strictParams = (existingMatch == null ? void 0 : existingMatch._strictParams) ?? interpolatePathResult.usedParams;
|
|
988
|
+
let paramsError = void 0;
|
|
989
|
+
if (!existingMatch) {
|
|
990
|
+
const strictParseParams = ((_c = route.options.params) == null ? void 0 : _c.parse) ?? route.options.parseParams;
|
|
991
|
+
if (strictParseParams) {
|
|
992
|
+
try {
|
|
993
|
+
Object.assign(
|
|
994
|
+
strictParams,
|
|
995
|
+
strictParseParams(strictParams)
|
|
996
|
+
);
|
|
997
|
+
} catch (err) {
|
|
1010
998
|
paramsError = new PathParamError(err.message, {
|
|
1011
999
|
cause: err
|
|
1012
1000
|
});
|
|
@@ -1016,11 +1004,7 @@ class RouterCore {
|
|
|
1016
1004
|
}
|
|
1017
1005
|
}
|
|
1018
1006
|
}
|
|
1019
|
-
|
|
1020
|
-
const existingMatch = this.getMatch(matchId);
|
|
1021
|
-
const previousMatch = this.state.matches.find(
|
|
1022
|
-
(d) => d.routeId === route.id
|
|
1023
|
-
);
|
|
1007
|
+
Object.assign(routeParams, strictParams);
|
|
1024
1008
|
const cause = previousMatch ? "stay" : "enter";
|
|
1025
1009
|
let match;
|
|
1026
1010
|
if (existingMatch) {
|