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

x/tsafe/mod.ts>PickOptionals

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

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

Type Parameters

T extends Record<string, unknown>
definition: Required<Pick<T, OptionalKeyof<T>>>