pakdatakit 2.6.0 → 2.7.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 +83 -7
- package/README.md +48 -14
- package/dist/{chunk-LQHM3ADX.js → chunk-33JPVN33.js} +11 -6
- package/dist/{chunk-YSRYWZCQ.cjs → chunk-36K225SE.cjs} +9 -9
- package/dist/{chunk-CEPNSHIC.js → chunk-3OCMTNQ7.js} +1 -1
- package/dist/{chunk-YDUXIENX.cjs → chunk-4YLSPXBZ.cjs} +2 -2
- package/dist/{chunk-2OBKPYJZ.cjs → chunk-6AIN4FKB.cjs} +12 -4
- package/dist/chunk-7NTUEHQV.cjs +69 -0
- package/dist/{chunk-KRYHLYN2.js → chunk-BATPA7GN.js} +12 -4
- package/dist/chunk-CKCOK6X4.js +64 -0
- package/dist/{chunk-7DY26QPN.js → chunk-CRYCAMWC.js} +1 -1
- package/dist/{chunk-TVL6RDAU.cjs → chunk-EGF4CINK.cjs} +2 -2
- package/dist/{chunk-XVEG53NN.cjs → chunk-GOGEMCGG.cjs} +84 -0
- package/dist/{chunk-QG5T7YQ5.js → chunk-OYQJQE5R.js} +5 -5
- package/dist/{chunk-5RGX4DWF.js → chunk-SGGQ6XB2.js} +46 -14
- package/dist/{chunk-UYFTXD4P.js → chunk-T6K46DGW.js} +1 -1
- package/dist/{chunk-AUQFA7EE.cjs → chunk-VSIVT5RT.cjs} +11 -6
- package/dist/{chunk-H6M6L26S.cjs → chunk-VZIBHQC7.cjs} +2 -2
- package/dist/{chunk-EA3SIHYT.js → chunk-WYNM5ZWY.js} +84 -1
- package/dist/{chunk-5DDHO5Z7.cjs → chunk-XWGSREI5.cjs} +46 -14
- package/dist/class-validator.cjs +13 -8
- package/dist/class-validator.d.cts +5 -2
- package/dist/class-validator.d.ts +5 -2
- package/dist/class-validator.js +12 -7
- package/dist/cli.js +1 -1
- package/dist/cnic.cjs +11 -3
- package/dist/cnic.d.cts +80 -3
- package/dist/cnic.d.ts +80 -3
- package/dist/cnic.js +1 -1
- package/dist/incometax.cjs +6 -6
- package/dist/incometax.d.cts +51 -7
- package/dist/incometax.d.ts +51 -7
- package/dist/incometax.js +1 -1
- package/dist/index.cjs +56 -44
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +9 -9
- package/dist/input.cjs +8 -8
- package/dist/input.js +2 -2
- package/dist/joi.cjs +7 -7
- package/dist/joi.d.cts +1 -1
- package/dist/joi.d.ts +1 -1
- package/dist/joi.js +6 -6
- package/dist/numbers.cjs +5 -5
- package/dist/numbers.d.cts +28 -5
- package/dist/numbers.d.ts +28 -5
- package/dist/numbers.js +1 -1
- package/dist/quality.cjs +5 -5
- package/dist/quality.js +2 -2
- package/dist/raast.cjs +5 -5
- package/dist/raast.d.cts +17 -6
- package/dist/raast.d.ts +17 -6
- package/dist/raast.js +1 -1
- package/dist/{rules-GxgPiVws.d.cts → rules-GEELAOfb.d.cts} +5 -0
- package/dist/{rules-GxgPiVws.d.ts → rules-GEELAOfb.d.ts} +5 -0
- package/dist/superstruct.cjs +7 -7
- package/dist/superstruct.d.cts +1 -1
- package/dist/superstruct.d.ts +1 -1
- package/dist/superstruct.js +6 -6
- package/dist/tax.cjs +5 -5
- package/dist/tax.d.cts +8 -2
- package/dist/tax.d.ts +8 -2
- package/dist/tax.js +2 -2
- package/dist/text.cjs +13 -9
- package/dist/text.d.cts +40 -4
- package/dist/text.d.ts +40 -4
- package/dist/text.js +1 -1
- package/dist/valibot.cjs +13 -7
- package/dist/valibot.d.cts +1 -1
- package/dist/valibot.d.ts +1 -1
- package/dist/valibot.js +12 -6
- package/dist/words.d.cts +4 -1
- package/dist/words.d.ts +4 -1
- package/dist/yup.cjs +7 -7
- package/dist/yup.d.cts +1 -1
- package/dist/yup.d.ts +1 -1
- package/dist/yup.js +6 -6
- package/dist/zod.cjs +9 -7
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.ts +1 -1
- package/dist/zod.js +8 -6
- package/package.json +1 -1
- package/dist/chunk-EEVNLTB4.js +0 -32
- package/dist/chunk-HTCSHHOR.cjs +0 -35
package/dist/quality.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk4YLSPXBZ_cjs = require('./chunk-4YLSPXBZ.cjs');
|
|
4
|
+
require('./chunk-VSIVT5RT.cjs');
|
|
5
5
|
require('./chunk-YTLE5K7G.cjs');
|
|
6
6
|
require('./chunk-QFPEFD67.cjs');
|
|
7
7
|
require('./chunk-I7UUPD3G.cjs');
|
|
@@ -13,13 +13,13 @@ require('./chunk-VPBMIYO2.cjs');
|
|
|
13
13
|
|
|
14
14
|
Object.defineProperty(exports, "ADDRESS_WEIGHTS", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk4YLSPXBZ_cjs.ADDRESS_WEIGHTS; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "phoneRiskSignals", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunk4YLSPXBZ_cjs.phoneRiskSignals; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "scoreAddress", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunk4YLSPXBZ_cjs.scoreAddress; }
|
|
25
25
|
});
|
package/dist/quality.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ADDRESS_WEIGHTS, phoneRiskSignals, scoreAddress } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { ADDRESS_WEIGHTS, phoneRiskSignals, scoreAddress } from './chunk-T6K46DGW.js';
|
|
2
|
+
import './chunk-33JPVN33.js';
|
|
3
3
|
import './chunk-P7LVE2TF.js';
|
|
4
4
|
import './chunk-B7DOQ5QF.js';
|
|
5
5
|
import './chunk-33QMFE2Z.js';
|
package/dist/raast.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6AIN4FKB_cjs = require('./chunk-6AIN4FKB.cjs');
|
|
4
4
|
require('./chunk-DHOP7LQX.cjs');
|
|
5
5
|
require('./chunk-VPBMIYO2.cjs');
|
|
6
6
|
|
|
@@ -8,17 +8,17 @@ require('./chunk-VPBMIYO2.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "createMerchantQr", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk6AIN4FKB_cjs.createMerchantQr; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "createRaastP2PQr", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk6AIN4FKB_cjs.createRaastP2PQr; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "parseRaastQr", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk6AIN4FKB_cjs.parseRaastQr; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "validateRaastQr", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk6AIN4FKB_cjs.validateRaastQr; }
|
|
24
24
|
});
|
package/dist/raast.d.cts
CHANGED
|
@@ -147,12 +147,21 @@ declare function createMerchantQr(options: MerchantQrOptions): string;
|
|
|
147
147
|
declare function parseRaastQr(payload: string): ParsedRaastQr | null;
|
|
148
148
|
/** A problem that stops a Raast QR from working or makes it unsafe to pay. */
|
|
149
149
|
type RaastQrError = 'not-a-raast-qr' | 'bad-checksum' | 'no-iban' | 'invalid-iban' | 'expired' | 'missing-expiry';
|
|
150
|
-
/**
|
|
151
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Something worth telling the payer, but which does not stop payment.
|
|
152
|
+
* `no-iban`: a merchant QR that names no IBAN; it pays through the
|
|
153
|
+
* merchant's own scheme, so the payee can't be checked from the QR.
|
|
154
|
+
*/
|
|
155
|
+
type RaastQrWarning = 'amount-ignored' | 'expires-soon' | 'no-iban';
|
|
152
156
|
/** Result of {@link validateRaastQr}. */
|
|
153
157
|
interface RaastQrValidation {
|
|
154
158
|
/** `true` when there are no errors. */
|
|
155
159
|
valid: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* `p2p` for a person-to-person QR, `merchant` for a merchant QR, `null`
|
|
162
|
+
* when the text is not a Raast QR.
|
|
163
|
+
*/
|
|
164
|
+
kind: 'p2p' | 'merchant' | null;
|
|
156
165
|
errors: RaastQrError[];
|
|
157
166
|
warnings: RaastQrWarning[];
|
|
158
167
|
/** The parsed QR, or `null` if it could not be read. */
|
|
@@ -170,14 +179,16 @@ interface ValidateRaastQrOptions {
|
|
|
170
179
|
* screen or to warn about a tampered sticker.
|
|
171
180
|
*
|
|
172
181
|
* Errors: not a Pakistani payment QR, checksum mismatch (damaged or edited),
|
|
173
|
-
* no IBAN
|
|
174
|
-
* without the expiry that banking apps require.
|
|
182
|
+
* a person-to-person QR with no IBAN, an IBAN that fails its checksum,
|
|
183
|
+
* expired, or a fixed-amount QR without the expiry that banking apps require.
|
|
175
184
|
* Warnings: an amount in a static QR (apps ignore it, so the payer must type
|
|
176
|
-
* it),
|
|
185
|
+
* it), a QR that expires soon (within an hour by default), or a merchant QR
|
|
186
|
+
* with no IBAN (`no-iban`): merchant QRs may pay through the merchant's own
|
|
187
|
+
* scheme, so it is valid, but the payee can't be checked from the QR.
|
|
177
188
|
*
|
|
178
189
|
* @example
|
|
179
190
|
* validateRaastQr(scannedText);
|
|
180
|
-
* // { valid: false, errors: ['expired'], warnings: [], qr: { ... } }
|
|
191
|
+
* // { valid: false, kind: 'p2p', errors: ['expired'], warnings: [], qr: { ... } }
|
|
181
192
|
*
|
|
182
193
|
* @param payload - Text decoded from the QR code
|
|
183
194
|
* @param options - Time to check against and the "expires soon" window
|
package/dist/raast.d.ts
CHANGED
|
@@ -147,12 +147,21 @@ declare function createMerchantQr(options: MerchantQrOptions): string;
|
|
|
147
147
|
declare function parseRaastQr(payload: string): ParsedRaastQr | null;
|
|
148
148
|
/** A problem that stops a Raast QR from working or makes it unsafe to pay. */
|
|
149
149
|
type RaastQrError = 'not-a-raast-qr' | 'bad-checksum' | 'no-iban' | 'invalid-iban' | 'expired' | 'missing-expiry';
|
|
150
|
-
/**
|
|
151
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Something worth telling the payer, but which does not stop payment.
|
|
152
|
+
* `no-iban`: a merchant QR that names no IBAN; it pays through the
|
|
153
|
+
* merchant's own scheme, so the payee can't be checked from the QR.
|
|
154
|
+
*/
|
|
155
|
+
type RaastQrWarning = 'amount-ignored' | 'expires-soon' | 'no-iban';
|
|
152
156
|
/** Result of {@link validateRaastQr}. */
|
|
153
157
|
interface RaastQrValidation {
|
|
154
158
|
/** `true` when there are no errors. */
|
|
155
159
|
valid: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* `p2p` for a person-to-person QR, `merchant` for a merchant QR, `null`
|
|
162
|
+
* when the text is not a Raast QR.
|
|
163
|
+
*/
|
|
164
|
+
kind: 'p2p' | 'merchant' | null;
|
|
156
165
|
errors: RaastQrError[];
|
|
157
166
|
warnings: RaastQrWarning[];
|
|
158
167
|
/** The parsed QR, or `null` if it could not be read. */
|
|
@@ -170,14 +179,16 @@ interface ValidateRaastQrOptions {
|
|
|
170
179
|
* screen or to warn about a tampered sticker.
|
|
171
180
|
*
|
|
172
181
|
* Errors: not a Pakistani payment QR, checksum mismatch (damaged or edited),
|
|
173
|
-
* no IBAN
|
|
174
|
-
* without the expiry that banking apps require.
|
|
182
|
+
* a person-to-person QR with no IBAN, an IBAN that fails its checksum,
|
|
183
|
+
* expired, or a fixed-amount QR without the expiry that banking apps require.
|
|
175
184
|
* Warnings: an amount in a static QR (apps ignore it, so the payer must type
|
|
176
|
-
* it),
|
|
185
|
+
* it), a QR that expires soon (within an hour by default), or a merchant QR
|
|
186
|
+
* with no IBAN (`no-iban`): merchant QRs may pay through the merchant's own
|
|
187
|
+
* scheme, so it is valid, but the payee can't be checked from the QR.
|
|
177
188
|
*
|
|
178
189
|
* @example
|
|
179
190
|
* validateRaastQr(scannedText);
|
|
180
|
-
* // { valid: false, errors: ['expired'], warnings: [], qr: { ... } }
|
|
191
|
+
* // { valid: false, kind: 'p2p', errors: ['expired'], warnings: [], qr: { ... } }
|
|
181
192
|
*
|
|
182
193
|
* @param payload - Text decoded from the QR code
|
|
183
194
|
* @param options - Time to check against and the "expires soon" window
|
package/dist/raast.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './chunk-
|
|
1
|
+
export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './chunk-BATPA7GN.js';
|
|
2
2
|
import './chunk-IBZPJS4H.js';
|
|
3
3
|
import './chunk-ENQ7O7VW.js';
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
interface AdapterOptions {
|
|
3
3
|
/** Error message to show instead of the default. */
|
|
4
4
|
message?: string;
|
|
5
|
+
/**
|
|
6
|
+
* `landline()` only: also accept UAN, toll-free and premium-rate numbers
|
|
7
|
+
* (see `validateLandline`). Ignored by the other checks.
|
|
8
|
+
*/
|
|
9
|
+
services?: boolean;
|
|
5
10
|
}
|
|
6
11
|
|
|
7
12
|
export type { AdapterOptions as A };
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
interface AdapterOptions {
|
|
3
3
|
/** Error message to show instead of the default. */
|
|
4
4
|
message?: string;
|
|
5
|
+
/**
|
|
6
|
+
* `landline()` only: also accept UAN, toll-free and premium-rate numbers
|
|
7
|
+
* (see `validateLandline`). Ignored by the other checks.
|
|
8
|
+
*/
|
|
9
|
+
services?: boolean;
|
|
5
10
|
}
|
|
6
11
|
|
|
7
12
|
export type { AdapterOptions as A };
|
package/dist/superstruct.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk36K225SE_cjs = require('./chunk-36K225SE.cjs');
|
|
4
4
|
require('./chunk-ESKXG7Y6.cjs');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-4YLSPXBZ.cjs');
|
|
6
|
+
require('./chunk-VZIBHQC7.cjs');
|
|
7
7
|
require('./chunk-SQIHFEXI.cjs');
|
|
8
8
|
require('./chunk-DHOP7LQX.cjs');
|
|
9
9
|
require('./chunk-MTS6SVNP.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-VSIVT5RT.cjs');
|
|
11
11
|
require('./chunk-YTLE5K7G.cjs');
|
|
12
12
|
require('./chunk-7E7L3NYS.cjs');
|
|
13
13
|
require('./chunk-QFPEFD67.cjs');
|
|
14
14
|
require('./chunk-I7UUPD3G.cjs');
|
|
15
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-7NTUEHQV.cjs');
|
|
16
16
|
require('./chunk-NLSIAPZG.cjs');
|
|
17
17
|
require('./chunk-33GOK7EE.cjs');
|
|
18
18
|
require('./chunk-E6GWBOKV.cjs');
|
|
@@ -20,11 +20,11 @@ require('./chunk-VPBMIYO2.cjs');
|
|
|
20
20
|
var superstruct = require('superstruct');
|
|
21
21
|
|
|
22
22
|
function schema(name) {
|
|
23
|
-
const rule =
|
|
23
|
+
const rule = chunk36K225SE_cjs.RULES[name];
|
|
24
24
|
return (options = {}) => superstruct.refine(
|
|
25
25
|
superstruct.string(),
|
|
26
26
|
`pk-${name}`,
|
|
27
|
-
(value) => rule.test(value) || (options.message ?? rule.message)
|
|
27
|
+
(value) => rule.test(value, options) || (options.message ?? rule.message)
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
var pk = {
|
package/dist/superstruct.d.cts
CHANGED
package/dist/superstruct.d.ts
CHANGED
package/dist/superstruct.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { RULES } from './chunk-
|
|
1
|
+
import { RULES } from './chunk-OYQJQE5R.js';
|
|
2
2
|
import './chunk-S274QFFB.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-T6K46DGW.js';
|
|
4
|
+
import './chunk-3OCMTNQ7.js';
|
|
5
5
|
import './chunk-RZQJAZKC.js';
|
|
6
6
|
import './chunk-IBZPJS4H.js';
|
|
7
7
|
import './chunk-V2XE3NCG.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-33JPVN33.js';
|
|
9
9
|
import './chunk-P7LVE2TF.js';
|
|
10
10
|
import './chunk-E6HSKRAE.js';
|
|
11
11
|
import './chunk-B7DOQ5QF.js';
|
|
12
12
|
import './chunk-33QMFE2Z.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-CKCOK6X4.js';
|
|
14
14
|
import './chunk-NDW52ZK3.js';
|
|
15
15
|
import './chunk-XOTCIXY6.js';
|
|
16
16
|
import './chunk-E2XU6NOW.js';
|
|
@@ -22,7 +22,7 @@ function schema(name) {
|
|
|
22
22
|
return (options = {}) => refine(
|
|
23
23
|
string(),
|
|
24
24
|
`pk-${name}`,
|
|
25
|
-
(value) => rule.test(value) || (options.message ?? rule.message)
|
|
25
|
+
(value) => rule.test(value, options) || (options.message ?? rule.message)
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
var pk = {
|
package/dist/tax.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkVZIBHQC7_cjs = require('./chunk-VZIBHQC7.cjs');
|
|
4
|
+
require('./chunk-7NTUEHQV.cjs');
|
|
5
5
|
require('./chunk-VPBMIYO2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "analyzeNTN", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkVZIBHQC7_cjs.analyzeNTN; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "validateNTN", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkVZIBHQC7_cjs.validateNTN; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "validateSTRN", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkVZIBHQC7_cjs.validateSTRN; }
|
|
20
20
|
});
|
package/dist/tax.d.cts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Kind of taxpayer an NTN belongs to: `individual` when the NTN is a 13-digit
|
|
3
|
+
* CNIC, `business` for a company's or association's 7-digit NTN.
|
|
4
|
+
*/
|
|
2
5
|
type NTNType = 'individual' | 'business';
|
|
3
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* What {@link analyzeNTN} reads from a National Tax Number: the kind of
|
|
8
|
+
* taxpayer, the digits and the usual display form.
|
|
9
|
+
*/
|
|
4
10
|
interface NTNInfo {
|
|
5
11
|
/** `individual` when the NTN is a CNIC; `business` for a 7-digit company/AOP NTN. */
|
|
6
12
|
type: NTNType;
|
package/dist/tax.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Kind of taxpayer an NTN belongs to: `individual` when the NTN is a 13-digit
|
|
3
|
+
* CNIC, `business` for a company's or association's 7-digit NTN.
|
|
4
|
+
*/
|
|
2
5
|
type NTNType = 'individual' | 'business';
|
|
3
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* What {@link analyzeNTN} reads from a National Tax Number: the kind of
|
|
8
|
+
* taxpayer, the digits and the usual display form.
|
|
9
|
+
*/
|
|
4
10
|
interface NTNInfo {
|
|
5
11
|
/** `individual` when the NTN is a CNIC; `business` for a 7-digit company/AOP NTN. */
|
|
6
12
|
type: NTNType;
|
package/dist/tax.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { analyzeNTN, validateNTN, validateSTRN } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { analyzeNTN, validateNTN, validateSTRN } from './chunk-3OCMTNQ7.js';
|
|
2
|
+
import './chunk-CKCOK6X4.js';
|
|
3
3
|
import './chunk-ENQ7O7VW.js';
|
package/dist/text.cjs
CHANGED
|
@@ -1,39 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGOGEMCGG_cjs = require('./chunk-GOGEMCGG.cjs');
|
|
4
4
|
require('./chunk-VPBMIYO2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "compareUrdu", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkGOGEMCGG_cjs.compareUrdu; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "isRTL", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkGOGEMCGG_cjs.isRTL; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "normalizeRomanUrdu", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkGOGEMCGG_cjs.normalizeRomanUrdu; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "normalizeText", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkGOGEMCGG_cjs.normalizeText; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "romanUrduKey", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkGOGEMCGG_cjs.romanUrduKey; }
|
|
23
27
|
});
|
|
24
28
|
Object.defineProperty(exports, "slugify", {
|
|
25
29
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkGOGEMCGG_cjs.slugify; }
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports, "toEnglishDigits", {
|
|
29
33
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkGOGEMCGG_cjs.toEnglishDigits; }
|
|
31
35
|
});
|
|
32
36
|
Object.defineProperty(exports, "toUrduDigits", {
|
|
33
37
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkGOGEMCGG_cjs.toUrduDigits; }
|
|
35
39
|
});
|
|
36
40
|
Object.defineProperty(exports, "wrapBidi", {
|
|
37
41
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkGOGEMCGG_cjs.wrapBidi; }
|
|
39
43
|
});
|
package/dist/text.d.cts
CHANGED
|
@@ -30,9 +30,15 @@ declare function toUrduDigits(text: string): string;
|
|
|
30
30
|
* @returns Text with English digits
|
|
31
31
|
*/
|
|
32
32
|
declare function toEnglishDigits(text: string): string;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Which letters {@link slugify} keeps in a URL slug: `any` (Latin and Urdu),
|
|
35
|
+
* `latin` (a-z only) or `urdu` (Urdu letters only).
|
|
36
|
+
*/
|
|
34
37
|
type SlugScript = 'any' | 'latin' | 'urdu';
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Options for {@link slugify}: which script's letters to keep in the slug.
|
|
40
|
+
* Digits are always kept, converted to 0-9.
|
|
41
|
+
*/
|
|
36
42
|
interface SlugifyOptions {
|
|
37
43
|
/**
|
|
38
44
|
* `any` (default) keeps Latin and Urdu letters, `latin` keeps only `a-z`,
|
|
@@ -100,7 +106,10 @@ declare function compareUrdu(a: string, b: string): -1 | 0 | 1;
|
|
|
100
106
|
* Never throws.
|
|
101
107
|
*/
|
|
102
108
|
declare function isRTL(text: string): boolean;
|
|
103
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Direction for {@link wrapBidi}: `auto` follows the first strong letter,
|
|
111
|
+
* `rtl` and `ltr` force right-to-left or left-to-right.
|
|
112
|
+
*/
|
|
104
113
|
type BidiDirection = 'auto' | 'rtl' | 'ltr';
|
|
105
114
|
/**
|
|
106
115
|
* Wraps text in Unicode directional isolates, so a name or number in one
|
|
@@ -118,6 +127,33 @@ type BidiDirection = 'auto' | 'rtl' | 'ltr';
|
|
|
118
127
|
* throws.
|
|
119
128
|
*/
|
|
120
129
|
declare function wrapBidi(text: string, direction?: BidiDirection): string;
|
|
130
|
+
/**
|
|
131
|
+
* A phonetic key for Roman Urdu, so that different spellings of the same
|
|
132
|
+
* name or word match: `Mubeen` and `Mobeen`, `Muhammad`, `Mohammad` and
|
|
133
|
+
* `Muhammed`, `Rehman` and `Rahman`, `Chaudhry`, `Chaudhary` and `Chaudhery`.
|
|
134
|
+
* Compare keys, not the text.
|
|
135
|
+
*
|
|
136
|
+
* Each word keeps its consonants, its first vowel sound and a vowel sound at
|
|
137
|
+
* its end. Letters for one sound are merged (`kh`, `sh`, `ch`; `ph` and `f`;
|
|
138
|
+
* `q`, `c` and `k`; `v` and `w`; `th` and `t`, `dh` and `d`), doubled letters
|
|
139
|
+
* count once, `e` counts as `a`, `o` as `u`, and a final `h` after a vowel is
|
|
140
|
+
* dropped. Accents are removed and anything other than Latin letters splits
|
|
141
|
+
* words. The key is not meant to be shown: it is an opaque string.
|
|
142
|
+
*
|
|
143
|
+
* Different names can share a key (`Hamid` and `Hamad`), so treat a match as
|
|
144
|
+
* "probably the same", not proof. {@link normalizeRomanUrdu} is a different
|
|
145
|
+
* tool: it rewrites informal spellings into readable text.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* romanUrduKey('Mubeen') === romanUrduKey('Mobeen'); // true
|
|
149
|
+
* romanUrduKey('Muhammad Rehman'); // 'muhmd rahmn'
|
|
150
|
+
* romanUrduKey('Hussain') === romanUrduKey('Hassan'); // false
|
|
151
|
+
*
|
|
152
|
+
* @param text - A name or other Roman Urdu text
|
|
153
|
+
* @returns The key, one part per word separated by spaces; `''` for text
|
|
154
|
+
* with no Latin letters or a value that is not a string. Never throws.
|
|
155
|
+
*/
|
|
156
|
+
declare function romanUrduKey(text: string): string;
|
|
121
157
|
|
|
122
|
-
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, slugify, toEnglishDigits, toUrduDigits, wrapBidi };
|
|
158
|
+
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, romanUrduKey, slugify, toEnglishDigits, toUrduDigits, wrapBidi };
|
|
123
159
|
export type { BidiDirection, SlugScript, SlugifyOptions };
|
package/dist/text.d.ts
CHANGED
|
@@ -30,9 +30,15 @@ declare function toUrduDigits(text: string): string;
|
|
|
30
30
|
* @returns Text with English digits
|
|
31
31
|
*/
|
|
32
32
|
declare function toEnglishDigits(text: string): string;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Which letters {@link slugify} keeps in a URL slug: `any` (Latin and Urdu),
|
|
35
|
+
* `latin` (a-z only) or `urdu` (Urdu letters only).
|
|
36
|
+
*/
|
|
34
37
|
type SlugScript = 'any' | 'latin' | 'urdu';
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Options for {@link slugify}: which script's letters to keep in the slug.
|
|
40
|
+
* Digits are always kept, converted to 0-9.
|
|
41
|
+
*/
|
|
36
42
|
interface SlugifyOptions {
|
|
37
43
|
/**
|
|
38
44
|
* `any` (default) keeps Latin and Urdu letters, `latin` keeps only `a-z`,
|
|
@@ -100,7 +106,10 @@ declare function compareUrdu(a: string, b: string): -1 | 0 | 1;
|
|
|
100
106
|
* Never throws.
|
|
101
107
|
*/
|
|
102
108
|
declare function isRTL(text: string): boolean;
|
|
103
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Direction for {@link wrapBidi}: `auto` follows the first strong letter,
|
|
111
|
+
* `rtl` and `ltr` force right-to-left or left-to-right.
|
|
112
|
+
*/
|
|
104
113
|
type BidiDirection = 'auto' | 'rtl' | 'ltr';
|
|
105
114
|
/**
|
|
106
115
|
* Wraps text in Unicode directional isolates, so a name or number in one
|
|
@@ -118,6 +127,33 @@ type BidiDirection = 'auto' | 'rtl' | 'ltr';
|
|
|
118
127
|
* throws.
|
|
119
128
|
*/
|
|
120
129
|
declare function wrapBidi(text: string, direction?: BidiDirection): string;
|
|
130
|
+
/**
|
|
131
|
+
* A phonetic key for Roman Urdu, so that different spellings of the same
|
|
132
|
+
* name or word match: `Mubeen` and `Mobeen`, `Muhammad`, `Mohammad` and
|
|
133
|
+
* `Muhammed`, `Rehman` and `Rahman`, `Chaudhry`, `Chaudhary` and `Chaudhery`.
|
|
134
|
+
* Compare keys, not the text.
|
|
135
|
+
*
|
|
136
|
+
* Each word keeps its consonants, its first vowel sound and a vowel sound at
|
|
137
|
+
* its end. Letters for one sound are merged (`kh`, `sh`, `ch`; `ph` and `f`;
|
|
138
|
+
* `q`, `c` and `k`; `v` and `w`; `th` and `t`, `dh` and `d`), doubled letters
|
|
139
|
+
* count once, `e` counts as `a`, `o` as `u`, and a final `h` after a vowel is
|
|
140
|
+
* dropped. Accents are removed and anything other than Latin letters splits
|
|
141
|
+
* words. The key is not meant to be shown: it is an opaque string.
|
|
142
|
+
*
|
|
143
|
+
* Different names can share a key (`Hamid` and `Hamad`), so treat a match as
|
|
144
|
+
* "probably the same", not proof. {@link normalizeRomanUrdu} is a different
|
|
145
|
+
* tool: it rewrites informal spellings into readable text.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* romanUrduKey('Mubeen') === romanUrduKey('Mobeen'); // true
|
|
149
|
+
* romanUrduKey('Muhammad Rehman'); // 'muhmd rahmn'
|
|
150
|
+
* romanUrduKey('Hussain') === romanUrduKey('Hassan'); // false
|
|
151
|
+
*
|
|
152
|
+
* @param text - A name or other Roman Urdu text
|
|
153
|
+
* @returns The key, one part per word separated by spaces; `''` for text
|
|
154
|
+
* with no Latin letters or a value that is not a string. Never throws.
|
|
155
|
+
*/
|
|
156
|
+
declare function romanUrduKey(text: string): string;
|
|
121
157
|
|
|
122
|
-
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, slugify, toEnglishDigits, toUrduDigits, wrapBidi };
|
|
158
|
+
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, romanUrduKey, slugify, toEnglishDigits, toUrduDigits, wrapBidi };
|
|
123
159
|
export type { BidiDirection, SlugScript, SlugifyOptions };
|
package/dist/text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, slugify, toEnglishDigits, toUrduDigits, wrapBidi } from './chunk-
|
|
1
|
+
export { compareUrdu, isRTL, normalizeRomanUrdu, normalizeText, romanUrduKey, slugify, toEnglishDigits, toUrduDigits, wrapBidi } from './chunk-WYNM5ZWY.js';
|
|
2
2
|
import './chunk-ENQ7O7VW.js';
|
package/dist/valibot.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk36K225SE_cjs = require('./chunk-36K225SE.cjs');
|
|
4
4
|
require('./chunk-ESKXG7Y6.cjs');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-4YLSPXBZ.cjs');
|
|
6
|
+
require('./chunk-VZIBHQC7.cjs');
|
|
7
7
|
require('./chunk-SQIHFEXI.cjs');
|
|
8
8
|
require('./chunk-DHOP7LQX.cjs');
|
|
9
9
|
require('./chunk-MTS6SVNP.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-VSIVT5RT.cjs');
|
|
11
11
|
require('./chunk-YTLE5K7G.cjs');
|
|
12
12
|
require('./chunk-7E7L3NYS.cjs');
|
|
13
13
|
require('./chunk-QFPEFD67.cjs');
|
|
14
14
|
require('./chunk-I7UUPD3G.cjs');
|
|
15
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-7NTUEHQV.cjs');
|
|
16
16
|
require('./chunk-NLSIAPZG.cjs');
|
|
17
17
|
require('./chunk-33GOK7EE.cjs');
|
|
18
18
|
require('./chunk-E6GWBOKV.cjs');
|
|
@@ -40,8 +40,14 @@ function _interopNamespace(e) {
|
|
|
40
40
|
var v__namespace = /*#__PURE__*/_interopNamespace(v);
|
|
41
41
|
|
|
42
42
|
function schema(name) {
|
|
43
|
-
const rule =
|
|
44
|
-
return (options = {}) => v__namespace.pipe(
|
|
43
|
+
const rule = chunk36K225SE_cjs.RULES[name];
|
|
44
|
+
return (options = {}) => v__namespace.pipe(
|
|
45
|
+
v__namespace.string(),
|
|
46
|
+
v__namespace.check(
|
|
47
|
+
(value) => rule.test(value, options),
|
|
48
|
+
options.message ?? rule.message
|
|
49
|
+
)
|
|
50
|
+
);
|
|
45
51
|
}
|
|
46
52
|
var pk = {
|
|
47
53
|
cnic: schema("cnic"),
|
package/dist/valibot.d.cts
CHANGED
package/dist/valibot.d.ts
CHANGED
package/dist/valibot.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { RULES } from './chunk-
|
|
1
|
+
import { RULES } from './chunk-OYQJQE5R.js';
|
|
2
2
|
import './chunk-S274QFFB.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-T6K46DGW.js';
|
|
4
|
+
import './chunk-3OCMTNQ7.js';
|
|
5
5
|
import './chunk-RZQJAZKC.js';
|
|
6
6
|
import './chunk-IBZPJS4H.js';
|
|
7
7
|
import './chunk-V2XE3NCG.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-33JPVN33.js';
|
|
9
9
|
import './chunk-P7LVE2TF.js';
|
|
10
10
|
import './chunk-E6HSKRAE.js';
|
|
11
11
|
import './chunk-B7DOQ5QF.js';
|
|
12
12
|
import './chunk-33QMFE2Z.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-CKCOK6X4.js';
|
|
14
14
|
import './chunk-NDW52ZK3.js';
|
|
15
15
|
import './chunk-XOTCIXY6.js';
|
|
16
16
|
import './chunk-E2XU6NOW.js';
|
|
@@ -19,7 +19,13 @@ import * as v from 'valibot';
|
|
|
19
19
|
|
|
20
20
|
function schema(name) {
|
|
21
21
|
const rule = RULES[name];
|
|
22
|
-
return (options = {}) => v.pipe(
|
|
22
|
+
return (options = {}) => v.pipe(
|
|
23
|
+
v.string(),
|
|
24
|
+
v.check(
|
|
25
|
+
(value) => rule.test(value, options),
|
|
26
|
+
options.message ?? rule.message
|
|
27
|
+
)
|
|
28
|
+
);
|
|
23
29
|
}
|
|
24
30
|
var pk = {
|
|
25
31
|
cnic: schema("cnic"),
|
package/dist/words.d.cts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Language for numbers and amounts in words: `'en'` for English with lakh and
|
|
3
|
+
* crore, `'ur'` for Urdu script.
|
|
4
|
+
*/
|
|
2
5
|
type WordsLanguage = 'en' | 'ur';
|
|
3
6
|
/** Options for {@link numberToWords}. */
|
|
4
7
|
interface NumberToWordsOptions {
|
package/dist/words.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Language for numbers and amounts in words: `'en'` for English with lakh and
|
|
3
|
+
* crore, `'ur'` for Urdu script.
|
|
4
|
+
*/
|
|
2
5
|
type WordsLanguage = 'en' | 'ur';
|
|
3
6
|
/** Options for {@link numberToWords}. */
|
|
4
7
|
interface NumberToWordsOptions {
|