pakdatakit 1.1.0 → 2.1.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.
Files changed (127) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +909 -666
  3. package/dist/address.cjs +17 -0
  4. package/dist/address.d.cts +36 -0
  5. package/dist/address.d.ts +36 -0
  6. package/dist/address.js +4 -0
  7. package/dist/chunk-3COX5FSL.cjs +1650 -0
  8. package/dist/chunk-432ZYMYV.js +31 -0
  9. package/dist/chunk-43ULDYUP.cjs +235 -0
  10. package/dist/chunk-44YRK7WO.js +231 -0
  11. package/dist/chunk-4EUKCSLW.js +221 -0
  12. package/dist/chunk-4VVFS6FN.cjs +715 -0
  13. package/dist/chunk-6TSKA2PH.js +38 -0
  14. package/dist/chunk-APXP7OK7.cjs +226 -0
  15. package/dist/chunk-AUATLZA5.cjs +168 -0
  16. package/dist/chunk-BSS4Z7NI.cjs +422 -0
  17. package/dist/chunk-CEPNSHIC.js +33 -0
  18. package/dist/chunk-CYJJ7KGC.cjs +108 -0
  19. package/dist/chunk-E47SNBWQ.cjs +224 -0
  20. package/dist/chunk-E7GAK72W.js +20 -0
  21. package/dist/chunk-EEVNLTB4.js +32 -0
  22. package/dist/chunk-ENQ7O7VW.js +32 -0
  23. package/dist/chunk-H6M6L26S.cjs +37 -0
  24. package/dist/chunk-HBOZIITD.js +351 -0
  25. package/dist/chunk-HTCSHHOR.cjs +35 -0
  26. package/dist/chunk-JKE4AMSZ.js +47 -0
  27. package/dist/chunk-JNP27XW2.cjs +22 -0
  28. package/dist/chunk-K6CZFCX6.js +1642 -0
  29. package/dist/chunk-KEHCTYLO.cjs +52 -0
  30. package/dist/chunk-KQKW2ZEK.cjs +18 -0
  31. package/dist/chunk-L2BDDM2W.js +165 -0
  32. package/dist/chunk-L45UXUWX.js +21 -0
  33. package/dist/chunk-LIYNKIKS.js +709 -0
  34. package/dist/chunk-LVHTH4P7.cjs +41 -0
  35. package/dist/chunk-P4CGOJEM.js +16 -0
  36. package/dist/chunk-PHHKIMO2.cjs +35 -0
  37. package/dist/chunk-QQQKISXT.js +223 -0
  38. package/dist/chunk-T3E4B5MJ.js +417 -0
  39. package/dist/chunk-VPBMIYO2.cjs +38 -0
  40. package/dist/chunk-XCXFGTHW.cjs +355 -0
  41. package/dist/chunk-Y6BUGLXU.js +95 -0
  42. package/dist/chunk-YLWZGSFY.cjs +99 -0
  43. package/dist/chunk-YS7MOLK2.cjs +23 -0
  44. package/dist/chunk-Z5JEIQVW.js +102 -0
  45. package/dist/cli.js +78 -2654
  46. package/dist/cnic.cjs +15 -0
  47. package/dist/cnic.d.cts +35 -0
  48. package/dist/cnic.d.ts +35 -0
  49. package/dist/cnic.js +2 -0
  50. package/dist/format.cjs +14 -0
  51. package/dist/format.d.cts +27 -0
  52. package/dist/format.d.ts +27 -0
  53. package/dist/format.js +1 -0
  54. package/dist/geo.cjs +27 -0
  55. package/dist/geo.d.cts +43 -0
  56. package/dist/geo.d.ts +43 -0
  57. package/dist/geo.js +2 -0
  58. package/dist/hijri.cjs +26 -0
  59. package/dist/hijri.d.cts +62 -0
  60. package/dist/hijri.d.ts +62 -0
  61. package/dist/hijri.js +1 -0
  62. package/dist/holidays.cjs +19 -0
  63. package/dist/holidays.d.cts +72 -0
  64. package/dist/holidays.d.ts +72 -0
  65. package/dist/holidays.js +2 -0
  66. package/dist/iban.cjs +15 -0
  67. package/dist/iban.d.cts +21 -0
  68. package/dist/iban.d.ts +21 -0
  69. package/dist/iban.js +2 -0
  70. package/dist/index.cjs +211 -0
  71. package/dist/index.d.cts +16 -0
  72. package/dist/index.d.ts +16 -300
  73. package/dist/index.js +18 -2764
  74. package/dist/networks.cjs +12 -0
  75. package/dist/networks.d.cts +20 -0
  76. package/dist/networks.d.ts +20 -0
  77. package/dist/networks.js +3 -0
  78. package/dist/numbers.cjs +24 -0
  79. package/dist/numbers.d.cts +53 -0
  80. package/dist/numbers.d.ts +53 -0
  81. package/dist/numbers.js +3 -0
  82. package/dist/phone.cjs +29 -0
  83. package/dist/phone.d.cts +56 -0
  84. package/dist/phone.d.ts +56 -0
  85. package/dist/phone.js +4 -0
  86. package/dist/postal.cjs +27 -0
  87. package/dist/postal.d.cts +40 -0
  88. package/dist/postal.d.ts +40 -0
  89. package/dist/postal.js +2 -0
  90. package/dist/raast.cjs +20 -0
  91. package/dist/raast.d.cts +125 -0
  92. package/dist/raast.d.ts +125 -0
  93. package/dist/raast.js +3 -0
  94. package/dist/rules-GxgPiVws.d.cts +7 -0
  95. package/dist/rules-GxgPiVws.d.ts +7 -0
  96. package/dist/tax.cjs +20 -0
  97. package/dist/tax.d.cts +47 -0
  98. package/dist/tax.d.ts +47 -0
  99. package/dist/tax.js +3 -0
  100. package/dist/text.cjs +23 -0
  101. package/dist/text.d.cts +34 -0
  102. package/dist/text.d.ts +34 -0
  103. package/dist/text.js +2 -0
  104. package/dist/valibot.cjs +47 -0
  105. package/dist/valibot.d.cts +22 -0
  106. package/dist/valibot.d.ts +22 -0
  107. package/dist/valibot.js +25 -0
  108. package/dist/whatsapp.cjs +12 -0
  109. package/dist/whatsapp.d.cts +12 -0
  110. package/dist/whatsapp.d.ts +12 -0
  111. package/dist/whatsapp.js +3 -0
  112. package/dist/words.cjs +14 -0
  113. package/dist/words.d.cts +49 -0
  114. package/dist/words.d.ts +49 -0
  115. package/dist/words.js +1 -0
  116. package/dist/yup.cjs +32 -0
  117. package/dist/yup.d.cts +22 -0
  118. package/dist/yup.d.ts +22 -0
  119. package/dist/yup.js +30 -0
  120. package/dist/zod.cjs +27 -0
  121. package/dist/zod.d.cts +22 -0
  122. package/dist/zod.d.ts +22 -0
  123. package/dist/zod.js +25 -0
  124. package/package.json +309 -77
  125. package/dist/cli.d.ts +0 -1
  126. package/dist/cli.js.map +0 -1
  127. package/dist/index.js.map +0 -1
