is v1.0.0 Is.Validators.Tuple View Source
Validation for tuple.
Examples
iex> Is.validate({}, :tuple)
[]
iex> Is.validate({}, tuple: false)
[{:error, [], "must not be a tuple"}]
iex> Is.validate({"a", "b", "c"}, tuple: :binary)
[]
iex> Is.validate(%{value: {"a", true, "c"}}, map: %{value: [tuple: [or: [:binary, :boolean]]]})
[]
iex> Is.validate({:error, "error message"}, tuple: {:atom, :binary})
[]
iex> Is.validate({:error, "error message"}, tuple: {:atom, :boolean})
[{:error, [1], "must be a boolean"}]