pakdatakit 2.1.1 → 2.2.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 +104 -0
- package/README.md +93 -6
- package/dist/address.cjs +4 -4
- package/dist/address.js +2 -2
- package/dist/{chunk-PHHKIMO2.cjs → chunk-33FXHM2E.cjs} +5 -5
- package/dist/chunk-3IARSCO6.cjs +317 -0
- package/dist/{chunk-BSS4Z7NI.cjs → chunk-3ZA265SK.cjs} +2 -2
- package/dist/{chunk-43ULDYUP.cjs → chunk-4VSGCQ6K.cjs} +107 -11
- package/dist/{chunk-Y6BUGLXU.js → chunk-6IPPANNX.js} +4 -1
- package/dist/{chunk-L45UXUWX.js → chunk-AZV45DMG.js} +1 -1
- package/dist/{chunk-QQQKISXT.js → chunk-BR4QLZPX.js} +11 -2
- package/dist/{chunk-AUATLZA5.cjs → chunk-CLL6VDPO.cjs} +4 -4
- package/dist/{chunk-P4CGOJEM.js → chunk-EMH4IP2U.js} +1 -1
- package/dist/{chunk-JNP27XW2.cjs → chunk-GJENL6VK.cjs} +6 -6
- package/dist/{chunk-APXP7OK7.cjs → chunk-HIZQBWNW.cjs} +11 -2
- package/dist/{chunk-YS7MOLK2.cjs → chunk-HTERSQGF.cjs} +3 -3
- package/dist/{chunk-E7GAK72W.js → chunk-HUQY2WR5.js} +3 -3
- package/dist/{chunk-L2BDDM2W.js → chunk-I664KOWP.js} +1 -1
- package/dist/{chunk-K6CZFCX6.js → chunk-J272OMDL.js} +51 -6
- package/dist/{chunk-KQKW2ZEK.cjs → chunk-NAJGGUAM.cjs} +2 -2
- package/dist/{chunk-YLWZGSFY.cjs → chunk-NTD4JLDW.cjs} +4 -0
- package/dist/{chunk-44YRK7WO.js → chunk-NZQ47NWD.js} +105 -10
- package/dist/{chunk-432ZYMYV.js → chunk-PLDVGOKZ.js} +2 -2
- package/dist/{chunk-T3E4B5MJ.js → chunk-RXNYY5K5.js} +1 -1
- package/dist/{chunk-3COX5FSL.cjs → chunk-SBS2GHM3.cjs} +51 -6
- package/dist/chunk-TTARJWGT.js +82 -0
- package/dist/chunk-U7MWHXMF.cjs +89 -0
- package/dist/chunk-YPPKY5XZ.js +312 -0
- package/dist/cli.js +1 -1
- package/dist/geo.cjs +6 -6
- package/dist/geo.js +1 -1
- package/dist/holidays.d.cts +2 -1
- package/dist/holidays.d.ts +2 -1
- package/dist/iban.cjs +11 -3
- package/dist/iban.d.cts +45 -1
- package/dist/iban.d.ts +45 -1
- package/dist/iban.js +1 -1
- package/dist/index.cjs +76 -37
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +16 -10
- package/dist/input.cjs +34 -0
- package/dist/input.d.cts +67 -0
- package/dist/input.d.ts +67 -0
- package/dist/input.js +5 -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/phone.cjs +8 -8
- package/dist/phone.js +3 -3
- package/dist/raast.cjs +9 -5
- package/dist/raast.d.cts +68 -5
- package/dist/raast.d.ts +68 -5
- package/dist/raast.js +2 -2
- package/dist/valibot.cjs +7 -7
- package/dist/valibot.js +6 -6
- package/dist/whatsapp.cjs +3 -3
- package/dist/whatsapp.js +2 -2
- package/dist/words.cjs +3 -3
- package/dist/words.js +1 -1
- package/dist/yup.cjs +7 -7
- package/dist/yup.js +6 -6
- package/dist/zod.cjs +7 -7
- package/dist/zod.js +6 -6
- package/package.json +16 -3
- package/dist/chunk-4EUKCSLW.js +0 -221
- package/dist/chunk-E47SNBWQ.cjs +0 -224
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { lazy, stripSeparators } from './chunk-ENQ7O7VW.js';
|
|
2
|
+
|
|
3
|
+
// data/banks.json
|
|
4
|
+
var banks_default = [
|
|
5
|
+
{
|
|
6
|
+
code: "ABPA",
|
|
7
|
+
name: "Allied Bank Limited",
|
|
8
|
+
type: "commercial"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
code: "AIIN",
|
|
12
|
+
name: "Al Baraka Bank (Pakistan) Limited",
|
|
13
|
+
type: "islamic"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
code: "ALFH",
|
|
17
|
+
name: "Bank Alfalah Limited",
|
|
18
|
+
type: "commercial"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
code: "APNA",
|
|
22
|
+
name: "Apna Microfinance Bank",
|
|
23
|
+
type: "microfinance"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
code: "ASCM",
|
|
27
|
+
name: "Askari Bank Limited",
|
|
28
|
+
type: "commercial"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
code: "BAHL",
|
|
32
|
+
name: "Bank Al Habib Limited",
|
|
33
|
+
type: "commercial"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
code: "BKCH",
|
|
37
|
+
name: "Bank of China Limited",
|
|
38
|
+
type: "foreign"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
code: "BKIP",
|
|
42
|
+
name: "BankIslami Pakistan Limited",
|
|
43
|
+
type: "islamic"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
code: "BPUN",
|
|
47
|
+
name: "The Bank of Punjab",
|
|
48
|
+
type: "commercial"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
code: "CITI",
|
|
52
|
+
name: "Citibank N.A. Pakistan",
|
|
53
|
+
type: "foreign"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
code: "DEUT",
|
|
57
|
+
name: "Deutsche Bank AG",
|
|
58
|
+
type: "foreign"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: "DUIB",
|
|
62
|
+
name: "Dubai Islamic Bank Pakistan Limited",
|
|
63
|
+
type: "islamic"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
code: "FAYS",
|
|
67
|
+
name: "Faysal Bank Limited",
|
|
68
|
+
type: "islamic"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
code: "FINC",
|
|
72
|
+
name: "ABHI Microfinance Bank (formerly FINCA Microfinance Bank)",
|
|
73
|
+
type: "microfinance"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
code: "FMFB",
|
|
77
|
+
name: "HBL Microfinance Bank (formerly First MicroFinance Bank)",
|
|
78
|
+
type: "microfinance"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
code: "FWOM",
|
|
82
|
+
name: "First Women Bank Limited",
|
|
83
|
+
type: "commercial"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
code: "HABB",
|
|
87
|
+
name: "Habib Bank Limited",
|
|
88
|
+
type: "commercial"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
code: "ICBK",
|
|
92
|
+
name: "Industrial and Commercial Bank of China",
|
|
93
|
+
type: "foreign"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
code: "JCMA",
|
|
97
|
+
name: "Mobilink Bank (JazzCash)",
|
|
98
|
+
type: "microfinance"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
code: "JSBL",
|
|
102
|
+
name: "JS Bank Limited",
|
|
103
|
+
type: "commercial"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
code: "KHBL",
|
|
107
|
+
name: "Khushhali Microfinance Bank",
|
|
108
|
+
type: "microfinance"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
code: "KHYB",
|
|
112
|
+
name: "The Bank of Khyber",
|
|
113
|
+
type: "commercial"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
code: "MCBL",
|
|
117
|
+
name: "MCB Bank Limited",
|
|
118
|
+
type: "commercial",
|
|
119
|
+
aliasOf: "MUCB"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
code: "MCIB",
|
|
123
|
+
name: "MCB Islamic Bank Limited",
|
|
124
|
+
type: "islamic"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
code: "MEZN",
|
|
128
|
+
name: "Meezan Bank Limited",
|
|
129
|
+
type: "islamic"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
code: "MPBL",
|
|
133
|
+
name: "Habib Metropolitan Bank Limited",
|
|
134
|
+
type: "commercial"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
code: "MSHQ",
|
|
138
|
+
name: "Mashreq Bank Pakistan Limited",
|
|
139
|
+
type: "digital"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
code: "MUCB",
|
|
143
|
+
name: "MCB Bank Limited",
|
|
144
|
+
type: "commercial"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
code: "NAYA",
|
|
148
|
+
name: "NayaPay",
|
|
149
|
+
type: "emi"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
code: "NBPA",
|
|
153
|
+
name: "National Bank of Pakistan",
|
|
154
|
+
type: "commercial"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
code: "NBPB",
|
|
158
|
+
name: "National Bank of Pakistan",
|
|
159
|
+
type: "commercial",
|
|
160
|
+
aliasOf: "NBPA"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
code: "NIBP",
|
|
164
|
+
name: "NIB Bank Limited (merged into MCB Bank)",
|
|
165
|
+
type: "commercial",
|
|
166
|
+
mergedInto: "MUCB"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
code: "NRSP",
|
|
170
|
+
name: "NRSP Microfinance Bank",
|
|
171
|
+
type: "microfinance"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
code: "RQMI",
|
|
175
|
+
name: "Raqami Islamic Digital Bank Limited",
|
|
176
|
+
type: "digital"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
code: "SADA",
|
|
180
|
+
name: "SadaPay",
|
|
181
|
+
type: "emi"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
code: "SAMB",
|
|
185
|
+
name: "Samba Bank Limited",
|
|
186
|
+
type: "commercial"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
code: "SAUD",
|
|
190
|
+
name: "Silkbank Limited (merged into United Bank Limited)",
|
|
191
|
+
type: "commercial",
|
|
192
|
+
mergedInto: "UNIL"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
code: "SBPP",
|
|
196
|
+
name: "State Bank of Pakistan",
|
|
197
|
+
type: "central"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
code: "SCBL",
|
|
201
|
+
name: "Standard Chartered Bank (Pakistan) Limited",
|
|
202
|
+
type: "commercial"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
code: "SIND",
|
|
206
|
+
name: "Sindh Bank Limited",
|
|
207
|
+
type: "commercial"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
code: "SMES",
|
|
211
|
+
name: "SME Bank Limited",
|
|
212
|
+
type: "specialized"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
code: "SONE",
|
|
216
|
+
name: "Soneri Bank Limited",
|
|
217
|
+
type: "commercial"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
code: "SUMB",
|
|
221
|
+
name: "Bank Makramah Limited (formerly Summit Bank)",
|
|
222
|
+
type: "commercial"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
code: "TAMW",
|
|
226
|
+
name: "easypaisa Digital Bank (formerly Tameer Microfinance Bank)",
|
|
227
|
+
type: "digital",
|
|
228
|
+
aliasOf: "TMFB"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
code: "TMFB",
|
|
232
|
+
name: "easypaisa Digital Bank (formerly Telenor Microfinance Bank)",
|
|
233
|
+
type: "digital"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
code: "UMBL",
|
|
237
|
+
name: "U Microfinance Bank",
|
|
238
|
+
type: "microfinance"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
code: "UNIL",
|
|
242
|
+
name: "United Bank Limited",
|
|
243
|
+
type: "commercial"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
code: "WMBL",
|
|
247
|
+
name: "Mobilink Bank (JazzCash)",
|
|
248
|
+
type: "microfinance",
|
|
249
|
+
aliasOf: "JCMA"
|
|
250
|
+
}
|
|
251
|
+
];
|
|
252
|
+
|
|
253
|
+
// src/iban.ts
|
|
254
|
+
var PK_IBAN_PATTERN = /^PK\d{2}[A-Z]{4}[A-Z0-9]{16}$/;
|
|
255
|
+
var banks = lazy(
|
|
256
|
+
() => banks_default.map((entry) => ({
|
|
257
|
+
code: entry.code,
|
|
258
|
+
name: entry.name,
|
|
259
|
+
type: entry.type,
|
|
260
|
+
active: entry.mergedInto === void 0,
|
|
261
|
+
mergedInto: entry.mergedInto ?? null,
|
|
262
|
+
aliasOf: entry.aliasOf ?? null
|
|
263
|
+
}))
|
|
264
|
+
);
|
|
265
|
+
var bankByCode = lazy(
|
|
266
|
+
() => new Map(banks().map((bank) => [bank.code, bank]))
|
|
267
|
+
);
|
|
268
|
+
function expandIbanChars(value) {
|
|
269
|
+
return value.replace(
|
|
270
|
+
/[A-Z]/g,
|
|
271
|
+
(char) => (char.charCodeAt(0) - 55).toString()
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
function mod97(numericIban) {
|
|
275
|
+
let remainder = 0;
|
|
276
|
+
for (const digit of numericIban) {
|
|
277
|
+
remainder = (remainder * 10 + Number(digit)) % 97;
|
|
278
|
+
}
|
|
279
|
+
return remainder;
|
|
280
|
+
}
|
|
281
|
+
function normalizeIBAN(iban) {
|
|
282
|
+
return stripSeparators(iban).toUpperCase();
|
|
283
|
+
}
|
|
284
|
+
function validateIBAN(iban) {
|
|
285
|
+
const normalized = normalizeIBAN(iban);
|
|
286
|
+
if (!PK_IBAN_PATTERN.test(normalized)) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
const rearranged = normalized.slice(4) + normalized.slice(0, 4);
|
|
290
|
+
return mod97(expandIbanChars(rearranged)) === 1;
|
|
291
|
+
}
|
|
292
|
+
function getBankFromIBAN(iban) {
|
|
293
|
+
if (!validateIBAN(iban)) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
return bankByCode().get(normalizeIBAN(iban).slice(4, 8))?.name ?? null;
|
|
297
|
+
}
|
|
298
|
+
function getBankInfo(ibanOrCode) {
|
|
299
|
+
const value = normalizeIBAN(ibanOrCode);
|
|
300
|
+
if (/^[A-Z]{4}$/.test(value)) {
|
|
301
|
+
return bankByCode().get(value) ?? null;
|
|
302
|
+
}
|
|
303
|
+
if (!validateIBAN(value)) {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
return bankByCode().get(value.slice(4, 8)) ?? null;
|
|
307
|
+
}
|
|
308
|
+
function getBanks() {
|
|
309
|
+
return banks().map((bank) => ({ ...bank }));
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export { getBankFromIBAN, getBankInfo, getBanks, validateIBAN };
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { normalizeRomanUrdu, formatHijri, toHijri, formatPKR, formatLakh, parseAddress, getCityByPostalCode, getPostalCode, getProvince, getBankFromIBAN, validateIBAN, analyzePhone, validatePhone, validateCNIC } from 'pakdatakit';
|
|
3
3
|
|
|
4
4
|
// package.json
|
|
5
|
-
var version = "2.
|
|
5
|
+
var version = "2.2.0";
|
|
6
6
|
var EXIT_OK = 0;
|
|
7
7
|
var EXIT_NEGATIVE = 1;
|
|
8
8
|
var EXIT_USAGE = 2;
|
package/dist/geo.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSBS2GHM3_cjs = require('./chunk-SBS2GHM3.cjs');
|
|
4
4
|
require('./chunk-VPBMIYO2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "getDistrictProvince", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkSBS2GHM3_cjs.getDistrictProvince; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "getDistrictsByProvince", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkSBS2GHM3_cjs.getDistrictsByProvince; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "getProvince", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkSBS2GHM3_cjs.getProvince; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "searchCities", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkSBS2GHM3_cjs.searchCities; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "searchDistricts", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkSBS2GHM3_cjs.searchDistricts; }
|
|
27
27
|
});
|
package/dist/geo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './chunk-
|
|
1
|
+
export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './chunk-J272OMDL.js';
|
|
2
2
|
import './chunk-ENQ7O7VW.js';
|
package/dist/holidays.d.cts
CHANGED
|
@@ -27,7 +27,8 @@ interface HolidayOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Observed or announced dates (`YYYY-MM-DD`) for Islamic holidays, used
|
|
29
29
|
* instead of the dataset or estimate. Use this to apply a new moon-sighting
|
|
30
|
-
* announcement before the library is updated.
|
|
30
|
+
* announcement before the library is updated. An empty list removes that
|
|
31
|
+
* holiday for the year.
|
|
31
32
|
*/
|
|
32
33
|
announced?: Partial<Record<IslamicHolidayId, string[]>>;
|
|
33
34
|
/** Day offset applied to estimated Islamic dates. Defaults to `0`. */
|
package/dist/holidays.d.ts
CHANGED
|
@@ -27,7 +27,8 @@ interface HolidayOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Observed or announced dates (`YYYY-MM-DD`) for Islamic holidays, used
|
|
29
29
|
* instead of the dataset or estimate. Use this to apply a new moon-sighting
|
|
30
|
-
* announcement before the library is updated.
|
|
30
|
+
* announcement before the library is updated. An empty list removes that
|
|
31
|
+
* holiday for the year.
|
|
31
32
|
*/
|
|
32
33
|
announced?: Partial<Record<IslamicHolidayId, string[]>>;
|
|
33
34
|
/** Day offset applied to estimated Islamic dates. Defaults to `0`. */
|
package/dist/iban.cjs
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3IARSCO6_cjs = require('./chunk-3IARSCO6.cjs');
|
|
4
4
|
require('./chunk-VPBMIYO2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "getBankFromIBAN", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk3IARSCO6_cjs.getBankFromIBAN; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getBankInfo", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunk3IARSCO6_cjs.getBankInfo; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "getBanks", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunk3IARSCO6_cjs.getBanks; }
|
|
11
19
|
});
|
|
12
20
|
Object.defineProperty(exports, "validateIBAN", {
|
|
13
21
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk3IARSCO6_cjs.validateIBAN; }
|
|
15
23
|
});
|
package/dist/iban.d.cts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/** Kind of institution, following the State Bank of Pakistan's grouping. */
|
|
2
|
+
type BankType = 'commercial' | 'islamic' | 'microfinance' | 'digital' | 'emi' | 'foreign' | 'specialized' | 'central';
|
|
3
|
+
/** A bank (or other institution) that issues Pakistani IBANs. */
|
|
4
|
+
interface BankInfo {
|
|
5
|
+
/** 4-letter IBAN bank code (characters 5–8 of the IBAN). */
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* `commercial`, `islamic` (full-fledged Islamic bank), `microfinance`,
|
|
10
|
+
* `digital` (digital retail bank), `emi` (electronic money institution such
|
|
11
|
+
* as a wallet), `foreign` (branch of a foreign bank), `specialized` or
|
|
12
|
+
* `central` (State Bank of Pakistan).
|
|
13
|
+
*/
|
|
14
|
+
type: BankType;
|
|
15
|
+
/** `false` for banks that merged into another and no longer exist. */
|
|
16
|
+
active: boolean;
|
|
17
|
+
/** Code of the bank this one merged into, if it no longer exists. */
|
|
18
|
+
mergedInto: string | null;
|
|
19
|
+
/** Main code of the same bank, when this is an older code still in use. */
|
|
20
|
+
aliasOf: string | null;
|
|
21
|
+
}
|
|
1
22
|
/**
|
|
2
23
|
* Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
|
|
3
24
|
*
|
|
@@ -17,5 +38,28 @@ declare function validateIBAN(iban: string): boolean;
|
|
|
17
38
|
* @returns Bank name or `null` if not found
|
|
18
39
|
*/
|
|
19
40
|
declare function getBankFromIBAN(iban: string): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns details of the bank that issued an IBAN: name, type (commercial,
|
|
43
|
+
* Islamic, microfinance, digital bank, wallet …) and whether it still exists.
|
|
44
|
+
*
|
|
45
|
+
* Also accepts a 4-letter bank code on its own.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* getBankInfo('PK36SCBL0000001123456702');
|
|
49
|
+
* // { code: 'SCBL', name: 'Standard Chartered Bank (Pakistan) Limited',
|
|
50
|
+
* // type: 'commercial', active: true, mergedInto: null, aliasOf: null }
|
|
51
|
+
* getBankInfo('SADA')?.type; // 'emi'
|
|
52
|
+
*
|
|
53
|
+
* @param ibanOrCode - A valid Pakistani IBAN, or a bank code such as `MEZN`
|
|
54
|
+
* @returns Bank details, or `null` if the IBAN is invalid or the code unknown
|
|
55
|
+
*/
|
|
56
|
+
declare function getBankInfo(ibanOrCode: string): BankInfo | null;
|
|
57
|
+
/**
|
|
58
|
+
* Lists every bank code in the dataset, sorted by code. Filter it for a
|
|
59
|
+
* bank picker, e.g. `getBanks().filter((b) => b.active && !b.aliasOf)`.
|
|
60
|
+
*
|
|
61
|
+
* @returns All banks, including merged banks and older alias codes
|
|
62
|
+
*/
|
|
63
|
+
declare function getBanks(): BankInfo[];
|
|
20
64
|
|
|
21
|
-
export { getBankFromIBAN, validateIBAN };
|
|
65
|
+
export { type BankInfo, type BankType, getBankFromIBAN, getBankInfo, getBanks, validateIBAN };
|
package/dist/iban.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/** Kind of institution, following the State Bank of Pakistan's grouping. */
|
|
2
|
+
type BankType = 'commercial' | 'islamic' | 'microfinance' | 'digital' | 'emi' | 'foreign' | 'specialized' | 'central';
|
|
3
|
+
/** A bank (or other institution) that issues Pakistani IBANs. */
|
|
4
|
+
interface BankInfo {
|
|
5
|
+
/** 4-letter IBAN bank code (characters 5–8 of the IBAN). */
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* `commercial`, `islamic` (full-fledged Islamic bank), `microfinance`,
|
|
10
|
+
* `digital` (digital retail bank), `emi` (electronic money institution such
|
|
11
|
+
* as a wallet), `foreign` (branch of a foreign bank), `specialized` or
|
|
12
|
+
* `central` (State Bank of Pakistan).
|
|
13
|
+
*/
|
|
14
|
+
type: BankType;
|
|
15
|
+
/** `false` for banks that merged into another and no longer exist. */
|
|
16
|
+
active: boolean;
|
|
17
|
+
/** Code of the bank this one merged into, if it no longer exists. */
|
|
18
|
+
mergedInto: string | null;
|
|
19
|
+
/** Main code of the same bank, when this is an older code still in use. */
|
|
20
|
+
aliasOf: string | null;
|
|
21
|
+
}
|
|
1
22
|
/**
|
|
2
23
|
* Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
|
|
3
24
|
*
|
|
@@ -17,5 +38,28 @@ declare function validateIBAN(iban: string): boolean;
|
|
|
17
38
|
* @returns Bank name or `null` if not found
|
|
18
39
|
*/
|
|
19
40
|
declare function getBankFromIBAN(iban: string): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns details of the bank that issued an IBAN: name, type (commercial,
|
|
43
|
+
* Islamic, microfinance, digital bank, wallet …) and whether it still exists.
|
|
44
|
+
*
|
|
45
|
+
* Also accepts a 4-letter bank code on its own.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* getBankInfo('PK36SCBL0000001123456702');
|
|
49
|
+
* // { code: 'SCBL', name: 'Standard Chartered Bank (Pakistan) Limited',
|
|
50
|
+
* // type: 'commercial', active: true, mergedInto: null, aliasOf: null }
|
|
51
|
+
* getBankInfo('SADA')?.type; // 'emi'
|
|
52
|
+
*
|
|
53
|
+
* @param ibanOrCode - A valid Pakistani IBAN, or a bank code such as `MEZN`
|
|
54
|
+
* @returns Bank details, or `null` if the IBAN is invalid or the code unknown
|
|
55
|
+
*/
|
|
56
|
+
declare function getBankInfo(ibanOrCode: string): BankInfo | null;
|
|
57
|
+
/**
|
|
58
|
+
* Lists every bank code in the dataset, sorted by code. Filter it for a
|
|
59
|
+
* bank picker, e.g. `getBanks().filter((b) => b.active && !b.aliasOf)`.
|
|
60
|
+
*
|
|
61
|
+
* @returns All banks, including merged banks and older alias codes
|
|
62
|
+
*/
|
|
63
|
+
declare function getBanks(): BankInfo[];
|
|
20
64
|
|
|
21
|
-
export { getBankFromIBAN, validateIBAN };
|
|
65
|
+
export { type BankInfo, type BankType, getBankFromIBAN, getBankInfo, getBanks, validateIBAN };
|
package/dist/iban.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getBankFromIBAN, validateIBAN } from './chunk-
|
|
1
|
+
export { getBankFromIBAN, getBankInfo, getBanks, validateIBAN } from './chunk-YPPKY5XZ.js';
|
|
2
2
|
import './chunk-ENQ7O7VW.js';
|