Skip to content

Commit

Permalink
npm run fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoffrey committed Jul 27, 2024
1 parent 5aead9a commit 8ae65f2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ export function* run<T, S>(
*/

export type UnionToIntersection<U> = (
U extends any ? (arg: U) => any : never
U extends any
? (arg: U) => any
: never
) extends (arg: infer I) => void
? I
: never
Expand Down Expand Up @@ -230,10 +232,11 @@ export type IsMatch<T, G> = T extends G ? (G extends T ? T : never) : never
* Check if a type is an exact match.
*/

export type IsExactMatch<T, U> =
(<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2
? T
: never
export type IsExactMatch<T, U> = (<G>() => G extends T ? 1 : 2) extends <
G,
>() => G extends U ? 1 : 2
? T
: never

/**
* Check if a type is a record type.
Expand Down Expand Up @@ -265,7 +268,11 @@ export type IsTuple<T> = T extends [any]
*/

export type IsUnion<T, U extends T = T> = (
T extends any ? (U extends T ? false : true) : false
T extends any
? U extends T
? false
: true
: false
) extends false
? never
: T
Expand Down

0 comments on commit 8ae65f2

Please sign in to comment.