Skip to main content
Module

x/ts_toolbelt_unofficial/mod.ts>T.Compulsory

👷 TypeScript's largest type utility library, now on Deno
Latest
type alias T.Compulsory
import { type T } from "https://deno.land/x/ts_toolbelt_unofficial@1.1.0/mod.ts";
const { Compulsory } = T;

Make that L's fields cannot be [[Nullable]] or [[Optional]] (it's like [[Required]] & [[NonNullable]] at once).

Examples

Example 1

 * import {L} from 'ts-toolbelt.ts'

type test0 = L.Compulsory<[1, 2, 3?, 4?]> // [1, 2, 3, 4]
type test1 = L.Compulsory<['a', 'b' | undefined, 'c', 'd', 'e' | null]> // ['a', 'b', 'c', 'd', 'e']

Type Parameters

L extends List
optional
depth extends Depth = "flat"
definition: Cast<CompulsoryPart<L, depth>, List>