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

Empty value validator.

example

Example

rule = [type: :string, empty: true]
Veli.valid("hello", rule) # valid
Veli.valid("", rule) # valid

rule = [type: :string, empty: false]
Veli.valid("hello", rule) # valid
Veli.valid("", rule) # not valid

Link to this section Summary

Link to this section Functions

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