pakdatakit 1.0.2 → 2.1.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.
Files changed (125) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +907 -597
  3. package/dist/address.cjs +17 -0
  4. package/dist/address.d.cts +36 -0
  5. package/dist/address.d.ts +36 -0
  6. package/dist/address.js +4 -0
  7. package/dist/chunk-3COX5FSL.cjs +1650 -0
  8. package/dist/chunk-422X6FEZ.cjs +220 -0
  9. package/dist/chunk-432ZYMYV.js +31 -0
  10. package/dist/chunk-4VVFS6FN.cjs +715 -0
  11. package/dist/chunk-6TSKA2PH.js +38 -0
  12. package/dist/chunk-APXP7OK7.cjs +226 -0
  13. package/dist/chunk-AUATLZA5.cjs +168 -0
  14. package/dist/chunk-BSS4Z7NI.cjs +422 -0
  15. package/dist/chunk-CEPNSHIC.js +33 -0
  16. package/dist/chunk-CQKK3S7A.js +217 -0
  17. package/dist/chunk-CYJJ7KGC.cjs +108 -0
  18. package/dist/chunk-EEVNLTB4.js +32 -0
  19. package/dist/chunk-ENQ7O7VW.js +32 -0
  20. package/dist/chunk-H4DVWUYH.js +231 -0
  21. package/dist/chunk-H6M6L26S.cjs +37 -0
  22. package/dist/chunk-HBOZIITD.js +351 -0
  23. package/dist/chunk-HTCSHHOR.cjs +35 -0
  24. package/dist/chunk-JKE4AMSZ.js +47 -0
  25. package/dist/chunk-K6CZFCX6.js +1642 -0
  26. package/dist/chunk-KEHCTYLO.cjs +52 -0
  27. package/dist/chunk-KQKW2ZEK.cjs +18 -0
  28. package/dist/chunk-L2BDDM2W.js +165 -0
  29. package/dist/chunk-L45UXUWX.js +21 -0
  30. package/dist/chunk-LIYNKIKS.js +709 -0
  31. package/dist/chunk-LVHTH4P7.cjs +41 -0
  32. package/dist/chunk-OVUR47QH.cjs +22 -0
  33. package/dist/chunk-P4CGOJEM.js +16 -0
  34. package/dist/chunk-PHHKIMO2.cjs +35 -0
  35. package/dist/chunk-QQQKISXT.js +223 -0
  36. package/dist/chunk-T3E4B5MJ.js +417 -0
  37. package/dist/chunk-VPBMIYO2.cjs +38 -0
  38. package/dist/chunk-WPKV5JT3.cjs +235 -0
  39. package/dist/chunk-XCXFGTHW.cjs +355 -0
  40. package/dist/chunk-XT4ZNXRC.js +20 -0
  41. package/dist/chunk-Y6BUGLXU.js +95 -0
  42. package/dist/chunk-YLWZGSFY.cjs +99 -0
  43. package/dist/chunk-YS7MOLK2.cjs +23 -0
  44. package/dist/chunk-Z5JEIQVW.js +102 -0
  45. package/dist/cli.js +129 -0
  46. package/dist/cnic.cjs +15 -0
  47. package/dist/cnic.d.cts +35 -0
  48. package/dist/cnic.d.ts +35 -0
  49. package/dist/cnic.js +2 -0
  50. package/dist/format.cjs +14 -0
  51. package/dist/format.d.cts +27 -0
  52. package/dist/format.d.ts +27 -0
  53. package/dist/format.js +1 -0
  54. package/dist/geo.cjs +27 -0
  55. package/dist/geo.d.cts +43 -0
  56. package/dist/geo.d.ts +43 -0
  57. package/dist/geo.js +2 -0
  58. package/dist/hijri.cjs +26 -0
  59. package/dist/hijri.d.cts +62 -0
  60. package/dist/hijri.d.ts +62 -0
  61. package/dist/hijri.js +1 -0
  62. package/dist/holidays.cjs +19 -0
  63. package/dist/holidays.d.cts +72 -0
  64. package/dist/holidays.d.ts +72 -0
  65. package/dist/holidays.js +2 -0
  66. package/dist/iban.cjs +15 -0
  67. package/dist/iban.d.cts +21 -0
  68. package/dist/iban.d.ts +21 -0
  69. package/dist/iban.js +2 -0
  70. package/dist/index.cjs +211 -0
  71. package/dist/index.d.cts +16 -0
  72. package/dist/index.d.ts +16 -190
  73. package/dist/index.js +18 -2465
  74. package/dist/networks.cjs +12 -0
  75. package/dist/networks.d.cts +20 -0
  76. package/dist/networks.d.ts +20 -0
  77. package/dist/networks.js +3 -0
  78. package/dist/numbers.cjs +24 -0
  79. package/dist/numbers.d.cts +53 -0
  80. package/dist/numbers.d.ts +53 -0
  81. package/dist/numbers.js +3 -0
  82. package/dist/phone.cjs +29 -0
  83. package/dist/phone.d.cts +56 -0
  84. package/dist/phone.d.ts +56 -0
  85. package/dist/phone.js +4 -0
  86. package/dist/postal.cjs +27 -0
  87. package/dist/postal.d.cts +40 -0
  88. package/dist/postal.d.ts +40 -0
  89. package/dist/postal.js +2 -0
  90. package/dist/raast.cjs +20 -0
  91. package/dist/raast.d.cts +119 -0
  92. package/dist/raast.d.ts +119 -0
  93. package/dist/raast.js +3 -0
  94. package/dist/rules-GxgPiVws.d.cts +7 -0
  95. package/dist/rules-GxgPiVws.d.ts +7 -0
  96. package/dist/tax.cjs +20 -0
  97. package/dist/tax.d.cts +47 -0
  98. package/dist/tax.d.ts +47 -0
  99. package/dist/tax.js +3 -0
  100. package/dist/text.cjs +23 -0
  101. package/dist/text.d.cts +34 -0
  102. package/dist/text.d.ts +34 -0
  103. package/dist/text.js +2 -0
  104. package/dist/valibot.cjs +47 -0
  105. package/dist/valibot.d.cts +22 -0
  106. package/dist/valibot.d.ts +22 -0
  107. package/dist/valibot.js +25 -0
  108. package/dist/whatsapp.cjs +12 -0
  109. package/dist/whatsapp.d.cts +12 -0
  110. package/dist/whatsapp.d.ts +12 -0
  111. package/dist/whatsapp.js +3 -0
  112. package/dist/words.cjs +14 -0
  113. package/dist/words.d.cts +49 -0
  114. package/dist/words.d.ts +49 -0
  115. package/dist/words.js +1 -0
  116. package/dist/yup.cjs +32 -0
  117. package/dist/yup.d.cts +22 -0
  118. package/dist/yup.d.ts +22 -0
  119. package/dist/yup.js +30 -0
  120. package/dist/zod.cjs +27 -0
  121. package/dist/zod.d.cts +22 -0
  122. package/dist/zod.d.ts +22 -0
  123. package/dist/zod.js +25 -0
  124. package/package.json +309 -69
  125. package/dist/index.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ /** Islamic public holidays, whose dates depend on moon sighting. */
