pakdatakit 2.2.0 → 2.3.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/DATA.md +306 -36
  2. package/README.md +178 -30
  3. package/dist/address.cjs +5 -5
  4. package/dist/address.d.cts +2 -1
  5. package/dist/address.d.ts +2 -1
  6. package/dist/address.js +3 -3
  7. package/dist/{chunk-4VSGCQ6K.cjs → chunk-2OBKPYJZ.cjs} +3 -3
  8. package/dist/chunk-33QMFE2Z.js +21244 -0
  9. package/dist/chunk-7E7L3NYS.cjs +11 -0
  10. package/dist/{chunk-TTARJWGT.js → chunk-A3HBEBXY.js} +2 -2
  11. package/dist/{chunk-3ZA265SK.cjs → chunk-AUQFA7EE.cjs} +172 -4
  12. package/dist/{chunk-HBOZIITD.js → chunk-CADQM4ZN.js} +14 -14
  13. package/dist/{chunk-3IARSCO6.cjs → chunk-DHOP7LQX.cjs} +25 -14
  14. package/dist/chunk-E6HSKRAE.js +9 -0
  15. package/dist/{chunk-33FXHM2E.cjs → chunk-ESKXG7Y6.cjs} +5 -5
  16. package/dist/{chunk-U7MWHXMF.cjs → chunk-FRBPAGEJ.cjs} +4 -4
  17. package/dist/chunk-I7UUPD3G.cjs +21252 -0
  18. package/dist/{chunk-YPPKY5XZ.js → chunk-IBZPJS4H.js} +26 -15
  19. package/dist/{chunk-CLL6VDPO.cjs → chunk-J5ARB4TE.cjs} +8 -8
  20. package/dist/{chunk-XCXFGTHW.cjs → chunk-J5ZF46NZ.cjs} +14 -14
  21. package/dist/{chunk-NZQ47NWD.js → chunk-KRYHLYN2.js} +1 -1
  22. package/dist/{chunk-RXNYY5K5.js → chunk-LQHM3ADX.js} +172 -4
  23. package/dist/{chunk-HTERSQGF.cjs → chunk-MTS6SVNP.cjs} +4 -4
  24. package/dist/chunk-N4S22XX3.js +6208 -0
  25. package/dist/chunk-OKMBYX3F.cjs +6220 -0
  26. package/dist/{chunk-6IPPANNX.js → chunk-P7LVE2TF.js} +2 -2
  27. package/dist/chunk-RZQJAZKC.js +22 -0
  28. package/dist/{chunk-PLDVGOKZ.js → chunk-S274QFFB.js} +2 -2
  29. package/dist/chunk-SQIHFEXI.cjs +25 -0
  30. package/dist/chunk-TBTWZC74.cjs +32 -0
  31. package/dist/{chunk-NAJGGUAM.cjs → chunk-TC3VRWZV.cjs} +2 -2
  32. package/dist/{chunk-I664KOWP.js → chunk-TQP2T33V.js} +5 -5
  33. package/dist/{chunk-AZV45DMG.js → chunk-V2XE3NCG.js} +2 -2
  34. package/dist/{chunk-NTD4JLDW.cjs → chunk-YTLE5K7G.cjs} +1 -1
  35. package/dist/{chunk-HUQY2WR5.js → chunk-YTSMFGTW.js} +13 -3
  36. package/dist/{chunk-EMH4IP2U.js → chunk-ZRONAQBV.js} +1 -1
  37. package/dist/class-validator.cjs +57 -0
  38. package/dist/class-validator.d.cts +57 -0
  39. package/dist/class-validator.d.ts +57 -0
  40. package/dist/class-validator.js +47 -0
  41. package/dist/cli.js +1 -1
  42. package/dist/cnic.d.cts +2 -1
  43. package/dist/cnic.d.ts +2 -1
  44. package/dist/geo.cjs +22 -6
  45. package/dist/geo.d.cts +56 -1
  46. package/dist/geo.d.ts +56 -1
  47. package/dist/geo.js +1 -1
  48. package/dist/hijri.d.cts +2 -1
  49. package/dist/hijri.d.ts +2 -1
  50. package/dist/holidays.cjs +4 -4
  51. package/dist/holidays.d.cts +2 -1
  52. package/dist/holidays.d.ts +2 -1
  53. package/dist/holidays.js +1 -1
  54. package/dist/iban.cjs +5 -5
  55. package/dist/iban.d.cts +10 -7
  56. package/dist/iban.d.ts +10 -7
  57. package/dist/iban.js +1 -1
  58. package/dist/index.cjs +106 -68
  59. package/dist/index.d.cts +5 -3
  60. package/dist/index.d.ts +5 -3
  61. package/dist/index.js +16 -14
  62. package/dist/input.cjs +9 -9
  63. package/dist/input.d.cts +2 -1
  64. package/dist/input.d.ts +2 -1
  65. package/dist/input.js +3 -3
  66. package/dist/joi.cjs +37 -0
  67. package/dist/joi.d.cts +24 -0
  68. package/dist/joi.d.ts +24 -0
  69. package/dist/joi.js +31 -0
  70. package/dist/networks.cjs +3 -3
  71. package/dist/networks.d.cts +2 -1
  72. package/dist/networks.d.ts +2 -1
  73. package/dist/networks.js +2 -2
  74. package/dist/numbers.cjs +6 -6
  75. package/dist/numbers.d.cts +2 -1
  76. package/dist/numbers.d.ts +2 -1
  77. package/dist/numbers.js +2 -2
  78. package/dist/passport.cjs +11 -0
  79. package/dist/passport.d.cts +27 -0
  80. package/dist/passport.d.ts +27 -0
  81. package/dist/passport.js +2 -0
  82. package/dist/phone.cjs +8 -8
  83. package/dist/phone.d.cts +2 -1
  84. package/dist/phone.d.ts +2 -1
  85. package/dist/phone.js +3 -3
  86. package/dist/postal.cjs +14 -6
  87. package/dist/postal.d.cts +54 -2
  88. package/dist/postal.d.ts +54 -2
  89. package/dist/postal.js +1 -1
  90. package/dist/raast.cjs +6 -6
  91. package/dist/raast.d.cts +2 -1
  92. package/dist/raast.d.ts +2 -1
  93. package/dist/raast.js +2 -2
  94. package/dist/superstruct.cjs +35 -0
  95. package/dist/superstruct.d.cts +24 -0
  96. package/dist/superstruct.d.ts +24 -0
  97. package/dist/superstruct.js +33 -0
  98. package/dist/tax.d.cts +2 -1
  99. package/dist/tax.d.ts +2 -1
  100. package/dist/valibot.cjs +12 -8
  101. package/dist/valibot.d.cts +2 -0
  102. package/dist/valibot.d.ts +2 -0
  103. package/dist/valibot.js +11 -7
  104. package/dist/vehicle.cjs +15 -0
  105. package/dist/vehicle.d.cts +43 -0
  106. package/dist/vehicle.d.ts +43 -0
  107. package/dist/vehicle.js +2 -0
  108. package/dist/whatsapp.cjs +3 -3
  109. package/dist/whatsapp.js +2 -2
  110. package/dist/words.d.cts +2 -1
  111. package/dist/words.d.ts +2 -1
  112. package/dist/yup.cjs +12 -8
  113. package/dist/yup.d.cts +2 -0
  114. package/dist/yup.d.ts +2 -0
  115. package/dist/yup.js +11 -7
  116. package/dist/zod.cjs +12 -8
  117. package/dist/zod.d.cts +2 -0
  118. package/dist/zod.d.ts +2 -0
  119. package/dist/zod.js +11 -7
  120. package/package.json +109 -11
  121. package/dist/chunk-4VVFS6FN.cjs +0 -715
  122. package/dist/chunk-GJENL6VK.cjs +0 -22
  123. package/dist/chunk-J272OMDL.js +0 -1687
  124. package/dist/chunk-LIYNKIKS.js +0 -709
  125. package/dist/chunk-SBS2GHM3.cjs +0 -1695
