View Source Runbox.Utils.Map (runbox v22.0.0)
A set of utility functions for Maps.
Summary
Functions
Follows the path in the (deep) map, defaulting to default if some of the
objects on the path is missing.
Functions
Follows the path in the (deep) map, defaulting to default if some of the
objects on the path is missing.
Example
iex> object = %{"some" => %{"deep" => %{"object" => "data"}}}
...> Runbox.Utils.Map.get_path(object, ["some", "deep", "object"])
"data"
iex> Runbox.Utils.Map.get_path(object, ["non-existent"], "default")
"default"