chronos-date 2.0.4 → 2.1.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 (85) hide show
  1. package/dist/constants.d.mts +1 -1
  2. package/dist/convert-C8LsoKmI-Blf3eLS6.mjs +285 -0
  3. package/dist/convert-C8LsoKmI-uBhT5hZQ.cjs +387 -0
  4. package/dist/dist-BPHYJA0t.mjs +70 -0
  5. package/dist/dist-CdMlZMZa.cjs +75 -0
  6. package/dist/{greet-DNGvP7nm.mjs → greet-BC86-X9W.mjs} +2 -2
  7. package/dist/{greet-CMkwXJ7o.cjs → greet-Brz0CVv1.cjs} +8 -8
  8. package/dist/guards-DTI799nG.mjs +46 -0
  9. package/dist/guards-dH9JJIso.cjs +51 -0
  10. package/dist/guards.cjs +14 -16
  11. package/dist/guards.d.cts +1 -1
  12. package/dist/guards.d.mts +1 -1
  13. package/dist/guards.mjs +1 -3
  14. package/dist/{helpers-Bq7Hczoa.cjs → helpers-BMDeRLjO.cjs} +6 -8
  15. package/dist/{helpers-C2spzGZ-.mjs → helpers-t49KkxOE.mjs} +2 -4
  16. package/dist/index.cjs +13 -14
  17. package/dist/index.d.cts +1 -1
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +4 -5
  20. package/dist/plugins/banglaPlugin.cjs +16 -33
  21. package/dist/plugins/banglaPlugin.d.cts +1 -1
  22. package/dist/plugins/banglaPlugin.d.mts +1 -1
  23. package/dist/plugins/banglaPlugin.mjs +2 -19
  24. package/dist/plugins/businessPlugin.cjs +4 -5
  25. package/dist/plugins/businessPlugin.d.cts +1 -1
  26. package/dist/plugins/businessPlugin.d.mts +1 -1
  27. package/dist/plugins/businessPlugin.mjs +1 -2
  28. package/dist/plugins/dateRangePlugin.cjs +4 -5
  29. package/dist/plugins/dateRangePlugin.d.cts +1 -1
  30. package/dist/plugins/dateRangePlugin.d.mts +1 -1
  31. package/dist/plugins/dateRangePlugin.mjs +1 -2
  32. package/dist/plugins/dayPartPlugin.cjs +2 -2
  33. package/dist/plugins/dayPartPlugin.d.cts +1 -1
  34. package/dist/plugins/dayPartPlugin.d.mts +1 -1
  35. package/dist/plugins/dayPartPlugin.mjs +1 -1
  36. package/dist/plugins/durationPlugin.d.cts +1 -1
  37. package/dist/plugins/durationPlugin.d.mts +1 -1
  38. package/dist/plugins/fromNowPlugin.cjs +2 -2
  39. package/dist/plugins/fromNowPlugin.d.cts +1 -1
  40. package/dist/plugins/fromNowPlugin.d.mts +1 -1
  41. package/dist/plugins/fromNowPlugin.mjs +1 -1
  42. package/dist/plugins/greetingPlugin.cjs +1 -1
  43. package/dist/plugins/greetingPlugin.d.cts +1 -1
  44. package/dist/plugins/greetingPlugin.d.mts +1 -1
  45. package/dist/plugins/greetingPlugin.mjs +1 -1
  46. package/dist/plugins/palindromePlugin.cjs +2 -9
  47. package/dist/plugins/palindromePlugin.d.cts +1 -1
  48. package/dist/plugins/palindromePlugin.d.mts +1 -1
  49. package/dist/plugins/palindromePlugin.mjs +1 -8
  50. package/dist/plugins/relativeTimePlugin.d.cts +1 -1
  51. package/dist/plugins/relativeTimePlugin.d.mts +1 -1
  52. package/dist/plugins/roundPlugin.cjs +8 -8
  53. package/dist/plugins/roundPlugin.d.cts +1 -1
  54. package/dist/plugins/roundPlugin.d.mts +1 -1
  55. package/dist/plugins/roundPlugin.mjs +1 -1
  56. package/dist/plugins/seasonPlugin.d.cts +1 -1
  57. package/dist/plugins/seasonPlugin.d.mts +1 -1
  58. package/dist/plugins/timeZonePlugin.cjs +3 -3
  59. package/dist/plugins/timeZonePlugin.d.cts +1 -1
  60. package/dist/plugins/timeZonePlugin.d.mts +1 -1
  61. package/dist/plugins/timeZonePlugin.mjs +2 -2
  62. package/dist/plugins/zodiacPlugin.cjs +1 -1
  63. package/dist/plugins/zodiacPlugin.d.cts +1 -1
  64. package/dist/plugins/zodiacPlugin.d.mts +1 -1
  65. package/dist/plugins/zodiacPlugin.mjs +1 -1
  66. package/dist/{types-Be4ZMpOV.d.mts → types-CiFnGEL8.d.mts} +967 -902
  67. package/dist/{types-dNpvroNQ.d.cts → types-zhhEJ8N7.d.cts} +966 -901
  68. package/dist/types.d.cts +1 -1
  69. package/dist/types.d.mts +1 -1
  70. package/dist/{utilities-C6NiChRE.mjs → utils-DBy7S7hH.mjs} +3 -5
  71. package/dist/{utilities-CCnKWAsS.cjs → utils-S_aw0TeC.cjs} +8 -10
  72. package/dist/utils.cjs +33 -34
  73. package/dist/utils.d.cts +4 -4
  74. package/dist/utils.d.mts +4 -4
  75. package/dist/utils.mjs +4 -5
  76. package/package.json +3 -3
  77. package/dist/convert-BDQBTK5P.cjs +0 -49
  78. package/dist/convert-D5Cd0cCg.mjs +0 -38
  79. package/dist/non-primitives-BqjRwK2B.cjs +0 -68
  80. package/dist/non-primitives-CbAOB6lb.mjs +0 -38
  81. package/dist/primitives-BXhrgs9R.mjs +0 -35
  82. package/dist/primitives-DfO90c3G.cjs +0 -65
  83. package/dist/utilities-BnHD2hHf.mjs +0 -59
  84. package/dist/utilities-C_KmjIRK.cjs +0 -88
  85. /package/dist/{seasons-B_kjFWIX.d.mts → seasons-DYk2jvtn.d.mts} +0 -0
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { L as VEDIC_ZODIAC_SIGNS, M as MONTHS, R as WESTERN_ZODIAC_SIGNS, _ as TIME_ZONE_LABELS, a as INDIA_IMD_SEASONS, c as JAPAN_SEASONS, d as US_ACADEMIC_SEASONS, f as IANA_TZ_IDS, g as TIME_ZONE_IDS, h as TIME_ZONES_NATIVE, i as ETHIOPIA_SEASONS, l as PHILIPPINES_SEASONS, m as TIME_ZONES, n as BANGLADESH_SEASONS, o as INDIA_TAMIL_SEASONS, p as NATIVE_TZ_IDS, r as DEFAULT_SEASONS, s as INDIA_VEDIC_SEASONS, t as AUSTRALIA_SEASONS, u as SEASON_PRESETS, w as DAYS } from "./seasons-B_kjFWIX.mjs";
17
+ import { L as VEDIC_ZODIAC_SIGNS, M as MONTHS, R as WESTERN_ZODIAC_SIGNS, _ as TIME_ZONE_LABELS, a as INDIA_IMD_SEASONS, c as JAPAN_SEASONS, d as US_ACADEMIC_SEASONS, f as IANA_TZ_IDS, g as TIME_ZONE_IDS, h as TIME_ZONES_NATIVE, i as ETHIOPIA_SEASONS, l as PHILIPPINES_SEASONS, m as TIME_ZONES, n as BANGLADESH_SEASONS, o as INDIA_TAMIL_SEASONS, p as NATIVE_TZ_IDS, r as DEFAULT_SEASONS, s as INDIA_VEDIC_SEASONS, t as AUSTRALIA_SEASONS, u as SEASON_PRESETS, w as DAYS } from "./seasons-DYk2jvtn.mjs";
18
18
  export { AUSTRALIA_SEASONS, BANGLADESH_SEASONS, ETHIOPIA_SEASONS, IANA_TZ_IDS, INDIA_IMD_SEASONS, INDIA_TAMIL_SEASONS, INDIA_VEDIC_SEASONS, JAPAN_SEASONS, MONTHS, NATIVE_TZ_IDS, PHILIPPINES_SEASONS, SEASON_PRESETS, TIME_ZONES, TIME_ZONES as TZ_ABBREVIATIONS, TIME_ZONES_NATIVE, TIME_ZONE_IDS, TIME_ZONE_LABELS, US_ACADEMIC_SEASONS, VEDIC_ZODIAC_SIGNS, DAYS as WEEK_DAYS, DEFAULT_SEASONS as WESTERN_SEASONS, WESTERN_ZODIAC_SIGNS };