package/dist/input.js CHANGED
@@ -1,5 +1,5 @@
1
- export { checkCNICInput, checkIBANInput, checkPhoneInput, formatCNICInput, formatIBANInput, formatPhoneInput } from './chunk-TTARJWGT.js';
2
- import './chunk-6IPPANNX.js';
1
+ export { checkCNICInput, checkIBANInput, checkPhoneInput, formatCNICInput, formatIBANInput, formatPhoneInput } from './chunk-A3HBEBXY.js';
2
+ import './chunk-P7LVE2TF.js';
3
3
  import './chunk-EEVNLTB4.js';
4
- import './chunk-YPPKY5XZ.js';
4
+ import './chunk-IBZPJS4H.js';
5
5
  import './chunk-ENQ7O7VW.js';
package/dist/joi.cjs ADDED
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ var chunkTBTWZC74_cjs = require('./chunk-TBTWZC74.cjs');
4
+ require('./chunk-SQIHFEXI.cjs');
5
+ require('./chunk-AUQFA7EE.cjs');
6
+ require('./chunk-7E7L3NYS.cjs');
7
+ require('./chunk-ESKXG7Y6.cjs');
8
+ require('./chunk-MTS6SVNP.cjs');
9
+ require('./chunk-YTLE5K7G.cjs');
10
+ require('./chunk-H6M6L26S.cjs');
11
+ require('./chunk-HTCSHHOR.cjs');
12
+ require('./chunk-DHOP7LQX.cjs');
13
+ require('./chunk-VPBMIYO2.cjs');
14
+ var Joi = require('joi');
15
+
16
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
+
18
+ var Joi__default = /*#__PURE__*/_interopDefault(Joi);
19
+
20
+ function schema(name) {
21
+ const rule = chunkTBTWZC74_cjs.RULES[name];
22
+ return (options = {}) => Joi__default.default.string().custom(
23
+ (value, helpers) => rule.test(value) ? value : helpers.message({ custom: options.message ?? rule.message })
24
+ );
25
+ }
26
+ var pk = {
27
+ cnic: schema("cnic"),
28
+ phone: schema("phone"),
29
+ iban: schema("iban"),
30
+ ntn: schema("ntn"),
31
+ strn: schema("strn"),
32
+ landline: schema("landline"),
33
+ passport: schema("passport"),
34
+ vehiclePlate: schema("vehiclePlate")
35
+ };
36
+
37
+ exports.pk = pk;
package/dist/joi.d.cts ADDED
@@ -0,0 +1,24 @@
1
+ import Joi from 'joi';
2
+ import { A as AdapterOptions } from './rules-GxgPiVws.cjs';
3
+
4
+ /**
5
+ * Joi schemas for Pakistani identifiers.
6
+ *
7
+ * @example
8
+ * import Joi from 'joi';
9
+ * import { pk } from 'pakdatakit/joi';
10
+ *
11
+ * const form = Joi.object({ cnic: pk.cnic().required(), phone: pk.phone() });
12
+ */
13
+ declare const pk: {
14
+ cnic: (options?: AdapterOptions) => Joi.StringSchema<string>;
15
+ phone: (options?: AdapterOptions) => Joi.StringSchema<string>;
16
+ iban: (options?: AdapterOptions) => Joi.StringSchema<string>;
17
+ ntn: (options?: AdapterOptions) => Joi.StringSchema<string>;
18
+ strn: (options?: AdapterOptions) => Joi.StringSchema<string>;
19
+ landline: (options?: AdapterOptions) => Joi.StringSchema<string>;
20
+ passport: (options?: AdapterOptions) => Joi.StringSchema<string>;
21
+ vehiclePlate: (options?: AdapterOptions) => Joi.StringSchema<string>;
22
+ };
23
+
24
+ export { AdapterOptions, pk };
package/dist/joi.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ import Joi from 'joi';
2
+ import { A as AdapterOptions } from './rules-GxgPiVws.js';
3
+
4
+ /**
5
+ * Joi schemas for Pakistani identifiers.
6
+ *
7
+ * @example
8
+ * import Joi from 'joi';
9
+ * import { pk } from 'pakdatakit/joi';
10
+ *
11
+ * const form = Joi.object({ cnic: pk.cnic().required(), phone: pk.phone() });
12
+ */
13
+ declare const pk: {
14
+ cnic: (options?: AdapterOptions) => Joi.StringSchema<string>;
15
+ phone: (options?: AdapterOptions) => Joi.StringSchema<string>;
16
+ iban: (options?: AdapterOptions) => Joi.StringSchema<string>;
17
+ ntn: (options?: AdapterOptions) => Joi.StringSchema<string>;
18
+ strn: (options?: AdapterOptions) => Joi.StringSchema<string>;
19
+ landline: (options?: AdapterOptions) => Joi.StringSchema<string>;
20
+ passport: (options?: AdapterOptions) => Joi.StringSchema<string>;
21
+ vehiclePlate: (options?: AdapterOptions) => Joi.StringSchema<string>;
22
+ };
23
+
24
+ export { AdapterOptions, pk };
package/dist/joi.js ADDED
@@ -0,0 +1,31 @@
1
+ import { RULES } from './chunk-YTSMFGTW.js';
2
+ import './chunk-RZQJAZKC.js';
3
+ import './chunk-LQHM3ADX.js';
4
+ import './chunk-E6HSKRAE.js';
5
+ import './chunk-S274QFFB.js';
6
+ import './chunk-V2XE3NCG.js';
7
+ import './chunk-P7LVE2TF.js';
8
+ import './chunk-CEPNSHIC.js';
9
+ import './chunk-EEVNLTB4.js';
10
+ import './chunk-IBZPJS4H.js';
11
+ import './chunk-ENQ7O7VW.js';
12
+ import Joi from 'joi';
13
+
14
+ function schema(name) {
15
+ const rule = RULES[name];
16
+ return (options = {}) => Joi.string().custom(
17
+ (value, helpers) => rule.test(value) ? value : helpers.message({ custom: options.message ?? rule.message })
18
+ );
19
+ }
20
+ var pk = {
21
+ cnic: schema("cnic"),
22
+ phone: schema("phone"),
23
+ iban: schema("iban"),
24
+ ntn: schema("ntn"),
25
+ strn: schema("strn"),
26
+ landline: schema("landline"),
27
+ passport: schema("passport"),
28
+ vehiclePlate: schema("vehiclePlate")
29
+ };
30
+
31
+ export { pk };
package/dist/networks.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkHTERSQGF_cjs = require('./chunk-HTERSQGF.cjs');
4
- require('./chunk-NTD4JLDW.cjs');
3
+ var chunkMTS6SVNP_cjs = require('./chunk-MTS6SVNP.cjs');
4
+ require('./chunk-YTLE5K7G.cjs');
5
5
  require('./chunk-VPBMIYO2.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "getNetwork", {
10
10
  enumerable: true,
11
- get: function () { return chunkHTERSQGF_cjs.getNetwork; }
11
+ get: function () { return chunkMTS6SVNP_cjs.getNetwork; }
12
12
  });
