toolbox-x 1.2.0 → 2.0.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 (126) hide show
  1. package/dist/{Color-Dsut0Bex.d.cts → Color-B8MR8Vp0.d.cts} +1 -1
  2. package/dist/{Color-DCfoQk_-.d.mts → Color-D2MfZx7L.d.mts} +1 -1
  3. package/dist/{Stylog-DXZtHAbp.d.mts → Stylog-CSbLtqrZ.d.mts} +5 -5
  4. package/dist/{Stylog-TyLCTRtT.d.cts → Stylog-DF0CWtZb.d.cts} +5 -5
  5. package/dist/{area-CvSC96va.d.mts → area-C4tDXnGC.d.mts} +3 -3
  6. package/dist/{area-CcRQ6TfR.d.cts → area-CMJZ0gVm.d.cts} +3 -3
  7. package/dist/{array-B6jWzJ4F.d.mts → array-26Vs2HCs.d.mts} +1 -1
  8. package/dist/{array-CqDu610k.d.cts → array-DJAq9Qj8.d.cts} +1 -1
  9. package/dist/{basics-K8BDSYD6.cjs → basics-CJmdhXoo.cjs} +567 -14
  10. package/dist/{basics-1_M7UvCn.mjs → basics-CebgkY-n.mjs} +449 -16
  11. package/dist/{basics-KobRNhV-.d.cts → basics-Cis9Ej6c.d.mts} +5 -5
  12. package/dist/{basics-V5M2oltn.d.mts → basics-D4yU0NQ_.d.cts} +5 -5
  13. package/dist/{case-uKFzt5TY.cjs → case-Bd7QLHYw.cjs} +3 -3
  14. package/dist/{case-KdrBKjjK.d.mts → case-ChRzRBnY.d.mts} +12 -12
  15. package/dist/{case-BQwn5N-k.mjs → case-DBC4Rj0h.mjs} +3 -3
  16. package/dist/{case--Vjea9DS.d.cts → case-DkYSKSeV.d.cts} +12 -12
  17. package/dist/change-case.cjs +1 -1
  18. package/dist/change-case.d.cts +1 -1
  19. package/dist/change-case.d.mts +1 -1
  20. package/dist/change-case.mjs +1 -1
  21. package/dist/colors.d.cts +2 -2
  22. package/dist/colors.d.mts +2 -2
  23. package/dist/constants.d.cts +1 -1
  24. package/dist/constants.d.mts +1 -1
  25. package/dist/converter.cjs +2 -2
  26. package/dist/converter.d.cts +2 -2
  27. package/dist/converter.d.mts +2 -2
  28. package/dist/converter.mjs +2 -2
  29. package/dist/date.cjs +10 -10
  30. package/dist/date.d.cts +4 -4
  31. package/dist/date.d.mts +4 -4
  32. package/dist/date.mjs +10 -10
  33. package/dist/dom.cjs +5 -6
  34. package/dist/dom.d.cts +3 -3
  35. package/dist/dom.d.mts +3 -3
  36. package/dist/dom.mjs +4 -5
  37. package/dist/{form-DoQGMTOc.d.mts → form-Cp1OyCRI.d.cts} +2 -2
  38. package/dist/{form-mP-nl8EC.d.cts → form-DPdS2AhM.d.mts} +2 -2
  39. package/dist/guards-B2s2wlVN.mjs +425 -0
  40. package/dist/{guards-Cp6KAkVI.mjs → guards-BK1QuvFZ.mjs} +3 -3
  41. package/dist/{guards-DP5k4_Mm.cjs → guards-Bsh6Bfdq.cjs} +3 -3
  42. package/dist/{guards-0VjySrPM.cjs → guards-DMJcjPDt.cjs} +279 -3
  43. package/dist/guards.cjs +9 -9
  44. package/dist/guards.d.cts +6 -5
  45. package/dist/guards.d.mts +6 -5
  46. package/dist/guards.mjs +5 -5
  47. package/dist/{hash-BcoFHSu1.d.cts → hash-DfhOK0Fi.d.mts} +1 -1
  48. package/dist/{hash-GYRx2ee_.d.mts → hash-IdZN0mIe.d.cts} +1 -1
  49. package/dist/hash.cjs +8 -8
  50. package/dist/hash.d.cts +8 -8
  51. package/dist/hash.d.mts +8 -8
  52. package/dist/hash.mjs +4 -5
  53. package/dist/{http-status-xrlR-LlB.d.mts → http-status-B-yBZr-J.d.mts} +1 -1
  54. package/dist/{http-status-C0DOpCDf.d.cts → http-status-Dq_hoSG6.d.cts} +1 -1
  55. package/dist/http-status.cjs +4 -4
  56. package/dist/http-status.d.cts +6 -6
  57. package/dist/http-status.d.mts +6 -6
  58. package/dist/http-status.mjs +4 -4
  59. package/dist/index-C5FoCCbF.d.cts +292 -0
  60. package/dist/index-CIJWxnDS.d.mts +292 -0
  61. package/dist/index.cjs +67 -248
  62. package/dist/index.d.cts +25 -280
  63. package/dist/index.d.mts +25 -280
  64. package/dist/index.mjs +11 -194
  65. package/dist/{object-ChFVh95z.d.cts → object-X5fSMx-I.d.cts} +13 -1
  66. package/dist/{object-ChFVh95z.d.mts → object-X5fSMx-I.d.mts} +13 -1
  67. package/dist/{objectify-CfXtS_E0.mjs → objectify-CQa8gQib.mjs} +3 -4
  68. package/dist/{objectify-CZJr9hwg.cjs → objectify-xQvZS3UI.cjs} +5 -6
  69. package/dist/paginator.d.cts +1 -1
  70. package/dist/paginator.d.mts +1 -1
  71. package/dist/{parse-BpUlILVi.cjs → parse-DT7jbWx7.cjs} +5 -5
  72. package/dist/{parse-rcJRAOJl.mjs → parse-erxBG2hd.mjs} +5 -5
  73. package/dist/{pluralizer-CdG-VJ6t.d.cts → pluralizer-B8vuljyy.d.cts} +1 -1
  74. package/dist/{pluralizer-D2Lh8CdU.d.mts → pluralizer-DOdDskzF.d.mts} +1 -1
  75. package/dist/pluralizer.cjs +6 -6
  76. package/dist/pluralizer.d.cts +6 -6
  77. package/dist/pluralizer.d.mts +6 -6
  78. package/dist/pluralizer.mjs +6 -6
  79. package/dist/{specials-Cye93-uo.mjs → specials-Hq5Ncd6y.mjs} +2 -2
  80. package/dist/{specials-BM6cx43o.cjs → specials-dkYP1Nh2.cjs} +2 -2
  81. package/dist/{string-CkwTVFeL.d.mts → string-C51m7T6d.d.mts} +4 -2
  82. package/dist/{string-Dq2b8rcN.d.cts → string-CO7HP50i.d.cts} +4 -2
  83. package/dist/stylog.cjs +5 -5
  84. package/dist/stylog.d.cts +2 -2
  85. package/dist/stylog.d.mts +2 -2
  86. package/dist/stylog.mjs +5 -5
  87. package/dist/types/array.d.cts +1 -1
  88. package/dist/types/array.d.mts +1 -1
  89. package/dist/types/colors.d.cts +1 -1
  90. package/dist/types/colors.d.mts +1 -1
  91. package/dist/types/converter.d.cts +1 -1
  92. package/dist/types/converter.d.mts +1 -1
  93. package/dist/types/date.d.cts +1 -1
  94. package/dist/types/date.d.mts +1 -1
  95. package/dist/types/form.d.cts +1 -1
  96. package/dist/types/form.d.mts +1 -1
  97. package/dist/types/hash.d.cts +1 -1
  98. package/dist/types/hash.d.mts +1 -1
  99. package/dist/types/http-status.d.cts +1 -1
  100. package/dist/types/http-status.d.mts +1 -1
  101. package/dist/types/index.d.cts +2 -2
  102. package/dist/types/index.d.mts +2 -2
  103. package/dist/types/number.d.cts +1 -1
  104. package/dist/types/number.d.mts +1 -1
  105. package/dist/types/object.d.cts +2 -2
  106. package/dist/types/object.d.mts +2 -2
  107. package/dist/types/pluralizer.d.cts +1 -1
  108. package/dist/types/pluralizer.d.mts +1 -1
  109. package/dist/types/string.d.cts +2 -2
  110. package/dist/types/string.d.mts +2 -2
  111. package/dist/types/stylog.d.cts +1 -1
  112. package/dist/types/stylog.d.mts +1 -1
  113. package/dist/types/utils.d.cts +1 -1
  114. package/dist/types/utils.d.mts +1 -1
  115. package/dist/{utilities-CzyXCRHM.cjs → utilities-CWV1GPGY.cjs} +1 -1
  116. package/dist/{utilities-B9axOvOX.mjs → utilities-DPscNbS1.mjs} +1 -1
  117. package/dist/{uuid-DgTBxcVu.d.cts → uuid-BUI3Jt8n.d.cts} +3 -3
  118. package/dist/{uuid-Yc3Uu8qr.d.mts → uuid-mEiy14sf.d.mts} +3 -3
  119. package/dist/verbalizer.cjs +3 -3
  120. package/dist/verbalizer.d.cts +3 -3
  121. package/dist/verbalizer.d.mts +3 -3
  122. package/dist/verbalizer.mjs +3 -3
  123. package/package.json +7 -6
  124. package/dist/guards-DeO4ukiK.mjs +0 -221
  125. package/dist/utils-CFyEFj2Y.cjs +0 -568
  126. package/dist/utils-CN3ocK98.mjs +0 -449
