Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/tsafe/mod.ts>UnpackPromise

🔩 The missing TypeScript utils
Go to Latest
type alias UnpackPromise
import { type UnpackPromise } from "https://deno.land/x/tsafe@v1.6.1/mod.ts";

Use case: declare const pr: Promise<string[]>; const x: UnpackPromise; <== x is string[]

Type Parameters

T extends
| PromiseLike<unknown>
| undefined
| null
| false
| ""
definition: T extends PromiseLike<infer U> ? U : never