Magik.Validator (Magik v0.9.0) View Source

Validation module that support

  • Validate type

Link to this section Summary

Functions

Checks whether an item_name conforms the given format.

Validate value type that support

Link to this section Functions

Link to this function

validate_format(value, check)

View Source

Specs

validate_format(String.t(), Regex.t()) :: :ok | {:error, String.t()}

Checks whether an item_name conforms the given format.

Examples

iex> Exop.ValidationChecks.validate_regex(%{a: "bar"}, :a, ~r/bar/) :ok

Link to this function

validate_length(value, checks)

View Source
Link to this function

validate_number(value, checks)

View Source

Specs

validate_number(number(), {atom(), number()}) :: boolean()
Link to this function

validate_type(value, struct_name)

View Source

Validate value type that support

  • boolean
  • integer
  • float
  • number
  • string
  • tuple
  • map
  • list
  • atom
  • function
  • keyword
  • struct