parseElectricityRef
function parseElectricityRef(input): | ElectricityRef | null;Defined in: bills.ts:52
Parses a Pakistani electricity bill identifier: a DISCO reference number, a DISCO customer ID or a K-Electric account number.
Formats are those the utilities’ own bill pages ask for (retrieved 2026-11-18; see DATA.md): PITC’s bill pages take a 14-digit reference number with a separate U/R choice, or a 10-digit customer ID (11 digits for LESCO); K-Electric asks for a “13 digits KE Account Number starting from 04000”. No check digit is published, so only the format is checked.
Spaces, dashes and dots are ignored, and Urdu digits are accepted.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
string |
Returns
Section titled “Returns”| ElectricityRef
| null
The identifier, or null if it matches none of the formats.
Never throws.