]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(types): custom Awaited for TS 4.x
authorEduardo San Martin Morote <posva13@gmail.com>
Sun, 30 Jan 2022 09:05:41 +0000 (10:05 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Sun, 30 Jan 2022 09:05:41 +0000 (10:05 +0100)
Fix #1006

packages/pinia/src/types.ts

index 20a0c5323c3126922cb28493302ca4d38d300255..0f8c8c850e7fba24993d883199b2205eada6dba1 100644 (file)
@@ -165,7 +165,7 @@ type _Awaited<T> = T extends null | undefined
   ? T // special case for `null | undefined` when not in `--strictNullChecks` mode
   : T extends object & { then(onfulfilled: infer F): any } // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
   ? F extends (value: infer V, ...args: any) => any // if the argument to `then` is callable, extracts the first argument
-    ? Awaited<V> // recursively unwrap the value
+    ? _Awaited<V> // recursively unwrap the value
     : never // the argument to `then` was not callable
   : T // non-object or non-thenable