truthy
La fonction truthy() est un type guard qui conserve uniquement les valeurs truthy (false, 0, "", null, undefined sont exclus).
Exemple interactif
Syntaxe
typescript
function truthy<
GenericInput extends unknown,
>(
input: GenericInput
): input is TruthyValue<GenericInput>;Paramètres
input: Valeur à tester.
Valeur de retour
Un type guard qui est vrai quand input est truthy.
