Skip to content

scoreAddress

function scoreAddress(input): AddressScore;

Defined in: quality.ts:157

Scores how complete a free-form Pakistani delivery address is, for cash on delivery and other courier use.

Built on parseAddress. It looks for a city, a house, plot or flat number, a street, an area, a postal code and a landmark (“near”, “opp”, “nazd”, “qareeb”, “سامنے” …), and adds up ADDRESS_WEIGHTS. A postal code that is a known post office raises the score more than an unknown one, and a post office in a different province from the city lowers it (with a warning in parsed.warnings).

This is a heuristic: it says how much an address tells a rider, not whether the address exists. It never throws.

Parameter Type
input string

AddressScore

scoreAddress('House 12, Street 4, Block B, Gulberg III, near Liberty Market, Lahore 54660');
// { score: 100, missing: [], parsed: { … } }