//return from promise
type promiseReturn<T extends Promise<unknown>> = T extends Promise<infer type>
? type extends Promise<unknown>
? promiseReturn<type>
: type
: never;
type prom = promiseReturn<Promise<string>>; //string
type prom_2 = promiseReturn<Promise<Promise<string>>>; //string