diff --git a/src/types.ts b/src/types.ts index 96d1ef6b72..26ec9830bd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -31,7 +31,8 @@ export type ReturnTypeOf = ? ReturnType : T extends AnyFunction[] ? // exclude `void` from intersection, see octokit/octokit.js#2115 - UnionToIntersection, void>> + // UnionToIntersection, void>> + UnionToIntersection> : never; /** diff --git a/test/typescript-validate.ts b/test/typescript-validate.ts index 61707f4537..5bd7821c2d 100644 --- a/test/typescript-validate.ts +++ b/test/typescript-validate.ts @@ -48,6 +48,7 @@ export function pluginsTest() { const octokitWithVoidAndNonVoidPlugins = new OctokitWithVoidAndNonVoidPlugins(); + expectType(octokitWithVoidAndNonVoidPlugins); expectType(octokitWithVoidAndNonVoidPlugins.foo); expectType(octokitWithVoidAndNonVoidPlugins.bar); }