Booléens
boolean applique la véracité JSONata (les chaînes vides, 0, les tableaux/objets vides sont faux) ; not la nie ; exists est vrai pour toute valeur autre que undefined (y compris null).
boolean
boolean(value: unknown): booleanVéracité JSONata : "", 0, [] et {} sont faux.
typeflow
hasBio: boolean(user.bio)not
not(value: unknown): booleanVéracité JSONata niée.
typeflow
isBlank: not(user.bio)exists
exists(value: unknown): booleanVrai sauf si la valeur est undefined (null existe).
typeflow
wasDeleted: exists(user.deletedAt)Playground
{ "hasBio": false, "hasTags": true, "isBlank": true, "wasDeleted": true }
type inféré
{
hasBio: boolean;
hasTags: boolean;
isBlank: boolean;
wasDeleted: boolean;
}