Added a type that unwraps promises

This commit is contained in:
Kir_Antipov 2022-12-24 17:37:29 +00:00
parent 6e27f6c851
commit f436b151aa

View file

@ -0,0 +1,6 @@
/**
* Obtains the underlying type of a {@link Promise}.
*
* @template T - A `Promise` type to extract the underlying type from.
*/
export type PromiseType<T extends Promise<unknown>> = T extends Promise<infer U> ? U : never;