LivePhone.normalize
You're seeing just the function
normalize
, go back to LivePhone module for more information.
Specs
This is used to normalize a given phone
number to E.164 format,
and returns a tuple with {:ok, formatted_phone}
for valid numbers
and {:error, unformatted_phone}
for invalid numbers.
Examples
iex> LivePhone.normalize("1234", nil)
{:error, "1234"}
iex> LivePhone.normalize("+1 (650) 253-0000", "US")
{:ok, "+16502530000"}