Type Alias IsNotFalse<T, $O>

IsNotFalse<T, $O>: $SpecialType<T, $MergeOptions<$O, {
    $else: IsNotFalse.$<T, $O>;
    $then: $ResolveBranch<T, $O, [$Then]>;
}>>

🎭 predicate

Validate if T is not false.

Type Parameters

type R = IsNotFalse<boolean> // boolean
type R = IsNotFalse<true> // true
type R = IsNotFalse<false> // false

type R = IsNotFalse<number> // true
type R = IsNotFalse<unknown> // true
type R = IsNotFalse<string | boolean> // boolean

🔢 customize

Filter to ensure T is not false, otherwise returns never.

type R = IsNotFalse<boolean, { selection: 'filter' }> // true
type R = IsNotFalse<true, { selection: 'filter' }> // true
type R = IsNotFalse<false, { selection: 'filter' }> // never

type R = IsNotFalse<number, { selection: 'filter' }> // number
type R = IsNotFalse<never, { selection: 'filter' }> // never
type R = IsNotFalse<unknown, { selection: 'filter' }> // unknown
type R = IsNotFalse<string | boolean, { selection: 'filter' }> // string | true
type R = IsNotFalse<string | false, { selection: 'filter' }> // string

🔢 customize:

Disable distribution of union types.

type R = IsNotFalse<false | 1> // boolean
type R = IsNotFalse<boolean | 1> // boolean
type R = IsNotFalse<boolean | 1, { distributive: false }> // true

🔢 customize

Use unique branch identifiers to allow precise processing of the result.

type R = IsNotFalse<false, $SelectionBranch> // $Else
type R = IsNotFalse<boolean, $SelectionBranch> // $Then | $Else
type R = IsNotFalse<string, $SelectionBranch> // $Then