Skip to content

Commit

Permalink
fix: Removes the Prettify type and stop using it in MergeObjs to avoid
Browse files Browse the repository at this point in the history
…#81 circular bug
  • Loading branch information
gustavoguichard committed Jul 31, 2023
1 parent e4f516e commit d5821bf
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@ type UnpackDFObject<Obj extends Record<string, DomainFunction>> =
| { [K in keyof Obj]: UnpackData<Obj[K]> }
| never

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

type Prettify<T> = {
[K in keyof T]: T[K]
// deno-lint-ignore ban-types
} & {}
type MergeObjs<Objs extends unknown[], output = {}> = Objs extends [
infer first,
...infer rest,
]
? MergeObjs<rest, Omit<output, keyof first> & first>
: output

type TupleToUnion<T extends unknown[]> = T[number]

Expand Down

0 comments on commit d5821bf

Please sign in to comment.