@@ -17,4 +17,5 @@ type NetworkName = 'Jazz' | 'Zong' | 'Telenor' | 'Ufone' | 'SCO' | 'Unknown';
17
17
  */
18
18
  declare function getNetwork(phone: string): NetworkName;
19
19
 
20
- export { type NetworkName, getNetwork };
20
+ export { getNetwork };
21
+ export type { NetworkName };
@@ -17,4 +17,5 @@ type NetworkName = 'Jazz' | 'Zong' | 'Telenor' | 'Ufone' | 'SCO' | 'Unknown';
17
17
  */
18
18
  declare function getNetwork(phone: string): NetworkName;
19
19
 
20
- export { type NetworkName, getNetwork };
20
+ export { getNetwork };
21
+ export type { NetworkName };
package/dist/networks.js CHANGED
@@ -1,3 +1,3 @@
1
- export { getNetwork } from './chunk-AZV45DMG.js';
2
- import './chunk-6IPPANNX.js';
1
+ export { getNetwork } from './chunk-V2XE3NCG.js';
2
+ import './chunk-P7LVE2TF.js';
3
3
  import './chunk-ENQ7O7VW.js';
package/dist/numbers.cjs CHANGED
@@ -1,24 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunk3ZA265SK_cjs = require('./chunk-3ZA265SK.cjs');
4
- require('./chunk-NTD4JLDW.cjs');
3
+ var chunkAUQFA7EE_cjs = require('./chunk-AUQFA7EE.cjs');
4
+ require('./chunk-YTLE5K7G.cjs');
5
5
  require('./chunk-VPBMIYO2.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "analyzeNumber", {
10
10
  enumerable: true,
11
- get: function () { return chunk3ZA265SK_cjs.analyzeNumber; }
11
+ get: function () { return chunkAUQFA7EE_cjs.analyzeNumber; }
12
12
  });
