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

Link to this function atomize_keys(map)

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}}

Link to this function strip_keys(list, keys)
strip_keys(Map.t() | [Map.t()], [Atom.t()]) :: Map.t() | [Map.t()]

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: %{}}}