Common utilities used in Our Very Own Elixir projects.
Add {:ovo_utils, "~> 0.1.0"}
to your deps
in mix.exs and run mix deps.get
Full documentation can be found at HexDocs.
populate_map_with_concurrent_functions(functions, timeout)
- Concurrently executes functions and returns the results in a map.
transform_keys(map, transformation)
- Applies a transformation function on map keys.atomise_string_keys(map)
- Converts string keys in maps to atoms.stringify_atom_keys(map)
- Converts all string keys in a map to atom keys.camelize_string_keys(map)
- Converts all string keys in a map to camel case.snakify_string_keys(map)
- Converts all string keys in a map to to snake case.
apply_on_ok(tuple, function)
- Applies a function to a value inside an {:ok | :error, value} tuple if atom is :ok, otherwise returns the tuple without applying the function.