Libphonenumber (Libphonenumber v0.1.0) View Source

Documentation for Libphonenumber.

Link to this section Summary

Functions

Show mobile phone validation info (phone number must be MSISDN)

Check is mobile phone valid (phone number must be MSISDN)

Link to this section Functions

Link to this function

mobile_phone_number_info(phone_number)

View Source

Specs

mobile_phone_number_info(binary()) :: %{
  :errors => [:null | map()],
  :valid => boolean(),
  optional(:country_metadata) => %{code: binary(), id: any(), name: any()},
  optional(:phone) => binary()
}

Show mobile phone validation info (phone number must be MSISDN)

Examples

iex> Libphonenumber.mobile_phone_number_info("+380938562241")
%{
  country_metadata: %{code: "380", id: "UA", name: "Ukraine (UA)"},
  errors: [],
  phone: "+380938562241",
  valid: true
}
Link to this function

mobile_phone_valid?(phone_number)

View Source

Specs

mobile_phone_valid?(binary()) :: boolean()

Check is mobile phone valid (phone number must be MSISDN)

Examples

iex> Libphonenumber.mobile_phone_valid?("+380938562241")
true

iex> Libphonenumber.mobile_phone_valid?("+380338560241")
false