MapTools

Provides extended utility functions for working with maps, which are not covered in vanilla elixir.

Examples

iex> MapTools.key_replace(%{a: 1, b: 2, c: 3}, %{a: :alpha, b: :beta})
%{alpha: 1, beta: 2, c: 3}
iex> MapTools.merge_recursive(%{a: 1, b: %{c: 2}}, %{a: 3, b: %{d: 4}})
%{a: 3, b: %{c: 2, d: 4}}
iex> MapTools.remove_nil(%{a: 1, b: nil, c: 3})
%{a: 1, c: 3}

Installation

If available in Hex, the package can be installed by adding map_tools to your list of dependencies in mix.exs:

def deps do
  [
    {:map_tools, "~> 1.0.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/map_tools.