13
13
  Object.defineProperty(exports, "getAreaCode", {
14
14
  enumerable: true,
15
- get: function () { return chunk3ZA265SK_cjs.getAreaCode; }
15
+ get: function () { return chunkAUQFA7EE_cjs.getAreaCode; }
16
16
  });
17
17
  Object.defineProperty(exports, "getNumberType", {
18
18
  enumerable: true,
19
- get: function () { return chunk3ZA265SK_cjs.getNumberType; }
19
+ get: function () { return chunkAUQFA7EE_cjs.getNumberType; }
20
20
  });
21
21
  Object.defineProperty(exports, "validateLandline", {
22
22
  enumerable: true,
23
- get: function () { return chunk3ZA265SK_cjs.validateLandline; }
23
+ get: function () { return chunkAUQFA7EE_cjs.validateLandline; }
24
24
  });
@@ -50,4 +50,5 @@ declare function validateLandline(phone: string): boolean;
50
50
  */
51
51
  declare function getAreaCode(city: string): string | null;
52
52
 
53
- export { type NumberInfo, type NumberType, analyzeNumber, getAreaCode, getNumberType, validateLandline };
53
+ export { analyzeNumber, getAreaCode, getNumberType, validateLandline };
54
+ export type { NumberInfo, NumberType };
package/dist/numbers.d.ts CHANGED
@@ -50,4 +50,5 @@ declare function validateLandline(phone: string): boolean;
50
50
  */
51
51
  declare function getAreaCode(city: string): string | null;
52
52
 
