typelab / assertions / IsTruthy
type IsTruthy<T> = _IsTrue<IfTruthy<T, true, false>>;Checks if a given type T is not `Falsy` or never.
| Type Parameter | Description |
|---|---|
|
|
The type to be checked. |
true if T is not `Falsy` or never, false otherwise.
type Valid = IsTruthy<0 | 1>; // true
type Invalid = IsTruthy<0 | 1>; // false