@@ -0,0 +1,285 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/primitives-Djsevc69.mjs
18
+ /**
19
+ * Copyright 2026 - present Nazmul Hassan
20
+ *
21
+ * Licensed under the Apache License, Version 2.0 (the "License");
22
+ * you may not use this file except in compliance with the License.
23
+ * You may obtain a copy of the License at
24
+ *
25
+ * http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software
28
+ * distributed under the License is distributed on an "AS IS" BASIS,
29
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30
+ * See the License for the specific language governing permissions and
31
+ * limitations under the License.
32
+ */
33
+ /**
34
+ * * Type guard to check whether a value is a finite number (excluding `NaN` and `Infinity`).
35
+ * @param value - The value to test.
36
+ * @returns `true` if the value is a finite number; otherwise `false`.
37
+ */
38
+ function isNumber(value) {
39
+ return typeof value === "number" && Number.isFinite(value);
40
+ }
41
+ /**
42
+ * * Type guard to check if a value is a string.
43
+ * @param value - The value to check.
44
+ * @returns `true` if the value is a string, otherwise `false`.
45
+ */
46
+ function isString(value) {
47
+ return typeof value === "string";
48
+ }
49
+ /**
50
+ * * Type guard to check if a value is a boolean.
51
+ * @param value - The value to check.
52
+ * @returns `true` if the value is a boolean, otherwise `false`.
53
+ */
54
+ function isBoolean(value) {
55
+ return typeof value === "boolean";
56
+ }
57
+ /**
58
+ * * Type guard to check if a value is undefined.
59
+ * @param value - The value to check.
60
+ * @returns `true` if the value is undefined, otherwise `false`.
61
+ */
62
+ function isUndefined(value) {
63
+ return value === void 0;
64
+ }
65
+ /**
66
+ * * Type guard to check if a value is a non-empty string.
67
+ * @param value - The value to check.
68
+ * @returns `true` if the value is a non-empty string, otherwise `false`.
69
+ */
70
+ function isNonEmptyString(value) {
71
+ return isString(value) && value?.length > 0;
72
+ }
73
+
74
+ //#endregion
75
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/constants-ZyfpysiQ.mjs
76
+ /** * Bangla digits from `০-৯` mapped against `0-9` */
77
+ const BN_DIGITS = /* @__PURE__ */ Object.freeze({
78
+ "০": 0,
79
+ "১": 1,
80
+ "২": 2,
81
+ "৩": 3,
82
+ "৪": 4,
83
+ "৫": 5,
84
+ "৬": 6,
85
+ "৭": 7,
86
+ "৮": 8,
87
+ "৯": 9
88
+ });
89
+
90
+ //#endregion
91
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/specials-Cye93-uo.mjs
92
+ /**
93
+ * Copyright 2026 - present Nazmul Hassan
94
+ *
95
+ * Licensed under the Apache License, Version 2.0 (the "License");
96
+ * you may not use this file except in compliance with the License.
97
+ * You may obtain a copy of the License at
98
+ *
99
+ * http://www.apache.org/licenses/LICENSE-2.0
100
+ *
101
+ * Unless required by applicable law or agreed to in writing, software
102
+ * distributed under the License is distributed on an "AS IS" BASIS,
103
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
+ * See the License for the specific language governing permissions and
105
+ * limitations under the License.
106
+ */
107
+ /**
108
+ * * Type guard to check if a value is an array.
109
+ * @param value - The value to check.
110
+ * @returns `true` if the value is an array, otherwise `false`.
111
+ */
112
+ function isArray(value) {
113
+ return Array.isArray(value);
114
+ }
115
+ /**
116
+ * * Type guard to check if a value is an array with length.
117
+ * @param value - The value to check.
118
+ * @returns `true` if the value is an array with length, otherwise `false`.
119
+ */
120
+ function isValidArray(value) {
121
+ return Array.isArray(value) && value?.length > 0;
122
+ }
123
+ /**
124
+ * * Type guard to check if a value is an object (excluding null).
125
+ * @param value - The value to check.
126
+ * @returns `true` if the value is an object, otherwise `false`.
127
+ */
128
+ function isObject(value) {
129
+ return value !== null && typeof value === "object" && !isArray(value);
130
+ }
131
+ /**
132
+ * * Type guard to check if a value is an object (excluding null) and has keys in it.
133
+ * @param value - The value to check.
134
+ * @returns `true` if the value is an object with valid keys, otherwise `false`.
135
+ */
136
+ function isNotEmptyObject(value) {
137
+ return isObject(value) && Object.keys(value)?.length > 0;
138
+ }
139
+ /**
140
+ * * Type guard to check if a value is an object with specific keys.
141
+ * @param value - The value to check.
142
+ * @param keys - The list of keys the object should contain.
143
+ * @returns `true` if the value is an object with the specified keys, otherwise `false`.
144
+ */
145
+ function isObjectWithKeys(value, keys) {
146
+ return isObject(value) && keys?.every((key) => key in value);
147
+ }
148
+ /**
149
+ * * Type guard to check if a value is a function.
150
+ * @param value - The value to check.
151
+ * @returns `true` if the value is a function, otherwise `false`.
152
+ */
153
+ function isFunction(value) {
154
+ return typeof value === "function";
155
+ }
156
+ /**
157
+ * * Type guard to check if a value is a string representing a finite number.
158
+ *
159
+ * @remarks
160
+ * - Accepts strings like: `"42"`, `" -5.5 "`, `"0.123"`, `"-0"`, `"1e5"`.
161
+ * - Rejects strings like: `"NaN"`, `"Infinity"`, `"-Infinity"`, `"abc"`, `""`, `"42abc"`.
162
+ *
163
+ * @param value - The value to test.
164
+ * @returns `true` if the value is a string that fully represents a finite number.
165
+ */
166
+ function isNumericString(value) {
167
+ return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
168
+ }
169
+
170
+ //#endregion
171
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/utilities-B9axOvOX.mjs
172
+ /**
173
+ * Copyright 2026 - present Nazmul Hassan
174
+ *
175
+ * Licensed under the Apache License, Version 2.0 (the "License");
176
+ * you may not use this file except in compliance with the License.
177
+ * You may obtain a copy of the License at
178
+ *
179
+ * http://www.apache.org/licenses/LICENSE-2.0
180
+ *
181
+ * Unless required by applicable law or agreed to in writing, software
182
+ * distributed under the License is distributed on an "AS IS" BASIS,
183
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
184
+ * See the License for the specific language governing permissions and
185
+ * limitations under the License.
186
+ */
187
+ /**
188
+ * * Rounds a number to the nearest specified interval.
189
+ * @param value - The number to round.
190
+ * @param interval - The interval to round to. Defaults to `5`.
191
+ * @returns The number rounded to the nearest interval.
192
+ * @example roundToNearest(27, 5) → 25
193
+ */
194
+ const roundToNearest = (value, interval = 5) => {
195
+ return Math.round(Number(value) / interval) * interval;
196
+ };
197
+ /**
198
+ * * Returns the ordinal suffix for a given number (e.g., 1 -> 'st', 2 -> 'nd', 3 -> 'rd', 4 -> 'th' etc.).
199
+ * @description The function handles special cases for 11, 12, and 13, which all use 'th' despite the last digit.
200
+ * If the `withNumber` parameter is `true`, the function returns the number along with its ordinal suffix (e.g., "1st").
201
+ * Otherwise, it returns only the ordinal suffix (e.g., "st").
202
+ *
203
+ * @param num - The number or number string to get the ordinal suffix for.
204
+ * @param withNumber - Whether to include the number along with its ordinal suffix (defaults to `true`).
205
+ * @returns The appropriate ordinal suffix, optionally with the number (e.g., '1st' or 'st`, '2nd' or 'nd' and so on.).
206
+ */
207
+ const getOrdinal = (num, withNumber = true) => {
208
+ const remainder10 = Number(num) % 10;
209
+ const remainder100 = Number(num) % 100;
210
+ let suffix;
211
+ if (remainder10 === 1 && remainder100 !== 11) suffix = "st";
212
+ else if (remainder10 === 2 && remainder100 !== 12) suffix = "nd";
213
+ else if (remainder10 === 3 && remainder100 !== 13) suffix = "rd";
214
+ else suffix = "th";
215
+ return withNumber ? String(num).concat(suffix) : suffix;
216
+ };
217
+ /**
218
+ * * Normalize a number or numeric string to a number.
219
+ * @description
220
+ * This function checks if the input is a number or a numeric string and converts it to a number.
221
+ * If the input is not a valid number or numeric string, it returns `undefined`.
222
+ * @param num - The number to normalize.
223
+ * @returns The normalized number or `undefined` if the input is not a valid number or numeric string.
224
+ */
225
+ function normalizeNumber(num) {
226
+ return isNumber(num) ? num : isNumericString(num) ? Number(num) : void 0;
227
+ }
228
+
229
+ //#endregion
230
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/basics-DQe9mP_M.mjs
231
+ /**
232
+ * Copyright 2026 - present Nazmul Hassan
233
+ *
234
+ * Licensed under the Apache License, Version 2.0 (the "License");
235
+ * you may not use this file except in compliance with the License.
236
+ * You may obtain a copy of the License at
237
+ *
238
+ * http://www.apache.org/licenses/LICENSE-2.0
239
+ *
240
+ * Unless required by applicable law or agreed to in writing, software
241
+ * distributed under the License is distributed on an "AS IS" BASIS,
242
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
243
+ * See the License for the specific language governing permissions and
244
+ * limitations under the License.
245
+ */
246
+ /**
247
+ * * Trims all the words in a string or an array of strings.
248
+ *
249
+ * @param input String or array of strings.
250
+ * @returns Trimmed string or array of strings.
251
+ */
252
+ function trimString(input) {
253
+ if (!input) return "";
254
+ if (isNonEmptyString(input)) return input.trim().replace(/\s+/g, " ");
255
+ if (Array.isArray(input)) return input.map((str) => isNonEmptyString(str) ? str.trim().replace(/\s+/g, " ") : str);
256
+ throw new TypeError("Expected string or array of strings!", { cause: "Invalid Input Type" });
257
+ }
258
+
259
+ //#endregion
260
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/convert-C8LsoKmI.mjs
261
+ /**
262
+ * * Reverses a given string.
263
+ * @param input - The string to reverse.
264
+ * @returns The reversed string.
265
+ */
266
+ const reverseString = (input) => {
267
+ return trimString(input)?.split("")?.reverse()?.join("");
268
+ };
269
+ /**
270
+ * * Returns a grammatically correct unit string, optionally prefixed with the number.
271
+ *
272
+ * @remarks For complex and versatile pluralization, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/pluralizer pluralizer} or {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/Pluralizer Pluralizer Class} instead.
273
+ *
274
+ * @param count The numeric value to determine singular or plural.
275
+ * @param unit The unit name (e.g., "day", "hour").
276
+ * @param withNumber Whether to prefix the count before the unit. Defaults to `true`.
277
+ * @returns Formatted unit string like `"1 day"`, `"2 months"`, or `"hour"`.
278
+ */
279
+ function formatUnitWithPlural(count, unit, withNumber = true) {
280
+ const pluralized = Math.abs(count) === 1 ? unit : `${unit}s`;
281
+ return withNumber ? `${count} ${pluralized}` : pluralized;
282
+ }
283
+
284
+ //#endregion
285
+ export { isUndefined as _, roundToNearest as a, isNumericString as c, isValidArray as d, BN_DIGITS as f, isString as g, isNumber as h, normalizeNumber as i, isObject as l, isNonEmptyString as m, reverseString as n, isFunction as o, isBoolean as p, getOrdinal as r, isNotEmptyObject as s, formatUnitWithPlural as t, isObjectWithKeys as u };
@@ -0,0 +1,387 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+
18
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/primitives-Djsevc69.mjs
19
+ /**
20
+ * Copyright 2026 - present Nazmul Hassan
21
+ *
22
+ * Licensed under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License.
24
+ * You may obtain a copy of the License at
25
+ *
26
+ * http://www.apache.org/licenses/LICENSE-2.0
27
+ *
28
+ * Unless required by applicable law or agreed to in writing, software
29
+ * distributed under the License is distributed on an "AS IS" BASIS,
30
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ * See the License for the specific language governing permissions and
32
+ * limitations under the License.
33
+ */
34
+ /**
35
+ * * Type guard to check whether a value is a finite number (excluding `NaN` and `Infinity`).
36
+ * @param value - The value to test.
37
+ * @returns `true` if the value is a finite number; otherwise `false`.
38
+ */
39
+ function isNumber(value) {
40
+ return typeof value === "number" && Number.isFinite(value);
41
+ }
42
+ /**
43
+ * * Type guard to check if a value is a string.
44
+ * @param value - The value to check.
45
+ * @returns `true` if the value is a string, otherwise `false`.
46
+ */
47
+ function isString(value) {
48
+ return typeof value === "string";
49
+ }
50
+ /**
51
+ * * Type guard to check if a value is a boolean.
52
+ * @param value - The value to check.
53
+ * @returns `true` if the value is a boolean, otherwise `false`.
54
+ */
55
+ function isBoolean(value) {
56
+ return typeof value === "boolean";
57
+ }
58
+ /**
59
+ * * Type guard to check if a value is undefined.
60
+ * @param value - The value to check.
61
+ * @returns `true` if the value is undefined, otherwise `false`.
62
+ */
63
+ function isUndefined(value) {
64
+ return value === void 0;
65
+ }
66
+ /**
67
+ * * Type guard to check if a value is a non-empty string.
68
+ * @param value - The value to check.
69
+ * @returns `true` if the value is a non-empty string, otherwise `false`.
70
+ */
71
+ function isNonEmptyString(value) {
72
+ return isString(value) && value?.length > 0;
73
+ }
74
+
75
+ //#endregion
76
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/constants-ZyfpysiQ.mjs
77
+ /** * Bangla digits from `০-৯` mapped against `0-9` */
78
+ const BN_DIGITS = /* @__PURE__ */ Object.freeze({
79
+ "০": 0,
80
+ "১": 1,
81
+ "২": 2,
82
+ "৩": 3,
83
+ "৪": 4,
84
+ "৫": 5,
85
+ "৬": 6,
86
+ "৭": 7,
87
+ "৮": 8,
88
+ "৯": 9
89
+ });
90
+
91
+ //#endregion
92
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/specials-Cye93-uo.mjs
93
+ /**
94
+ * Copyright 2026 - present Nazmul Hassan
95
+ *
96
+ * Licensed under the Apache License, Version 2.0 (the "License");
97
+ * you may not use this file except in compliance with the License.
98
+ * You may obtain a copy of the License at
99
+ *
100
+ * http://www.apache.org/licenses/LICENSE-2.0
101
+ *
102
+ * Unless required by applicable law or agreed to in writing, software
103
+ * distributed under the License is distributed on an "AS IS" BASIS,
104
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
+ * See the License for the specific language governing permissions and
106
+ * limitations under the License.
107
+ */
108
+ /**
109
+ * * Type guard to check if a value is an array.
110
+ * @param value - The value to check.
111
+ * @returns `true` if the value is an array, otherwise `false`.
112
+ */
113
+ function isArray(value) {
114
+ return Array.isArray(value);
115
+ }
116
+ /**
117
+ * * Type guard to check if a value is an array with length.
118
+ * @param value - The value to check.
119
+ * @returns `true` if the value is an array with length, otherwise `false`.
120
+ */
121
+ function isValidArray(value) {
122
+ return Array.isArray(value) && value?.length > 0;
123
+ }
124
+ /**
125
+ * * Type guard to check if a value is an object (excluding null).
126
+ * @param value - The value to check.
127
+ * @returns `true` if the value is an object, otherwise `false`.
128
+ */
129
+ function isObject(value) {
130
+ return value !== null && typeof value === "object" && !isArray(value);
131
+ }
132
+ /**
133
+ * * Type guard to check if a value is an object (excluding null) and has keys in it.
134
+ * @param value - The value to check.
135
+ * @returns `true` if the value is an object with valid keys, otherwise `false`.
136
+ */
137
+ function isNotEmptyObject(value) {
138
+ return isObject(value) && Object.keys(value)?.length > 0;
139
+ }
140
+ /**
141
+ * * Type guard to check if a value is an object with specific keys.
142
+ * @param value - The value to check.
143
+ * @param keys - The list of keys the object should contain.
144
+ * @returns `true` if the value is an object with the specified keys, otherwise `false`.
145
+ */
146
+ function isObjectWithKeys(value, keys) {
147
+ return isObject(value) && keys?.every((key) => key in value);
148
+ }
149
+ /**
150
+ * * Type guard to check if a value is a function.
151
+ * @param value - The value to check.
152
+ * @returns `true` if the value is a function, otherwise `false`.
153
+ */
154
+ function isFunction(value) {
155
+ return typeof value === "function";
156
+ }
157
+ /**
158
+ * * Type guard to check if a value is a string representing a finite number.
159
+ *
160
+ * @remarks
161
+ * - Accepts strings like: `"42"`, `" -5.5 "`, `"0.123"`, `"-0"`, `"1e5"`.
162
+ * - Rejects strings like: `"NaN"`, `"Infinity"`, `"-Infinity"`, `"abc"`, `""`, `"42abc"`.
163
+ *
164
+ * @param value - The value to test.
165
+ * @returns `true` if the value is a string that fully represents a finite number.
166
+ */
167
+ function isNumericString(value) {
168
+ return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
169
+ }
170
+
171
+ //#endregion
172
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/utilities-B9axOvOX.mjs
173
+ /**
174
+ * Copyright 2026 - present Nazmul Hassan
175
+ *
176
+ * Licensed under the Apache License, Version 2.0 (the "License");
177
+ * you may not use this file except in compliance with the License.
178
+ * You may obtain a copy of the License at
179
+ *
180
+ * http://www.apache.org/licenses/LICENSE-2.0
181
+ *
182
+ * Unless required by applicable law or agreed to in writing, software
183
+ * distributed under the License is distributed on an "AS IS" BASIS,
184
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185
+ * See the License for the specific language governing permissions and
186
+ * limitations under the License.
187
+ */
188
+ /**
189
+ * * Rounds a number to the nearest specified interval.
190
+ * @param value - The number to round.
191
+ * @param interval - The interval to round to. Defaults to `5`.
192
+ * @returns The number rounded to the nearest interval.
193
+ * @example roundToNearest(27, 5) → 25
194
+ */
195
+ const roundToNearest = (value, interval = 5) => {
196
+ return Math.round(Number(value) / interval) * interval;
197
+ };
198
+ /**
199
+ * * Returns the ordinal suffix for a given number (e.g., 1 -> 'st', 2 -> 'nd', 3 -> 'rd', 4 -> 'th' etc.).
200
+ * @description The function handles special cases for 11, 12, and 13, which all use 'th' despite the last digit.
201
+ * If the `withNumber` parameter is `true`, the function returns the number along with its ordinal suffix (e.g., "1st").
202
+ * Otherwise, it returns only the ordinal suffix (e.g., "st").
203
+ *
204
+ * @param num - The number or number string to get the ordinal suffix for.
205
+ * @param withNumber - Whether to include the number along with its ordinal suffix (defaults to `true`).
206
+ * @returns The appropriate ordinal suffix, optionally with the number (e.g., '1st' or 'st`, '2nd' or 'nd' and so on.).
207
+ */
208
+ const getOrdinal = (num, withNumber = true) => {
209
+ const remainder10 = Number(num) % 10;
210
+ const remainder100 = Number(num) % 100;
211
+ let suffix;
212
+ if (remainder10 === 1 && remainder100 !== 11) suffix = "st";
213
+ else if (remainder10 === 2 && remainder100 !== 12) suffix = "nd";
214
+ else if (remainder10 === 3 && remainder100 !== 13) suffix = "rd";
215
+ else suffix = "th";
216
+ return withNumber ? String(num).concat(suffix) : suffix;
217
+ };
218
+ /**
219
+ * * Normalize a number or numeric string to a number.
220
+ * @description
221
+ * This function checks if the input is a number or a numeric string and converts it to a number.
222
+ * If the input is not a valid number or numeric string, it returns `undefined`.
223
+ * @param num - The number to normalize.
224
+ * @returns The normalized number or `undefined` if the input is not a valid number or numeric string.
225
+ */
226
+ function normalizeNumber(num) {
227
+ return isNumber(num) ? num : isNumericString(num) ? Number(num) : void 0;
228
+ }
229
+
230
+ //#endregion
231
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/basics-DQe9mP_M.mjs
232
+ /**
233
+ * Copyright 2026 - present Nazmul Hassan
234
+ *
235
+ * Licensed under the Apache License, Version 2.0 (the "License");
236
+ * you may not use this file except in compliance with the License.
237
+ * You may obtain a copy of the License at
238
+ *
239
+ * http://www.apache.org/licenses/LICENSE-2.0
240
+ *
241
+ * Unless required by applicable law or agreed to in writing, software
242
+ * distributed under the License is distributed on an "AS IS" BASIS,
243
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244
+ * See the License for the specific language governing permissions and
245
+ * limitations under the License.
246
+ */
247
+ /**
248
+ * * Trims all the words in a string or an array of strings.
249
+ *
250
+ * @param input String or array of strings.
251
+ * @returns Trimmed string or array of strings.
252
+ */
253
+ function trimString(input) {
254
+ if (!input) return "";
255
+ if (isNonEmptyString(input)) return input.trim().replace(/\s+/g, " ");
256
+ if (Array.isArray(input)) return input.map((str) => isNonEmptyString(str) ? str.trim().replace(/\s+/g, " ") : str);
257
+ throw new TypeError("Expected string or array of strings!", { cause: "Invalid Input Type" });
258
+ }
259
+
260
+ //#endregion
261
+ //#region node_modules/.pnpm/toolbox-x@1.0.1-rc.6/node_modules/toolbox-x/dist/convert-C8LsoKmI.mjs
262
+ /**
263
+ * * Reverses a given string.
264
+ * @param input - The string to reverse.
265
+ * @returns The reversed string.
266
+ */
267
+ const reverseString = (input) => {
268
+ return trimString(input)?.split("")?.reverse()?.join("");
269
+ };
270
+ /**
271
+ * * Returns a grammatically correct unit string, optionally prefixed with the number.
272
+ *
273
+ * @remarks For complex and versatile pluralization, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utilities/string/pluralizer pluralizer} or {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/Pluralizer Pluralizer Class} instead.
274
+ *
275
+ * @param count The numeric value to determine singular or plural.
276
+ * @param unit The unit name (e.g., "day", "hour").
277
+ * @param withNumber Whether to prefix the count before the unit. Defaults to `true`.
278
+ * @returns Formatted unit string like `"1 day"`, `"2 months"`, or `"hour"`.
279
+ */
280
+ function formatUnitWithPlural(count, unit, withNumber = true) {
281
+ const pluralized = Math.abs(count) === 1 ? unit : `${unit}s`;
282
+ return withNumber ? `${count} ${pluralized}` : pluralized;
283
+ }
284
+
285
+ //#endregion
286
+ Object.defineProperty(exports, 'BN_DIGITS', {
287
+ enumerable: true,
288
+ get: function () {
289
+ return BN_DIGITS;
290
+ }
291
+ });
292
+ Object.defineProperty(exports, 'formatUnitWithPlural', {
293
+ enumerable: true,
294
+ get: function () {
295
+ return formatUnitWithPlural;
296
+ }
297
+ });
298
+ Object.defineProperty(exports, 'getOrdinal', {
299
+ enumerable: true,
300
+ get: function () {
301
+ return getOrdinal;
302
+ }
303
+ });
304
+ Object.defineProperty(exports, 'isBoolean', {
305
+ enumerable: true,
306
+ get: function () {
307
+ return isBoolean;
308
+ }
309
+ });
310
+ Object.defineProperty(exports, 'isFunction', {
311
+ enumerable: true,
312
+ get: function () {
313
+ return isFunction;
314
+ }
315
+ });
316
+ Object.defineProperty(exports, 'isNonEmptyString', {
317
+ enumerable: true,
318
+ get: function () {
319
+ return isNonEmptyString;
320
+ }
321
+ });
322
+ Object.defineProperty(exports, 'isNotEmptyObject', {
323
+ enumerable: true,
324
+ get: function () {
325
+ return isNotEmptyObject;
326
+ }
327
+ });
328
+ Object.defineProperty(exports, 'isNumber', {
329
+ enumerable: true,
330
+ get: function () {
331
+ return isNumber;
332
+ }
333
+ });
334
+ Object.defineProperty(exports, 'isNumericString', {
335
+ enumerable: true,
336
+ get: function () {
337
+ return isNumericString;
338
+ }
339
+ });
340
+ Object.defineProperty(exports, 'isObject', {
341
+ enumerable: true,
342
+ get: function () {
343
+ return isObject;
344
+ }
345
+ });
346
+ Object.defineProperty(exports, 'isObjectWithKeys', {
347
+ enumerable: true,
348
+ get: function () {
349
+ return isObjectWithKeys;
350
+ }
351
+ });
352
+ Object.defineProperty(exports, 'isString', {
353
+ enumerable: true,
354
+ get: function () {
355
+ return isString;
356
+ }
357
+ });
358
+ Object.defineProperty(exports, 'isUndefined', {
359
+ enumerable: true,
360
+ get: function () {
361
+ return isUndefined;
362
+ }
363
+ });
364
+ Object.defineProperty(exports, 'isValidArray', {
365
+ enumerable: true,
366
+ get: function () {
367
+ return isValidArray;
368
+ }
369
+ });
370
+ Object.defineProperty(exports, 'normalizeNumber', {
371
+ enumerable: true,
372
+ get: function () {
373
+ return normalizeNumber;
374
+ }
375
+ });
376
+ Object.defineProperty(exports, 'reverseString', {
377
+ enumerable: true,
378
+ get: function () {
379
+ return reverseString;
380
+ }
381
+ });
382
+ Object.defineProperty(exports, 'roundToNearest', {
383
+ enumerable: true,
384
+ get: function () {
385
+ return roundToNearest;
386
+ }
387
+ });