package/dist/dom.d.mts CHANGED
@@ -14,9 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { A as ParsedQuery, G as Deserializer, M as QueryObject, ct as Serializer, j as ParsedQueryGeneric, y as GenericObject } from "./object-ChFVh95z.mjs";
18
- import { P as QueryString } from "./string-CkwTVFeL.mjs";
19
- import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "./form-DoQGMTOc.mjs";
17
+ import { J as Deserializer, M as ParsedQueryGeneric, N as QueryObject, ft as Serializer, j as ParsedQuery, y as GenericObject } from "./object-X5fSMx-I.mjs";
18
+ import { F as QueryString } from "./string-C51m7T6d.mjs";
19
+ import { a as OriginFileObj, i as FormDataConfigs, o as ParsedFormData, r as FileUpload, s as SerializedForm, t as CustomFile } from "./form-DPdS2AhM.mjs";
20
20
 
21
21
  //#region src/dom/query.d.ts
22
22
  /**
package/dist/dom.mjs CHANGED
@@ -15,11 +15,10 @@
15
15
  */
16
16
 
17
17
  import { a as isNonEmptyString, d as isString } from "./primitives-Djsevc69.mjs";
18
- import { j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-Cye93-uo.mjs";
19
- import { t as isDateLike } from "./guards-Cp6KAkVI.mjs";
20
- import { n as trimString } from "./basics-1_M7UvCn.mjs";
21
- import { _ as isOriginFileObj, a as flattenObjectKeyValue, d as isCustomFile, f as isCustomFileArray, g as isFileUpload, h as isFileOrBlob, l as parseObjectValues, m as isFileList, p as isFileArray, v as isValidFormData } from "./objectify-CfXtS_E0.mjs";
22
- import { a as deepParsePrimitives } from "./utils-CN3ocK98.mjs";
18
+ import { j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-Hq5Ncd6y.mjs";
19
+ import { t as isDateLike } from "./guards-BK1QuvFZ.mjs";
20
+ import { I as deepParsePrimitives, n as trimString } from "./basics-CebgkY-n.mjs";
21
+ import { _ as isOriginFileObj, a as flattenObjectKeyValue, d as isCustomFile, f as isCustomFileArray, g as isFileUpload, h as isFileOrBlob, l as parseObjectValues, m as isFileList, p as isFileArray, v as isValidFormData } from "./objectify-CQa8gQib.mjs";
23
22
 
24
23
  //#region src/dom/query.ts
25
24
  /**
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { $r as RequireExactly, S as KeyForObject, T as NestedKeyString, u as DotNotationKey, x as KeyForArray } from "./object-ChFVh95z.mjs";
18
- import { P as QueryString } from "./string-CkwTVFeL.mjs";
17
+ import { S as KeyForObject, T as NestedKeyString, ri as RequireExactly, u as DotNotationKey, x as KeyForArray } from "./object-X5fSMx-I.cjs";
18
+ import { F as QueryString } from "./string-CO7HP50i.cjs";
19
19
 
20
20
  //#region src/types/form.d.ts
21
21
  /** - Configuration options to control FormData generation behavior. */
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { $r as RequireExactly, S as KeyForObject, T as NestedKeyString, u as DotNotationKey, x as KeyForArray } from "./object-ChFVh95z.cjs";
18
- import { P as QueryString } from "./string-Dq2b8rcN.cjs";
17
+ import { S as KeyForObject, T as NestedKeyString, ri as RequireExactly, u as DotNotationKey, x as KeyForArray } from "./object-X5fSMx-I.mjs";
18
+ import { F as QueryString } from "./string-C51m7T6d.mjs";
19
19
 
20
20
  //#region src/types/form.d.ts
21
21
  /** - Configuration options to control FormData generation behavior. */
@@ -0,0 +1,425 @@
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
+ import { d as isString, m as isUndefined } from "./primitives-Djsevc69.mjs";
18
+ import { b as isFunction, w as isNotEmptyObject } from "./specials-Hq5Ncd6y.mjs";
19
+ import { a as normalizeNumber } from "./utilities-DPscNbS1.mjs";
20
+ import { G as stableStringify, n as trimString } from "./basics-CebgkY-n.mjs";
21
+
22
+ //#region src/object/basics.ts
23
+ /**
24
+ * * Deep clone an object using `structuredClone` or deterministic *JSON serialization*.
25
+ *
26
+ * @param obj Object to clone.
27
+ * @param serialize Whether to force deterministic JSON serialization instead of using `structuredClone`. Defaults to `false`.
28
+ * @returns Deep cloned object.
29
+ *
30
+ * @remarks
31
+ * **Primary behavior**
32
+ * - By default (`serialize = false`), the function uses {@link https://developer.mozilla.org/docs/Web/API/Window/structuredClone structuredClone} when available. This supports:
33
+ * - Circular references
34
+ * - `Date` objects
35
+ * - `Map` / `Set`
36
+ * - `RegExp`
37
+ * - Typed arrays
38
+ * - Most built-in JavaScript types
39
+ * - Preserves `undefined` values
40
+ *
41
+ * - **Note:** `structuredClone` **does not preserve class prototypes**, even though it preserves data types like `Date`, `Map`, and `Set`.
42
+ *
43
+ * **Deterministic serialization mode**
44
+ * - When `serialize = true`, or when `structuredClone` is unavailable, the function falls back to **stable JSON serialization** via `stableStringify`. This guarantees:
45
+ * - All object keys are sorted alphabetically.
46
+ * - Consistent output across environments (deterministic).
47
+ * - All `undefined` values are converted to `null`.
48
+ * - Converting date-like objects (`Date`, `Chronos`, `Moment.js`, `Day.js`, `Luxon`, `JS-Joda`, `Temporal`) **in the same way that {@link JSON.stringify} would serialize them**, ensuring predictable and JSON-compliant output.
49
+ *
50
+ * - This mode is ideal for:
51
+ * - Hashing
52
+ * - Signature generation
53
+ * - Deep equality checks
54
+ * - Anything requiring deterministic, environment-neutral output
55
+ *
56
+ * **Deterministic mode limitations**
57
+ * - JSON serialization will:
58
+ * - Drop functions and `Symbol` values.
59
+ * - Lose prototype and class instance information.
60
+ * - Convert all date-like objects into strings.
61
+ * - Fail on circular references.
62
+ *
63
+ * **Final safety fallback**
64
+ * - If JSON serialization fails (e.g., due to circular references), the function returns a **shallow clone** (`{ ...obj }`) to ensure the cloning never throws.
65
+ */
66
+ function cloneObject(obj, serialize = false) {
67
+ try {
68
+ if (!serialize && typeof structuredClone === "function") return structuredClone(obj);
69
+ return JSON.parse(stableStringify(obj));
70
+ } catch {
71
+ return { ...obj };
72
+ }
73
+ }
74
+ /**
75
+ * * Count the number of fields in an object.
76
+ *
77
+ * @param obj Object to check.
78
+ * @returns Number of fields in the object.
79
+ */
80
+ function countObjectFields(obj) {
81
+ if (obj != null) return Object.keys(obj)?.length;
82
+ return 0;
83
+ }
84
+ function extractObjectKeys(obj, tuple) {
85
+ const keys = isNotEmptyObject(obj) ? Object.keys(obj) : [];
86
+ return tuple ? keys : keys;
87
+ }
88
+ /**
89
+ * * Recursively extracts all nested keys from an object as an array.
90
+ *
91
+ * @remarks
92
+ * - Returns an empty array (`[]`) for an empty object or a non-object value.
93
+ * - For only top-level keys, use {@link extractObjectKeys}.
94
+ *
95
+ * @param obj The object from which to extract the keys.
96
+ * @returns An array of all the nested keys (string literals) from the specified object.
97
+ */
98
+ function extractObjectKeysDeep(obj) {
99
+ function _getDeepKeys(candidate) {
100
+ let result = [];
101
+ for (const key in candidate) {
102
+ result.push(key);
103
+ if (isNotEmptyObject(candidate[key])) result = [...result, ..._getDeepKeys(candidate[key])];
104
+ }
105
+ return result;
106
+ }
107
+ return isNotEmptyObject(obj) ? _getDeepKeys(obj) : [];
108
+ }
109
+ /**
110
+ * * Extracts all the top-level entries of an object as an array of key-value pairs.
111
+ *
112
+ * @remarks
113
+ * - Returns an empty array (`[]`) for an empty object or a non-object value.
114
+ * - Internally uses {@link Object.entries}.
115
+ *
116
+ * @param obj The object from which to extract the entries.
117
+ * @returns An array of key-value pairs.
118
+ */
119
+ function extractObjectEntries(obj) {
120
+ return isNotEmptyObject(obj) ? Object.entries(obj) : [];
121
+ }
122
+
123
+ //#endregion
124
+ //#region src/array/basics.ts
125
+ /**
126
+ * * Flattens a nested array recursively or wraps any non-array data type in an array.
127
+ *
128
+ * @param input - The input value, which can be a nested array or a non-array value.
129
+ * @returns A fully flattened array of type `Flatten<T>`. If the input is not an array, it wraps it in a single-element array.
130
+ */
131
+ const flattenArray = (input) => {
132
+ if (!Array.isArray(input)) return [input];
133
+ return input.reduce((acc, item) => {
134
+ return acc.concat(Array.isArray(item) ? flattenArray(item) : [item]);
135
+ }, []);
136
+ };
137
+ /**
138
+ * * Filters an array of objects based on multiple conditions for specified keys.
139
+ *
140
+ * @param array - The array of objects to filter.
141
+ * @param conditions - An object where keys represent the property names and values represent filter conditions.
142
+ * The conditions can be a function `(value: T[K]) => boolean`.
143
+ * @returns The filtered array of objects.
144
+ * @throws `Error` If the input is not a valid array.
145
+ *
146
+ * @remarks Use `findAll` instance method from `Finder` class for **more advanced filtering and searching.**
147
+ */
148
+ const filterArrayOfObjects = (array, conditions) => {
149
+ if (!Array.isArray(array)) throw new TypeError("The provided input is not a valid array!");
150
+ return array?.filter((item) => {
151
+ return extractObjectEntries(conditions)?.every((pair) => {
152
+ const [key, conditionFn] = pair ?? [];
153
+ if (key && isFunction(conditionFn)) return conditionFn(item[key]);
154
+ return true;
155
+ });
156
+ });
157
+ };
158
+ /**
159
+ * * Checks if a value is an empty array or an array with only empty values.
160
+ *
161
+ * @param value - The value to check.
162
+ * @returns `true` if the value is not an array, an empty array, or an array containing only `null`, `undefined`, empty objects, or empty arrays.
163
+ */
164
+ const isInvalidOrEmptyArray = (value) => {
165
+ if (!Array.isArray(value)) return true;
166
+ if (value?.length === 0) return true;
167
+ return value?.every((item) => item == null || Array.isArray(item) && item?.length === 0 || typeof item === "object" && Object.keys(item || {})?.length === 0);
168
+ };
169
+ /**
170
+ * * Shuffle the elements of an array.
171
+ *
172
+ * @param array Array to shuffle.
173
+ * @returns Shuffled array.
174
+ */
175
+ const shuffleArray = (array) => {
176
+ if (isInvalidOrEmptyArray(array)) return array;
177
+ const shuffled = [...array];
178
+ for (let i = shuffled?.length - 1; i > 0; i--) {
179
+ const j = Math.floor(Math.random() * (i + 1));
180
+ [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
181
+ }
182
+ return shuffled;
183
+ };
184
+ /**
185
+ * * Get the last element of an array.
186
+ *
187
+ * @param array Array to get the last element from.
188
+ * @returns The last element or `undefined` if the array is empty.
189
+ */
190
+ const getLastArrayElement = (array) => {
191
+ return array?.length > 0 ? array[array?.length - 1] : void 0;
192
+ };
193
+
194
+ //#endregion
195
+ //#region src/number/guards.ts
196
+ /**
197
+ * * Check if a number is even or not.
198
+ *
199
+ * @param input The number or numeric string to check.
200
+ * @returns Boolean: `true` if even and `false` if not even.
201
+ */
202
+ const isEven = (input) => {
203
+ const parsed = normalizeNumber(input);
204
+ if (isUndefined(parsed)) return false;
205
+ return parsed % 2 === 0;
206
+ };
207
+ /**
208
+ * * Checks if a number is odd or not.
209
+ *
210
+ * @param input The number or numeric string to check.
211
+ * @returns Boolean: `true` if odd and `false` if not odd.
212
+ */
213
+ const isOdd = (input) => {
214
+ const parsed = normalizeNumber(input);
215
+ if (isUndefined(parsed)) return false;
216
+ return parsed % 2 !== 0;
217
+ };
218
+ /**
219
+ * * Checks if a number is a multiple of another number.
220
+ *
221
+ * @param input - The number to check.
222
+ * @param multipleOf - The number to check against.
223
+ * @returns `true` if `input` is a multiple of `multipleOf`, otherwise `false`.
224
+ */
225
+ const isMultiple = (input, multipleOf) => {
226
+ return input % multipleOf === 0;
227
+ };
228
+ /**
229
+ * * Checks if a number is a perfect square.
230
+ *
231
+ * @param num The number to check.
232
+ * @returns `true` if the number is a perfect square, otherwise `false`.
233
+ */
234
+ function isPerfectSquare(num) {
235
+ return Number.isInteger(Math.sqrt(num));
236
+ }
237
+ /**
238
+ * * Checks if a number is part of the Fibonacci sequence.
239
+ *
240
+ * @param num The number to check.
241
+ * @returns `true` if the number is a Fibonacci number, otherwise `false`.
242
+ */
243
+ function isFibonacci(num) {
244
+ return isPerfectSquare(5 * num * num + 4) || isPerfectSquare(5 * num * num - 4);
245
+ }
246
+ /**
247
+ * * Checks whether any input is not a finite number.
248
+ *
249
+ * @param numbers - The list of numbers to validate.
250
+ * @returns `true` if any input is not finite.
251
+ */
252
+ function areInvalidNumbers(...numbers) {
253
+ return numbers?.some((n) => !Number.isFinite(n));
254
+ }
255
+
256
+ //#endregion
257
+ //#region src/number/prime.ts
258
+ /**
259
+ * * Checks if a number is prime.
260
+ *
261
+ * @param number The number to check.
262
+ * @returns Boolean: `true` if the number is prime, otherwise `false`.
263
+ */
264
+ const isPrime = (number) => {
265
+ if (number < 2) return false;
266
+ if (number === 2 || number === 3) return true;
267
+ if (number % 2 === 0 || number % 3 === 0) return false;
268
+ for (let i = 5; i * i <= number; i += 6) if (number % i === 0 || number % (i + 2) === 0) return false;
269
+ return true;
270
+ };
271
+ /**
272
+ * * Find prime numbers in a given range.
273
+ *
274
+ * @param start The starting number of the range. Default is `1`.
275
+ * @param end The ending number of the range. Default is `1000`.
276
+ * @returns An array of prime numbers within the range (inclusive).
277
+ */
278
+ const findPrimeNumbers = (start = 1, end = 1e3) => {
279
+ let startNumber = start, endNumber = end;
280
+ if (start > end) [startNumber, endNumber] = [end, start];
281
+ return Array.from({ length: endNumber - startNumber + 1 }, (_, i) => startNumber + i).filter(isPrime);
282
+ };
283
+
284
+ //#endregion
285
+ //#region src/string/convert.ts
286
+ /**
287
+ * * Replaces all occurrences of a string or pattern in the given input string.
288
+ *
289
+ * - If `find` is a string, it is converted into a global regular expression (`/find/g`).
290
+ * - If `find` is a `RegExp`, the global (`g`) flag is ensured.
291
+ * - Trims the input before performing replacements.
292
+ *
293
+ * @param input - The string in which replacements should be performed.
294
+ * @param find - The substring or regex pattern to search for.
295
+ * @param replace - The string to replace matches with.
296
+ * @returns The modified/refined string with replacements applied.
297
+ */
298
+ const replaceAllInString = (input, find, replace) => {
299
+ const trimmedString = trimString(input);
300
+ const regex = isString(find) ? new RegExp(find, "g") : new RegExp(find, find?.flags.includes("g") ? find?.flags : find?.flags + "g");
301
+ return trimmedString?.replace(regex, replace);
302
+ };
303
+ /**
304
+ * * Converts a string into a URL-friendly slug.
305
+ * @param input - The string to be converted.
306
+ * @returns The slugified string.
307
+ */
308
+ const slugifyString = (input) => {
309
+ return trimString(normalizeString(input))?.toLowerCase()?.replace(/[^a-z0-9]+/g, "-")?.replace(/^-+|-+$/g, "");
310
+ };
311
+ /**
312
+ * * Masks part of a string for privacy.
313
+ * @param input - The string to mask.
314
+ * @param options - Options for masking a string.
315
+ * @returns The masked string.
316
+ */
317
+ const maskString = (input, options) => {
318
+ const { start = 1, end = 1, maskCharacter: maskChar = "*" } = options || {};
319
+ const trimmedString = trimString(input);
320
+ if (trimmedString?.length <= start + end) return maskChar?.repeat(trimmedString?.length);
321
+ return trimmedString.slice(0, start) + maskChar?.repeat(trimmedString?.length - start - end) + (end > 0 ? trimmedString.slice(-end) : "");
322
+ };
323
+ /**
324
+ * * Reverses a given string.
325
+ * @param input - The string to reverse.
326
+ * @returns The reversed string.
327
+ *
328
+ * @remarks It {@link trimString trims} the whitespace of the input string before reversing it.
329
+ */
330
+ const reverseString = (input) => {
331
+ return trimString(input)?.split("")?.reverse()?.join("");
332
+ };
333
+ /**
334
+ * * Normalizes a string by removing diacritics (accents).
335
+ * @param str The input string.
336
+ * @returns The normalized string.
337
+ */
338
+ function normalizeString(str) {
339
+ return str?.normalize("NFD")?.replace(/[\u0300-\u036f]/g, "");
340
+ }
341
+ /**
342
+ * * Extracts all email addresses from a string.
343
+ * @param str The input string.
344
+ * @returns An array of extracted email addresses.
345
+ */
346
+ function extractEmails(str) {
347
+ return str?.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g) || [];
348
+ }
349
+ /**
350
+ * * Extracts all URLs from a string.
351
+ * @param str The input string.
352
+ * @returns An array of extracted URLs.
353
+ */
354
+ function extractURLs(str) {
355
+ return str?.match(/https?:\/\/[^\s/$.?#].[^\s]*/g) || [];
356
+ }
357
+ /**
358
+ * * Returns a grammatically correct unit string, optionally prefixed with the number.
359
+ *
360
+ * @remarks For complex and versatile pluralization, please refer to {@link https://toolbox-x.nazmul-nhb.dev/docs/utils/string/pluralizer pluralizer} or {@link https://toolbox-x.nazmul-nhb.dev/docs/classes/pluralizer Pluralizer Class} instead.
361
+ *
362
+ * @param count The numeric value to determine singular or plural.
363
+ * @param unit The unit name (e.g., "day", "hour").
364
+ * @param withNumber Whether to prefix the count before the unit. Defaults to `true`.
365
+ * @returns Formatted unit string like `"1 day"`, `"2 months"`, or `"hour"`.
366
+ */
367
+ function formatUnitWithPlural(count, unit, withNumber = true) {
368
+ const pluralized = Math.abs(count) === 1 ? unit : `${unit}s`;
369
+ return withNumber ? `${count} ${pluralized}` : pluralized;
370
+ }
371
+
372
+ //#endregion
373
+ //#region src/string/guards.ts
374
+ /**
375
+ * * Checks if a string is a palindrome.
376
+ * @param input - The string to check.
377
+ * @returns True if the string is a palindrome, otherwise false.
378
+ */
379
+ const isPalindrome = (input) => {
380
+ const normalized = input.toLowerCase().replace(/[^a-z0-9]/g, "");
381
+ return normalized === reverseString(normalized);
382
+ };
383
+ /**
384
+ * * Checks if a string is in camelCase format.
385
+ * @param str The string to check.
386
+ * @returns `true` if the string is in camelCase, otherwise `false`.
387
+ */
388
+ function isCamelCase(str) {
389
+ return /^[a-z]+([A-Z][a-z]*)*$/.test(str);
390
+ }
391
+ /**
392
+ * * Checks if a string is in PascalCase format.
393
+ * @param str The string to check.
394
+ * @returns `true` if the string is in PascalCase, otherwise `false`.
395
+ */
396
+ function isPascalCase(str) {
397
+ return /^[A-Z][a-zA-Z]*$/.test(str);
398
+ }
399
+ /**
400
+ * * Checks if a string is in snake_case format.
401
+ * @param str The string to check.
402
+ * @returns `true` if the string is in snake_case, otherwise `false`.
403
+ */
404
+ function isSnakeCase(str) {
405
+ return /^[a-z]+(_[a-z]+)*$/.test(str);
406
+ }
407
+ /**
408
+ * * Checks if a string is in kebab-case format.
409
+ * @param str The string to check.
410
+ * @returns `true` if the string is in kebab-case, otherwise `false`.
411
+ */
412
+ function isKebabCase(str) {
413
+ return /^[a-z]+(-[a-z]+)*$/.test(str);
414
+ }
415
+ /**
416
+ * * Checks if a string contains only emojis.
417
+ * @param str The string to check.
418
+ * @returns `true` if the string contains only emojis, otherwise `false`.
419
+ */
420
+ function isEmojiOnly(str) {
421
+ return /^[\p{Emoji}]+$/u.test(str);
422
+ }
423
+
424
+ //#endregion
425
+ export { extractObjectEntries as A, filterArrayOfObjects as C, shuffleArray as D, isInvalidOrEmptyArray as E, extractObjectKeysDeep as M, cloneObject as O, isPerfectSquare as S, getLastArrayElement as T, areInvalidNumbers as _, isPascalCase as a, isMultiple as b, extractURLs as c, normalizeString as d, replaceAllInString as f, isPrime as g, findPrimeNumbers as h, isPalindrome as i, extractObjectKeys as j, countObjectFields as k, formatUnitWithPlural as l, slugifyString as m, isEmojiOnly as n, isSnakeCase as o, reverseString as p, isKebabCase as r, extractEmails as s, isCamelCase as t, maskString as u, isEven as v, flattenArray as w, isOdd as x, isFibonacci as y };
@@ -16,8 +16,8 @@
16
16
 
17
17
  import { a as isNonEmptyString, d as isString, n as isBoolean } from "./primitives-Djsevc69.mjs";
18
18
  import { n as NATIVE_TZ_IDS, t as IANA_TZ_IDS } from "./timezone-avZ4TvDx.mjs";
19
- import { T as isObject, b as isFunction, d as isNumericString } from "./specials-Cye93-uo.mjs";
20
- import { a as normalizeNumber } from "./utilities-B9axOvOX.mjs";
19
+ import { T as isObject, b as isFunction, d as isNumericString } from "./specials-Hq5Ncd6y.mjs";
20
+ import { a as normalizeNumber } from "./utilities-DPscNbS1.mjs";
21
21
 
22
22
  //#region src/date/guards.ts
23
23
  /**
@@ -41,7 +41,7 @@ function isValidTime(value) {
41
41
  * @returns `true` if the value is a valid utc offset, `false` otherwise.
42
42
  */
43
43
  function isValidUTCOffset(value) {
44
- return isString(value) ? /^UTC[+-]?\d{1,2}:\d{2}$/.test(value) : false;
44
+ return isString(value) ? /^UTC[+-]?(?:0[0-9]|1[0-4]):(?:00|15|30|45)$/.test(value) : false;
45
45
  }
46
46
  /**
47
47
  * * Validates whether the provided value is a recognized IANA time zone identifier (excluding `"Factory"`), based on the {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones IANA TZ Database}.
@@ -16,8 +16,8 @@
16
16
 
17
17
  const require_primitives = require('./primitives-CBGICrDR.cjs');
18
18
  const require_timezone = require('./timezone-CSz7R0L6.cjs');
19
- const require_specials = require('./specials-BM6cx43o.cjs');
20
- const require_utilities = require('./utilities-CzyXCRHM.cjs');
19
+ const require_specials = require('./specials-dkYP1Nh2.cjs');
20
+ const require_utilities = require('./utilities-CWV1GPGY.cjs');
21
21
 
22
22
  //#region src/date/guards.ts
23
23
  /**
@@ -41,7 +41,7 @@ function isValidTime(value) {
41
41
  * @returns `true` if the value is a valid utc offset, `false` otherwise.
42
42
  */
43
43
  function isValidUTCOffset(value) {
44
- return require_primitives.isString(value) ? /^UTC[+-]?\d{1,2}:\d{2}$/.test(value) : false;
44
+ return require_primitives.isString(value) ? /^UTC[+-]?(?:0[0-9]|1[0-4]):(?:00|15|30|45)$/.test(value) : false;
45
45
  }
46
46
  /**
47
47
  * * Validates whether the provided value is a recognized IANA time zone identifier (excluding `"Factory"`), based on the {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones IANA TZ Database}.