Skip to content

Commit

Permalink
refactor(types): loosen Intersection definition
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Aug 4, 2022
1 parent 4df8656 commit c5cf5b6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/types/intersection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
* @module tutils/types/Intersection
*/

import type ObjectPlain from './object-plain'

/**
* Combine two types.
* Combines `T1` and `T2`.
*
* @see https://typescriptlang.org/docs/handbook/unions-and-intersections.html#intersection-types
* @see https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#intersections
*
* @template T1 - Object type 1
* @template T2 - Object type 2
* @template T1 - Base type(s)
* @template T2 - Type(s) to combine with `T1`
*/
type Intersection<
T1 extends ObjectPlain = ObjectPlain,
T2 extends ObjectPlain = ObjectPlain
> = T1 & T2
type Intersection<T1 = any, T2 = any> = T1 & T2

export { type Intersection as default }

0 comments on commit c5cf5b6

Please sign in to comment.