Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/tsafe/UnpackPromise.ts>UnpackPromise

🔩 The missing TypeScript utils
Go to Latest
type alias UnpackPromise
import { type UnpackPromise } from "https://deno.land/x/tsafe@v1.6.5/UnpackPromise.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