Skip to content

Commit

Permalink
Update lib/intersection-type.helper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Sep 30, 2022
1 parent dd22614 commit 54aa72f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/intersection-type.helper.ts
Expand Up @@ -22,9 +22,9 @@ type ClassRefsToConstructors<T extends Type[]> = {

// Firstly, it uses indexed access type `Class[][number]` to convert `Class[]` to union type of it
// e.g. `[Foo, Bar][number]` becomes `Foo | Bar`
// then, it use the `UnionToIntersection` type to transform union type to intersection type
// then, uses the `UnionToIntersection` type to transform union type to intersection type
// e.g. `Foo | Bar` becomes `Foo & Bar`
// finally, put them into `MappedType` as the original implementation
// finally, returns `MappedType` passing the generated intersection type as a type argument
type Intersection<T extends Type[]> = MappedType<
UnionToIntersection<ClassRefsToConstructors<T>[number]>
>;
Expand Down

0 comments on commit 54aa72f

Please sign in to comment.