is v1.0.0 Is.Validators.MapKeys View Source
Validation for map keys.
Examples
iex> Is.validate(%{a: true}, map_keys: :atom)
[]
iex> Is.validate(%{"a" => true, "b" => true}, map_keys: [or: [:atom, :binary]])
[]
iex> Is.validate(%{a: true}, map_keys: :binary)
[{:error, [], "map_keys: must be a binary"}]
iex> Is.validate(true, map_keys: :binary)
[{:error, [], "map_keys: value must be a map"}]