Skip to content

getNetwork

function getNetwork(phone): NetworkName;

Defined in: networks.ts:39

Detects the mobile network for a Pakistani phone number based on its prefix.

Returns the network the prefix was originally allocated to. Due to Mobile Number Portability (MNP) and operator mergers, the current carrier may differ.

Parameter Type Description
phone string The phone number to look up

NetworkName

Network name or "Unknown" if the number is not a valid Pakistani mobile number