53
- export { type NumberInfo, type NumberType, analyzeNumber, getAreaCode, getNumberType, validateLandline };
53
+ export { analyzeNumber, getAreaCode, getNumberType, validateLandline };
54
+ export type { NumberInfo, NumberType };
package/dist/numbers.js CHANGED
@@ -1,3 +1,3 @@
1
- export { analyzeNumber, getAreaCode, getNumberType, validateLandline } from './chunk-RXNYY5K5.js';
2
- import './chunk-6IPPANNX.js';
1
+ export { analyzeNumber, getAreaCode, getNumberType, validateLandline } from './chunk-LQHM3ADX.js';
2
+ import './chunk-P7LVE2TF.js';
3
3
  import './chunk-ENQ7O7VW.js';
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunk7E7L3NYS_cjs = require('./chunk-7E7L3NYS.cjs');
4
+ require('./chunk-VPBMIYO2.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "validatePassport", {
9
+ enumerable: true,
10
+ get: function () { return chunk7E7L3NYS_cjs.validatePassport; }
11
+ });
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Validates the format of a Pakistani passport number: two letters followed by
3
+ * seven digits, e.g. `AB1234567`. Case, surrounding spaces and spaces or
4
+ * dashes between the letters and digits are ignored.
5
+ *
6
+ * DGIP does not publish the format, so this checks the common shape only. Two
7
+ * letters and seven digits is the number format given for the 2013 ordinary
8
+ * passport in the EU's PRADO register
9
+ * (https://www.consilium.europa.eu/prado/en/PAK-AO-02003/index.html) and fits
10
+ * the 9-character document-number field of ICAO Doc 9303
11
+ * (https://www.icao.int/publications/Documents/9303_p4_cons_en.pdf). No source
12
+ * was found for later models (2017, 2022 e-passport) or for diplomatic and
13
+ * official passports, which may differ, so treat `false` as "unusual", not
14
+ * "fake". The letters' meaning is not documented and is not checked; the MRZ
15
+ * check digit is not part of the number.
16
+ *
17
+ * @example
18
+ * validatePassport('AB1234567'); // true
19
+ * validatePassport('ab 1234567'); // true
20
+ * validatePassport('A12345678'); // false
21
+ *
22
+ * @param passport - Passport number to validate
23
+ * @returns `true` if the format is valid
24
+ */
25
+ declare function validatePassport(passport: string): boolean;
26
+
27
+ export { validatePassport };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Validates the format of a Pakistani passport number: two letters followed by
3
+ * seven digits, e.g. `AB1234567`. Case, surrounding spaces and spaces or
4
+ * dashes between the letters and digits are ignored.
5
+ *
6
+ * DGIP does not publish the format, so this checks the common shape only. Two
7
+ * letters and seven digits is the number format given for the 2013 ordinary
8
+ * passport in the EU's PRADO register
9
+ * (https://www.consilium.europa.eu/prado/en/PAK-AO-02003/index.html) and fits
10
+ * the 9-character document-number field of ICAO Doc 9303
11
+ * (https://www.icao.int/publications/Documents/9303_p4_cons_en.pdf). No source
12
+ * was found for later models (2017, 2022 e-passport) or for diplomatic and
13
+ * official passports, which may differ, so treat `false` as "unusual", not
14
+ * "fake". The letters' meaning is not documented and is not checked; the MRZ
15
+ * check digit is not part of the number.
16
+ *
17
+ * @example
18
+ * validatePassport('AB1234567'); // true
19
+ * validatePassport('ab 1234567'); // true
20
+ * validatePassport('A12345678'); // false
21
+ *
22
+ * @param passport - Passport number to validate
23
+ * @returns `true` if the format is valid
24
+ */
25
+ declare function validatePassport(passport: string): boolean;
26
+
27
+ export { validatePassport };
@@ -0,0 +1,2 @@
1
+ export { validatePassport } from './chunk-E6HSKRAE.js';
2
+ import './chunk-ENQ7O7VW.js';
package/dist/phone.cjs CHANGED
@@ -1,29 +1,29 @@
1
1
  'use strict';
2
2
 
3
- var chunk33FXHM2E_cjs = require('./chunk-33FXHM2E.cjs');
4
- require('./chunk-HTERSQGF.cjs');
5
- var chunkNTD4JLDW_cjs = require('./chunk-NTD4JLDW.cjs');
3
+ var chunkESKXG7Y6_cjs = require('./chunk-ESKXG7Y6.cjs');
4
+ require('./chunk-MTS6SVNP.cjs');
5
+ var chunkYTLE5K7G_cjs = require('./chunk-YTLE5K7G.cjs');
6
6
  require('./chunk-VPBMIYO2.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "analyzePhone", {
11
11
  enumerable: true,
12
- get: function () { return chunk33FXHM2E_cjs.analyzePhone; }
12
+ get: function () { return chunkESKXG7Y6_cjs.analyzePhone; }
13
13
  });
14
14
  Object.defineProperty(exports, "formatPhone", {
15
15
  enumerable: true,
16
- get: function () { return chunk33FXHM2E_cjs.formatPhone; }
16
+ get: function () { return chunkESKXG7Y6_cjs.formatPhone; }
17
17
  });
18
18
  Object.defineProperty(exports, "validatePhone", {
19
19
  enumerable: true,
20
- get: function () { return chunk33FXHM2E_cjs.validatePhone; }
20
+ get: function () { return chunkESKXG7Y6_cjs.validatePhone; }
21
21
  });
22
22
  Object.defineProperty(exports, "getPhonePrefix", {
23
23
  enumerable: true,
24
- get: function () { return chunkNTD4JLDW_cjs.getPhonePrefix; }
24
+ get: function () { return chunkYTLE5K7G_cjs.getPhonePrefix; }
25
25
  });
26
26
  Object.defineProperty(exports, "normalizePhoneDigits", {
27
27
  enumerable: true,
28
- get: function () { return chunkNTD4JLDW_cjs.normalizePhoneDigits; }
28
+ get: function () { return chunkYTLE5K7G_cjs.normalizePhoneDigits; }
29
29
  });
package/dist/phone.d.cts CHANGED
@@ -53,4 +53,5 @@ declare function formatPhone(phone: string): string | null;
53
53
  */
54
54
  declare function analyzePhone(phone: string): PhoneAnalysis;
55
55
 
56
- export { NetworkName, type PhoneAnalysis, analyzePhone, formatPhone, getPhonePrefix, normalizePhoneDigits, validatePhone };
56
+ export { NetworkName, analyzePhone, formatPhone, getPhonePrefix, normalizePhoneDigits, validatePhone };
57
+ export type { PhoneAnalysis };
package/dist/phone.d.ts CHANGED
@@ -53,4 +53,5 @@ declare function formatPhone(phone: string): string | null;
53
53
  */
54
54
  declare function analyzePhone(phone: string): PhoneAnalysis;
55
55
 
56
- export { NetworkName, type PhoneAnalysis, analyzePhone, formatPhone, getPhonePrefix, normalizePhoneDigits, validatePhone };
56
+ export { NetworkName, analyzePhone, formatPhone, getPhonePrefix, normalizePhoneDigits, validatePhone };
57
+ export type { PhoneAnalysis };
package/dist/phone.js CHANGED
@@ -1,4 +1,4 @@
1
- export { analyzePhone, formatPhone, validatePhone } from './chunk-PLDVGOKZ.js';
2
- import './chunk-AZV45DMG.js';
3
- export { getPhonePrefix, normalizePhoneDigits } from './chunk-6IPPANNX.js';
1
+ export { analyzePhone, formatPhone, validatePhone } from './chunk-S274QFFB.js';
2
+ import './chunk-V2XE3NCG.js';
3
+ export { getPhonePrefix, normalizePhoneDigits } from './chunk-P7LVE2TF.js';
4
4
  import './chunk-ENQ7O7VW.js';
package/dist/postal.cjs CHANGED
@@ -1,27 +1,35 @@
1
1
  'use strict';
2
2
 
3
- var chunk4VVFS6FN_cjs = require('./chunk-4VVFS6FN.cjs');
3
+ var chunkI7UUPD3G_cjs = require('./chunk-I7UUPD3G.cjs');
4
4
  require('./chunk-VPBMIYO2.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "getCityByPostalCode", {
9
9
  enumerable: true,
10
- get: function () { return chunk4VVFS6FN_cjs.getCityByPostalCode; }
10
+ get: function () { return chunkI7UUPD3G_cjs.getCityByPostalCode; }
11
+ });
12
+ Object.defineProperty(exports, "getPostOffice", {
13
+ enumerable: true,
14
+ get: function () { return chunkI7UUPD3G_cjs.getPostOffice; }
11
15
  });
12
16
  Object.defineProperty(exports, "getPostalAreas", {
13
17
  enumerable: true,
14
- get: function () { return chunk4VVFS6FN_cjs.getPostalAreas; }
18
+ get: function () { return chunkI7UUPD3G_cjs.getPostalAreas; }
15
19
  });
16
20
  Object.defineProperty(exports, "getPostalCode", {
17
21
  enumerable: true,
18
- get: function () { return chunk4VVFS6FN_cjs.getPostalCode; }
22
+ get: function () { return chunkI7UUPD3G_cjs.getPostalCode; }
19
23
  });
20
24
  Object.defineProperty(exports, "getPostalCodes", {
21
25
  enumerable: true,
22
- get: function () { return chunk4VVFS6FN_cjs.getPostalCodes; }
26
+ get: function () { return chunkI7UUPD3G_cjs.getPostalCodes; }
27
+ });
28
+ Object.defineProperty(exports, "searchPostOffices", {
29
+ enumerable: true,
30
+ get: function () { return chunkI7UUPD3G_cjs.searchPostOffices; }
23
31
  });
24
32
  Object.defineProperty(exports, "searchPostalCodes", {
25
33
  enumerable: true,
26
- get: function () { return chunk4VVFS6FN_cjs.searchPostalCodes; }
34
+ get: function () { return chunkI7UUPD3G_cjs.searchPostalCodes; }
27
35
  });
package/dist/postal.d.cts CHANGED
@@ -1,5 +1,56 @@
1
+ /** A delivery post office from Pakistan Post's post code directory. */
2
+ interface PostOffice {
3
+ /** 5-digit post code, e.g. `48330`. */
4
+ code: string;
5
+ /** Office name as the directory gives it, in title case, e.g. `Dulmial`. */
6
+ office: string;
7
+ /**
8
+ * The city the office belongs to when that is known (`Lahore` for an office
9
+ * in Lahore); otherwise the office's own name, which for most offices is
10
+ * its town or village.
11
+ */
12
+ town: string;
13
+ /**
14
+ * The district, when the town is the headquarters a district is named
15
+ * after; otherwise `null`. The directory has no district column.
16
+ */
17
+ district: string | null;
18
+ /** Province or territory. */
19
+ province: string;
20
+ }
1
21
  /**
2
- * Returns the city name for a Pakistani postal code.
22
+ * Returns the delivery post office for a post code, from Pakistan Post's
23
+ * directory of about 2,560 offices.
24
+ *
25
+ * Unlike `getCityByPostalCode`, which only answers for codes in the cities
26
+ * pakdatakit lists, this knows every delivery office, including those in
27
+ * towns and villages.
28
+ *
29
+ * @param code - Post code (whitespace is ignored)
30
+ * @returns The post office, or `null` if the code is not in the directory
31
+ *
32
+ * @example
33
+ * getPostOffice('48330');
34
+ * // { code: '48330', office: 'Dulmial', town: 'Dulmial', district: null, province: 'Punjab' }
35
+ */
36
+ declare function getPostOffice(code: string): PostOffice | null;
37
+ /**
38
+ * Searches Pakistan Post's directory by office name, town or post code.
39
+ *
40
+ * Matching is case-insensitive: an office matches when its name or town
41
+ * contains the query, or its code starts with it.
42
+ *
43
+ * @param query - Partial office name, town or post code
44
+ * @returns Matching post offices, sorted by post code
45
+ */
46
+ declare function searchPostOffices(query: string): PostOffice[];
47
+
48
+ /**
49
+ * Returns the city for a Pakistani postal code.
50
+ *
51
+ * Only codes of post offices in a city on pakdatakit's city list return a
52
+ * city (`54660` → `Lahore`). The code of a post office in a town or village
53
+ * that is not on the list returns `null`; use `getPostOffice` for those.
3
54
  *
4
55
  * @param postalCode - Postal code to look up (whitespace is ignored)
5
56
  * @returns City name or `null` if not found
@@ -37,4 +88,5 @@ declare function searchPostalCodes(query: string): string[];
37
88
  */
38
89
  declare function getPostalAreas(city: string): string[];
39
90
 
40
- export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes };
91
+ export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes };
92
+ export type { PostOffice };
package/dist/postal.d.ts CHANGED
@@ -1,5 +1,56 @@
1
+ /** A delivery post office from Pakistan Post's post code directory. */
2
+ interface PostOffice {
3
+ /** 5-digit post code, e.g. `48330`. */
4
+ code: string;
5
+ /** Office name as the directory gives it, in title case, e.g. `Dulmial`. */
6
+ office: string;
7
+ /**
8
+ * The city the office belongs to when that is known (`Lahore` for an office
9
+ * in Lahore); otherwise the office's own name, which for most offices is
10
+ * its town or village.
11
+ */
12
+ town: string;
13
+ /**
14
+ * The district, when the town is the headquarters a district is named
15
+ * after; otherwise `null`. The directory has no district column.
16
+ */
17
+ district: string | null;
18
+ /** Province or territory. */
19
+ province: string;
20
+ }
1
21
  /**
2
- * Returns the city name for a Pakistani postal code.
22
+ * Returns the delivery post office for a post code, from Pakistan Post's
23
+ * directory of about 2,560 offices.
24
+ *
25
+ * Unlike `getCityByPostalCode`, which only answers for codes in the cities
26
+ * pakdatakit lists, this knows every delivery office, including those in
27
+ * towns and villages.
28
+ *
29
+ * @param code - Post code (whitespace is ignored)
30
+ * @returns The post office, or `null` if the code is not in the directory
31
+ *
32
+ * @example
33
+ * getPostOffice('48330');
34
+ * // { code: '48330', office: 'Dulmial', town: 'Dulmial', district: null, province: 'Punjab' }
35
+ */
36
+ declare function getPostOffice(code: string): PostOffice | null;
37
+ /**
38
+ * Searches Pakistan Post's directory by office name, town or post code.
39
+ *
40
+ * Matching is case-insensitive: an office matches when its name or town
41
+ * contains the query, or its code starts with it.
42
+ *
43
+ * @param query - Partial office name, town or post code
44
+ * @returns Matching post offices, sorted by post code
45
+ */
46
+ declare function searchPostOffices(query: string): PostOffice[];
47
+
48
+ /**
49
+ * Returns the city for a Pakistani postal code.
50
+ *
51
+ * Only codes of post offices in a city on pakdatakit's city list return a
52
+ * city (`54660` → `Lahore`). The code of a post office in a town or village
53
+ * that is not on the list returns `null`; use `getPostOffice` for those.
3
54
  *
4
55
  * @param postalCode - Postal code to look up (whitespace is ignored)
5
56
  * @returns City name or `null` if not found
@@ -37,4 +88,5 @@ declare function searchPostalCodes(query: string): string[];
37
88
  */
