View Source MyspaceIPFS.Utils (Myspace IPFS v0.1.0-alpha.1)
Some common functions that are used throughout the library.
Link to this section Summary
Functions
Filter out any empty values from a list. Removes nil, {}, [], and "".
Extracts the data from a response. Given a response, it will structure the data in a way that is easier to work with. IPFS only sends strings. This function will convert the string to a list of maps.
Wraps the data in an elixir standard response tuple. {:ok, data} or {:error, data}
Unlists a list if it only contains one element.
Link to this section Functions
Filter out any empty values from a list. Removes nil, {}, [], and "".
Extracts the data from a response. Given a response, it will structure the data in a way that is easier to work with. IPFS only sends strings. This function will convert the string to a list of maps.
Wraps the data in an elixir standard response tuple. {:ok, data} or {:error, data}
Unlists a list if it only contains one element.