pakdatakit 2.1.2 → 2.2.1
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 +105 -0
- package/README.md +94 -9
- package/dist/address.cjs +4 -4
- package/dist/address.d.cts +2 -1
- package/dist/address.d.ts +2 -1
- package/dist/address.js +2 -2
- package/dist/{chunk-PHHKIMO2.cjs → chunk-33FXHM2E.cjs} +5 -5
- package/dist/{chunk-3COX5FSL.cjs → chunk-34CJGJ67.cjs} +53 -6
- package/dist/chunk-3IARSCO6.cjs +317 -0
- package/dist/{chunk-BSS4Z7NI.cjs → chunk-3ZA265SK.cjs} +2 -2
- package/dist/{chunk-AUATLZA5.cjs → chunk-47P7HILD.cjs} +4 -4
- package/dist/{chunk-Q7XHVR3U.cjs → chunk-4VSGCQ6K.cjs} +86 -15
- 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-K6CZFCX6.js → chunk-E6DT2DWQ.js} +53 -6
- 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-KQKW2ZEK.cjs → chunk-NAJGGUAM.cjs} +2 -2
- package/dist/{chunk-YLWZGSFY.cjs → chunk-NTD4JLDW.cjs} +4 -0
- package/dist/{chunk-R7UTY3SY.js → chunk-NZQ47NWD.js} +84 -14
- package/dist/{chunk-432ZYMYV.js → chunk-PLDVGOKZ.js} +2 -2
- package/dist/{chunk-L2BDDM2W.js → chunk-QKH7W2CC.js} +1 -1
- package/dist/{chunk-T3E4B5MJ.js → chunk-RXNYY5K5.js} +1 -1
- 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/cnic.d.cts +2 -1
- package/dist/cnic.d.ts +2 -1
- package/dist/geo.cjs +6 -6
- package/dist/geo.js +1 -1
- package/dist/hijri.d.cts +2 -1
- package/dist/hijri.d.ts +2 -1
- package/dist/holidays.d.cts +4 -2
- package/dist/holidays.d.ts +4 -2
- package/dist/iban.cjs +11 -3
- package/dist/iban.d.cts +46 -1
- package/dist/iban.d.ts +46 -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 +68 -0
- package/dist/input.d.ts +68 -0
- package/dist/input.js +5 -0
- package/dist/networks.cjs +3 -3
- package/dist/networks.d.cts +2 -1
- package/dist/networks.d.ts +2 -1
- package/dist/networks.js +2 -2
- package/dist/numbers.cjs +6 -6
- package/dist/numbers.d.cts +2 -1
- package/dist/numbers.d.ts +2 -1
- package/dist/numbers.js +2 -2
- package/dist/phone.cjs +8 -8
- package/dist/phone.d.cts +2 -1
- package/dist/phone.d.ts +2 -1
- package/dist/phone.js +3 -3
- package/dist/raast.cjs +9 -5
- package/dist/raast.d.cts +54 -8
- package/dist/raast.d.ts +54 -8
- package/dist/raast.js +2 -2
- package/dist/tax.d.cts +2 -1
- package/dist/tax.d.ts +2 -1
- 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.d.cts +2 -1
- package/dist/words.d.ts +2 -1
- 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 +24 -11
- package/dist/chunk-4EUKCSLW.js +0 -221
- package/dist/chunk-E47SNBWQ.cjs +0 -224
package/dist/raast.cjs
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk4VSGCQ6K_cjs = require('./chunk-4VSGCQ6K.cjs');
|
|
4
|
+
require('./chunk-3IARSCO6.cjs');
|
|
5
5
|
require('./chunk-VPBMIYO2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "createMerchantQr", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk4VSGCQ6K_cjs.createMerchantQr; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "createRaastP2PQr", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk4VSGCQ6K_cjs.createRaastP2PQr; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "parseRaastQr", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk4VSGCQ6K_cjs.parseRaastQr; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "validateRaastQr", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunk4VSGCQ6K_cjs.validateRaastQr; }
|
|
20
24
|
});
|
package/dist/raast.d.cts
CHANGED
|
@@ -10,6 +10,8 @@ interface EmvField {
|
|
|
10
10
|
children?: EmvField[];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/** A duration such as `'30m'`, `'12h'` or `'7d'` (minutes, hours or days). */
|
|
14
|
+
type RaastDuration = `${number}${'m' | 'h' | 'd'}`;
|
|
13
15
|
/** Options for {@link createRaastP2PQr}. */
|
|
14
16
|
interface RaastP2PQrOptions {
|
|
15
17
|
/** Payee's Pakistani IBAN. */
|
|
@@ -25,8 +27,16 @@ interface RaastP2PQrOptions {
|
|
|
25
27
|
* expiry, and ignore the amount in static ones.
|
|
26
28
|
*/
|
|
27
29
|
amount?: number;
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* When a QR with an amount stops working (tag 07). With `amount`, give this
|
|
32
|
+
* or `expiresIn`.
|
|
33
|
+
*/
|
|
29
34
|
expiresAt?: Date;
|
|
35
|
+
/**
|
|
36
|
+
* How long from now a QR with an amount works, instead of `expiresAt`:
|
|
37
|
+
* milliseconds, or a string such as `'30m'`, `'12h'` or `'7d'`.
|
|
38
|
+
*/
|
|
39
|
+
expiresIn?: number | RaastDuration;
|
|
30
40
|
/** Payee's bank name (up to 25 characters). */
|
|
31
41
|
bankName?: string;
|
|
32
42
|
/** Payment description (up to 30 characters). */
|
|
@@ -105,16 +115,12 @@ interface ParsedRaastQr {
|
|
|
105
115
|
*
|
|
106
116
|
* @example
|
|
107
117
|
* createRaastP2PQr({ iban: 'PK36SCBL0000001123456702' });
|
|
108
|
-
* createRaastP2PQr({
|
|
109
|
-
* iban: 'PK36SCBL0000001123456702',
|
|
110
|
-
* amount: 1500,
|
|
111
|
-
* expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
|
|
112
|
-
* });
|
|
118
|
+
* createRaastP2PQr({ iban: 'PK36SCBL0000001123456702', amount: 1500, expiresIn: '1d' });
|
|
113
119
|
*
|
|
114
120
|
* @param options - Payee IBAN and optional amount with expiry, bank name and description
|
|
115
121
|
* @returns QR payload string
|
|
116
122
|
* @throws {RangeError} If the IBAN is invalid, a field is too long, or an
|
|
117
|
-
* amount is given without `expiresAt`
|
|
123
|
+
* amount is given without `expiresAt` or `expiresIn`
|
|
118
124
|
*/
|
|
119
125
|
declare function createRaastP2PQr(options: RaastP2PQrOptions): string;
|
|
120
126
|
/**
|
|
@@ -139,5 +145,45 @@ declare function createMerchantQr(options: MerchantQrOptions): string;
|
|
|
139
145
|
* @returns Parsed details, or `null` if the payload is not a well-formed Pakistani QR code
|
|
140
146
|
*/
|
|
141
147
|
declare function parseRaastQr(payload: string): ParsedRaastQr | null;
|
|
148
|
+
/** A problem that stops a Raast QR from working or makes it unsafe to pay. */
|
|
149
|
+
type RaastQrError = 'not-a-raast-qr' | 'bad-checksum' | 'no-iban' | 'invalid-iban' | 'expired' | 'missing-expiry';
|
|
150
|
+
/** Something worth telling the payer, but which does not stop payment. */
|
|
151
|
+
type RaastQrWarning = 'amount-ignored' | 'expires-soon';
|
|
152
|
+
/** Result of {@link validateRaastQr}. */
|
|
153
|
+
interface RaastQrValidation {
|
|
154
|
+
/** `true` when there are no errors. */
|
|
155
|
+
valid: boolean;
|
|
156
|
+
errors: RaastQrError[];
|
|
157
|
+
warnings: RaastQrWarning[];
|
|
158
|
+
/** The parsed QR, or `null` if it could not be read. */
|
|
159
|
+
qr: ParsedRaastQr | null;
|
|
160
|
+
}
|
|
161
|
+
/** Options for {@link validateRaastQr}. */
|
|
162
|
+
interface ValidateRaastQrOptions {
|
|
163
|
+
/** The time to check expiry against. Defaults to now. */
|
|
164
|
+
now?: Date;
|
|
165
|
+
/** Warn when a QR expires within this many milliseconds. Defaults to 1 hour. */
|
|
166
|
+
expiresSoonMs?: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Checks whether a Raast QR code can be paid, e.g. before showing a payment
|
|
170
|
+
* screen or to warn about a tampered sticker.
|
|
171
|
+
*
|
|
172
|
+
* Errors: not a Pakistani payment QR, checksum mismatch (damaged or edited),
|
|
173
|
+
* no IBAN or an IBAN that fails its checksum, expired, or a fixed-amount QR
|
|
174
|
+
* without the expiry that banking apps require.
|
|
175
|
+
* Warnings: an amount in a static QR (apps ignore it, so the payer must type
|
|
176
|
+
* it), or a QR that expires soon (within an hour by default).
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* validateRaastQr(scannedText);
|
|
180
|
+
* // { valid: false, errors: ['expired'], warnings: [], qr: { ... } }
|
|
181
|
+
*
|
|
182
|
+
* @param payload - Text decoded from the QR code
|
|
183
|
+
* @param options - Time to check against and the "expires soon" window
|
|
184
|
+
* @returns Validation result with the parsed QR
|
|
185
|
+
*/
|
|
186
|
+
declare function validateRaastQr(payload: string, options?: ValidateRaastQrOptions): RaastQrValidation;
|
|
142
187
|
|
|
143
|
-
export {
|
|
188
|
+
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr };
|
|
189
|
+
export type { EmvField, MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastDuration, RaastP2PQrOptions, RaastQrError, RaastQrValidation, RaastQrWarning, ValidateRaastQrOptions };
|
package/dist/raast.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ interface EmvField {
|
|
|
10
10
|
children?: EmvField[];
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/** A duration such as `'30m'`, `'12h'` or `'7d'` (minutes, hours or days). */
|
|
14
|
+
type RaastDuration = `${number}${'m' | 'h' | 'd'}`;
|
|
13
15
|
/** Options for {@link createRaastP2PQr}. */
|
|
14
16
|
interface RaastP2PQrOptions {
|
|
15
17
|
/** Payee's Pakistani IBAN. */
|
|
@@ -25,8 +27,16 @@ interface RaastP2PQrOptions {
|
|
|
25
27
|
* expiry, and ignore the amount in static ones.
|
|
26
28
|
*/
|
|
27
29
|
amount?: number;
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* When a QR with an amount stops working (tag 07). With `amount`, give this
|
|
32
|
+
* or `expiresIn`.
|
|
33
|
+
*/
|
|
29
34
|
expiresAt?: Date;
|
|
35
|
+
/**
|
|
36
|
+
* How long from now a QR with an amount works, instead of `expiresAt`:
|
|
37
|
+
* milliseconds, or a string such as `'30m'`, `'12h'` or `'7d'`.
|
|
38
|
+
*/
|
|
39
|
+
expiresIn?: number | RaastDuration;
|
|
30
40
|
/** Payee's bank name (up to 25 characters). */
|
|
31
41
|
bankName?: string;
|
|
32
42
|
/** Payment description (up to 30 characters). */
|
|
@@ -105,16 +115,12 @@ interface ParsedRaastQr {
|
|
|
105
115
|
*
|
|
106
116
|
* @example
|
|
107
117
|
* createRaastP2PQr({ iban: 'PK36SCBL0000001123456702' });
|
|
108
|
-
* createRaastP2PQr({
|
|
109
|
-
* iban: 'PK36SCBL0000001123456702',
|
|
110
|
-
* amount: 1500,
|
|
111
|
-
* expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
|
|
112
|
-
* });
|
|
118
|
+
* createRaastP2PQr({ iban: 'PK36SCBL0000001123456702', amount: 1500, expiresIn: '1d' });
|
|
113
119
|
*
|
|
114
120
|
* @param options - Payee IBAN and optional amount with expiry, bank name and description
|
|
115
121
|
* @returns QR payload string
|
|
116
122
|
* @throws {RangeError} If the IBAN is invalid, a field is too long, or an
|
|
117
|
-
* amount is given without `expiresAt`
|
|
123
|
+
* amount is given without `expiresAt` or `expiresIn`
|
|
118
124
|
*/
|
|
119
125
|
declare function createRaastP2PQr(options: RaastP2PQrOptions): string;
|
|
120
126
|
/**
|
|
@@ -139,5 +145,45 @@ declare function createMerchantQr(options: MerchantQrOptions): string;
|
|
|
139
145
|
* @returns Parsed details, or `null` if the payload is not a well-formed Pakistani QR code
|
|
140
146
|
*/
|
|
141
147
|
declare function parseRaastQr(payload: string): ParsedRaastQr | null;
|
|
148
|
+
/** A problem that stops a Raast QR from working or makes it unsafe to pay. */
|
|
149
|
+
type RaastQrError = 'not-a-raast-qr' | 'bad-checksum' | 'no-iban' | 'invalid-iban' | 'expired' | 'missing-expiry';
|
|
150
|
+
/** Something worth telling the payer, but which does not stop payment. */
|
|
151
|
+
type RaastQrWarning = 'amount-ignored' | 'expires-soon';
|
|
152
|
+
/** Result of {@link validateRaastQr}. */
|
|
153
|
+
interface RaastQrValidation {
|
|
154
|
+
/** `true` when there are no errors. */
|
|
155
|
+
valid: boolean;
|
|
156
|
+
errors: RaastQrError[];
|
|
157
|
+
warnings: RaastQrWarning[];
|
|
158
|
+
/** The parsed QR, or `null` if it could not be read. */
|
|
159
|
+
qr: ParsedRaastQr | null;
|
|
160
|
+
}
|
|
161
|
+
/** Options for {@link validateRaastQr}. */
|
|
162
|
+
interface ValidateRaastQrOptions {
|
|
163
|
+
/** The time to check expiry against. Defaults to now. */
|
|
164
|
+
now?: Date;
|
|
165
|
+
/** Warn when a QR expires within this many milliseconds. Defaults to 1 hour. */
|
|
166
|
+
expiresSoonMs?: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Checks whether a Raast QR code can be paid, e.g. before showing a payment
|
|
170
|
+
* screen or to warn about a tampered sticker.
|
|
171
|
+
*
|
|
172
|
+
* Errors: not a Pakistani payment QR, checksum mismatch (damaged or edited),
|
|
173
|
+
* no IBAN or an IBAN that fails its checksum, expired, or a fixed-amount QR
|
|
174
|
+
* without the expiry that banking apps require.
|
|
175
|
+
* Warnings: an amount in a static QR (apps ignore it, so the payer must type
|
|
176
|
+
* it), or a QR that expires soon (within an hour by default).
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* validateRaastQr(scannedText);
|
|
180
|
+
* // { valid: false, errors: ['expired'], warnings: [], qr: { ... } }
|
|
181
|
+
*
|
|
182
|
+
* @param payload - Text decoded from the QR code
|
|
183
|
+
* @param options - Time to check against and the "expires soon" window
|
|
184
|
+
* @returns Validation result with the parsed QR
|
|
185
|
+
*/
|
|
186
|
+
declare function validateRaastQr(payload: string, options?: ValidateRaastQrOptions): RaastQrValidation;
|
|
142
187
|
|
|
143
|
-
export {
|
|
188
|
+
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr };
|
|
189
|
+
export type { EmvField, MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastDuration, RaastP2PQrOptions, RaastQrError, RaastQrValidation, RaastQrWarning, ValidateRaastQrOptions };
|
package/dist/raast.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createMerchantQr, createRaastP2PQr, parseRaastQr } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './chunk-NZQ47NWD.js';
|
|
2
|
+
import './chunk-YPPKY5XZ.js';
|
|
3
3
|
import './chunk-ENQ7O7VW.js';
|
package/dist/tax.d.cts
CHANGED
|
@@ -44,4 +44,5 @@ declare function validateNTN(ntn: string): boolean;
|
|
|
44
44
|
*/
|
|
45
45
|
declare function validateSTRN(strn: string): boolean;
|
|
46
46
|
|
|
47
|
-
export {
|
|
47
|
+
export { analyzeNTN, validateNTN, validateSTRN };
|
|
48
|
+
export type { NTNInfo, NTNType };
|
package/dist/tax.d.ts
CHANGED
|
@@ -44,4 +44,5 @@ declare function validateNTN(ntn: string): boolean;
|
|
|
44
44
|
*/
|
|
45
45
|
declare function validateSTRN(strn: string): boolean;
|
|
46
46
|
|
|
47
|
-
export {
|
|
47
|
+
export { analyzeNTN, validateNTN, validateSTRN };
|
|
48
|
+
export type { NTNInfo, NTNType };
|
package/dist/valibot.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkGJENL6VK_cjs = require('./chunk-GJENL6VK.cjs');
|
|
4
|
+
require('./chunk-3ZA265SK.cjs');
|
|
5
|
+
require('./chunk-33FXHM2E.cjs');
|
|
6
|
+
require('./chunk-HTERSQGF.cjs');
|
|
7
|
+
require('./chunk-NTD4JLDW.cjs');
|
|
7
8
|
require('./chunk-H6M6L26S.cjs');
|
|
8
|
-
require('./chunk-YLWZGSFY.cjs');
|
|
9
9
|
require('./chunk-HTCSHHOR.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-3IARSCO6.cjs');
|
|
11
11
|
require('./chunk-VPBMIYO2.cjs');
|
|
12
12
|
var v = require('valibot');
|
|
13
13
|
|
|
@@ -32,7 +32,7 @@ function _interopNamespace(e) {
|
|
|
32
32
|
var v__namespace = /*#__PURE__*/_interopNamespace(v);
|
|
33
33
|
|
|
34
34
|
function schema(name) {
|
|
35
|
-
const rule =
|
|
35
|
+
const rule = chunkGJENL6VK_cjs.RULES[name];
|
|
36
36
|
return (options = {}) => v__namespace.pipe(v__namespace.string(), v__namespace.check(rule.test, options.message ?? rule.message));
|
|
37
37
|
}
|
|
38
38
|
var pk = {
|
package/dist/valibot.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RULES } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { RULES } from './chunk-HUQY2WR5.js';
|
|
2
|
+
import './chunk-RXNYY5K5.js';
|
|
3
|
+
import './chunk-PLDVGOKZ.js';
|
|
4
|
+
import './chunk-AZV45DMG.js';
|
|
5
|
+
import './chunk-6IPPANNX.js';
|
|
5
6
|
import './chunk-CEPNSHIC.js';
|
|
6
|
-
import './chunk-Y6BUGLXU.js';
|
|
7
7
|
import './chunk-EEVNLTB4.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-YPPKY5XZ.js';
|
|
9
9
|
import './chunk-ENQ7O7VW.js';
|
|
10
10
|
import * as v from 'valibot';
|
|
11
11
|
|
package/dist/whatsapp.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkNAJGGUAM_cjs = require('./chunk-NAJGGUAM.cjs');
|
|
4
|
+
require('./chunk-NTD4JLDW.cjs');
|
|
5
5
|
require('./chunk-VPBMIYO2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "createWhatsAppLink", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkNAJGGUAM_cjs.createWhatsAppLink; }
|
|
12
12
|
});
|
package/dist/whatsapp.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createWhatsAppLink } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { createWhatsAppLink } from './chunk-EMH4IP2U.js';
|
|
2
|
+
import './chunk-6IPPANNX.js';
|
|
3
3
|
import './chunk-ENQ7O7VW.js';
|
package/dist/words.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHIZQBWNW_cjs = require('./chunk-HIZQBWNW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "amountInWords", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkHIZQBWNW_cjs.amountInWords; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "numberToWords", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkHIZQBWNW_cjs.numberToWords; }
|
|
14
14
|
});
|
package/dist/words.d.cts
CHANGED
|
@@ -46,4 +46,5 @@ declare function numberToWords(n: number, options?: NumberToWordsOptions): strin
|
|
|
46
46
|
*/
|
|
47
47
|
declare function amountInWords(amount: number, options?: AmountInWordsOptions): string;
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { amountInWords, numberToWords };
|
|
50
|
+
export type { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage };
|
package/dist/words.d.ts
CHANGED
|
@@ -46,4 +46,5 @@ declare function numberToWords(n: number, options?: NumberToWordsOptions): strin
|
|
|
46
46
|
*/
|
|
47
47
|
declare function amountInWords(amount: number, options?: AmountInWordsOptions): string;
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { amountInWords, numberToWords };
|
|
50
|
+
export type { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage };
|
package/dist/words.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { amountInWords, numberToWords } from './chunk-
|
|
1
|
+
export { amountInWords, numberToWords } from './chunk-BR4QLZPX.js';
|
package/dist/yup.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkGJENL6VK_cjs = require('./chunk-GJENL6VK.cjs');
|
|
4
|
+
require('./chunk-3ZA265SK.cjs');
|
|
5
|
+
require('./chunk-33FXHM2E.cjs');
|
|
6
|
+
require('./chunk-HTERSQGF.cjs');
|
|
7
|
+
require('./chunk-NTD4JLDW.cjs');
|
|
7
8
|
require('./chunk-H6M6L26S.cjs');
|
|
8
|
-
require('./chunk-YLWZGSFY.cjs');
|
|
9
9
|
require('./chunk-HTCSHHOR.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-3IARSCO6.cjs');
|
|
11
11
|
require('./chunk-VPBMIYO2.cjs');
|
|
12
12
|
var yup = require('yup');
|
|
13
13
|
|
|
14
14
|
function schema(name) {
|
|
15
|
-
const rule =
|
|
15
|
+
const rule = chunkGJENL6VK_cjs.RULES[name];
|
|
16
16
|
return (options = {}) => yup.string().test(
|
|
17
17
|
`pk-${name}`,
|
|
18
18
|
options.message ?? rule.message,
|
package/dist/yup.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RULES } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { RULES } from './chunk-HUQY2WR5.js';
|
|
2
|
+
import './chunk-RXNYY5K5.js';
|
|
3
|
+
import './chunk-PLDVGOKZ.js';
|
|
4
|
+
import './chunk-AZV45DMG.js';
|
|
5
|
+
import './chunk-6IPPANNX.js';
|
|
5
6
|
import './chunk-CEPNSHIC.js';
|
|
6
|
-
import './chunk-Y6BUGLXU.js';
|
|
7
7
|
import './chunk-EEVNLTB4.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-YPPKY5XZ.js';
|
|
9
9
|
import './chunk-ENQ7O7VW.js';
|
|
10
10
|
import { string } from 'yup';
|
|
11
11
|
|
package/dist/zod.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkGJENL6VK_cjs = require('./chunk-GJENL6VK.cjs');
|
|
4
|
+
require('./chunk-3ZA265SK.cjs');
|
|
5
|
+
require('./chunk-33FXHM2E.cjs');
|
|
6
|
+
require('./chunk-HTERSQGF.cjs');
|
|
7
|
+
require('./chunk-NTD4JLDW.cjs');
|
|
7
8
|
require('./chunk-H6M6L26S.cjs');
|
|
8
|
-
require('./chunk-YLWZGSFY.cjs');
|
|
9
9
|
require('./chunk-HTCSHHOR.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-3IARSCO6.cjs');
|
|
11
11
|
require('./chunk-VPBMIYO2.cjs');
|
|
12
12
|
var zod = require('zod');
|
|
13
13
|
|
|
14
14
|
function schema(name) {
|
|
15
|
-
const rule =
|
|
15
|
+
const rule = chunkGJENL6VK_cjs.RULES[name];
|
|
16
16
|
return (options = {}) => zod.z.string().refine(rule.test, { message: options.message ?? rule.message });
|
|
17
17
|
}
|
|
18
18
|
var pk = {
|
package/dist/zod.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RULES } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { RULES } from './chunk-HUQY2WR5.js';
|
|
2
|
+
import './chunk-RXNYY5K5.js';
|
|
3
|
+
import './chunk-PLDVGOKZ.js';
|
|
4
|
+
import './chunk-AZV45DMG.js';
|
|
5
|
+
import './chunk-6IPPANNX.js';
|
|
5
6
|
import './chunk-CEPNSHIC.js';
|
|
6
|
-
import './chunk-Y6BUGLXU.js';
|
|
7
7
|
import './chunk-EEVNLTB4.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-YPPKY5XZ.js';
|
|
9
9
|
import './chunk-ENQ7O7VW.js';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pakdatakit",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Production-ready utility toolkit for Pakistani developers — CNIC, phone, WhatsApp, IBAN, postal codes, address parsing, Hijri dates, Roman Urdu, networks, geography, and formatting",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -90,6 +90,16 @@
|
|
|
90
90
|
"default": "./dist/iban.cjs"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
+
"./input": {
|
|
94
|
+
"import": {
|
|
95
|
+
"types": "./dist/input.d.ts",
|
|
96
|
+
"default": "./dist/input.js"
|
|
97
|
+
},
|
|
98
|
+
"require": {
|
|
99
|
+
"types": "./dist/input.d.cts",
|
|
100
|
+
"default": "./dist/input.cjs"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
93
103
|
"./networks": {
|
|
94
104
|
"import": {
|
|
95
105
|
"types": "./dist/networks.d.ts",
|
|
@@ -213,7 +223,8 @@
|
|
|
213
223
|
"./package.json": "./package.json"
|
|
214
224
|
},
|
|
215
225
|
"files": [
|
|
216
|
-
"dist"
|
|
226
|
+
"dist",
|
|
227
|
+
"DATA.md"
|
|
217
228
|
],
|
|
218
229
|
"sideEffects": false,
|
|
219
230
|
"scripts": {
|
|
@@ -227,7 +238,8 @@
|
|
|
227
238
|
"format": "prettier --write .",
|
|
228
239
|
"format:check": "prettier --check .",
|
|
229
240
|
"typecheck": "tsc --noEmit",
|
|
230
|
-
"prepublishOnly": "npm run lint && npm run typecheck && npm test && npm run build"
|
|
241
|
+
"prepublishOnly": "npm run lint && npm run typecheck && npm test && npm run build",
|
|
242
|
+
"docs": "typedoc && node scripts/generate-llms.mjs"
|
|
231
243
|
},
|
|
232
244
|
"keywords": [
|
|
233
245
|
"pakistan",
|
|
@@ -274,19 +286,20 @@
|
|
|
274
286
|
"node": ">=20"
|
|
275
287
|
},
|
|
276
288
|
"devDependencies": {
|
|
277
|
-
"@eslint/js": "^
|
|
278
|
-
"@types/node": "^
|
|
279
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
280
|
-
"@typescript-eslint/parser": "^8.
|
|
281
|
-
"eslint": "^
|
|
289
|
+
"@eslint/js": "^10.0.1",
|
|
290
|
+
"@types/node": "^26.6.5",
|
|
291
|
+
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
|
292
|
+
"@typescript-eslint/parser": "^8.72.0",
|
|
293
|
+
"eslint": "^10.13.0",
|
|
282
294
|
"eslint-config-prettier": "^10.1.5",
|
|
283
295
|
"globals": "^17.6.0",
|
|
284
296
|
"libphonenumber-js": "^1.13.15",
|
|
285
|
-
"prettier": "^3.
|
|
286
|
-
"tsup": "^
|
|
297
|
+
"prettier": "^3.9.10",
|
|
298
|
+
"tsup": "^9.0.0",
|
|
299
|
+
"typedoc": "^0.28.20",
|
|
287
300
|
"typescript": "^5.8.3",
|
|
288
301
|
"valibot": "^1.5.0",
|
|
289
|
-
"vitest": "^
|
|
302
|
+
"vitest": "^5.0.5",
|
|
290
303
|
"yup": "^1.7.1",
|
|
291
304
|
"zod": "^4.6.7"
|
|
292
305
|
},
|