Skip to content

Commit

Permalink
fix: Change MergeObjs definition to avoid infinite circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavoguichard committed Jul 31, 2023
1 parent b70d584 commit 6f210bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ type UnpackDFObject<Obj extends Record<string, DomainFunction>> =
| { [K in keyof Obj]: UnpackData<Obj[K]> }
| never

type MergeObjs<Objs extends unknown[], output = {}> = Prettify<
type MergeObjs<Objs extends unknown[], output = {}> =
Objs extends [infer first, ...infer rest]
? MergeObjs<rest, Omit<output, keyof first> & first>
? MergeObjs<rest, Prettify<Omit<output, keyof first> & first>>
: output
>

type Prettify<T> = {
[K in keyof T]: T[K]
Expand Down

0 comments on commit 6f210bc

Please sign in to comment.