io.github.soleworks.validity.phone:
Courier.kt
phone
phone(countryCode, areaCode, format) on String
Checks that the string is a valid phone number, by the metadata of libphonenumber. Every argument is optional and
narrows what passes: a number from another country, with another area code or written in another format fails.
countryCode: the country calling code the number must have, such as55or+55. Withnull, any country.areaCode: the area code the number must have, such as11. Withnull, any area code.format: how the number must be written, aPhoneFormat. Withnull, any of them.
phone
mobilePhone
mobilePhone(countryCode, areaCode, format) on String
Checks that the string is a valid mobile phone number, with the same arguments as phone. Numbers that can be mobile
or fixed line, as in the United States, pass.
mobilePhone
countryCode
countryCode() on String
Checks that the string is a country calling code, such as 55 or +1, with or without the +.
countryCode
areaCode
areaCode(countryCode) on String
Checks that the string is an area code used in countryCode, such as 11 in Brazil. Where the area codes of a country
have different lengths, any 1 to 5 digits pass.
areaCode
Formats
PhoneFormat says how a number is written: