Checks if a given type T is a truthy value. A truthy value is any value that is not a falsy value.
T
true if T is not a subtype of Falsy, otherwise false.
true
Falsy
false
type TruthyString = IsTruthy<string>; // => true type TruthyNumber = IsTruthy<10>; // => true type FalsyNull = IsTruthy<null>; // => false type FalsyEmptyString = IsTruthy<''>; => false Copy
type TruthyString = IsTruthy<string>; // => true type TruthyNumber = IsTruthy<10>; // => true type FalsyNull = IsTruthy<null>; // => false type FalsyEmptyString = IsTruthy<''>; => false
Checks if a given type
T
is a truthy value. A truthy value is any value that is not a falsy value.