DarkMatter.Maps (DarkMatter v1.1.3) View Source

Utils for handling maps

Link to this section Summary

Functions

Provide indifferent access to maps.

Returns a sorted list of atom keys found in results.

Link to this section Types

Specs

access_key() :: atom() | String.t()

Specs

access_key_or_keys() :: access_key() | [access_key(), ...]

Specs

accessor_path() :: iget_key() | [iget_key(), ...]

Specs

iget_key() :: atom()

Link to this section Functions

Link to this function

access_in(map, key_or_keys, default \\ nil)

View Source

Specs

access_in(map(), access_key_or_keys(), any()) :: any()

Safe version of Kernel.get_in/2

Link to this function

compact(map_or_struct, opts \\ %{allow_nil: false, deep: false})

View Source

Specs

compact(map() | struct(), opts :: Keyword.t() | map()) :: map()

Returns a map with nil values omitted

Link to this function

iget(map, key)

View Source (since 1.1.2)

Specs

iget(map(), accessor_path()) :: any()

Provide indifferent access to maps.

Link to this function

iget(map, key_or_keys, default)

View Source

Specs

iget(map(), accessor_path(), any()) :: any()

Specs

sorted_keys(map()) :: [atom() | String.t(), ...]

Returns a sorted list of atom keys found in results.