Skip to content

Commit

Permalink
fix: LooseUnion object typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Nov 21, 2023
1 parent 3bd16ff commit c410c17
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ export type LooseUnion<TUnion extends string | number | object> =
TUnion extends string
? (string & {})
: (
TUnion extends object
? (object & {})
: (number & {})
TUnion extends number
? (number & {})
: (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TUnion extends Record<keyof any, unknown>
? (object & {})
: never
)
)
);

Expand Down

0 comments on commit c410c17

Please sign in to comment.