This solution is generated by ChatGPT, correctness is not guaranteed. You might also be able to find a solution fromcommunity posts.
AI solution for TypeScript puzzle on BFE.dev
25. implement UnwrapPromise<T>
type UnwrapPromise<T> = T extends Promise<infer U> ? U : Error;