Skip to main content
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.0/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