pakdatakit 2.2.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DATA.md +512 -34
- package/LICENSE +1 -1
- package/NOTICE +14 -0
- package/README.md +472 -28
- package/dist/address.cjs +6 -5
- package/dist/address.js +4 -3
- package/dist/bills.cjs +19 -0
- package/dist/bills.d.cts +63 -0
- package/dist/bills.d.ts +63 -0
- package/dist/bills.js +2 -0
- package/dist/{chunk-4VSGCQ6K.cjs → chunk-2OBKPYJZ.cjs} +3 -3
- package/dist/chunk-33GOK7EE.cjs +5312 -0
- package/dist/chunk-33QMFE2Z.js +21244 -0
- package/dist/chunk-34U2ZMHR.js +194 -0
- package/dist/chunk-4GSBHJX6.js +165 -0
- package/dist/chunk-5DDHO5Z7.cjs +565 -0
- package/dist/chunk-5EY5DQS7.js +51 -0
- package/dist/chunk-5RGX4DWF.js +559 -0
- package/dist/chunk-5UCRHVI4.cjs +302 -0
- package/dist/{chunk-TTARJWGT.js → chunk-7DY26QPN.js} +2 -2
- package/dist/chunk-7E7L3NYS.cjs +11 -0
- package/dist/{chunk-3ZA265SK.cjs → chunk-AUQFA7EE.cjs} +172 -4
- package/dist/{chunk-QKH7W2CC.js → chunk-B7DOQ5QF.js} +6 -5
- package/dist/{chunk-HBOZIITD.js → chunk-CADQM4ZN.js} +14 -14
- package/dist/chunk-CF6AMRBU.cjs +198 -0
- package/dist/chunk-CZOZB4K3.js +61 -0
- package/dist/{chunk-3IARSCO6.cjs → chunk-DHOP7LQX.cjs} +25 -14
- package/dist/chunk-E2XU6NOW.js +909 -0
- package/dist/chunk-E6GWBOKV.cjs +911 -0
- package/dist/chunk-E6HSKRAE.js +9 -0
- package/dist/chunk-EA3SIHYT.js +313 -0
- package/dist/{chunk-33FXHM2E.cjs → chunk-ESKXG7Y6.cjs} +5 -5
- package/dist/chunk-I7UUPD3G.cjs +21252 -0
- package/dist/{chunk-YPPKY5XZ.js → chunk-IBZPJS4H.js} +26 -15
- package/dist/chunk-IDTRFOQW.js +35 -0
- package/dist/{chunk-XCXFGTHW.cjs → chunk-J5ZF46NZ.cjs} +14 -14
- package/dist/{chunk-NZQ47NWD.js → chunk-KRYHLYN2.js} +1 -1
- package/dist/{chunk-RXNYY5K5.js → chunk-LQHM3ADX.js} +172 -4
- package/dist/{chunk-HTERSQGF.cjs → chunk-MTS6SVNP.cjs} +4 -4
- package/dist/chunk-OTI7HY55.js +297 -0
- package/dist/{chunk-6IPPANNX.js → chunk-P7LVE2TF.js} +2 -2
- package/dist/{chunk-47P7HILD.cjs → chunk-QFPEFD67.cjs} +9 -8
- package/dist/chunk-RZQJAZKC.js +22 -0
- package/dist/{chunk-PLDVGOKZ.js → chunk-S274QFFB.js} +2 -2
- package/dist/chunk-SF4ECUZ6.cjs +56 -0
- package/dist/chunk-SQIHFEXI.cjs +25 -0
- package/dist/{chunk-NAJGGUAM.cjs → chunk-TC3VRWZV.cjs} +2 -2
- package/dist/{chunk-U7MWHXMF.cjs → chunk-TVL6RDAU.cjs} +4 -4
- package/dist/chunk-UYFTXD4P.js +168 -0
- package/dist/{chunk-AZV45DMG.js → chunk-V2XE3NCG.js} +2 -2
- package/dist/chunk-XCFZKCV2.cjs +37 -0
- package/dist/chunk-XOTCIXY6.js +5301 -0
- package/dist/chunk-XVEG53NN.cjs +322 -0
- package/dist/chunk-YDUXIENX.cjs +172 -0
- package/dist/chunk-YPAWNWFD.cjs +168 -0
- package/dist/chunk-YQFI7W3I.cjs +65 -0
- package/dist/{chunk-NTD4JLDW.cjs → chunk-YTLE5K7G.cjs} +1 -1
- package/dist/{chunk-EMH4IP2U.js → chunk-ZRONAQBV.js} +1 -1
- package/dist/class-validator.cjs +65 -0
- package/dist/class-validator.d.cts +63 -0
- package/dist/class-validator.d.ts +63 -0
- package/dist/class-validator.js +54 -0
- package/dist/cli.js +1 -1
- package/dist/courier.cjs +16 -0
- package/dist/courier.d.cts +51 -0
- package/dist/courier.d.ts +51 -0
- package/dist/courier.js +3 -0
- package/dist/fbr-invoice.cjs +25 -0
- package/dist/fbr-invoice.d.cts +170 -0
- package/dist/fbr-invoice.d.ts +170 -0
- package/dist/fbr-invoice.js +4 -0
- package/dist/geo.cjs +23 -6
- package/dist/geo.d.cts +56 -1
- package/dist/geo.d.ts +56 -1
- package/dist/geo.js +2 -1
- package/dist/holidays.cjs +4 -4
- package/dist/holidays.js +1 -1
- package/dist/iban.cjs +5 -5
- package/dist/iban.d.cts +8 -6
- package/dist/iban.d.ts +8 -6
- package/dist/iban.js +1 -1
- package/dist/incometax.cjs +27 -0
- package/dist/incometax.d.cts +91 -0
- package/dist/incometax.d.ts +91 -0
- package/dist/incometax.js +2 -0
- package/dist/index.cjs +253 -111
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +25 -15
- package/dist/input.cjs +9 -9
- package/dist/input.js +3 -3
- package/dist/joi.cjs +43 -0
- package/dist/joi.d.cts +25 -0
- package/dist/joi.d.ts +25 -0
- package/dist/joi.js +37 -0
- package/dist/networks.cjs +3 -3
- package/dist/networks.js +2 -2
- package/dist/numbers.cjs +6 -6
- package/dist/numbers.js +2 -2
- package/dist/passport.cjs +11 -0
- package/dist/passport.d.cts +27 -0
- package/dist/passport.d.ts +27 -0
- package/dist/passport.js +2 -0
- package/dist/phone.cjs +8 -8
- package/dist/phone.js +3 -3
- package/dist/postal.cjs +14 -6
- package/dist/postal.d.cts +54 -2
- package/dist/postal.d.ts +54 -2
- package/dist/postal.js +1 -1
- package/dist/quality.cjs +25 -0
- package/dist/quality.d.cts +62 -0
- package/dist/quality.d.ts +62 -0
- package/dist/quality.js +8 -0
- package/dist/raast.cjs +6 -6
- package/dist/raast.js +2 -2
- package/dist/salestax.cjs +20 -0
- package/dist/salestax.d.cts +106 -0
- package/dist/salestax.d.ts +106 -0
- package/dist/salestax.js +3 -0
- package/dist/superstruct.cjs +41 -0
- package/dist/superstruct.d.cts +25 -0
- package/dist/superstruct.d.ts +25 -0
- package/dist/superstruct.js +39 -0
- package/dist/text.cjs +21 -5
- package/dist/text.d.cts +90 -1
- package/dist/text.d.ts +90 -1
- package/dist/text.js +1 -1
- package/dist/valibot.cjs +18 -8
- package/dist/valibot.d.cts +3 -0
- package/dist/valibot.d.ts +3 -0
- package/dist/valibot.js +17 -7
- package/dist/vehicle.cjs +15 -0
- package/dist/vehicle.d.cts +43 -0
- package/dist/vehicle.d.ts +43 -0
- package/dist/vehicle.js +2 -0
- package/dist/whatsapp.cjs +3 -3
- package/dist/whatsapp.js +2 -2
- package/dist/yup.cjs +18 -8
- package/dist/yup.d.cts +3 -0
- package/dist/yup.d.ts +3 -0
- package/dist/yup.js +17 -7
- package/dist/zod.cjs +18 -8
- package/dist/zod.d.cts +3 -0
- package/dist/zod.d.ts +3 -0
- package/dist/zod.js +17 -7
- package/package.json +167 -6
- package/dist/chunk-34CJGJ67.cjs +0 -1697
- package/dist/chunk-4VVFS6FN.cjs +0 -715
- package/dist/chunk-E6DT2DWQ.js +0 -1689
- package/dist/chunk-GJENL6VK.cjs +0 -22
- package/dist/chunk-HUQY2WR5.js +0 -20
- package/dist/chunk-JKE4AMSZ.js +0 -47
- package/dist/chunk-KEHCTYLO.cjs +0 -52
- package/dist/chunk-LIYNKIKS.js +0 -709
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { CNICInfo, getCNICInfo, validateCNIC } from './cnic.js';
|
|
2
2
|
export { PhoneAnalysis, analyzePhone, formatPhone, validatePhone } from './phone.js';
|
|
3
3
|
export { NetworkName, getNetwork } from './networks.js';
|
|
4
|
-
export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './geo.js';
|
|
4
|
+
export { getDistrictProvince, getDistrictsByProvince, getDivisionOfDistrict, getDivisions, getProvince, getTehsilDistrict, getTehsils, searchCities, searchDistricts } from './geo.js';
|
|
5
5
|
export { formatLakh, formatPKR } from './format.js';
|
|
6
6
|
export { createWhatsAppLink } from './whatsapp.js';
|
|
7
7
|
export { BankInfo, BankType, getBankFromIBAN, getBankInfo, getBanks, validateIBAN } from './iban.js';
|
|
8
|
-
export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './postal.js';
|
|
8
|
+
export { PostOffice, getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes } from './postal.js';
|
|
9
9
|
export { ParsedAddress, formatAddress, parseAddress } from './address.js';
|
|
10
|
-
export { normalizeRomanUrdu, normalizeText, toEnglishDigits, toUrduDigits } from './text.js';
|
|
10
|
+
export { BidiDirection, SlugScript, SlugifyOptions, compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, slugify, toEnglishDigits, toUrduDigits, wrapBidi } from './text.js';
|
|
11
11
|
export { HijriDate, HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './hijri.js';
|
|
12
12
|
export { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage, amountInWords, numberToWords } from './words.js';
|
|
13
13
|
export { NTNInfo, NTNType, analyzeNTN, validateNTN, validateSTRN } from './tax.js';
|
|
@@ -15,11 +15,19 @@ export { NumberInfo, NumberType, analyzeNumber, getAreaCode, getNumberType, vali
|
|
|
15
15
|
export { MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastDuration, RaastP2PQrOptions, RaastQrError, RaastQrValidation, RaastQrWarning, ValidateRaastQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './raast.js';
|
|
16
16
|
export { Holiday, HolidayId, HolidayOptions, IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './holidays.js';
|
|
17
17
|
export { InputState, checkCNICInput, checkIBANInput, checkPhoneInput, formatCNICInput, formatIBANInput, formatPhoneInput } from './input.js';
|
|
18
|
+
export { validatePassport } from './passport.js';
|
|
19
|
+
export { VehiclePlate, parseVehiclePlate, validateVehiclePlate } from './vehicle.js';
|
|
20
|
+
export { ADDRESS_WEIGHTS, AddressPart, AddressScore, PhoneRiskFlag, phoneRiskSignals, scoreAddress } from './quality.js';
|
|
21
|
+
export { SalesTaxAmounts, SalesTaxKind, SalesTaxOptions, SalesTaxRate, SalesTaxRateQuery, calculateSalesTax, getSalesTaxRate, splitInclusive } from './salestax.js';
|
|
22
|
+
export { ElectricityRef, ElectricityRefType, GasCompany, parseElectricityRef, validateElectricityRef, validateGasConsumerNumber } from './bills.js';
|
|
23
|
+
export { Courier, CourierStatus, mapCourierStatus, normalizeCityForCourier } from './courier.js';
|
|
24
|
+
export { FBR_DI_SPEC_VERSION, FbrInvoice, FbrInvoiceBuild, FbrInvoiceError, FbrInvoiceInput, FbrInvoiceItem, FbrInvoiceItemInput, FbrInvoiceTotals, FbrInvoiceType, FbrInvoiceValidation, FbrInvoiceValidationOptions, FbrRegistrationType, buildFbrInvoice, expectedSalesTax, validateFbrInvoice } from './fbr-invoice.js';
|
|
25
|
+
export { SalaryTax, SalaryTaxOptions, SalaryTaxSlab, SalaryTaxYear, calculateMonthlySalaryTax, calculateSalaryTax, getSalaryTaxSlabs, getSalaryTaxYears, getTaxYear } from './incometax.js';
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* Date (YYYY-MM-DD) the bundled datasets were last checked against their
|
|
21
29
|
* sources. See DATA.md for what each dataset is based on.
|
|
22
30
|
*/
|
|
23
|
-
declare const dataVersion = "2026-11-
|
|
31
|
+
declare const dataVersion = "2026-11-18";
|
|
24
32
|
|
|
25
33
|
export { dataVersion };
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
export { createWhatsAppLink } from './chunk-
|
|
1
|
+
export { createWhatsAppLink } from './chunk-ZRONAQBV.js';
|
|
2
2
|
export { amountInWords, numberToWords } from './chunk-BR4QLZPX.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { getNetwork } from './chunk-AZV45DMG.js';
|
|
7
|
-
import './chunk-6IPPANNX.js';
|
|
8
|
-
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './chunk-NZQ47NWD.js';
|
|
3
|
+
export { analyzePhone, formatPhone, validatePhone } from './chunk-S274QFFB.js';
|
|
4
|
+
export { ADDRESS_WEIGHTS, phoneRiskSignals, scoreAddress } from './chunk-UYFTXD4P.js';
|
|
5
|
+
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './chunk-KRYHLYN2.js';
|
|
9
6
|
export { analyzeNTN, validateNTN, validateSTRN } from './chunk-CEPNSHIC.js';
|
|
10
|
-
export { normalizeRomanUrdu, normalizeText, toEnglishDigits, toUrduDigits } from './chunk-
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
7
|
+
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, slugify, toEnglishDigits, toUrduDigits, wrapBidi } from './chunk-EA3SIHYT.js';
|
|
8
|
+
export { parseVehiclePlate, validateVehiclePlate } from './chunk-RZQJAZKC.js';
|
|
9
|
+
export { getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './chunk-CADQM4ZN.js';
|
|
10
|
+
export { formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './chunk-Z5JEIQVW.js';
|
|
11
|
+
export { calculateMonthlySalaryTax, calculateSalaryTax, getSalaryTaxSlabs, getSalaryTaxYears, getTaxYear } from './chunk-5RGX4DWF.js';
|
|
12
|
+
export { checkCNICInput, checkIBANInput, checkPhoneInput, formatCNICInput, formatIBANInput, formatPhoneInput } from './chunk-7DY26QPN.js';
|
|
13
|
+
export { getBankFromIBAN, getBankInfo, getBanks, validateIBAN } from './chunk-IBZPJS4H.js';
|
|
14
|
+
export { getNetwork } from './chunk-V2XE3NCG.js';
|
|
15
|
+
export { analyzeNumber, getAreaCode, getNumberType, validateLandline } from './chunk-LQHM3ADX.js';
|
|
16
|
+
import './chunk-P7LVE2TF.js';
|
|
17
|
+
export { validatePassport } from './chunk-E6HSKRAE.js';
|
|
18
|
+
export { formatAddress, parseAddress } from './chunk-B7DOQ5QF.js';
|
|
19
|
+
export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes } from './chunk-33QMFE2Z.js';
|
|
20
|
+
export { parseElectricityRef, validateElectricityRef, validateGasConsumerNumber } from './chunk-CZOZB4K3.js';
|
|
13
21
|
export { getCNICInfo, validateCNIC } from './chunk-EEVNLTB4.js';
|
|
22
|
+
export { mapCourierStatus, normalizeCityForCourier } from './chunk-4GSBHJX6.js';
|
|
23
|
+
export { FBR_DI_SPEC_VERSION, buildFbrInvoice, expectedSalesTax, validateFbrInvoice } from './chunk-OTI7HY55.js';
|
|
24
|
+
export { calculateSalesTax, getSalesTaxRate, splitInclusive } from './chunk-34U2ZMHR.js';
|
|
25
|
+
import './chunk-5EY5DQS7.js';
|
|
14
26
|
export { formatLakh, formatPKR } from './chunk-6TSKA2PH.js';
|
|
15
|
-
export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './chunk-
|
|
16
|
-
|
|
17
|
-
export { formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './chunk-Z5JEIQVW.js';
|
|
18
|
-
export { getBankFromIBAN, getBankInfo, getBanks, validateIBAN } from './chunk-YPPKY5XZ.js';
|
|
27
|
+
export { getDistrictProvince, getDistrictsByProvince, getDivisionOfDistrict, getDivisions, getProvince, getTehsilDistrict, getTehsils, searchCities, searchDistricts } from './chunk-XOTCIXY6.js';
|
|
28
|
+
import './chunk-E2XU6NOW.js';
|
|
19
29
|
import './chunk-ENQ7O7VW.js';
|
|
20
30
|
|
|
21
31
|
// src/data-version.ts
|
|
22
|
-
var dataVersion = "2026-11-
|
|
32
|
+
var dataVersion = "2026-11-18";
|
|
23
33
|
|
|
24
34
|
export { dataVersion };
|
package/dist/input.cjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkTVL6RDAU_cjs = require('./chunk-TVL6RDAU.cjs');
|
|
4
|
+
require('./chunk-DHOP7LQX.cjs');
|
|
5
|
+
require('./chunk-YTLE5K7G.cjs');
|
|
5
6
|
require('./chunk-HTCSHHOR.cjs');
|
|
6
|
-
require('./chunk-3IARSCO6.cjs');
|
|
7
7
|
require('./chunk-VPBMIYO2.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "checkCNICInput", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkTVL6RDAU_cjs.checkCNICInput; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "checkIBANInput", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkTVL6RDAU_cjs.checkIBANInput; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "checkPhoneInput", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkTVL6RDAU_cjs.checkPhoneInput; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "formatCNICInput", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkTVL6RDAU_cjs.formatCNICInput; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "formatIBANInput", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkTVL6RDAU_cjs.formatIBANInput; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "formatPhoneInput", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkTVL6RDAU_cjs.formatPhoneInput; }
|
|
34
34
|
});
|
package/dist/input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { checkCNICInput, checkIBANInput, checkPhoneInput, formatCNICInput, formatIBANInput, formatPhoneInput } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { checkCNICInput, checkIBANInput, checkPhoneInput, formatCNICInput, formatIBANInput, formatPhoneInput } from './chunk-7DY26QPN.js';
|
|
2
|
+
import './chunk-IBZPJS4H.js';
|
|
3
|
+
import './chunk-P7LVE2TF.js';
|
|
3
4
|
import './chunk-EEVNLTB4.js';
|
|
4
|
-
import './chunk-YPPKY5XZ.js';
|
|
5
5
|
import './chunk-ENQ7O7VW.js';
|
package/dist/joi.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXCFZKCV2_cjs = require('./chunk-XCFZKCV2.cjs');
|
|
4
|
+
require('./chunk-ESKXG7Y6.cjs');
|
|
5
|
+
require('./chunk-YDUXIENX.cjs');
|
|
6
|
+
require('./chunk-H6M6L26S.cjs');
|
|
7
|
+
require('./chunk-SQIHFEXI.cjs');
|
|
8
|
+
require('./chunk-DHOP7LQX.cjs');
|
|
9
|
+
require('./chunk-MTS6SVNP.cjs');
|
|
10
|
+
require('./chunk-AUQFA7EE.cjs');
|
|
11
|
+
require('./chunk-YTLE5K7G.cjs');
|
|
12
|
+
require('./chunk-7E7L3NYS.cjs');
|
|
13
|
+
require('./chunk-QFPEFD67.cjs');
|
|
14
|
+
require('./chunk-I7UUPD3G.cjs');
|
|
15
|
+
require('./chunk-HTCSHHOR.cjs');
|
|
16
|
+
require('./chunk-33GOK7EE.cjs');
|
|
17
|
+
require('./chunk-E6GWBOKV.cjs');
|
|
18
|
+
require('./chunk-VPBMIYO2.cjs');
|
|
19
|
+
var Joi = require('joi');
|
|
20
|
+
|
|
21
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
|
|
23
|
+
var Joi__default = /*#__PURE__*/_interopDefault(Joi);
|
|
24
|
+
|
|
25
|
+
function schema(name) {
|
|
26
|
+
const rule = chunkXCFZKCV2_cjs.RULES[name];
|
|
27
|
+
return (options = {}) => Joi__default.default.string().custom(
|
|
28
|
+
(value, helpers) => rule.test(value) ? value : helpers.message({ custom: options.message ?? rule.message })
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
var pk = {
|
|
32
|
+
cnic: schema("cnic"),
|
|
33
|
+
phone: schema("phone"),
|
|
34
|
+
iban: schema("iban"),
|
|
35
|
+
ntn: schema("ntn"),
|
|
36
|
+
strn: schema("strn"),
|
|
37
|
+
landline: schema("landline"),
|
|
38
|
+
passport: schema("passport"),
|
|
39
|
+
vehiclePlate: schema("vehiclePlate"),
|
|
40
|
+
codPhone: schema("codPhone")
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.pk = pk;
|
package/dist/joi.d.cts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { A as AdapterOptions } from './rules-GxgPiVws.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Joi schemas for Pakistani identifiers.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import Joi from 'joi';
|
|
9
|
+
* import { pk } from 'pakdatakit/joi';
|
|
10
|
+
*
|
|
11
|
+
* const form = Joi.object({ cnic: pk.cnic().required(), phone: pk.phone() });
|
|
12
|
+
*/
|
|
13
|
+
declare const pk: {
|
|
14
|
+
cnic: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
15
|
+
phone: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
16
|
+
iban: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
17
|
+
ntn: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
18
|
+
strn: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
19
|
+
landline: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
20
|
+
passport: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
21
|
+
vehiclePlate: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
22
|
+
codPhone: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { AdapterOptions, pk };
|
package/dist/joi.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { A as AdapterOptions } from './rules-GxgPiVws.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Joi schemas for Pakistani identifiers.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import Joi from 'joi';
|
|
9
|
+
* import { pk } from 'pakdatakit/joi';
|
|
10
|
+
*
|
|
11
|
+
* const form = Joi.object({ cnic: pk.cnic().required(), phone: pk.phone() });
|
|
12
|
+
*/
|
|
13
|
+
declare const pk: {
|
|
14
|
+
cnic: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
15
|
+
phone: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
16
|
+
iban: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
17
|
+
ntn: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
18
|
+
strn: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
19
|
+
landline: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
20
|
+
passport: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
21
|
+
vehiclePlate: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
22
|
+
codPhone: (options?: AdapterOptions) => Joi.StringSchema<string>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { AdapterOptions, pk };
|
package/dist/joi.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RULES } from './chunk-IDTRFOQW.js';
|
|
2
|
+
import './chunk-S274QFFB.js';
|
|
3
|
+
import './chunk-UYFTXD4P.js';
|
|
4
|
+
import './chunk-CEPNSHIC.js';
|
|
5
|
+
import './chunk-RZQJAZKC.js';
|
|
6
|
+
import './chunk-IBZPJS4H.js';
|
|
7
|
+
import './chunk-V2XE3NCG.js';
|
|
8
|
+
import './chunk-LQHM3ADX.js';
|
|
9
|
+
import './chunk-P7LVE2TF.js';
|
|
10
|
+
import './chunk-E6HSKRAE.js';
|
|
11
|
+
import './chunk-B7DOQ5QF.js';
|
|
12
|
+
import './chunk-33QMFE2Z.js';
|
|
13
|
+
import './chunk-EEVNLTB4.js';
|
|
14
|
+
import './chunk-XOTCIXY6.js';
|
|
15
|
+
import './chunk-E2XU6NOW.js';
|
|
16
|
+
import './chunk-ENQ7O7VW.js';
|
|
17
|
+
import Joi from 'joi';
|
|
18
|
+
|
|
19
|
+
function schema(name) {
|
|
20
|
+
const rule = RULES[name];
|
|
21
|
+
return (options = {}) => Joi.string().custom(
|
|
22
|
+
(value, helpers) => rule.test(value) ? value : helpers.message({ custom: options.message ?? rule.message })
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
var pk = {
|
|
26
|
+
cnic: schema("cnic"),
|
|
27
|
+
phone: schema("phone"),
|
|
28
|
+
iban: schema("iban"),
|
|
29
|
+
ntn: schema("ntn"),
|
|
30
|
+
strn: schema("strn"),
|
|
31
|
+
landline: schema("landline"),
|
|
32
|
+
passport: schema("passport"),
|
|
33
|
+
vehiclePlate: schema("vehiclePlate"),
|
|
34
|
+
codPhone: schema("codPhone")
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { pk };
|
package/dist/networks.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkMTS6SVNP_cjs = require('./chunk-MTS6SVNP.cjs');
|
|
4
|
+
require('./chunk-YTLE5K7G.cjs');
|
|
5
5
|
require('./chunk-VPBMIYO2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "getNetwork", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkMTS6SVNP_cjs.getNetwork; }
|
|
12
12
|
});
|
package/dist/networks.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getNetwork } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { getNetwork } from './chunk-V2XE3NCG.js';
|
|
2
|
+
import './chunk-P7LVE2TF.js';
|
|
3
3
|
import './chunk-ENQ7O7VW.js';
|
package/dist/numbers.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkAUQFA7EE_cjs = require('./chunk-AUQFA7EE.cjs');
|
|
4
|
+
require('./chunk-YTLE5K7G.cjs');
|
|
5
5
|
require('./chunk-VPBMIYO2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "analyzeNumber", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkAUQFA7EE_cjs.analyzeNumber; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "getAreaCode", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkAUQFA7EE_cjs.getAreaCode; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "getNumberType", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkAUQFA7EE_cjs.getNumberType; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "validateLandline", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkAUQFA7EE_cjs.validateLandline; }
|
|
24
24
|
});
|
package/dist/numbers.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { analyzeNumber, getAreaCode, getNumberType, validateLandline } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { analyzeNumber, getAreaCode, getNumberType, validateLandline } from './chunk-LQHM3ADX.js';
|
|
2
|
+
import './chunk-P7LVE2TF.js';
|
|
3
3
|
import './chunk-ENQ7O7VW.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk7E7L3NYS_cjs = require('./chunk-7E7L3NYS.cjs');
|
|
4
|
+
require('./chunk-VPBMIYO2.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "validatePassport", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk7E7L3NYS_cjs.validatePassport; }
|
|
11
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates the format of a Pakistani passport number: two letters followed by
|
|
3
|
+
* seven digits, e.g. `AB1234567`. Case, surrounding spaces and spaces or
|
|
4
|
+
* dashes between the letters and digits are ignored.
|
|
5
|
+
*
|
|
6
|
+
* DGIP does not publish the format, so this checks the common shape only. Two
|
|
7
|
+
* letters and seven digits is the number format given for the 2013 ordinary
|
|
8
|
+
* passport in the EU's PRADO register
|
|
9
|
+
* (https://www.consilium.europa.eu/prado/en/PAK-AO-02003/index.html) and fits
|
|
10
|
+
* the 9-character document-number field of ICAO Doc 9303
|
|
11
|
+
* (https://www.icao.int/publications/Documents/9303_p4_cons_en.pdf). No source
|
|
12
|
+
* was found for later models (2017, 2022 e-passport) or for diplomatic and
|
|
13
|
+
* official passports, which may differ, so treat `false` as "unusual", not
|
|
14
|
+
* "fake". The letters' meaning is not documented and is not checked; the MRZ
|
|
15
|
+
* check digit is not part of the number.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* validatePassport('AB1234567'); // true
|
|
19
|
+
* validatePassport('ab 1234567'); // true
|
|
20
|
+
* validatePassport('A12345678'); // false
|
|
21
|
+
*
|
|
22
|
+
* @param passport - Passport number to validate
|
|
23
|
+
* @returns `true` if the format is valid
|
|
24
|
+
*/
|
|
25
|
+
declare function validatePassport(passport: string): boolean;
|
|
26
|
+
|
|
27
|
+
export { validatePassport };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates the format of a Pakistani passport number: two letters followed by
|
|
3
|
+
* seven digits, e.g. `AB1234567`. Case, surrounding spaces and spaces or
|
|
4
|
+
* dashes between the letters and digits are ignored.
|
|
5
|
+
*
|
|
6
|
+
* DGIP does not publish the format, so this checks the common shape only. Two
|
|
7
|
+
* letters and seven digits is the number format given for the 2013 ordinary
|
|
8
|
+
* passport in the EU's PRADO register
|
|
9
|
+
* (https://www.consilium.europa.eu/prado/en/PAK-AO-02003/index.html) and fits
|
|
10
|
+
* the 9-character document-number field of ICAO Doc 9303
|
|
11
|
+
* (https://www.icao.int/publications/Documents/9303_p4_cons_en.pdf). No source
|
|
12
|
+
* was found for later models (2017, 2022 e-passport) or for diplomatic and
|
|
13
|
+
* official passports, which may differ, so treat `false` as "unusual", not
|
|
14
|
+
* "fake". The letters' meaning is not documented and is not checked; the MRZ
|
|
15
|
+
* check digit is not part of the number.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* validatePassport('AB1234567'); // true
|
|
19
|
+
* validatePassport('ab 1234567'); // true
|
|
20
|
+
* validatePassport('A12345678'); // false
|
|
21
|
+
*
|
|
22
|
+
* @param passport - Passport number to validate
|
|
23
|
+
* @returns `true` if the format is valid
|
|
24
|
+
*/
|
|
25
|
+
declare function validatePassport(passport: string): boolean;
|
|
26
|
+
|
|
27
|
+
export { validatePassport };
|
package/dist/passport.js
ADDED
package/dist/phone.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
var
|
|
3
|
+
var chunkESKXG7Y6_cjs = require('./chunk-ESKXG7Y6.cjs');
|
|
4
|
+
require('./chunk-MTS6SVNP.cjs');
|
|
5
|
+
var chunkYTLE5K7G_cjs = require('./chunk-YTLE5K7G.cjs');
|
|
6
6
|
require('./chunk-VPBMIYO2.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "analyzePhone", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkESKXG7Y6_cjs.analyzePhone; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "formatPhone", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkESKXG7Y6_cjs.formatPhone; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "validatePhone", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkESKXG7Y6_cjs.validatePhone; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "getPhonePrefix", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkYTLE5K7G_cjs.getPhonePrefix; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "normalizePhoneDigits", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkYTLE5K7G_cjs.normalizePhoneDigits; }
|
|
29
29
|
});
|
package/dist/phone.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { analyzePhone, formatPhone, validatePhone } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
export { getPhonePrefix, normalizePhoneDigits } from './chunk-
|
|
1
|
+
export { analyzePhone, formatPhone, validatePhone } from './chunk-S274QFFB.js';
|
|
2
|
+
import './chunk-V2XE3NCG.js';
|
|
3
|
+
export { getPhonePrefix, normalizePhoneDigits } from './chunk-P7LVE2TF.js';
|
|
4
4
|
import './chunk-ENQ7O7VW.js';
|
package/dist/postal.cjs
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkI7UUPD3G_cjs = require('./chunk-I7UUPD3G.cjs');
|
|
4
4
|
require('./chunk-VPBMIYO2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "getCityByPostalCode", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkI7UUPD3G_cjs.getCityByPostalCode; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getPostOffice", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkI7UUPD3G_cjs.getPostOffice; }
|
|
11
15
|
});
|
|
12
16
|
Object.defineProperty(exports, "getPostalAreas", {
|
|
13
17
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkI7UUPD3G_cjs.getPostalAreas; }
|
|
15
19
|
});
|
|
16
20
|
Object.defineProperty(exports, "getPostalCode", {
|
|
17
21
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkI7UUPD3G_cjs.getPostalCode; }
|
|
19
23
|
});
|
|
20
24
|
Object.defineProperty(exports, "getPostalCodes", {
|
|
21
25
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkI7UUPD3G_cjs.getPostalCodes; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "searchPostOffices", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkI7UUPD3G_cjs.searchPostOffices; }
|
|
23
31
|
});
|
|
24
32
|
Object.defineProperty(exports, "searchPostalCodes", {
|
|
25
33
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkI7UUPD3G_cjs.searchPostalCodes; }
|
|
27
35
|
});
|
package/dist/postal.d.cts
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
|
+
/** A delivery post office from Pakistan Post's post code directory. */
|
|
2
|
+
interface PostOffice {
|
|
3
|
+
/** 5-digit post code, e.g. `48330`. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** Office name as the directory gives it, in title case, e.g. `Dulmial`. */
|
|
6
|
+
office: string;
|
|
7
|
+
/**
|
|
8
|
+
* The city the office belongs to when that is known (`Lahore` for an office
|
|
9
|
+
* in Lahore); otherwise the office's own name, which for most offices is
|
|
10
|
+
* its town or village.
|
|
11
|
+
*/
|
|
12
|
+
town: string;
|
|
13
|
+
/**
|
|
14
|
+
* The district, when the town is the headquarters a district is named
|
|
15
|
+
* after; otherwise `null`. The directory has no district column.
|
|
16
|
+
*/
|
|
17
|
+
district: string | null;
|
|
18
|
+
/** Province or territory. */
|
|
19
|
+
province: string;
|
|
20
|
+
}
|
|
1
21
|
/**
|
|
2
|
-
* Returns the
|
|
22
|
+
* Returns the delivery post office for a post code, from Pakistan Post's
|
|
23
|
+
* directory of about 2,560 offices.
|
|
24
|
+
*
|
|
25
|
+
* Unlike `getCityByPostalCode`, which only answers for codes in the cities
|
|
26
|
+
* pakdatakit lists, this knows every delivery office, including those in
|
|
27
|
+
* towns and villages.
|
|
28
|
+
*
|
|
29
|
+
* @param code - Post code (whitespace is ignored)
|
|
30
|
+
* @returns The post office, or `null` if the code is not in the directory
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* getPostOffice('48330');
|
|
34
|
+
* // { code: '48330', office: 'Dulmial', town: 'Dulmial', district: null, province: 'Punjab' }
|
|
35
|
+
*/
|
|
36
|
+
declare function getPostOffice(code: string): PostOffice | null;
|
|
37
|
+
/**
|
|
38
|
+
* Searches Pakistan Post's directory by office name, town or post code.
|
|
39
|
+
*
|
|
40
|
+
* Matching is case-insensitive: an office matches when its name or town
|
|
41
|
+
* contains the query, or its code starts with it.
|
|
42
|
+
*
|
|
43
|
+
* @param query - Partial office name, town or post code
|
|
44
|
+
* @returns Matching post offices, sorted by post code
|
|
45
|
+
*/
|
|
46
|
+
declare function searchPostOffices(query: string): PostOffice[];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the city for a Pakistani postal code.
|
|
50
|
+
*
|
|
51
|
+
* Only codes of post offices in a city on pakdatakit's city list return a
|
|
52
|
+
* city (`54660` → `Lahore`). The code of a post office in a town or village
|
|
53
|
+
* that is not on the list returns `null`; use `getPostOffice` for those.
|
|
3
54
|
*
|
|
4
55
|
* @param postalCode - Postal code to look up (whitespace is ignored)
|
|
5
56
|
* @returns City name or `null` if not found
|
|
@@ -37,4 +88,5 @@ declare function searchPostalCodes(query: string): string[];
|
|
|
37
88
|
*/
|
|
38
89
|
declare function getPostalAreas(city: string): string[];
|
|
39
90
|
|
|
40
|
-
export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes };
|
|
91
|
+
export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes };
|
|
92
|
+
export type { PostOffice };
|
package/dist/postal.d.ts
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
|
+
/** A delivery post office from Pakistan Post's post code directory. */
|
|
2
|
+
interface PostOffice {
|
|
3
|
+
/** 5-digit post code, e.g. `48330`. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** Office name as the directory gives it, in title case, e.g. `Dulmial`. */
|
|
6
|
+
office: string;
|
|
7
|
+
/**
|
|
8
|
+
* The city the office belongs to when that is known (`Lahore` for an office
|
|
9
|
+
* in Lahore); otherwise the office's own name, which for most offices is
|
|
10
|
+
* its town or village.
|
|
11
|
+
*/
|
|
12
|
+
town: string;
|
|
13
|
+
/**
|
|
14
|
+
* The district, when the town is the headquarters a district is named
|
|
15
|
+
* after; otherwise `null`. The directory has no district column.
|
|
16
|
+
*/
|
|
17
|
+
district: string | null;
|
|
18
|
+
/** Province or territory. */
|
|
19
|
+
province: string;
|
|
20
|
+
}
|
|
1
21
|
/**
|
|
2
|
-
* Returns the
|
|
22
|
+
* Returns the delivery post office for a post code, from Pakistan Post's
|
|
23
|
+
* directory of about 2,560 offices.
|
|
24
|
+
*
|
|
25
|
+
* Unlike `getCityByPostalCode`, which only answers for codes in the cities
|
|
26
|
+
* pakdatakit lists, this knows every delivery office, including those in
|
|
27
|
+
* towns and villages.
|
|
28
|
+
*
|
|
29
|
+
* @param code - Post code (whitespace is ignored)
|
|
30
|
+
* @returns The post office, or `null` if the code is not in the directory
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* getPostOffice('48330');
|
|
34
|
+
* // { code: '48330', office: 'Dulmial', town: 'Dulmial', district: null, province: 'Punjab' }
|
|
35
|
+
*/
|
|
36
|
+
declare function getPostOffice(code: string): PostOffice | null;
|
|
37
|
+
/**
|
|
38
|
+
* Searches Pakistan Post's directory by office name, town or post code.
|
|
39
|
+
*
|
|
40
|
+
* Matching is case-insensitive: an office matches when its name or town
|
|
41
|
+
* contains the query, or its code starts with it.
|
|
42
|
+
*
|
|
43
|
+
* @param query - Partial office name, town or post code
|
|
44
|
+
* @returns Matching post offices, sorted by post code
|
|
45
|
+
*/
|
|
46
|
+
declare function searchPostOffices(query: string): PostOffice[];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the city for a Pakistani postal code.
|
|
50
|
+
*
|
|
51
|
+
* Only codes of post offices in a city on pakdatakit's city list return a
|
|
52
|
+
* city (`54660` → `Lahore`). The code of a post office in a town or village
|
|
53
|
+
* that is not on the list returns `null`; use `getPostOffice` for those.
|
|
3
54
|
*
|
|
4
55
|
* @param postalCode - Postal code to look up (whitespace is ignored)
|
|
5
56
|
* @returns City name or `null` if not found
|
|
@@ -37,4 +88,5 @@ declare function searchPostalCodes(query: string): string[];
|
|
|
37
88
|
*/
|
|
38
89
|
declare function getPostalAreas(city: string): string[];
|
|
39
90
|
|
|
40
|
-
export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes };
|
|
91
|
+
export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes };
|
|
92
|
+
export type { PostOffice };
|
package/dist/postal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './chunk-
|
|
1
|
+
export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes } from './chunk-33QMFE2Z.js';
|
|
2
2
|
import './chunk-ENQ7O7VW.js';
|