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
// To prevent users with TypeScript versions lower than 4.5 from encountering unsupported Awaited<T> type, a copy has been made here.
17
+
exporttypeAwaited<T>=Textendsnull|undefined
18
+
? T// special case for `null | undefined` when not in `--strictNullChecks` mode
19
+
: Textendsobject&{then(onfulfilled: infer F, ...args: infer _): any}// `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
20
+
? Fextends(value: infer V, ...args: infer _)=>any// if the argument to `then` is callable, extracts the first argument
0 commit comments