@tanstack/router-core 0.0.1-beta.52 → 0.0.1-beta.54
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/build/cjs/history.js +1 -2
- package/build/cjs/history.js.map +1 -1
- package/build/cjs/router.js +1 -1
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +2 -3
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +150 -150
- package/build/types/index.d.ts +1 -1
- package/build/umd/index.development.js +2 -3
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/history.ts +12 -2
- package/src/router.ts +8 -4
package/build/types/index.d.ts
CHANGED
|
@@ -271,7 +271,7 @@ declare class Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRout
|
|
|
271
271
|
gcMaxAge?: never;
|
|
272
272
|
}) => Promise<void>;
|
|
273
273
|
loadMatchData: (routeMatch: RouteMatch<any, any>) => Promise<Record<string, unknown>>;
|
|
274
|
-
invalidateRoute: (opts:
|
|
274
|
+
invalidateRoute: <TFrom extends ValidFromPath<TAllRouteInfo> = "/", TTo extends string = ".">(opts: ToOptions<TAllRouteInfo, TFrom, TTo, ResolveRelativePath<TFrom, NoInfer<TTo>>>) => Promise<void>;
|
|
275
275
|
reload: () => void;
|
|
276
276
|
resolvePath: (from: string, path: string) => string;
|
|
277
277
|
navigate: <TFrom extends ValidFromPath<TAllRouteInfo> = "/", TTo extends string = ".">({ from, to, search, hash, replace, params, }: NavigateOptions<TAllRouteInfo, TFrom, TTo>) => Promise<void>;
|
|
@@ -149,10 +149,9 @@
|
|
|
149
149
|
function parseLocation(href, state) {
|
|
150
150
|
let hashIndex = href.indexOf('#');
|
|
151
151
|
let searchIndex = href.indexOf('?');
|
|
152
|
-
const pathEnd = Math.min(hashIndex, searchIndex);
|
|
153
152
|
return {
|
|
154
153
|
href,
|
|
155
|
-
pathname:
|
|
154
|
+
pathname: href.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length),
|
|
156
155
|
hash: hashIndex > -1 ? href.substring(hashIndex, searchIndex) : '',
|
|
157
156
|
search: searchIndex > -1 ? href.substring(searchIndex) : '',
|
|
158
157
|
state
|
|
@@ -1356,7 +1355,7 @@
|
|
|
1356
1355
|
// If this `to` is a valid external URL, return
|
|
1357
1356
|
// null for LinkUtils
|
|
1358
1357
|
const toString = String(to);
|
|
1359
|
-
const fromString = String(from);
|
|
1358
|
+
const fromString = typeof from === 'undefined' ? from : String(from);
|
|
1360
1359
|
let isExternal;
|
|
1361
1360
|
try {
|
|
1362
1361
|
new URL(`${toString}`);
|