File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1477,13 +1477,11 @@ interface Promise<T> {
1477
1477
*/
1478
1478
type Awaited < T > =
1479
1479
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
1480
- T extends object ? // `await` only unwraps object types with a callable then. Non-object types are not unwrapped.
1481
- T extends { then ( onfulfilled : infer F ) : any } ? // thenable, extracts the first argument to `then()`
1482
- F extends ( ( value : infer V ) => any ) ? // if the argument to `then` is callable, extracts the argument
1483
- Awaited < V > : // recursively unwrap the value
1484
- never : // the argument to `then` was not callable.
1485
- T : // argument was not an object
1486
- T ; // non-thenable
1480
+ T extends object & { then ( onfulfilled : infer F ) : any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1481
+ F extends ( ( value : infer V ) => any ) ? // if the argument to `then` is callable, extracts the argument
1482
+ Awaited < V > : // recursively unwrap the value
1483
+ never : // the argument to `then` was not callable
1484
+ T ; // non-object or non-thenable
1487
1485
1488
1486
interface ArrayLike < T > {
1489
1487
readonly length : number ;
You can’t perform that action at this time.
0 commit comments