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

Type validator.

  • :string
  • :integer
  • :float
  • :boolean

example

Example

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

Link to this section Summary

Link to this section Functions

@spec valid?(boolean() | binary() | maybe_improper_list() | number() | map(), atom()) ::
  boolean()