Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 611 Bytes

File metadata and controls

43 lines (31 loc) · 611 Bytes

typelab / assertions / IsFalsy

type IsFalsy<T> = _IsTrue<IfFalsy<T, true, false>>;

Checks if a given type T is `Falsy`.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is `Falsy`, false otherwise.

Example

type Valid = IsFalsy<false | '' | 0 | 0n | null | undefined | void>; // true
type Invalid = IsFalsy<0 | 1>; // false