@tanstack/react-router 1.2.1 → 1.2.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
3
  "author": "Tanner Linsley",
4
- "version": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -44,7 +44,7 @@
44
44
  "@tanstack/store": "^0.1.3",
45
45
  "tiny-invariant": "^1.3.1",
46
46
  "tiny-warning": "^1.0.3",
47
- "@tanstack/history": "1.2.1"
47
+ "@tanstack/history": "1.2.2"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "rollup --config rollup.config.js"
package/src/link.tsx CHANGED
@@ -184,13 +184,28 @@ export type ParamOptions<
184
184
  | 'fullSearchSchemaInput' = TParamVariant extends 'PATH'
185
185
  ? 'allParams'
186
186
  : 'fullSearchSchemaInput',
187
- TFromParams = Expand<Exclude<RouteByPath<TRouteTree, TFrom>['types'][TFromRouteType], RootSearchSchema>>,
188
- TToIndex = RouteByPath<TRouteTree, `${TTo}/`> extends never ? TTo : `${TTo}/`,
187
+ TFromParams = Expand<
188
+ Exclude<
189
+ RouteByPath<TRouteTree, TFrom>['types'][TFromRouteType],
190
+ RootSearchSchema
191
+ >
192
+ >,
193
+ TToIndex = RouteByPath<TRouteTree, `${TTo}/`> extends never ? TTo : `${TTo}/`,
189
194
  TToParams = TToIndex extends ''
190
195
  ? TFromParams
191
196
  : never extends TResolved
192
- ? Expand<Exclude<RouteByPath<TRouteTree, TToIndex>['types'][TToRouteType], RootSearchSchema>>
193
- : Expand<Exclude<RouteByPath<TRouteTree, TResolved>['types'][TToRouteType], RootSearchSchema>>,
197
+ ? Expand<
198
+ Exclude<
199
+ RouteByPath<TRouteTree, TToIndex>['types'][TToRouteType],
200
+ RootSearchSchema
201
+ >
202
+ >
203
+ : Expand<
204
+ Exclude<
205
+ RouteByPath<TRouteTree, TResolved>['types'][TToRouteType],
206
+ RootSearchSchema
207
+ >
208
+ >,
194
209
  TReducer = ParamsReducer<TFromParams, TToParams>,
195
210
  > = Expand<WithoutEmpty<PickRequired<TToParams>>> extends never
196
211
  ? Partial<MakeParamOption<TParamVariant, true | TReducer>>
@@ -21,7 +21,7 @@ export function useNavigate<
21
21
  <
22
22
  TFrom extends RoutePaths<TRouteTree> | string = TDefaultFrom,
23
23
  TTo extends string = '',
24
- TMaskFrom extends RoutePaths<TRouteTree>| string = TFrom,
24
+ TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,
25
25
  TMaskTo extends string = '',
26
26
  >({
27
27
  from,
package/src/utils.ts CHANGED
@@ -18,8 +18,8 @@ export type PickExtra<T, K> = {
18
18
  [TKey in keyof K as string extends TKey
19
19
  ? never
20
20
  : TKey extends keyof T
21
- ? never
22
- : TKey]: K[TKey]
21
+ ? never
22
+ : TKey]: K[TKey]
23
23
  }
24
24
 
25
25
  export type PickRequired<T> = {
@@ -108,15 +108,15 @@ export type ValueKeys<O> = Extract<keyof O, PropertyKey>
108
108
  export type DeepAwaited<T> = T extends Promise<infer A>
109
109
  ? DeepAwaited<A>
110
110
  : T extends Record<infer A, Promise<infer B>>
111
- ? { [K in A]: DeepAwaited<B> }
112
- : T
111
+ ? { [K in A]: DeepAwaited<B> }
112
+ : T
113
113
 
114
114
  export type PathParamMask<TRoutePath extends string> =
115
115
  TRoutePath extends `${infer L}/$${infer C}/${infer R}`
116
116
  ? PathParamMask<`${L}/${string}/${R}`>
117
117
  : TRoutePath extends `${infer L}/$${infer C}`
118
- ? PathParamMask<`${L}/${string}`>
119
- : TRoutePath
118
+ ? PathParamMask<`${L}/${string}`>
119
+ : TRoutePath
120
120
 
121
121
  export type Timeout = ReturnType<typeof setTimeout>
122
122
 
@@ -327,10 +327,10 @@ export type RouteFromIdOrRoute<
327
327
  > = T extends ParseRoute<TRouteTree>
328
328
  ? T
329
329
  : T extends RouteIds<TRouteTree>
330
- ? RoutesById<TRouteTree>[T]
331
- : T extends string
332
- ? RouteIds<TRouteTree>
333
- : never
330
+ ? RoutesById<TRouteTree>[T]
331
+ : T extends string
332
+ ? RouteIds<TRouteTree>
333
+ : never
334
334
 
335
335
  export function useRouteContext<
336
336
  TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],