Valicon (valicon v1.9.2)

Copy Markdown View Source

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

key()

@type key() :: atom() | String.t()

Functions

run_validations(attrs, validations)

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

Runs the given validations on the given attributes.

validate(attrs, validations)

@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.