soundcloud v0.1.0 Soundcloud.Utils View Source
Utilities module.
Collection of useful functions.
Link to this section Summary
Functions
Flattens a list of maps to a single map
Transforms a map with string for keys to a map with atoms as keys
Link to this section Functions
Link to this function
list_of_maps_to_map(list, acc \\ %{})
View Source
list_of_maps_to_map([map()], map()) :: map()
Flattens a list of maps to a single map.
Examples
iex> Soundcloud.Utils.list_of_maps_to_map([%{"a" => 5}, %{"b" => 10}])
%{"a" => 5, "b" => 10}
Link to this function
map_string_keys_to_atoms(map)
View Source
map_string_keys_to_atoms(%{optional(binary()) => any()}) :: map()
Transforms a map with string for keys to a map with atoms as keys.
Examples
iex> Soundcloud.Utils.map_string_keys_to_atoms(%{"foo" => 5, "bar" => %{"tar" => 10}})
%{foo: 5, bar: %{tar: 10}}