UNPKG

actionhero

Version:

The reusable, scalable, and quick node.js API server for stateless and stateful applications

10 lines (8 loc) 265 B
// from https://www.jpwilliams.dev/how-to-unpack-the-return-type-of-a-promise-in-typescript export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T extends (...args: any) => Promise<infer U> ? U : T extends (...args: any) => infer U ? U : T;