validatePhone function checks whether a phone number matches a predefined country format. It iterates through a list of countries and uses regular expressions to validate the number based on the country code, prefix, and mask.ts
import { validatePhone } from "@arkyn/shared";
string): The phone number to be validated.boolean): Returns true if the phone number matches any country format, otherwise false.ts
import { validatePhone } from "./validatePhone";validatePhone("+55 32912345678"); // true (valid for Brazil)validatePhone("+1-684 1234567"); // true (valid for American Samoa)validatePhone("+55 1234567890"); // false (invalid for Brazil)