Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/tsafe/UnpackPromise.ts

🔩 The missing TypeScript utils
Go to Latest
File
/** * Use case: * declare const pr: Promise<string[]>; * const x: UnpackPromise<typeof pr>; <== x is string[] */export type UnpackPromise<T extends PromiseLike<unknown> | undefined | null | false | ""> = T extends PromiseLike<infer U> ? U : never;