sparkpost v0.1.0 Washup
Tools for verifying and pruning Elixir structs before JSON serialisation.
Summary
Functions
Walk a possibly nested data structure, filtering out nil values
Walk a possibly nested data structure and raise an exception if a :required is found
Functions
Walk a possibly nested data structure, filtering out nil values.
Example
iex> jenny = %{name: "Jennifer", age: 27, rank: "Captain", pets: nil}
iex> Washup.filter(jenny)
%{name: "Jennifer", age: 27, rank: "Captain"}
iex> Washup.filter("Plain String")
"Plain String"