antikythera v0.3.0 Antikythera.NestedMap View Source

Utility functions to work with nested maps.

Link to this section Summary

Functions

Updates a key in a nested map. Recursively traversing the map according to the given keys to the last member. If the last member exists, update it with the given function. Unlike Kernel.update_in/3, returns :error if any of the keys cannot be found.

Link to this section Functions

Link to this function

deep_merge(m1, m2)

View Source
deep_merge(map(), map()) :: map()
Link to this function

force_update(m, keys, fun)

View Source
force_update(map(), [any()], (any() -> any())) :: map()
Link to this function

update_existing_in(m, keys, fun)

View Source
update_existing_in(map(), [any()], (any() -> any())) ::
  {:ok, map()} | :error

Updates a key in a nested map. Recursively traversing the map according to the given keys to the last member. If the last member exists, update it with the given function. Unlike Kernel.update_in/3, returns :error if any of the keys cannot be found.