View Source Veli.Validators.Run (Veli v0.2.0)

Allows you to add custom validator. Any other value than true will computed as false.

example

Example

rule = [type: :integer, run: fn x -> rem(x, 2) === 0 end]
Veli.valid(2, rule) # valid
Veli.valid(3, rule) # not valid

Link to this section Summary

Link to this section Functions

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