Seventh challenge is Awaited
Promise and gets the value in the same way.
Sometimes it’s useful to get the value even if it’s double wrapped with
Promise so this is also possible.
Type inference in conditional types is defined in TypeScript as following:
Within the extends clause of a conditional type, it is now possible to have infer declarations that introduce a type variable to be inferred. Such inferred type variables may be referenced in the true branch of the conditional type
As we want to unbox double or maybe thrice wrapped
Promise we need Recursive Conditional Types:
It’s available since TypeScript 4.1 and allows us to do so with
This is it ⭐️
Don’t forget to check the solution on Playground 🚀typescripteasy