package/dist/cnic.cjs ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var chunkHTCSHHOR_cjs = require('./chunk-HTCSHHOR.cjs');
4
+ require('./chunk-VPBMIYO2.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "getCNICInfo", {
9
+ enumerable: true,
10
+ get: function () { return chunkHTCSHHOR_cjs.getCNICInfo; }
11
+ });
12
+ Object.defineProperty(exports, "validateCNIC", {
13
+ enumerable: true,
14
+ get: function () { return chunkHTCSHHOR_cjs.validateCNIC; }
15
+ });
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Validates a Pakistani CNIC number.
3
+ *
4
+ * Accepts `3520212345671`, `35202-1234567-1`, `35202 1234567 1` and Urdu digits.
5
+ * Separators must sit between the 5-7-1 digit groups and be used consistently.
6
+ *
7
+ * NADRA does not publish a check-digit algorithm, so this validates structure only.
8
+ *
9
+ * @param cnic - The CNIC string to validate
10
+ * @returns `true` if the CNIC is valid, otherwise `false`
11
+ */
12
+ declare function validateCNIC(cnic: string): boolean;
13
+ /** Information encoded in a CNIC number. */
14
+ interface CNICInfo {
15
+ /** The CNIC as 13 digits without separators. */
16
+ digits: string;
17
+ /** The CNIC in `#####-#######-#` form. */
18
+ formatted: string;
19
+ /**
20
+ * Province where the CNIC was first registered (from the first digit).
21
+ * This is not necessarily where the holder lives now.
22
+ */
23
+ province: string;
24
+ /** Gender encoded in the last digit: odd for male, even for female. */
25
+ gender: 'male' | 'female';
26
+ }
27
+ /**
28
+ * Reads the province of registration and gender encoded in a CNIC.
29
+ *
30
+ * @param cnic - CNIC in any format accepted by {@link validateCNIC}
31
+ * @returns Decoded information, or `null` if the CNIC is invalid
32
+ */
33
+ declare function getCNICInfo(cnic: string): CNICInfo | null;
34
+
35
+ export { type CNICInfo, getCNICInfo, validateCNIC };
package/dist/cnic.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Validates a Pakistani CNIC number.
3
+ *
4
+ * Accepts `3520212345671`, `35202-1234567-1`, `35202 1234567 1` and Urdu digits.
5
+ * Separators must sit between the 5-7-1 digit groups and be used consistently.
6
+ *
7
+ * NADRA does not publish a check-digit algorithm, so this validates structure only.
8
+ *
9
+ * @param cnic - The CNIC string to validate
10
+ * @returns `true` if the CNIC is valid, otherwise `false`
11
+ */
12
+ declare function validateCNIC(cnic: string): boolean;
13
+ /** Information encoded in a CNIC number. */
14
+ interface CNICInfo {
15
+ /** The CNIC as 13 digits without separators. */
16
+ digits: string;
17
+ /** The CNIC in `#####-#######-#` form. */
18
+ formatted: string;
19
+ /**
20
+ * Province where the CNIC was first registered (from the first digit).
21
+ * This is not necessarily where the holder lives now.
22
+ */
23
+ province: string;
24
+ /** Gender encoded in the last digit: odd for male, even for female. */
25
+ gender: 'male' | 'female';
26
+ }
27
+ /**
28
+ * Reads the province of registration and gender encoded in a CNIC.
29
+ *
30
+ * @param cnic - CNIC in any format accepted by {@link validateCNIC}
31
+ * @returns Decoded information, or `null` if the CNIC is invalid
32
+ */
33
+ declare function getCNICInfo(cnic: string): CNICInfo | null;
34
+
35
+ export { type CNICInfo, getCNICInfo, validateCNIC };
package/dist/cnic.js ADDED
@@ -0,0 +1,2 @@
1
+ export { getCNICInfo, validateCNIC } from './chunk-EEVNLTB4.js';
2
+ import './chunk-ENQ7O7VW.js';
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkLVHTH4P7_cjs = require('./chunk-LVHTH4P7.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "formatLakh", {
8
+ enumerable: true,
9
+ get: function () { return chunkLVHTH4P7_cjs.formatLakh; }
10
+ });
11
+ Object.defineProperty(exports, "formatPKR", {
12
+ enumerable: true,
13
+ get: function () { return chunkLVHTH4P7_cjs.formatPKR; }
14
+ });
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Formats a numeric amount as Pakistani Rupees with comma separators,
3
+ * rounded to whole rupees. Negative amounts are prefixed with `-`.
4
+ *
5
+ * @param amount - The amount in PKR
6
+ * @returns Formatted string (e.g. `"Rs. 150,000"`, `"-Rs. 500"`)
7
+ * @throws {RangeError} If `amount` is `NaN` or infinite
8
+ */
9
+ declare function formatPKR(amount: number): string;
10
+ /**
11
+ * Formats a numeric amount using Pakistani lakh/crore conventions.
12
+ *
13
+ * - Amounts of 1 crore or more render as `"N Crore"` (e.g. `10000000` → `"1 Crore"`)
14
+ * - Amounts of 1 lakh or more render as `"N Lakh"` (e.g. `2500000` → `"25 Lakh"`)
15
+ * - Smaller amounts fall back to {@link formatPKR}
16
+ *
17
+ * Values are rounded to two decimals before the unit is chosen, so
18
+ * `9999999` renders as `"1 Crore"` rather than `"100 Lakh"`.
19
+ * Negative amounts are prefixed with `-`.
20
+ *
21
+ * @param amount - The amount in PKR
22
+ * @returns Human-readable lakh/crore string
23
+ * @throws {RangeError} If `amount` is `NaN` or infinite
24
+ */
25
+ declare function formatLakh(amount: number): string;
26
+
27
+ export { formatLakh, formatPKR };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Formats a numeric amount as Pakistani Rupees with comma separators,
3
+ * rounded to whole rupees. Negative amounts are prefixed with `-`.
4
+ *
5
+ * @param amount - The amount in PKR
6
+ * @returns Formatted string (e.g. `"Rs. 150,000"`, `"-Rs. 500"`)
7
+ * @throws {RangeError} If `amount` is `NaN` or infinite
8
+ */
9
+ declare function formatPKR(amount: number): string;
10
+ /**
11
+ * Formats a numeric amount using Pakistani lakh/crore conventions.
12
+ *
13
+ * - Amounts of 1 crore or more render as `"N Crore"` (e.g. `10000000` → `"1 Crore"`)
14
+ * - Amounts of 1 lakh or more render as `"N Lakh"` (e.g. `2500000` → `"25 Lakh"`)
15
+ * - Smaller amounts fall back to {@link formatPKR}
16
+ *
17
+ * Values are rounded to two decimals before the unit is chosen, so
18
+ * `9999999` renders as `"1 Crore"` rather than `"100 Lakh"`.
19
+ * Negative amounts are prefixed with `-`.
20
+ *
21
+ * @param amount - The amount in PKR
22
+ * @returns Human-readable lakh/crore string
23
+ * @throws {RangeError} If `amount` is `NaN` or infinite
24
+ */
25
+ declare function formatLakh(amount: number): string;
26
+
27
+ export { formatLakh, formatPKR };
package/dist/format.js ADDED
@@ -0,0 +1 @@
1
+ export { formatLakh, formatPKR } from './chunk-6TSKA2PH.js';
package/dist/geo.cjs ADDED
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var chunk3COX5FSL_cjs = require('./chunk-3COX5FSL.cjs');
4
+ require('./chunk-VPBMIYO2.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "getDistrictProvince", {
9
+ enumerable: true,
10
+ get: function () { return chunk3COX5FSL_cjs.getDistrictProvince; }
11
+ });
12
+ Object.defineProperty(exports, "getDistrictsByProvince", {
13
+ enumerable: true,
14
+ get: function () { return chunk3COX5FSL_cjs.getDistrictsByProvince; }
15
+ });
16
+ Object.defineProperty(exports, "getProvince", {
17
+ enumerable: true,
18
+ get: function () { return chunk3COX5FSL_cjs.getProvince; }
19
+ });
20
+ Object.defineProperty(exports, "searchCities", {
21
+ enumerable: true,
22
+ get: function () { return chunk3COX5FSL_cjs.searchCities; }
23
+ });
24
+ Object.defineProperty(exports, "searchDistricts", {
25
+ enumerable: true,
26
+ get: function () { return chunk3COX5FSL_cjs.searchDistricts; }
27
+ });
package/dist/geo.d.cts ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Returns the province for a given Pakistani city name.
3
+ *
4
+ * Matching is case-insensitive and ignores inconsistent spacing.
5
+ * Returns `null` when no exact city match is found.
6
+ *
7
+ * @param city - The city name to look up
8
+ * @returns Province name or `null` if not found
9
+ */
10
+ declare function getProvince(city: string): string | null;
11
+ /**
12
+ * Searches cities by partial, case-insensitive name match.
13
+ *
14
+ * @param query - Partial city name to search for
15
+ * @returns Alphabetically sorted list of matching city names
16
+ */
17
+ declare function searchCities(query: string): string[];
18
+ /**
19
+ * Returns the province for a given Pakistani district name.
20
+ *
21
+ * Matching is case-insensitive and ignores inconsistent spacing.
22
+ * Returns `null` when no exact district match is found.
23
+ *
24
+ * @param district - The district name to look up
25
+ * @returns Province name or `null` if not found
26
+ */
27
+ declare function getDistrictProvince(district: string): string | null;
28
+ /**
29
+ * Searches districts by partial, case-insensitive name match.
30
+ *
31
+ * @param query - Partial district name to search for
32
+ * @returns Alphabetically sorted list of matching district names
33
+ */
34
+ declare function searchDistricts(query: string): string[];
35
+ /**
36
+ * Returns all districts for a given province (case-insensitive).
37
+ *
38
+ * @param province - Province name to filter by
39
+ * @returns Alphabetically sorted district names
40
+ */
41
+ declare function getDistrictsByProvince(province: string): string[];
42
+
43
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts };
package/dist/geo.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Returns the province for a given Pakistani city name.
3
+ *
4
+ * Matching is case-insensitive and ignores inconsistent spacing.
5
+ * Returns `null` when no exact city match is found.
6
+ *
7
+ * @param city - The city name to look up
8
+ * @returns Province name or `null` if not found
9
+ */
10
+ declare function getProvince(city: string): string | null;
11
+ /**
12
+ * Searches cities by partial, case-insensitive name match.
13
+ *
14
+ * @param query - Partial city name to search for
15
+ * @returns Alphabetically sorted list of matching city names
16
+ */
17
+ declare function searchCities(query: string): string[];
18
+ /**
19
+ * Returns the province for a given Pakistani district name.
20
+ *
21
+ * Matching is case-insensitive and ignores inconsistent spacing.
22
+ * Returns `null` when no exact district match is found.
23
+ *
24
+ * @param district - The district name to look up
25
+ * @returns Province name or `null` if not found
26
+ */
27
+ declare function getDistrictProvince(district: string): string | null;
28
+ /**
29
+ * Searches districts by partial, case-insensitive name match.
30
+ *
31
+ * @param query - Partial district name to search for
32
+ * @returns Alphabetically sorted list of matching district names
33
+ */
34
+ declare function searchDistricts(query: string): string[];
35
+ /**
36
+ * Returns all districts for a given province (case-insensitive).
37
+ *
38
+ * @param province - Province name to filter by
39
+ * @returns Alphabetically sorted district names
40
+ */
41
+ declare function getDistrictsByProvince(province: string): string[];
42
+
43
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts };
package/dist/geo.js ADDED
@@ -0,0 +1,2 @@
1
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './chunk-K6CZFCX6.js';
2
+ import './chunk-ENQ7O7VW.js';
package/dist/hijri.cjs ADDED
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var chunkCYJJ7KGC_cjs = require('./chunk-CYJJ7KGC.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "formatHijri", {
8
+ enumerable: true,
9
+ get: function () { return chunkCYJJ7KGC_cjs.formatHijri; }
10
+ });
11
+ Object.defineProperty(exports, "fromHijri", {
12
+ enumerable: true,
13
+ get: function () { return chunkCYJJ7KGC_cjs.fromHijri; }
14
+ });
15
+ Object.defineProperty(exports, "getHijriMonthName", {
16
+ enumerable: true,
17
+ get: function () { return chunkCYJJ7KGC_cjs.getHijriMonthName; }
18
+ });
19
+ Object.defineProperty(exports, "isRamadan", {
20
+ enumerable: true,
21
+ get: function () { return chunkCYJJ7KGC_cjs.isRamadan; }
22
+ });
23
+ Object.defineProperty(exports, "toHijri", {
24
+ enumerable: true,
25
+ get: function () { return chunkCYJJ7KGC_cjs.toHijri; }
26
+ });
@@ -0,0 +1,62 @@
1
+ /** Islamic (Hijri) date components. */
2
+ interface HijriDate {
3
+ year: number;
4
+ month: number;
5
+ day: number;
6
+ }
7
+ /** Options for Hijri conversions. */
8
+ interface HijriOptions {
9
+ /**
10
+ * Whole days to shift the tabular calendar by, to match local moon sighting.
11
+ * For example, `-1` when Pakistan's Ruet-e-Hilal calendar runs a day behind
12
+ * the tabular date. Defaults to `0`.
13
+ */
14
+ offset?: number;
15
+ }
16
+ /**
17
+ * Converts a Gregorian `Date` to a Hijri (Islamic) date.
18
+ *
19
+ * Uses the tabular (arithmetic, "islamic-civil") calendar. Actual dates in
20
+ * Pakistan follow moon sighting and can differ by a day or two; pass
21
+ * `options.offset` to adjust.
22
+ *
23
+ * @param date - Gregorian date (local date components are used)
24
+ * @param options - Optional day offset for moon-sighting adjustment
25
+ * @returns Hijri date components
26
+ * @throws {RangeError} If `date` is invalid or `offset` is not an integer
27
+ */
28
+ declare function toHijri(date: Date, options?: HijriOptions): HijriDate;
29
+ /**
30
+ * Converts a Hijri date to a Gregorian `Date` (local midnight).
31
+ *
32
+ * @param hijri - Hijri date components
33
+ * @param options - Optional day offset, matching the one used with {@link toHijri}
34
+ * @returns Gregorian date
35
+ * @throws {RangeError} If the Hijri components are out of range
36
+ */
37
+ declare function fromHijri(hijri: HijriDate, options?: HijriOptions): Date;
38
+ /**
39
+ * Formats a Gregorian date as a Hijri date string.
40
+ *
41
+ * @param date - Gregorian date
42
+ * @param options - Optional day offset for moon-sighting adjustment
43
+ * @returns Formatted Hijri string (e.g. `"14 Ramadan 1447"`)
44
+ */
45
+ declare function formatHijri(date: Date, options?: HijriOptions): string;
46
+ /**
47
+ * Returns the English name of a Hijri month (1–12).
48
+ *
49
+ * @param month - Hijri month number
50
+ * @returns Month name, or `null` if `month` is not an integer from 1 to 12
51
+ */
52
+ declare function getHijriMonthName(month: number): string | null;
53
+ /**
54
+ * Returns whether a Gregorian date falls in the month of Ramadan.
55
+ *
56
+ * @param date - Gregorian date
57
+ * @param options - Optional day offset for moon-sighting adjustment
58
+ * @returns `true` during Ramadan
59
+ */
60
+ declare function isRamadan(date: Date, options?: HijriOptions): boolean;
61
+
62
+ export { type HijriDate, type HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri };
@@ -0,0 +1,62 @@
1
+ /** Islamic (Hijri) date components. */
2
+ interface HijriDate {
3
+ year: number;
4
+ month: number;
5
+ day: number;
6
+ }
7
+ /** Options for Hijri conversions. */
8
+ interface HijriOptions {
9
+ /**
10
+ * Whole days to shift the tabular calendar by, to match local moon sighting.
11
+ * For example, `-1` when Pakistan's Ruet-e-Hilal calendar runs a day behind
12
+ * the tabular date. Defaults to `0`.
13
+ */
14
+ offset?: number;
15
+ }
16
+ /**
17
+ * Converts a Gregorian `Date` to a Hijri (Islamic) date.
18
+ *
19
+ * Uses the tabular (arithmetic, "islamic-civil") calendar. Actual dates in
20
+ * Pakistan follow moon sighting and can differ by a day or two; pass
21
+ * `options.offset` to adjust.
22
+ *
23
+ * @param date - Gregorian date (local date components are used)
24
+ * @param options - Optional day offset for moon-sighting adjustment
25
+ * @returns Hijri date components
26
+ * @throws {RangeError} If `date` is invalid or `offset` is not an integer
27
+ */
28
+ declare function toHijri(date: Date, options?: HijriOptions): HijriDate;
29
+ /**
30
+ * Converts a Hijri date to a Gregorian `Date` (local midnight).
31
+ *
32
+ * @param hijri - Hijri date components
33
+ * @param options - Optional day offset, matching the one used with {@link toHijri}
34
+ * @returns Gregorian date
35
+ * @throws {RangeError} If the Hijri components are out of range
36
+ */
37
+ declare function fromHijri(hijri: HijriDate, options?: HijriOptions): Date;
38
+ /**
39
+ * Formats a Gregorian date as a Hijri date string.
40
+ *
41
+ * @param date - Gregorian date
42
+ * @param options - Optional day offset for moon-sighting adjustment
43
+ * @returns Formatted Hijri string (e.g. `"14 Ramadan 1447"`)
44
+ */
45
+ declare function formatHijri(date: Date, options?: HijriOptions): string;
46
+ /**
47
+ * Returns the English name of a Hijri month (1–12).
48
+ *
49
+ * @param month - Hijri month number
50
+ * @returns Month name, or `null` if `month` is not an integer from 1 to 12
51
+ */
52
+ declare function getHijriMonthName(month: number): string | null;
53
+ /**
54
+ * Returns whether a Gregorian date falls in the month of Ramadan.
55
+ *
56
+ * @param date - Gregorian date
57
+ * @param options - Optional day offset for moon-sighting adjustment
58
+ * @returns `true` during Ramadan
59
+ */
60
+ declare function isRamadan(date: Date, options?: HijriOptions): boolean;
61
+
62
+ export { type HijriDate, type HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri };
package/dist/hijri.js ADDED
@@ -0,0 +1 @@
1
+ export { formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './chunk-Z5JEIQVW.js';
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var chunkXCXFGTHW_cjs = require('./chunk-XCXFGTHW.cjs');
4
+ require('./chunk-CYJJ7KGC.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "getHolidaysOn", {
9
+ enumerable: true,
10
+ get: function () { return chunkXCXFGTHW_cjs.getHolidaysOn; }
11
+ });
12
+ Object.defineProperty(exports, "getPakistanHolidays", {
13
+ enumerable: true,
14
+ get: function () { return chunkXCXFGTHW_cjs.getPakistanHolidays; }
15
+ });
16
+ Object.defineProperty(exports, "isPakistanHoliday", {
17
+ enumerable: true,
18
+ get: function () { return chunkXCXFGTHW_cjs.isPakistanHoliday; }
19
+ });
@@ -0,0 +1,72 @@
1
+ /** Islamic public holidays, whose dates depend on moon sighting. */
2
+ type IslamicHolidayId = 'eid-ul-fitr' | 'eid-ul-adha' | 'ashura' | 'eid-milad-un-nabi';
3
+ /** Identifier of a Pakistani federal public holiday. */
4
+ type HolidayId = IslamicHolidayId | 'kashmir-day' | 'pakistan-day' | 'labour-day' | 'youm-e-takbeer' | 'independence-day' | 'iqbal-day' | 'quaid-e-azam-day' | 'day-after-christmas';
5
+ /** A public holiday on a specific date. */
6
+ interface Holiday {
7
+ id: HolidayId;
8
+ name: string;
9
+ /** Date as `YYYY-MM-DD`. */
10
+ date: string;
11
+ type: 'national' | 'religious';
12
+ /**
13
+ * `true` when an Islamic holiday's date is calculated from the tabular Hijri
14
+ * calendar because the observed dates are not in the dataset yet. The real
15
+ * date depends on the moon-sighting announcement.
16
+ */
17
+ estimated: boolean;
18
+ /** `true` for holidays that apply to Christian employees only. */
19
+ christiansOnly?: boolean;
20
+ /** Source of an observed Islamic holiday date. */
21
+ source?: string;
22
+ }
23
+ /** Options for {@link getPakistanHolidays}. */
24
+ interface HolidayOptions {
25
+ /** Include 26 December, a holiday for Christian employees only. Defaults to `false`. */
26
+ includeChristianHolidays?: boolean;
27
+ /**
28
+ * Observed or announced dates (`YYYY-MM-DD`) for Islamic holidays, used
29
+ * instead of the dataset or estimate. Use this to apply a new moon-sighting
30
+ * announcement before the library is updated.
31
+ */
32
+ announced?: Partial<Record<IslamicHolidayId, string[]>>;
33
+ /** Day offset applied to estimated Islamic dates. Defaults to `0`. */
34
+ hijriOffset?: number;
35
+ }
36
+ /**
37
+ * Lists Pakistan's federal public holidays for a year, sorted by date.
38
+ *
39
+ * Islamic holidays use the dates actually observed after moon sighting
40
+ * (2020 onwards, from Cabinet Division and SBP notifications). For years not
41
+ * yet in the dataset they are estimated from the tabular Hijri calendar and
42
+ * marked `estimated: true`; pass `announced` to use official dates instead.
43
+ *
44
+ * Optional holidays (e.g. Shab-e-Barat, Easter, Youm-e-Ali) are not included.
45
+ *
46
+ * @example
47
+ * getPakistanHolidays(2025).find((h) => h.id === 'eid-ul-fitr');
48
+ * // { id: 'eid-ul-fitr', name: 'Eid ul Fitr', date: '2025-03-31', type: 'religious', estimated: false, ... }
49
+ *
50
+ * @param year - Gregorian year
51
+ * @param options - Christian holidays, announced dates and estimate offset
52
+ * @returns Holidays in date order
53
+ */
54
+ declare function getPakistanHolidays(year: number, options?: HolidayOptions): Holiday[];
55
+ /**
56
+ * Returns the public holidays that fall on a date.
57
+ *
58
+ * @param date - A `Date` (local calendar date) or `YYYY-MM-DD` string
59
+ * @param options - Same options as {@link getPakistanHolidays}
60
+ * @returns Holidays on that date; empty if it is not a public holiday
61
+ */
62
+ declare function getHolidaysOn(date: Date | string, options?: HolidayOptions): Holiday[];
63
+ /**
64
+ * Returns whether a date is a Pakistani federal public holiday.
65
+ *
66
+ * @param date - A `Date` (local calendar date) or `YYYY-MM-DD` string
67
+ * @param options - Same options as {@link getPakistanHolidays}
68
+ * @returns `true` on a public holiday
69
+ */
70
+ declare function isPakistanHoliday(date: Date | string, options?: HolidayOptions): boolean;
71
+
72
+ export { type Holiday, type HolidayId, type HolidayOptions, type IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday };
@@ -0,0 +1,72 @@
1
+ /** Islamic public holidays, whose dates depend on moon sighting. */
2
+ type IslamicHolidayId = 'eid-ul-fitr' | 'eid-ul-adha' | 'ashura' | 'eid-milad-un-nabi';
3
+ /** Identifier of a Pakistani federal public holiday. */
4
+ type HolidayId = IslamicHolidayId | 'kashmir-day' | 'pakistan-day' | 'labour-day' | 'youm-e-takbeer' | 'independence-day' | 'iqbal-day' | 'quaid-e-azam-day' | 'day-after-christmas';
5
+ /** A public holiday on a specific date. */
6
+ interface Holiday {
7
+ id: HolidayId;
8
+ name: string;
9
+ /** Date as `YYYY-MM-DD`. */
10
+ date: string;
11
+ type: 'national' | 'religious';
12
+ /**
13
+ * `true` when an Islamic holiday's date is calculated from the tabular Hijri
14
+ * calendar because the observed dates are not in the dataset yet. The real
15
+ * date depends on the moon-sighting announcement.
16
+ */
17
+ estimated: boolean;
18
+ /** `true` for holidays that apply to Christian employees only. */
19
+ christiansOnly?: boolean;
20
+ /** Source of an observed Islamic holiday date. */
21
+ source?: string;
22
+ }
23
+ /** Options for {@link getPakistanHolidays}. */
24
+ interface HolidayOptions {
25
+ /** Include 26 December, a holiday for Christian employees only. Defaults to `false`. */
26
+ includeChristianHolidays?: boolean;
27
+ /**
28
+ * Observed or announced dates (`YYYY-MM-DD`) for Islamic holidays, used
29
+ * instead of the dataset or estimate. Use this to apply a new moon-sighting
30
+ * announcement before the library is updated.
31
+ */
32
+ announced?: Partial<Record<IslamicHolidayId, string[]>>;
33
+ /** Day offset applied to estimated Islamic dates. Defaults to `0`. */
34
+ hijriOffset?: number;
35
+ }
36
+ /**
37
+ * Lists Pakistan's federal public holidays for a year, sorted by date.
38
+ *
39
+ * Islamic holidays use the dates actually observed after moon sighting
40
+ * (2020 onwards, from Cabinet Division and SBP notifications). For years not
41
+ * yet in the dataset they are estimated from the tabular Hijri calendar and
42
+ * marked `estimated: true`; pass `announced` to use official dates instead.
43
+ *
44
+ * Optional holidays (e.g. Shab-e-Barat, Easter, Youm-e-Ali) are not included.
45
+ *
46
+ * @example
47
+ * getPakistanHolidays(2025).find((h) => h.id === 'eid-ul-fitr');
48
+ * // { id: 'eid-ul-fitr', name: 'Eid ul Fitr', date: '2025-03-31', type: 'religious', estimated: false, ... }
49
+ *
50
+ * @param year - Gregorian year
51
+ * @param options - Christian holidays, announced dates and estimate offset
52
+ * @returns Holidays in date order
53
+ */
54
+ declare function getPakistanHolidays(year: number, options?: HolidayOptions): Holiday[];
55
+ /**
56
+ * Returns the public holidays that fall on a date.
57
+ *
58
+ * @param date - A `Date` (local calendar date) or `YYYY-MM-DD` string
59
+ * @param options - Same options as {@link getPakistanHolidays}
60
+ * @returns Holidays on that date; empty if it is not a public holiday
61
+ */
62
+ declare function getHolidaysOn(date: Date | string, options?: HolidayOptions): Holiday[];
63
+ /**
64
+ * Returns whether a date is a Pakistani federal public holiday.
65
+ *
66
+ * @param date - A `Date` (local calendar date) or `YYYY-MM-DD` string
67
+ * @param options - Same options as {@link getPakistanHolidays}
68
+ * @returns `true` on a public holiday
69
+ */
70
+ declare function isPakistanHoliday(date: Date | string, options?: HolidayOptions): boolean;
71
+
72
+ export { type Holiday, type HolidayId, type HolidayOptions, type IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday };
@@ -0,0 +1,2 @@
1
+ export { getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './chunk-HBOZIITD.js';
2
+ import './chunk-Z5JEIQVW.js';
package/dist/iban.cjs ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var chunkE47SNBWQ_cjs = require('./chunk-E47SNBWQ.cjs');
4
+ require('./chunk-VPBMIYO2.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "getBankFromIBAN", {
9
+ enumerable: true,
10
+ get: function () { return chunkE47SNBWQ_cjs.getBankFromIBAN; }
11
+ });
12
+ Object.defineProperty(exports, "validateIBAN", {
13
+ enumerable: true,
14
+ get: function () { return chunkE47SNBWQ_cjs.validateIBAN; }
15
+ });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
3
+ *
4
+ * Accepts spaced or unspaced input. Only `PK` IBANs of exactly 24 characters
5
+ * are supported.
6
+ *
7
+ * @param iban - IBAN string to validate
8
+ * @returns `true` if valid, otherwise `false`
9
+ */
10
+ declare function validateIBAN(iban: string): boolean;
11
+ /**
12
+ * Returns the bank name for a valid Pakistani IBAN based on its 4-letter bank code.
13
+ *
14
+ * Returns `null` when the IBAN is invalid or the bank code is not in the dataset.
15
+ *
16
+ * @param iban - IBAN string to look up
17
+ * @returns Bank name or `null` if not found
18
+ */
19
+ declare function getBankFromIBAN(iban: string): string | null;
20
+
21
+ export { getBankFromIBAN, validateIBAN };