Repository navigation
pakdatakit 2.5.0
pakdatakit 2.5.0 · Package · Docs · Playground
Includes everything prepared for 2.4.0, which was never published on its own: the 2.4.0 changes are listed here with the 2.5.0 ones.
Added
slugify(),compareUrdu(),isRTL()andwrapBidi()(pakdatakit/text).
slugifymakes URL slugs that keep Urdu letters (no transliteration), with
script: 'any' | 'latin' | 'urdu'.compareUrdusorts in Urdu alphabetical
order following the Unicode CLDR collation for Urdu (CLDR 49), with letters
joined to ھ as letters of their own, the same in every port without ICU.
isRTLchecks the first letter's direction;wrapBidiwraps text in
Unicode directional isolates.calculateSalaryTax(),calculateMonthlySalaryTax(),getSalaryTaxSlabs(),
getSalaryTaxYears()andgetTaxYear()(pakdatakit/incometax), with the
new datasetdata/income-tax-slabs.json: the salaried income tax rate table
for tax years 2020 to 2027 from FBR's consolidated Income Tax Ordinance.
Returns the tax, the monthly amount, the effective rate and the slab, rounded
half up to the paisa. Surcharge, credits and exemptions are not applied.
Thesourcefor tax year 2027 is the Finance Act, 2026 as gazetted; FBR
Circular No. 02 of 2026-27 and the consolidated Ordinance are cited in
DATA.md.scoreAddress()andphoneRiskSignals()(pakdatakit/quality): heuristics
for cash on delivery.scoreAddressscores an address 0 to 100 from its city,
house number, street, area, postal code (a known post office scores more)
and landmark words in English, Roman Urdu and Urdu, and lists what is
missing.phoneRiskSignalsflags invalid, landline, service, repeated-digit,
sequential and placeholder numbers. The form adapters gainpk.codPhone()
(IsCodPhonefor class-validator).getSalesTaxRate(),calculateSalesTax()andsplitInclusive()
(pakdatakit/salestax): standard sales tax rates with the dates they
applied, from 1 July 2019, for goods (federal) and for services in Punjab,
Sindh, Khyber Pakhtunkhwa, Balochistan and Islamabad Capital Territory, each
with its law and official source (new datasetsales-tax-rates.json).
Amounts are rounded half up to the paisa.parseElectricityRef(),validateElectricityRef()and
validateGasConsumerNumber()(pakdatakit/bills): DISCO 14-digit reference
numbers (with U/R), DISCO customer IDs, K-Electric account numbers, and SNGPL
and SSGC consumer numbers, in the formats the utilities' bill pages ask for.
discoisnullfor DISCO bills, as no official source maps the digits to a
company.mapCourierStatus()andnormalizeCityForCourier()(pakdatakit/courier):
one status vocabulary for courier statuses, mapping only publicly documented
statuses (PostEx's API guide v4.1.9 and Leopards' "Returned to Shipper"; TCS,
M&P, Trax and BlueEx publish none), and city short forms (LHR,Khi,
Pindi,Isb, Lyallpur, Urdu names) mapped to the city list. No API clients
and no tracking-number detection, as no courier documents its format. The
status mapping is experimental: its values may change in a minor release
as more couriers' lists are added (see CONTRIBUTING.md).buildFbrInvoice()andvalidateFbrInvoice()(pakdatakit/fbr-invoice):
types for FBR's Digital Invoicing JSON, a builder that works out each line's
sales tax, and an offline validator that reports FBR's error codes, following
PRAL's "Technical Specification for DI API" v1.12. No HTTP client and no
tokens.
Changed
- Package metadata: the description, keywords and homepage now follow the same
style in every registry, and CI checks that the version, repository URL,
licence and author agree across ports (npm run check:metadata). binandrepository.urlinpackage.jsonare written in the form npm
publishes, sonpm publishno longer warns that it corrected them.- New
NOTICEfile (included in the npm package) and an "Origin and
attribution" section in the README. test-vectors/README.mddocuments the shared test vectors;
npm run test:portsregenerates them and runs every port against them.dataVersionis now2026-11-18(new dataset: sales tax rates).