38
89
  declare function getPostalAreas(city: string): string[];
39
90
 
40
- export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes };
91
+ export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes };
92
+ export type { PostOffice };
package/dist/postal.js CHANGED
@@ -1,2 +1,2 @@
1
- export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './chunk-LIYNKIKS.js';
1
+ export { getCityByPostalCode, getPostOffice, getPostalAreas, getPostalCode, getPostalCodes, searchPostOffices, searchPostalCodes } from './chunk-33QMFE2Z.js';
2
2
  import './chunk-ENQ7O7VW.js';
package/dist/raast.cjs CHANGED
@@ -1,24 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunk4VSGCQ6K_cjs = require('./chunk-4VSGCQ6K.cjs');
4
- require('./chunk-3IARSCO6.cjs');
3
+ var chunk2OBKPYJZ_cjs = require('./chunk-2OBKPYJZ.cjs');
4
+ require('./chunk-DHOP7LQX.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 chunk4VSGCQ6K_cjs.createMerchantQr; }
11
+ get: function () { return chunk2OBKPYJZ_cjs.createMerchantQr; }
12
12
  });
13
13
  Object.defineProperty(exports, "createRaastP2PQr", {
14
14
  enumerable: true,
15
- get: function () { return chunk4VSGCQ6K_cjs.createRaastP2PQr; }
15
+ get: function () { return chunk2OBKPYJZ_cjs.createRaastP2PQr; }
16
16
  });
