@tanstack/react-router 1.15.23 → 1.16.0

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/src/link.tsx CHANGED
@@ -207,9 +207,9 @@ export type ParamOptions<
207
207
  : `${TTo}/`,
208
208
  TToParams = TToIndex extends ''
209
209
  ? PostProcessParams<
210
- RouteByPath<TRouteTree, TFrom>['types'][TToRouteType],
211
- TParamVariant
212
- >
210
+ RouteByPath<TRouteTree, TFrom>['types'][TToRouteType],
211
+ TParamVariant
212
+ >
213
213
  : [TResolved] extends [never]
214
214
  ? PostProcessParams<
215
215
  RouteByPath<TRouteTree, TToIndex>['types'][TToRouteType],
@@ -219,7 +219,11 @@ export type ParamOptions<
219
219
  RouteByPath<TRouteTree, TResolved>['types'][TToRouteType],
220
220
  TParamVariant
221
221
  >,
222
- TRelativeToParams = TParamVariant extends 'SEARCH' ? TToParams : true extends IsUnion<TFromParams> ? TToParams : MakeDifferenceOptional<TFromParams, TToParams>,
222
+ TRelativeToParams = TParamVariant extends 'SEARCH'
223
+ ? TToParams
224
+ : true extends IsUnion<TFromParams>
225
+ ? TToParams
226
+ : MakeDifferenceOptional<TFromParams, TToParams>,
223
227
  TReducer = ParamsReducer<TFromParams, TRelativeToParams>,
224
228
  > =
225
229
  Expand<WithoutEmpty<PickRequired<TRelativeToParams>>> extends never
@@ -288,12 +292,10 @@ export type LinkOptions<
288
292
  disabled?: boolean
289
293
  }
290
294
 
291
- export type CheckPath<TRouteTree extends AnyRoute, TPath, TPass> = Exclude<
292
- TPath,
293
- RoutePaths<TRouteTree>
294
- > extends never
295
- ? TPass
296
- : CheckPathError<TRouteTree, Exclude<TPath, RoutePaths<TRouteTree>>>
295
+ export type CheckPath<TRouteTree extends AnyRoute, TPath, TPass> =
296
+ Exclude<TPath, RoutePaths<TRouteTree>> extends never
297
+ ? TPass
298
+ : CheckPathError<TRouteTree, Exclude<TPath, RoutePaths<TRouteTree>>>
297
299
 
298
300
  export type CheckPathError<TRouteTree extends AnyRoute, TInvalids> = {
299
301
  to: RoutePaths<TRouteTree>
package/src/router.ts CHANGED
@@ -841,7 +841,7 @@ export class Router<
841
841
  let nextParams =
842
842
  (dest.params ?? true) === true
843
843
  ? prevParams
844
- : {...prevParams, ...functionalUpdate(dest.params!, prevParams)}
844
+ : { ...prevParams, ...functionalUpdate(dest.params!, prevParams) }
845
845
 
846
846
  if (nextParams) {
847
847
  matches
package/src/utils.ts CHANGED
@@ -34,13 +34,16 @@ export type DeepPartial<T> = T extends object
34
34
  }
35
35
  : T
36
36
 
37
- export type MakeDifferenceOptional<T, U> = Omit<U, keyof T> & Partial<Pick<U, keyof T & keyof U>> & PickRequired<Omit<U, keyof PickRequired<T>>>
37
+ export type MakeDifferenceOptional<T, U> = Omit<U, keyof T> &
38
+ Partial<Pick<U, keyof T & keyof U>> &
39
+ PickRequired<Omit<U, keyof PickRequired<T>>>
38
40
 
39
41
  // from https://stackoverflow.com/a/53955431
40
- export type IsUnion<T, U extends T = T> =
41
- (T extends any ?
42
- (U extends T ? false : true)
43
- : never) extends false ? false : true
42
+ export type IsUnion<T, U extends T = T> = (
43
+ T extends any ? (U extends T ? false : true) : never
44
+ ) extends false
45
+ ? false
46
+ : true
44
47
 
45
48
  // type Compute<T> = { [K in keyof T]: T[K] } | never
46
49