normalizeCityForCourier
function normalizeCityForCourier(input): string | null;Defined in: courier.ts:242
Maps the way a customer or a courier writes a city to the city’s name in pakdatakit’s city list, so orders can be matched against a courier’s service list.
Accepts the exact name in any case, short forms (LHR, Khi, Pindi,
Isb, FSD), the old name Lyallpur, a trailing “city”, and the main
cities in Urdu script.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
string |
Returns
Section titled “Returns”string | null
A city from the city list, or null. Never throws.
Example
Section titled “Example”normalizeCityForCourier('LHR'); // "Lahore"normalizeCityForCourier('lyallpur'); // "Faisalabad"normalizeCityForCourier('Karachi City'); // "Karachi"normalizeCityForCourier('Atlantis'); // null