Skip to content

Commit

Permalink
fix(types): another fix to union type handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Oct 2, 2024
1 parent 6f9e629 commit 8f82392
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export type FieldSelection<
? NodeFields<T> extends infer TFields
? TFieldPath extends `${infer TField}.${infer TRest}`
? TField extends Keys<TFields>
? Access<TFields, TField> extends object
? FieldSelection<Access<TFields, TField>, TRest>
: undefined
? Access<TFields, TField> extends infer TValue
? TValue extends object
? FieldSelection<TValue, TRest>
: undefined
: never
: undefined
: TFieldPath extends Keys<TFields>
? Access<TFields, TFieldPath>
Expand Down

0 comments on commit 8f82392

Please sign in to comment.