View Source Moar.Map (Moar v0.1.0)

Map-related functions

Link to this section Summary

Functions

Convert keys in map to atoms

Convert keys to atoms, traversing through descendant lists and maps

Merge two enumerables into a single map

Return a copy of map with old_key_name changed to new_key_name

Convert keys in map to strings

Transform values of map using transformer function

Link to this section Functions

@spec atomize_keys(map()) :: map()

Convert keys in map to atoms

@spec deep_atomize_keys(list() | map()) :: map()

Convert keys to atoms, traversing through descendant lists and maps

@spec merge(Enum.t(), Enum.t()) :: map()

Merge two enumerables into a single map

Link to this function

rename_key(map, old_key_name, new_key_name)

View Source
@spec rename_key(map(), binary() | atom(), binary() | atom()) :: map()

Return a copy of map with old_key_name changed to new_key_name

Link to this function

rename_keys(map, keys_map)

View Source
@spec stringify_keys(map()) :: map()

Convert keys in map to strings

Link to this function

transform(map, key, transformer)

View Source
@spec transform(map(), atom() | binary() | list(), (any() -> any())) :: map()

Transform values of map using transformer function