You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/es5.d.ts
+5-6
Original file line number
Diff line number
Diff line change
@@ -1522,12 +1522,11 @@ interface Promise<T> {
1522
1522
* Recursively unwraps the "awaited type" of a type. Non-promise "thenables" should resolve to `never`. This emulates the behavior of `await`.
1523
1523
*/
1524
1524
typeAwaited<T>=
1525
-
Textendsnull|undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
1526
-
Textendsobject&{then(onfulfilled: infer F, ...args: infer _): any} ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1527
-
Fextends((value: infer V, ...args: infer _)=>any) ? // if the argument to `then` is callable, extracts the first argument
1528
-
Awaited<V> : // recursively unwrap the value
1529
-
never : // the argument to `then` was not callable
1530
-
T;// non-object or non-thenable
1525
+
Textendsobject&{then(onfulfilled: infer F, ...args: infer _): any} ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1526
+
Fextends((value: infer V, ...args: infer _)=>any) ? // if the argument to `then` is callable, extracts the first argument
1527
+
Awaited<V> : // recursively unwrap the value
1528
+
never : // the argument to `then` was not callable
0 commit comments