* Determines whether a type is an object with a callable `then` member.
(type)
| 81327 | * Determines whether a type is an object with a callable `then` member. |
| 81328 | */ |
| 81329 | function isThenableType(type) { |
| 81330 | if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) { |
| 81331 | // primitive types cannot be considered "thenable" since they are not objects. |
| 81332 | return false; |
| 81333 | } |
| 81334 | var thenFunction = getTypeOfPropertyOfType(type, "then"); |
| 81335 | return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* TypeFacts.NEUndefinedOrNull */), 0 /* SignatureKind.Call */).length > 0; |
| 81336 | } |
| 81337 | function isAwaitedTypeInstantiation(type) { |
| 81338 | var _a; |
| 81339 | if (type.flags & 16777216 /* TypeFlags.Conditional */) { |
no test coverage detected