2
+ type IslamicHolidayId = 'eid-ul-fitr' | 'eid-ul-adha' | 'ashura' | 'eid-milad-un-nabi';
3
+ /** Identifier of a Pakistani federal public holiday. */
4
+ type HolidayId = IslamicHolidayId | 'kashmir-day' | 'pakistan-day' | 'labour-day' | 'youm-e-takbeer' | 'independence-day' | 'iqbal-day' | 'quaid-e-azam-day' | 'day-after-christmas';
5
+ /** A public holiday on a specific date. */
6
+ interface Holiday {
7
+ id: HolidayId;
8
+ name: string;
9
+ /** Date as `YYYY-MM-DD`. */
10
+ date: string;
11
+ type: 'national' | 'religious';
12
+ /**
13
+ * `true` when an Islamic holiday's date is calculated from the tabular Hijri
14
+ * calendar because the observed dates are not in the dataset yet. The real
15
+ * date depends on the moon-sighting announcement.
16
+ */
17
+ estimated: boolean;
18
+ /** `true` for holidays that apply to Christian employees only. */
19
+ christiansOnly?: boolean;
20
+ /** Source of an observed Islamic holiday date. */
21
+ source?: string;
22
+ }
23
+ /** Options for {@link getPakistanHolidays}. */
24
+ interface HolidayOptions {
25
+ /** Include 26 December, a holiday for Christian employees only. Defaults to `false`. */
26
+ includeChristianHolidays?: boolean;
27
+ /**
28
+ * Observed or announced dates (`YYYY-MM-DD`) for Islamic holidays, used
29
+ * instead of the dataset or estimate. Use this to apply a new moon-sighting
30
+ * announcement before the library is updated.
31
+ */
32
+ announced?: Partial<Record<IslamicHolidayId, string[]>>;
33
+ /** Day offset applied to estimated Islamic dates. Defaults to `0`. */
34
+ hijriOffset?: number;
35
+ }
36
+ /**
37
+ * Lists Pakistan's federal public holidays for a year, sorted by date.
38
+ *
39
+ * Islamic holidays use the dates actually observed after moon sighting
40
+ * (2020 onwards, from Cabinet Division and SBP notifications). For years not
41
+ * yet in the dataset they are estimated from the tabular Hijri calendar and
42
+ * marked `estimated: true`; pass `announced` to use official dates instead.
43
+ *
44
+ * Optional holidays (e.g. Shab-e-Barat, Easter, Youm-e-Ali) are not included.
45
+ *
46
+ * @example
47
+ * getPakistanHolidays(2025).find((h) => h.id === 'eid-ul-fitr');
48
+ * // { id: 'eid-ul-fitr', name: 'Eid ul Fitr', date: '2025-03-31', type: 'religious', estimated: false, ... }
49
+ *
50
+ * @param year - Gregorian year
51
+ * @param options - Christian holidays, announced dates and estimate offset
52
+ * @returns Holidays in date order
53
+ */
54
+ declare function getPakistanHolidays(year: number, options?: HolidayOptions): Holiday[];
55
+ /**
56
+ * Returns the public holidays that fall on a date.
57
+ *
58
+ * @param date - A `Date` (local calendar date) or `YYYY-MM-DD` string
59
+ * @param options - Same options as {@link getPakistanHolidays}
60
+ * @returns Holidays on that date; empty if it is not a public holiday
61
+ */
62
+ declare function getHolidaysOn(date: Date | string, options?: HolidayOptions): Holiday[];
63
+ /**
64
+ * Returns whether a date is a Pakistani federal public holiday.
65
+ *
66
+ * @param date - A `Date` (local calendar date) or `YYYY-MM-DD` string
67
+ * @param options - Same options as {@link getPakistanHolidays}
68
+ * @returns `true` on a public holiday
69
+ */
70
+ declare function isPakistanHoliday(date: Date | string, options?: HolidayOptions): boolean;
71
+
72
+ export { type Holiday, type HolidayId, type HolidayOptions, type IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday };
@@ -0,0 +1,2 @@
1
+ export { getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './chunk-HBOZIITD.js';
2
+ import './chunk-Z5JEIQVW.js';
package/dist/iban.cjs ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var chunk422X6FEZ_cjs = require('./chunk-422X6FEZ.cjs');
4
+ require('./chunk-VPBMIYO2.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "getBankFromIBAN", {
9
+ enumerable: true,
10
+ get: function () { return chunk422X6FEZ_cjs.getBankFromIBAN; }
11
+ });
12
+ Object.defineProperty(exports, "validateIBAN", {
13
+ enumerable: true,
14
+ get: function () { return chunk422X6FEZ_cjs.validateIBAN; }
15
+ });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
3
+ *
4
+ * Accepts spaced or unspaced input. Only `PK` IBANs of exactly 24 characters
5
+ * are supported.
6
+ *
7
+ * @param iban - IBAN string to validate
8
+ * @returns `true` if valid, otherwise `false`
9
+ */
10
+ declare function validateIBAN(iban: string): boolean;
11
+ /**
12
+ * Returns the bank name for a valid Pakistani IBAN based on its 4-letter bank code.
13
+ *
14
+ * Returns `null` when the IBAN is invalid or the bank code is not in the dataset.
15
+ *
16
+ * @param iban - IBAN string to look up
17
+ * @returns Bank name or `null` if not found
18
+ */
19
+ declare function getBankFromIBAN(iban: string): string | null;
20
+
21
+ export { getBankFromIBAN, validateIBAN };
package/dist/iban.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
3
+ *
4
+ * Accepts spaced or unspaced input. Only `PK` IBANs of exactly 24 characters
5
+ * are supported.
6
+ *
7
+ * @param iban - IBAN string to validate
8
+ * @returns `true` if valid, otherwise `false`
9
+ */
10
+ declare function validateIBAN(iban: string): boolean;
11
+ /**
12
+ * Returns the bank name for a valid Pakistani IBAN based on its 4-letter bank code.
13
+ *
14
+ * Returns `null` when the IBAN is invalid or the bank code is not in the dataset.
15
+ *
16
+ * @param iban - IBAN string to look up
17
+ * @returns Bank name or `null` if not found
18
+ */
19
+ declare function getBankFromIBAN(iban: string): string | null;
20
+
21
+ export { getBankFromIBAN, validateIBAN };
package/dist/iban.js ADDED
@@ -0,0 +1,2 @@
1
+ export { getBankFromIBAN, validateIBAN } from './chunk-CQKK3S7A.js';
2
+ import './chunk-ENQ7O7VW.js';
package/dist/index.cjs ADDED
@@ -0,0 +1,211 @@
1
+ 'use strict';
2
+
3
+ var chunkAPXP7OK7_cjs = require('./chunk-APXP7OK7.cjs');
4
+ var chunkBSS4Z7NI_cjs = require('./chunk-BSS4Z7NI.cjs');
5
+ var chunkPHHKIMO2_cjs = require('./chunk-PHHKIMO2.cjs');
6
+ var chunkYS7MOLK2_cjs = require('./chunk-YS7MOLK2.cjs');
7
+ var chunkWPKV5JT3_cjs = require('./chunk-WPKV5JT3.cjs');
8
+ var chunkH6M6L26S_cjs = require('./chunk-H6M6L26S.cjs');
9
+ var chunkKEHCTYLO_cjs = require('./chunk-KEHCTYLO.cjs');
10
+ var chunkKQKW2ZEK_cjs = require('./chunk-KQKW2ZEK.cjs');
11
+ require('./chunk-YLWZGSFY.cjs');
12
+ var chunkAUATLZA5_cjs = require('./chunk-AUATLZA5.cjs');
13
+ var chunk4VVFS6FN_cjs = require('./chunk-4VVFS6FN.cjs');
14
+ var chunkHTCSHHOR_cjs = require('./chunk-HTCSHHOR.cjs');
15
+ var chunkLVHTH4P7_cjs = require('./chunk-LVHTH4P7.cjs');
16
+ var chunk3COX5FSL_cjs = require('./chunk-3COX5FSL.cjs');
17
+ var chunkXCXFGTHW_cjs = require('./chunk-XCXFGTHW.cjs');
18
+ var chunkCYJJ7KGC_cjs = require('./chunk-CYJJ7KGC.cjs');
19
+ var chunk422X6FEZ_cjs = require('./chunk-422X6FEZ.cjs');
20
+ require('./chunk-VPBMIYO2.cjs');
21
+
22
+
23
+
24
+ Object.defineProperty(exports, "amountInWords", {
25
+ enumerable: true,
26
+ get: function () { return chunkAPXP7OK7_cjs.amountInWords; }
27
+ });
28
+ Object.defineProperty(exports, "numberToWords", {
29
+ enumerable: true,
30
+ get: function () { return chunkAPXP7OK7_cjs.numberToWords; }
31
+ });
32
+ Object.defineProperty(exports, "analyzeNumber", {
33
+ enumerable: true,
34
+ get: function () { return chunkBSS4Z7NI_cjs.analyzeNumber; }
35
+ });
36
+ Object.defineProperty(exports, "getAreaCode", {
37
+ enumerable: true,
38
+ get: function () { return chunkBSS4Z7NI_cjs.getAreaCode; }
39
+ });
40
+ Object.defineProperty(exports, "getNumberType", {
41
+ enumerable: true,
42
+ get: function () { return chunkBSS4Z7NI_cjs.getNumberType; }
43
+ });
44
+ Object.defineProperty(exports, "validateLandline", {
45
+ enumerable: true,
46
+ get: function () { return chunkBSS4Z7NI_cjs.validateLandline; }
47
+ });
48
+ Object.defineProperty(exports, "analyzePhone", {
49
+ enumerable: true,
50
+ get: function () { return chunkPHHKIMO2_cjs.analyzePhone; }
51
+ });
52
+ Object.defineProperty(exports, "formatPhone", {
53
+ enumerable: true,
54
+ get: function () { return chunkPHHKIMO2_cjs.formatPhone; }
55
+ });
56
+ Object.defineProperty(exports, "validatePhone", {
57
+ enumerable: true,
58
+ get: function () { return chunkPHHKIMO2_cjs.validatePhone; }
59
+ });
60
+ Object.defineProperty(exports, "getNetwork", {
61
+ enumerable: true,
62
+ get: function () { return chunkYS7MOLK2_cjs.getNetwork; }
63
+ });
64
+ Object.defineProperty(exports, "createMerchantQr", {
65
+ enumerable: true,
66
+ get: function () { return chunkWPKV5JT3_cjs.createMerchantQr; }
67
+ });
68
+ Object.defineProperty(exports, "createRaastP2PQr", {
69
+ enumerable: true,
70
+ get: function () { return chunkWPKV5JT3_cjs.createRaastP2PQr; }
71
+ });
72
+ Object.defineProperty(exports, "parseRaastQr", {
73
+ enumerable: true,
74
+ get: function () { return chunkWPKV5JT3_cjs.parseRaastQr; }
75
+ });
76
+ Object.defineProperty(exports, "analyzeNTN", {
77
+ enumerable: true,
78
+ get: function () { return chunkH6M6L26S_cjs.analyzeNTN; }
79
+ });
80
+ Object.defineProperty(exports, "validateNTN", {
81
+ enumerable: true,
82
+ get: function () { return chunkH6M6L26S_cjs.validateNTN; }
83
+ });
84
+ Object.defineProperty(exports, "validateSTRN", {
85
+ enumerable: true,
86
+ get: function () { return chunkH6M6L26S_cjs.validateSTRN; }
87
+ });
88
+ Object.defineProperty(exports, "normalizeRomanUrdu", {
89
+ enumerable: true,
90
+ get: function () { return chunkKEHCTYLO_cjs.normalizeRomanUrdu; }
91
+ });
92
+ Object.defineProperty(exports, "normalizeText", {
93
+ enumerable: true,
94
+ get: function () { return chunkKEHCTYLO_cjs.normalizeText; }
95
+ });
96
+ Object.defineProperty(exports, "toEnglishDigits", {
97
+ enumerable: true,
98
+ get: function () { return chunkKEHCTYLO_cjs.toEnglishDigits; }
99
+ });
100
+ Object.defineProperty(exports, "toUrduDigits", {
101
+ enumerable: true,
102
+ get: function () { return chunkKEHCTYLO_cjs.toUrduDigits; }
103
+ });
104
+ Object.defineProperty(exports, "createWhatsAppLink", {
105
+ enumerable: true,
106
+ get: function () { return chunkKQKW2ZEK_cjs.createWhatsAppLink; }
107
+ });
108
+ Object.defineProperty(exports, "formatAddress", {
109
+ enumerable: true,
110
+ get: function () { return chunkAUATLZA5_cjs.formatAddress; }
111
+ });
112
+ Object.defineProperty(exports, "parseAddress", {
113
+ enumerable: true,
114
+ get: function () { return chunkAUATLZA5_cjs.parseAddress; }
115
+ });
116
+ Object.defineProperty(exports, "getCityByPostalCode", {
117
+ enumerable: true,
118
+ get: function () { return chunk4VVFS6FN_cjs.getCityByPostalCode; }
119
+ });
120
+ Object.defineProperty(exports, "getPostalAreas", {
121
+ enumerable: true,
122
+ get: function () { return chunk4VVFS6FN_cjs.getPostalAreas; }
123
+ });
124
+ Object.defineProperty(exports, "getPostalCode", {
125
+ enumerable: true,
126
+ get: function () { return chunk4VVFS6FN_cjs.getPostalCode; }
127
+ });
128
+ Object.defineProperty(exports, "getPostalCodes", {
129
+ enumerable: true,
130
+ get: function () { return chunk4VVFS6FN_cjs.getPostalCodes; }
131
+ });
132
+ Object.defineProperty(exports, "searchPostalCodes", {
133
+ enumerable: true,
134
+ get: function () { return chunk4VVFS6FN_cjs.searchPostalCodes; }
135
+ });
136
+ Object.defineProperty(exports, "getCNICInfo", {
137
+ enumerable: true,
138
+ get: function () { return chunkHTCSHHOR_cjs.getCNICInfo; }
139
+ });
140
+ Object.defineProperty(exports, "validateCNIC", {
141
+ enumerable: true,
142
+ get: function () { return chunkHTCSHHOR_cjs.validateCNIC; }
143
+ });
144
+ Object.defineProperty(exports, "formatLakh", {
145
+ enumerable: true,
146
+ get: function () { return chunkLVHTH4P7_cjs.formatLakh; }
147
+ });
148
+ Object.defineProperty(exports, "formatPKR", {
149
+ enumerable: true,
150
+ get: function () { return chunkLVHTH4P7_cjs.formatPKR; }
151
+ });
152
+ Object.defineProperty(exports, "getDistrictProvince", {
153
+ enumerable: true,
154
+ get: function () { return chunk3COX5FSL_cjs.getDistrictProvince; }
155
+ });
156
+ Object.defineProperty(exports, "getDistrictsByProvince", {
157
+ enumerable: true,
158
+ get: function () { return chunk3COX5FSL_cjs.getDistrictsByProvince; }
159
+ });
160
+ Object.defineProperty(exports, "getProvince", {
161
+ enumerable: true,
162
+ get: function () { return chunk3COX5FSL_cjs.getProvince; }
163
+ });
164
+ Object.defineProperty(exports, "searchCities", {
165
+ enumerable: true,
166
+ get: function () { return chunk3COX5FSL_cjs.searchCities; }
167
+ });
168
+ Object.defineProperty(exports, "searchDistricts", {
169
+ enumerable: true,
170
+ get: function () { return chunk3COX5FSL_cjs.searchDistricts; }
171
+ });
172
+ Object.defineProperty(exports, "getHolidaysOn", {
173
+ enumerable: true,
174
+ get: function () { return chunkXCXFGTHW_cjs.getHolidaysOn; }
175
+ });
176
+ Object.defineProperty(exports, "getPakistanHolidays", {
177
+ enumerable: true,
178
+ get: function () { return chunkXCXFGTHW_cjs.getPakistanHolidays; }
179
+ });
180
+ Object.defineProperty(exports, "isPakistanHoliday", {
181
+ enumerable: true,
182
+ get: function () { return chunkXCXFGTHW_cjs.isPakistanHoliday; }
183
+ });
184
+ Object.defineProperty(exports, "formatHijri", {
185
+ enumerable: true,
186
+ get: function () { return chunkCYJJ7KGC_cjs.formatHijri; }
187
+ });
188
+ Object.defineProperty(exports, "fromHijri", {
189
+ enumerable: true,
190
+ get: function () { return chunkCYJJ7KGC_cjs.fromHijri; }
191
+ });
192
+ Object.defineProperty(exports, "getHijriMonthName", {
193
+ enumerable: true,
194
+ get: function () { return chunkCYJJ7KGC_cjs.getHijriMonthName; }
195
+ });
196
+ Object.defineProperty(exports, "isRamadan", {
197
+ enumerable: true,
198
+ get: function () { return chunkCYJJ7KGC_cjs.isRamadan; }
199
+ });
200
+ Object.defineProperty(exports, "toHijri", {
201
+ enumerable: true,
202
+ get: function () { return chunkCYJJ7KGC_cjs.toHijri; }
203
+ });
204
+ Object.defineProperty(exports, "getBankFromIBAN", {
205
+ enumerable: true,
206
+ get: function () { return chunk422X6FEZ_cjs.getBankFromIBAN; }
207
+ });
208
+ Object.defineProperty(exports, "validateIBAN", {
209
+ enumerable: true,
210
+ get: function () { return chunk422X6FEZ_cjs.validateIBAN; }
211
+ });
@@ -0,0 +1,16 @@
1
+ export { CNICInfo, getCNICInfo, validateCNIC } from './cnic.cjs';
2
+ export { PhoneAnalysis, analyzePhone, formatPhone, validatePhone } from './phone.cjs';
3
+ export { NetworkName, getNetwork } from './networks.cjs';
4
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './geo.cjs';
5
+ export { formatLakh, formatPKR } from './format.cjs';
6
+ export { createWhatsAppLink } from './whatsapp.cjs';
7
+ export { getBankFromIBAN, validateIBAN } from './iban.cjs';
8
+ export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './postal.cjs';
9
+ export { ParsedAddress, formatAddress, parseAddress } from './address.cjs';
10
+ export { normalizeRomanUrdu, normalizeText, toEnglishDigits, toUrduDigits } from './text.cjs';
11
+ export { HijriDate, HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './hijri.cjs';
12
+ export { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage, amountInWords, numberToWords } from './words.cjs';
13
+ export { NTNInfo, NTNType, analyzeNTN, validateNTN, validateSTRN } from './tax.cjs';
14
+ export { NumberInfo, NumberType, analyzeNumber, getAreaCode, getNumberType, validateLandline } from './numbers.cjs';
15
+ export { MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastP2PQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr } from './raast.cjs';
16
+ export { Holiday, HolidayId, HolidayOptions, IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './holidays.cjs';
package/dist/index.d.ts CHANGED
@@ -1,190 +1,16 @@
1
- /**
2
- * Validates a Pakistani CNIC number.
3
- *
4
- * Accepts formats with or without dashes/spaces (e.g. `3520212345671` or `35202-1234567-1`).
5
- * Strips separators before checking for exactly 13 numeric digits.
6
- *
7
- * @param cnic - The CNIC string to validate
8
- * @returns `true` if the CNIC is valid, otherwise `false`
9
- */
10
- declare function validateCNIC(cnic: string): boolean;
11
-
12
- type NetworkName = 'Jazz' | 'Zong' | 'Telenor' | 'Ufone' | 'Unknown';
13
- /**
14
- * Detects the mobile network for a Pakistani phone number based on its prefix.
15
- *
16
- * Returns the original issuing network (Jazz, Zong, Telenor, or Ufone).
17
- * Due to Mobile Number Portability (MNP), the current carrier may differ.
18
- *
19
- * @param phone - The phone number to look up
20
- * @returns Network name or `"Unknown"` if the prefix is not recognized
21
- */
22
- declare function getNetwork(phone: string): NetworkName;
23
-
24
- /** Combined phone validation, formatting, and network analysis result. */
25
- interface PhoneAnalysis {
26
- valid: boolean;
27
- formatted: string | null;
28
- network: NetworkName;
29
- }
30
- /**
31
- * Validates a Pakistani mobile phone number.
32
- *
33
- * Accepts local (`03001234567`), international (`+923001234567`),
34
- * and short (`3001234567`) formats. Ignores spaces and dashes.
35
- *
36
- * @param phone - The phone number string to validate
37
- * @returns `true` if valid, otherwise `false`
38
- */
39
- declare function validatePhone(phone: string): boolean;
40
- /**
41
- * Formats a Pakistani mobile number to international E.164 style (`+923001234567`).
42
- *
43
- * Returns an empty string when the input is not a valid Pakistani mobile number.
44
- *
45
- * @param phone - The phone number string to format
46
- * @returns Formatted phone number or empty string if invalid
47
- */
48
- declare function formatPhone(phone: string): string;
49
-
50
- /**
51
- * Analyzes a Pakistani mobile number in a single call.
52
- *
53
- * Combines validation, E.164 formatting, and network detection.
54
- * Invalid numbers return `{ valid: false, formatted: null, network: "Unknown" }`.
55
- *
56
- * @param phone - Phone number in any supported format
57
- * @returns Structured phone analysis result
58
- */
59
- declare function analyzePhone(phone: string): PhoneAnalysis;
60
-
61
- /**
62
- * Returns the province for a given Pakistani city name.
63
- *
64
- * Matching is case-insensitive and ignores inconsistent spacing.
65
- * Returns `null` when no exact city match is found.
66
- *
67
- * @param city - The city name to look up
68
- * @returns Province name or `null` if not found
69
- */
70
- declare function getProvince(city: string): string | null;
71
- /**
72
- * Searches cities by partial, case-insensitive name match.
73
- *
74
- * @param query - Partial city name to search for
75
- * @returns Alphabetically sorted list of matching city names
76
- */
77
- declare function searchCities(query: string): string[];
78
- /**
79
- * Returns the province for a given Pakistani district name.
80
- *
81
- * Matching is case-insensitive and ignores inconsistent spacing.
82
- * Returns `null` when no exact district match is found.
83
- *
84
- * @param district - The district name to look up
85
- * @returns Province name or `null` if not found
86
- */
87
- declare function getDistrictProvince(district: string): string | null;
88
- /**
89
- * Searches districts by partial, case-insensitive name match.
90
- *
91
- * @param query - Partial district name to search for
92
- * @returns Alphabetically sorted list of matching district names
93
- */
94
- declare function searchDistricts(query: string): string[];
95
- /**
96
- * Returns all districts for a given province (case-insensitive).
97
- *
98
- * @param province - Province name to filter by
99
- * @returns Alphabetically sorted district names
100
- */
101
- declare function getDistrictsByProvince(province: string): string[];
102
-
103
- /**
104
- * Formats a numeric amount as Pakistani Rupees with comma separators.
105
- *
106
- * Non-finite values and negative amounts are treated as zero.
107
- *
108
- * @param amount - The amount in PKR
109
- * @returns Formatted string (e.g. `"Rs. 150,000"`)
110
- */
111
- declare function formatPKR(amount: number): string;
112
- /**
113
- * Formats a numeric amount using Pakistani lakh/crore conventions.
114
- *
115
- * - Amounts >= 1 crore render as `"N Crore"` (e.g. `10000000` → `"1 Crore"`)
116
- * - Amounts >= 1 lakh render as `"N Lakh"` (e.g. `2500000` → `"25 Lakh"`)
117
- * - Smaller amounts fall back to {@link formatPKR}
118
- *
119
- * Non-finite values and negative amounts are treated as zero.
120
- *
121
- * @param amount - The amount in PKR
122
- * @returns Human-readable lakh/crore string
123
- */
124
- declare function formatLakh(amount: number): string;
125
-
126
- /**
127
- * Creates a WhatsApp click-to-chat link for a Pakistani mobile number.
128
- *
129
- * Accepts local, international, and short phone formats. Returns an empty
130
- * string when the phone number is invalid.
131
- *
132
- * @param phone - Pakistani mobile number in any supported format
133
- * @param message - Optional pre-filled message (URL-encoded)
134
- * @returns WhatsApp wa.me link or empty string if invalid
135
- */
136
- declare function createWhatsAppLink(phone: string, message?: string): string;
137
-
138
- /**
139
- * Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
140
- *
141
- * Accepts spaced or unspaced input. Only `PK` IBANs of exactly 24 characters
142
- * are supported.
143
- *
144
- * @param iban - IBAN string to validate
145
- * @returns `true` if valid, otherwise `false`
146
- */
147
- declare function validateIBAN(iban: string): boolean;
148
- /**
149
- * Returns the bank name for a valid Pakistani IBAN based on its 4-letter bank code.
150
- *
151
- * Returns `null` when the IBAN is invalid or the bank code is not in the dataset.
152
- *
153
- * @param iban - IBAN string to look up
154
- * @returns Bank name or `null` if not found
155
- */
156
- declare function getBankFromIBAN(iban: string): string | null;
157
-
158
- /**
159
- * Returns the city name for a Pakistani postal code.
160
- *
161
- * @param postalCode - Postal code to look up (whitespace is ignored)
162
- * @returns City name or `null` if not found
163
- */
164
- declare function getCityByPostalCode(postalCode: string): string | null;
165
- /**
166
- * Returns the primary postal code for a Pakistani city.
167
- *
168
- * Matching is case-insensitive and whitespace-tolerant.
169
- * When multiple postal codes exist, returns the primary GPO code.
170
- *
171
- * @param city - City name to look up
172
- * @returns Postal code or `null` if not found
173
- */
174
- declare function getPostalCode(city: string): string | null;
175
- /**
176
- * Returns all known postal codes for a city (case-insensitive).
177
- *
178
- * @param city - City name to look up
179
- * @returns Alphabetically sorted postal codes
180
- */
181
- declare function getPostalCodes(city: string): string[];
182
- /**
183
- * Searches postal entries by city name, area, or postal code prefix.
184
- *
185
- * @param query - Partial search term
186
- * @returns Matching postal code strings, sorted alphabetically
187
- */
188
- declare function searchPostalCodes(query: string): string[];
189
-
190
- export { type NetworkName, type PhoneAnalysis, analyzePhone, createWhatsAppLink, formatLakh, formatPKR, formatPhone, getBankFromIBAN, getCityByPostalCode, getDistrictProvince, getDistrictsByProvince, getNetwork, getPostalCode, getPostalCodes, getProvince, searchCities, searchDistricts, searchPostalCodes, validateCNIC, validateIBAN, validatePhone };
1
+ export { CNICInfo, getCNICInfo, validateCNIC } from './cnic.js';
2
+ export { PhoneAnalysis, analyzePhone, formatPhone, validatePhone } from './phone.js';
3
+ export { NetworkName, getNetwork } from './networks.js';
4
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './geo.js';
5
+ export { formatLakh, formatPKR } from './format.js';
6
+ export { createWhatsAppLink } from './whatsapp.js';
7
+ export { getBankFromIBAN, validateIBAN } from './iban.js';
8
+ export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './postal.js';
9
+ export { ParsedAddress, formatAddress, parseAddress } from './address.js';
10
+ export { normalizeRomanUrdu, normalizeText, toEnglishDigits, toUrduDigits } from './text.js';
11
+ export { HijriDate, HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './hijri.js';
12
+ export { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage, amountInWords, numberToWords } from './words.js';
13
+ export { NTNInfo, NTNType, analyzeNTN, validateNTN, validateSTRN } from './tax.js';
14
+ export { NumberInfo, NumberType, analyzeNumber, getAreaCode, getNumberType, validateLandline } from './numbers.js';
15
+ export { MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastP2PQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr } from './raast.js';
16
+ export { Holiday, HolidayId, HolidayOptions, IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './holidays.js';