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

x/ts_essentials/lib/types.ts>OptionalKeys

All basic TypeScript types in one place 🤙
Latest
type alias OptionalKeys
import { type OptionalKeys } from "https://deno.land/x/ts_essentials@v9.1.2/lib/types.ts";

Gets keys of an object which are optional

definition: T extends unknown ? [K in keyof T]-?: undefined extends [K2 in keyof T]: K2[K] ? K : never[keyof T] : never