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: packages/core/src/utils/handleCallbackErrors.ts
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
import{isThenable}from'../utils/is';
2
2
3
+
/* eslint-disable */
4
+
// Vendor this in to be TS 3.8 compatible
5
+
typeAwaited<T>=Textendsnull|undefined
6
+
? T// special case for `null | undefined` when not in `--strictNullChecks` mode
7
+
: Textendsobject&{then(onfulfilled: infer F, ...args: infer _): any}// `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
8
+
? Fextends(value: infer V, ...args: infer _)=>any// if the argument to `then` is callable, extracts the first argument
0 commit comments