25. implement UnwrapPromise<T>

TypeScript
Is this helpful ?

  - accepted / - tried

Implement UnwrapPromise<T> to return the resolved type of a promise.

type A = UnwrapPromise<Promise<string>> // string
type B = UnwrapPromise<Promise<null>> // null
type C = UnwrapPromise<null> // Error

Let's try to solve this problem within 5 minutes.

Discuss(8)