Assoc.Util (Assoc v0.2.0) View Source

Collection of utility functions

Link to this section Summary

Functions

Recursively converts the keys of a map into an atom.

Link to this section Functions

Link to this function

keys_to_atoms(map, options \\ [])

View Source

Recursively converts the keys of a map into an atom.

Options:

:allowlist -> List of strings to convert to atoms. When passed, only strings in allowlist will be converted.

Example:

keys_to_atoms(%{"nested" => %{"example" => "value"}})

Returns:

%{nested: %{example: "value"}}