ex_commons v0.1.1 ExCommons.Map
Helpers for Maps and Structs.
Link to this section Summary
Functions
Atomize keys deeply in a map.
Examples
Strips selected keys from maps, that can be in a list, or and embedded within. Will not strip keys from NaiveDateTime, and DateTime, unless given directly
Link to this section Functions
Atomize keys deeply in a map.
Examples
iex> ExCommons.Map.atomize_keys(%{atom: %{“string” => true}}) %{atom: %{string: true}}
iex> ExCommons.Map.atomize_keys(%{“string” => %{“string” => true}}) %{string: %{string: true}}
Strips selected keys from maps, that can be in a list, or and embedded within. Will not strip keys from NaiveDateTime, and DateTime, unless given directly.
Examples
iex> ExCommons.Map.strip_keys(%{}, []) %{}
iex> ExCommons.Map.strip_keys([%{key: :val}], [:key]) [%{}]
iex> ExCommons.Map.strip_keys(%{embed: %{layered: %{key: :val}}}, [:key]) %{embed: %{layered: %{}}}