View Source Valicon (valicon v1.7.2)

The collection of ectoless validation and helper functions for validation of pure data structures.

Summary

Functions

Runs the given validations on the given attributes.

Validates the given attributes with the given validations.

Types

Functions

Link to this function

run_validations(attrs, validations)

View Source
@spec run_validations(
  map() | list(),
  [
    (map() | list() ->
       [Valicon.ValidationError.t()] | Valicon.ValidationError.t())
  ]
) :: [Valicon.ValidationError.t()]

Runs the given validations on the given attributes.

Link to this function

validate(attrs, validations)

View Source
@spec validate(map() | list(), [
  (map() | list() ->
     [Valicon.ValidationError.t()] | Valicon.ValidationError.t())
]) :: {:ok, map() | list()} | {:error, [Valicon.ValidationError.t()]}

Validates the given attributes with the given validations.