View Source Veli.Validators.Nullable (Veli v0.2.6)

Nullable validator.

example

Example

rule = [type: :integer, nullable: true]
Veli.valid(2, rule) # valid
Veli.valid(nil, rule) # valid
Veli.valid(4.2, rule) # not valid

Link to this section Summary

Link to this section Functions

@spec valid?(any(), boolean()) :: boolean() | nil