From a7040144e532dbf338cb11865a8f5396818ec6c7 Mon Sep 17 00:00:00 2001 From: Terry Fu Date: Thu, 24 Oct 2024 16:20:18 +1100 Subject: [PATCH] don't reiterate through all type parts for each part --- packages/type-utils/src/predicates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/type-utils/src/predicates.ts b/packages/type-utils/src/predicates.ts index 5c0680c8f7d5..3a4f451aaa1c 100644 --- a/packages/type-utils/src/predicates.ts +++ b/packages/type-utils/src/predicates.ts @@ -131,7 +131,7 @@ export function discriminateAnyType( return AnyType.AnyArray; } for (const part of tsutils.typeParts(type)) { - if (tsutils.isThenableType(checker, tsNode, type)) { + if (tsutils.isThenableType(checker, tsNode, part)) { const awaitedType = checker.getAwaitedType(part); if (awaitedType) { const awaitedAnyType = discriminateAnyType(