Xema.Utils.has_key-question-mark
You're seeing just the function
has_key-question-mark
, go back to Xema.Utils module for more information.
Specs
Returns whether the given key
exists in the given value
.
Returns true if
value
is a map and containskey
as a key.value
is a keyword and containskey
as a key.value
is a list of tuples withkey
as the first element.
Example
iex> alias Xema.Utils
iex> Utils.has_key?(%{foo: 5}, :foo)
true
iex> Utils.has_key?([foo: 5], :foo)
true
iex> Utils.has_key?([{"foo", 5}], "foo")
true