UnsafeAtomizeKeys

Function to convert all binary keys to atoms in a map. Keys of other types will be left unchanged. The conversion will deeply traverse nested maps and lists.

The name "unsafe" refers to the fact that atoms in Elixir/Erlang are not garbage collected. If this function is called on maps with an unbounded number of keys then system resources could be depleted. This is intended for use when calling trusted APIs that will have a finite number of unique keys.

Installation

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

def deps do
  [
    {:unsafe_atomize_keys, "~> 1.1.0"}
  ]
end

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