Commit bc7c0ff
authored
(fix) awaited type of promise or plain value (#439)
When awaiting the value of a type like Promise<string> | null, the type
wouldn't match PromiseLike. Hence the awaited value would still be
Promise<string> | null and not string | null. Reducing it to one type
declaration and using a conditional type to infer the awaited type
should do the trick.1 parent cf4eb70 commit bc7c0ff
1 file changed
+2
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 157 | | |
163 | 158 | | |
164 | | - | |
165 | | - | |
| 159 | + | |
| 160 | + | |
166 | 161 | | |
167 | 162 | | |
168 | 163 | | |
| |||
0 commit comments