Skip to content

Commit

Permalink
fix(): hotfix, exclude any type from inferring type
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Nov 26, 2021
1 parent 396e822 commit d389108
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/types/path-value.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ export type PathImpl<T, Key extends keyof T> = Key extends string
: never;

export type PathImpl2<T> = PathImpl<T, keyof T> | keyof T;
export type Path<T> = PathImpl2<T> extends string | keyof T
? PathImpl2<T>
: keyof T;

export type Path<T> = keyof T extends string
? PathImpl2<T> extends string | keyof T
? PathImpl2<T>
: keyof T
: never;

export type PathValue<
T,
Expand Down

0 comments on commit d389108

Please sign in to comment.