numbers library
Landline, UAN, toll-free, premium and personal numbers.
Same as the pakdatakit/numbers entry point of the npm package.
Classes
- NumberInfo
- Result of analyzeNumber.
Enums
- NumberType
- Kind of Pakistani telephone number.
Functions
-
analyzeNumber(
String phone) → NumberInfo? -
Identifies and formats any Pakistani telephone number: mobile, landline,
UAN (
111), toll-free (0800), premium-rate (0900) or personal (0122). -
getAreaCode(
String city) → String? -
Returns the landline area code for a city, with trunk prefix (e.g.
"042"), ornullif the city is not in the dataset. Case-insensitive. -
getNumberType(
String phone) → NumberType? -
Returns the type of a Pakistani telephone number, or
nullif it is not a valid Pakistani number. See analyzeNumber. -
validateLandline(
String phone) → bool -
Validates a Pakistani landline (fixed-line) number such as
042-35761234.