17
17
  Object.defineProperty(exports, "parseRaastQr", {
18
18
  enumerable: true,
19
- get: function () { return chunk4VSGCQ6K_cjs.parseRaastQr; }
19
+ get: function () { return chunk2OBKPYJZ_cjs.parseRaastQr; }
20
20
  });
21
21
  Object.defineProperty(exports, "validateRaastQr", {
22
22
  enumerable: true,
23
- get: function () { return chunk4VSGCQ6K_cjs.validateRaastQr; }
23
+ get: function () { return chunk2OBKPYJZ_cjs.validateRaastQr; }
24
24
  });
package/dist/raast.d.cts CHANGED
@@ -185,4 +185,5 @@ interface ValidateRaastQrOptions {
185
185
  */
186
186
  declare function validateRaastQr(payload: string, options?: ValidateRaastQrOptions): RaastQrValidation;
187
187
 
188
- export { type EmvField, type MerchantAccountInfo, type MerchantQrOptions, type ParsedRaastQr, type RaastDuration, type RaastP2PQrOptions, type RaastQrError, type RaastQrValidation, type RaastQrWarning, type ValidateRaastQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr };
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
@@ -185,4 +185,5 @@ interface ValidateRaastQrOptions {
185
185
  */
186
186
  declare function validateRaastQr(payload: string, options?: ValidateRaastQrOptions): RaastQrValidation;
187
187
 
188
- export { type EmvField, type MerchantAccountInfo, type MerchantQrOptions, type ParsedRaastQr, type RaastDuration, type RaastP2PQrOptions, type RaastQrError, type RaastQrValidation, type RaastQrWarning, type ValidateRaastQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr };
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, validateRaastQr } from './chunk-NZQ47NWD.js';
2
- import './chunk-YPPKY5XZ.js';
1
+ export { createMerchantQr, createRaastP2PQr, parseRaastQr, validateRaastQr } from './chunk-KRYHLYN2.js';
2
+ import './chunk-IBZPJS4H.js';
3
3
  import './chunk-ENQ7O7VW.js';
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var chunkTBTWZC74_cjs = require('./chunk-TBTWZC74.cjs');
4
+ require('./chunk-SQIHFEXI.cjs');
5
+ require('./chunk-AUQFA7EE.cjs');
6
+ require('./chunk-7E7L3NYS.cjs');
7
+ require('./chunk-ESKXG7Y6.cjs');
8
+ require('./chunk-MTS6SVNP.cjs');
9
+ require('./chunk-YTLE5K7G.cjs');
10
+ require('./chunk-H6M6L26S.cjs');
11
+ require('./chunk-HTCSHHOR.cjs');
12
+ require('./chunk-DHOP7LQX.cjs');
13
+ require('./chunk-VPBMIYO2.cjs');
14
+ var superstruct = require('superstruct');
15
+
16
+ function schema(name) {
17
+ const rule = chunkTBTWZC74_cjs.RULES[name];
18
+ return (options = {}) => superstruct.refine(
19
+ superstruct.string(),
20
+ `pk-${name}`,
21
+ (value) => rule.test(value) || (options.message ?? rule.message)
22
+ );
23
+ }
24
+ var pk = {
25
+ cnic: schema("cnic"),
26
+ phone: schema("phone"),
27
+ iban: schema("iban"),
28
+ ntn: schema("ntn"),
29
+ strn: schema("strn"),
30
+ landline: schema("landline"),
31
+ passport: schema("passport"),
32
+ vehiclePlate: schema("vehiclePlate")
33
+ };
34
+
35
+ exports.pk = pk;