@remix-run/router 1.13.0 → 1.13.1
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/router.cjs.js +3 -10
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +3 -9
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +3 -10
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +2 -2
- package/dist/router.umd.min.js.map +1 -1
- package/dist/utils.d.ts +0 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/router.ts +1 -2
- package/utils.ts +0 -11
package/dist/utils.d.ts
CHANGED
|
@@ -399,7 +399,6 @@ export declare function resolvePath(to: To, fromPathname?: string): Path;
|
|
|
399
399
|
* </Route>
|
|
400
400
|
*/
|
|
401
401
|
export declare function getPathContributingMatches<T extends AgnosticRouteMatch = AgnosticRouteMatch>(matches: T[]): T[];
|
|
402
|
-
export declare function getResolveToMatches<T extends AgnosticRouteMatch = AgnosticRouteMatch>(matches: T[]): string[];
|
|
403
402
|
/**
|
|
404
403
|
* @private
|
|
405
404
|
*/
|
package/index.ts
CHANGED
|
@@ -87,7 +87,7 @@ export {
|
|
|
87
87
|
ErrorResponseImpl as UNSAFE_ErrorResponseImpl,
|
|
88
88
|
convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes,
|
|
89
89
|
convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch,
|
|
90
|
-
|
|
90
|
+
getPathContributingMatches as UNSAFE_getPathContributingMatches,
|
|
91
91
|
} from "./utils";
|
|
92
92
|
|
|
93
93
|
export {
|
package/package.json
CHANGED
package/router.ts
CHANGED
|
@@ -40,7 +40,6 @@ import {
|
|
|
40
40
|
convertRouteMatchToUiMatch,
|
|
41
41
|
convertRoutesToDataRoutes,
|
|
42
42
|
getPathContributingMatches,
|
|
43
|
-
getResolveToMatches,
|
|
44
43
|
immutableRouteKeys,
|
|
45
44
|
isRouteErrorResponse,
|
|
46
45
|
joinPaths,
|
|
@@ -3341,7 +3340,7 @@ function normalizeTo(
|
|
|
3341
3340
|
// Resolve the relative path
|
|
3342
3341
|
let path = resolveTo(
|
|
3343
3342
|
to ? to : ".",
|
|
3344
|
-
|
|
3343
|
+
getPathContributingMatches(contextualMatches).map((m) => m.pathnameBase),
|
|
3345
3344
|
stripBasename(location.pathname, basename) || location.pathname,
|
|
3346
3345
|
relative === "path"
|
|
3347
3346
|
);
|
package/utils.ts
CHANGED
|
@@ -1145,17 +1145,6 @@ export function getPathContributingMatches<
|
|
|
1145
1145
|
);
|
|
1146
1146
|
}
|
|
1147
1147
|
|
|
1148
|
-
// Return the array of pathnames for the current route matches - used to
|
|
1149
|
-
// generate the routePathnames input for resolveTo()
|
|
1150
|
-
export function getResolveToMatches<
|
|
1151
|
-
T extends AgnosticRouteMatch = AgnosticRouteMatch
|
|
1152
|
-
>(matches: T[]) {
|
|
1153
|
-
// Use the full pathname for the leaf match so we include splat values for "." links
|
|
1154
|
-
return getPathContributingMatches(matches).map((match, idx) =>
|
|
1155
|
-
idx === matches.length - 1 ? match.pathname : match.pathnameBase
|
|
1156
|
-
);
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
1148
|
/**
|
|
1160
1149
|
* @private
|
|
1161
1150
|
*/
|