Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 1.42 KB

README.md

File metadata and controls

31 lines (18 loc) · 1.42 KB

Hex.pm Build Status Coverage Status

OVO Utils

Common utilities used in Our Very Own Elixir projects.

Installation

Add {:ovo_utils, "~> 0.1.0"} to your deps in mix.exs and run mix deps.get

Documentation

Full documentation can be found at HexDocs.

Utility Functions

Concurrent Tasks

  • populate_map_with_concurrent_functions(functions, timeout) - Concurrently executes functions and returns the results in a map.

Maps

  • 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.

Miscellaneous

  • 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.