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

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

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()