is v1.0.0 Is.Validators.And View Source

AND logic operators for validators.

Examples

iex> Is.validate(10, and: [:integer, equals: 10])
[]

iex> Is.validate(nil, and: [:optional, :integer, equals: 10])
[]

iex> Is.validate(10, and: [integer: false, equals: 10])
[{:error, [], "must not be an integer"}]

iex> Is.validate(10, and: [:integer, equals: 11])
[{:error, [], "must equals 11"}]

Link to this section Summary

Link to this section Functions

Link to this function validate(data, conditions) View Source
validate(any(), Keyword.t()) :: :ok | [{:error, [any()], binary()}]
Link to this function validate_option(condition, arg) View Source