phony
Types
pub type Country {
Country(name: String, alpha2: String, code: String)
}
Constructors
-
Country(name: String, alpha2: String, code: String)
pub type PhoneNumberKind {
Mobile
Landline
}
Constructors
-
Mobile
-
Landline
pub type ValidationResult {
ValidationResult(country: Country, kind: PhoneNumberKind)
}
Constructors
-
ValidationResult(country: Country, kind: PhoneNumberKind)
Functions
pub fn get_countries() -> List(Country)
pub fn validate_by_code(
phone_number: String,
code: String,
) -> Result(ValidationResult, Nil)
pub fn validate_by_country(
phone_number: String,
alpha2: String,
) -> Result(ValidationResult, Nil)