From 5a6144a6daf256c76ca138a052dbb7e0d30d1ff7 Mon Sep 17 00:00:00 2001 From: Gregor Martynus <39992+gr2m@users.noreply.github.com> Date: Tue, 8 Jun 2021 00:46:17 -0700 Subject: [PATCH] test: avoid the void regression --- src/types.ts | 3 ++- test/typescript-validate.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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); }