Skip to content

Commit 7fcb62e

Browse files
committed
fix(types): custom Awaited for TS 4.x
Fix #1006
1 parent a572b15 commit 7fcb62e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/pinia/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ type _Awaited<T> = T extends null | undefined
165165
? T // special case for `null | undefined` when not in `--strictNullChecks` mode
166166
: T extends object & { then(onfulfilled: infer F): any } // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
167167
? F extends (value: infer V, ...args: any) => any // if the argument to `then` is callable, extracts the first argument
168-
? Awaited<V> // recursively unwrap the value
168+
? _Awaited<V> // recursively unwrap the value
169169
: never // the argument to `then` was not callable
170170
: T // non-object or non-thenable
171171

0 commit comments

Comments
 (0)