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

x/tsafe/index.ts

🔩 The missing TypeScript utils
Latest
import * as tsafe from "https://deno.land/x/tsafe@v1.8.5/index.ts";

Type Aliases

Ensure that a that a specific type that we are declaring extends a more generic type

Return type of objectEntries https://docs.tsafe.dev/objectentries

Return type of objectFromEntries https://docs.tsafe.dev/objectFromEntries

Shorthand for Parameters[0] https://docs.tsafe.dev/param0

PickOptionals<{ p1: string; p2?: string; p3?: number; }> is the type { p2: string; p3: number; }

PickRequired<{ p1: string; p2?: string; p3?: number; p4: string; }> is the type { p1: string; p4: number; }

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