Oneflow v0.1.1 Oneflow.Helpers
This module contains generic usful functions.
Link to this section Summary
Functions
Prepends given prefix to the given string
Removes any key value pair with a nil value in Enum. Given
the map %{test: nil, key: 1}
it should return a map
with jsut key
Link to this section Functions
Link to this function
prepend(string, prefix, atom)
Prepends given prefix to the given string.
Examples
iex> Oneflow.Helpers.prepend(“/accounts”, “/api”, :url) “/api/accounts”
iex> Oneflow.Helpers.prepend(“secret”, “token:”, :string) “token:secret”
Link to this function
remove_nil_values(map)
Removes any key value pair with a nil value in Enum. Given
the map %{test: nil, key: 1}
it should return a map
with jsut key
.
Returns %{key: 1}
.
Examples
iex> Oneflow.Helpers.remove_nil_values(%{test: nil, key: 1}) [key: 1]
iex> Oneflow.Helpers.remove_nil_values([test: nil, key: 1]) [key: 1]