Skip to content

Commit

Permalink
fix(typescript): avoid the void
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jun 13, 2021
1 parent 2d9a596 commit 42b7c9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export type ReturnTypeOf<T extends AnyFunction | AnyFunction[]> =
T extends AnyFunction
? ReturnType<T>
: T extends AnyFunction[]
? UnionToIntersection<ReturnType<T[number]>>
? // exclude `void` from intersection, see octokit/octokit.js#2115
UnionToIntersection<Exclude<ReturnType<T[number]>, void>>
: never;

/**
Expand Down

0 comments on commit 42b7c9b

Please sign in to comment.