Skip to content

Commit

Permalink
fix: handle unions correctly in KeysAsDotNotation
Browse files Browse the repository at this point in the history
  • Loading branch information
tobloef committed May 16, 2024
1 parent f9389f7 commit ab7696b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/util-types/keys-as-dot-notation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export type KeysAsDotNotation<
IgnoredTypes = never,
Key extends keyof T = keyof T
> = (
T extends (IgnoredTypes | DefaultIgnoredTypes)
? never
: T extends (infer ElementType)[]
? DistributeDotNotation<ElementType, IgnoredTypes>
: T extends readonly (infer ElementType)[]
IsUnion<T> extends true
? DistributeDotNotation<T, IgnoredTypes>
: T extends (IgnoredTypes | DefaultIgnoredTypes)
? never
: T extends (infer ElementType)[]
? DistributeDotNotation<ElementType, IgnoredTypes>
: IsUnion<T> extends true
? DistributeDotNotation<T, IgnoredTypes>
: T extends readonly (infer ElementType)[]
? DistributeDotNotation<ElementType, IgnoredTypes>
: Key extends string
? (
Key |
Expand Down

0 comments on commit ab7696b

Please sign in to comment.