toolbox-x 1.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 (190) hide show
  1. package/LICENSE +201 -0
  2. package/dist/Color-B3mgF9Dh.d.cts +486 -0
  3. package/dist/Color-D38Xrw65.d.mts +486 -0
  4. package/dist/Stylog-Df7eq3-j.d.cts +519 -0
  5. package/dist/Stylog-jvlLcMQq.d.mts +519 -0
  6. package/dist/array-DvW0zIu6.d.mts +130 -0
  7. package/dist/array-rUnEVisO.d.cts +130 -0
  8. package/dist/basics-D_eSv0cu.cjs +132 -0
  9. package/dist/basics-Dp_aEK81.mjs +115 -0
  10. package/dist/basics-WEYWlnRO.d.cts +95 -0
  11. package/dist/basics-uBSfkBEI.d.mts +95 -0
  12. package/dist/case-BWIt8Ash.mjs +449 -0
  13. package/dist/case-C-S-b5YP.d.cts +327 -0
  14. package/dist/case-CS8Ii3A7.cjs +526 -0
  15. package/dist/case-CybASFPD.d.mts +327 -0
  16. package/dist/change-case.cjs +32 -0
  17. package/dist/change-case.d.cts +18 -0
  18. package/dist/change-case.d.mts +18 -0
  19. package/dist/change-case.mjs +19 -0
  20. package/dist/colors.cjs +574 -0
  21. package/dist/colors.d.cts +355 -0
  22. package/dist/colors.d.mts +355 -0
  23. package/dist/colors.mjs +547 -0
  24. package/dist/constants-2gAw23_7.mjs +144 -0
  25. package/dist/constants-B34K0QPi.d.cts +21 -0
  26. package/dist/constants-BIBDKY1u.cjs +924 -0
  27. package/dist/constants-BWT-810U.cjs +158 -0
  28. package/dist/constants-BwbHnXlM.mjs +662 -0
  29. package/dist/constants-BxN9l5el.cjs +74 -0
  30. package/dist/constants-CLS_bgKD.d.mts +847 -0
  31. package/dist/constants-D73iFu8g.mjs +171 -0
  32. package/dist/constants-DAfRxaa8.mjs +62 -0
  33. package/dist/constants-DQYeCjlx.cjs +207 -0
  34. package/dist/constants-Deeie-iH.d.mts +21 -0
  35. package/dist/constants-DpTG9RP6.d.mts +29 -0
  36. package/dist/constants-DqwnkJ_d.cjs +740 -0
  37. package/dist/constants-DvRUY_FY.cjs +150 -0
  38. package/dist/constants-VcRtQu0K.d.cts +29 -0
  39. package/dist/constants-X5hm1UtB.mjs +912 -0
  40. package/dist/constants-eNd-iYsV.mjs +134 -0
  41. package/dist/constants-qm8FafmD.d.cts +847 -0
  42. package/dist/constants.cjs +415 -0
  43. package/dist/constants.d.cts +184 -0
  44. package/dist/constants.d.mts +184 -0
  45. package/dist/constants.mjs +378 -0
  46. package/dist/convert-BOCgUv2D.cjs +252 -0
  47. package/dist/convert-Bn4jFomQ.mjs +169 -0
  48. package/dist/convert-BrzlG-m_.cjs +475 -0
  49. package/dist/convert-DhaUoPVU.mjs +368 -0
  50. package/dist/converter-1P90_RcP.d.mts +402 -0
  51. package/dist/converter-CmkcAppi.d.cts +402 -0
  52. package/dist/converter.cjs +780 -0
  53. package/dist/converter.d.cts +29 -0
  54. package/dist/converter.d.mts +29 -0
  55. package/dist/converter.mjs +771 -0
  56. package/dist/countries-CIpmtEzV.cjs +1469 -0
  57. package/dist/countries-Cy0xiqS3.mjs +1463 -0
  58. package/dist/css-colors-Bx947Ng3.d.cts +179 -0
  59. package/dist/css-colors-CXCDqQbG.cjs +186 -0
  60. package/dist/css-colors-CXTp1vvy.d.mts +179 -0
  61. package/dist/css-colors-DfUW3nTR.mjs +180 -0
  62. package/dist/date.cjs +332 -0
  63. package/dist/date.d.cts +213 -0
  64. package/dist/date.d.mts +213 -0
  65. package/dist/date.mjs +298 -0
  66. package/dist/dom.cjs +461 -0
  67. package/dist/dom.d.cts +228 -0
  68. package/dist/dom.d.mts +228 -0
  69. package/dist/dom.mjs +429 -0
  70. package/dist/form-BMFVGUrN.d.mts +118 -0
  71. package/dist/form-DRFbryvK.d.cts +118 -0
  72. package/dist/guards-3kaUX66g.mjs +157 -0
  73. package/dist/guards-C8gkvIHb.cjs +240 -0
  74. package/dist/guards-DdyU4h4o.mjs +110 -0
  75. package/dist/guards-Efhp1mNy.cjs +151 -0
  76. package/dist/guards.cjs +172 -0
  77. package/dist/guards.d.cts +399 -0
  78. package/dist/guards.d.mts +399 -0
  79. package/dist/guards.mjs +75 -0
  80. package/dist/hash-B6JPEyAz.d.mts +131 -0
  81. package/dist/hash-NTpeKYB_.d.cts +131 -0
  82. package/dist/hash.cjs +2126 -0
  83. package/dist/hash.d.cts +1239 -0
  84. package/dist/hash.d.mts +1239 -0
  85. package/dist/hash.mjs +2095 -0
  86. package/dist/http-status-BAZdtr7-.d.mts +65 -0
  87. package/dist/http-status-U_3MtoGb.d.cts +65 -0
  88. package/dist/http-status.cjs +173 -0
  89. package/dist/http-status.d.cts +142 -0
  90. package/dist/http-status.d.mts +142 -0
  91. package/dist/http-status.mjs +171 -0
  92. package/dist/index.cjs +2551 -0
  93. package/dist/index.d.cts +1493 -0
  94. package/dist/index.d.mts +1493 -0
  95. package/dist/index.mjs +2357 -0
  96. package/dist/object-B0TV3eHx.d.mts +8052 -0
  97. package/dist/object-Blq0Amdv.d.cts +8052 -0
  98. package/dist/objectify-CDs0Fbr1.mjs +417 -0
  99. package/dist/objectify-DIJ-OBmo.cjs +524 -0
  100. package/dist/paginator.cjs +245 -0
  101. package/dist/paginator.d.cts +144 -0
  102. package/dist/paginator.d.mts +144 -0
  103. package/dist/paginator.mjs +243 -0
  104. package/dist/parse-2ubxXZRp.cjs +211 -0
  105. package/dist/parse-N7g942uy.mjs +164 -0
  106. package/dist/pluralizer-BjMIc6uT.d.mts +42 -0
  107. package/dist/pluralizer-Cb6ZmrDl.d.cts +42 -0
  108. package/dist/pluralizer.cjs +678 -0
  109. package/dist/pluralizer.d.cts +152 -0
  110. package/dist/pluralizer.d.mts +152 -0
  111. package/dist/pluralizer.mjs +676 -0
  112. package/dist/primitives-B26uZolQ.cjs +228 -0
  113. package/dist/primitives-KsFUp3kQ.mjs +144 -0
  114. package/dist/specials-D48_IZbd.d.mts +108 -0
  115. package/dist/specials-DzLr1ZgU.cjs +477 -0
  116. package/dist/specials-LVONlKbQ.d.cts +108 -0
  117. package/dist/specials-uhDuRg8H.mjs +292 -0
  118. package/dist/string-CBAbxaG1.d.mts +258 -0
  119. package/dist/string-CsNsm_65.d.cts +258 -0
  120. package/dist/stylog.cjs +621 -0
  121. package/dist/stylog.d.cts +49 -0
  122. package/dist/stylog.d.mts +49 -0
  123. package/dist/stylog.mjs +614 -0
  124. package/dist/timezone-B2OYK6Fh.mjs +5589 -0
  125. package/dist/timezone-Beh9IGpw.cjs +5625 -0
  126. package/dist/types/array.cjs +16 -0
  127. package/dist/types/array.d.cts +18 -0
  128. package/dist/types/array.d.mts +18 -0
  129. package/dist/types/array.mjs +17 -0
  130. package/dist/types/colors.cjs +16 -0
  131. package/dist/types/colors.d.cts +18 -0
  132. package/dist/types/colors.d.mts +18 -0
  133. package/dist/types/colors.mjs +17 -0
  134. package/dist/types/converter.cjs +16 -0
  135. package/dist/types/converter.d.cts +18 -0
  136. package/dist/types/converter.d.mts +18 -0
  137. package/dist/types/converter.mjs +17 -0
  138. package/dist/types/form.cjs +16 -0
  139. package/dist/types/form.d.cts +18 -0
  140. package/dist/types/form.d.mts +18 -0
  141. package/dist/types/form.mjs +17 -0
  142. package/dist/types/hash.cjs +16 -0
  143. package/dist/types/hash.d.cts +18 -0
  144. package/dist/types/hash.d.mts +18 -0
  145. package/dist/types/hash.mjs +17 -0
  146. package/dist/types/http-status.cjs +16 -0
  147. package/dist/types/http-status.d.cts +18 -0
  148. package/dist/types/http-status.d.mts +18 -0
  149. package/dist/types/http-status.mjs +17 -0
  150. package/dist/types/index.cjs +16 -0
  151. package/dist/types/index.d.cts +18 -0
  152. package/dist/types/index.d.mts +18 -0
  153. package/dist/types/index.mjs +17 -0
  154. package/dist/types/number.cjs +16 -0
  155. package/dist/types/number.d.cts +18 -0
  156. package/dist/types/number.d.mts +18 -0
  157. package/dist/types/number.mjs +17 -0
  158. package/dist/types/object.cjs +16 -0
  159. package/dist/types/object.d.cts +18 -0
  160. package/dist/types/object.d.mts +18 -0
  161. package/dist/types/object.mjs +17 -0
  162. package/dist/types/pluralizer.cjs +16 -0
  163. package/dist/types/pluralizer.d.cts +18 -0
  164. package/dist/types/pluralizer.d.mts +18 -0
  165. package/dist/types/pluralizer.mjs +17 -0
  166. package/dist/types/string.cjs +16 -0
  167. package/dist/types/string.d.cts +18 -0
  168. package/dist/types/string.d.mts +18 -0
  169. package/dist/types/string.mjs +17 -0
  170. package/dist/types/stylog.cjs +16 -0
  171. package/dist/types/stylog.d.cts +18 -0
  172. package/dist/types/stylog.d.mts +18 -0
  173. package/dist/types/stylog.mjs +17 -0
  174. package/dist/types/utils.cjs +16 -0
  175. package/dist/types/utils.d.cts +18 -0
  176. package/dist/types/utils.d.mts +18 -0
  177. package/dist/types/utils.mjs +17 -0
  178. package/dist/types/verbalizer.cjs +16 -0
  179. package/dist/types/verbalizer.d.cts +30 -0
  180. package/dist/types/verbalizer.d.mts +30 -0
  181. package/dist/types/verbalizer.mjs +17 -0
  182. package/dist/utilities-CLUmdQeV.cjs +140 -0
  183. package/dist/utilities-m5yFKqLd.mjs +105 -0
  184. package/dist/utils-ClW9LA6f.mjs +449 -0
  185. package/dist/utils-DLFRgXUC.cjs +568 -0
  186. package/dist/verbalizer.cjs +998 -0
  187. package/dist/verbalizer.d.cts +148 -0
  188. package/dist/verbalizer.d.mts +148 -0
  189. package/dist/verbalizer.mjs +996 -0
  190. package/package.json +249 -0
@@ -0,0 +1,477 @@
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
+ const require_primitives = require('./primitives-B26uZolQ.cjs');
18
+
19
+ //#region src/guards/non-primitives.ts
20
+ /**
21
+ * * Type guard to check if a value is an array.
22
+ * @param value - The value to check.
23
+ * @returns `true` if the value is an array, otherwise `false`.
24
+ */
25
+ function isArray(value) {
26
+ return Array.isArray(value);
27
+ }
28
+ /**
29
+ * * Type guard to check if a value is an array with length.
30
+ * @param value - The value to check.
31
+ * @returns `true` if the value is an array with length, otherwise `false`.
32
+ */
33
+ function isValidArray(value) {
34
+ return Array.isArray(value) && value?.length > 0;
35
+ }
36
+ /**
37
+ * * Type guard to check if a value is an object (excluding null).
38
+ * @param value - The value to check.
39
+ * @returns `true` if the value is an object, otherwise `false`.
40
+ */
41
+ function isObject(value) {
42
+ return value !== null && typeof value === "object" && !isArray(value);
43
+ }
44
+ /**
45
+ * * Type guard to check if a value is an object (excluding null) and has keys in it.
46
+ * @param value - The value to check.
47
+ * @returns `true` if the value is an object with valid keys, otherwise `false`.
48
+ */
49
+ function isNotEmptyObject(value) {
50
+ return isObject(value) && Object.keys(value)?.length > 0;
51
+ }
52
+ /**
53
+ * * Type guard to check if a value is an object with specific keys.
54
+ * @param value - The value to check.
55
+ * @param keys - The list of keys the object should contain.
56
+ * @returns `true` if the value is an object with the specified keys, otherwise `false`.
57
+ */
58
+ function isObjectWithKeys(value, keys) {
59
+ return isObject(value) && keys?.every((key) => key in value);
60
+ }
61
+ /**
62
+ * * Type guard to check if a value is an empty object.
63
+ * @param value - The value to check.
64
+ * @returns `true` if the value is an empty object, otherwise `false`.
65
+ */
66
+ function isEmptyObject(value) {
67
+ return isObject(value) && Object.keys(value)?.length === 0;
68
+ }
69
+ /**
70
+ * * Type guard to check if a value is a function.
71
+ * @param value - The value to check.
72
+ * @returns `true` if the value is a function, otherwise `false`.
73
+ */
74
+ function isFunction(value) {
75
+ return typeof value === "function";
76
+ }
77
+ /**
78
+ * * Determines whether the provided property descriptor represents a method.
79
+ *
80
+ * @param descriptor - The property descriptor to check.
81
+ * @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.
82
+ */
83
+ const isMethodDescriptor = (descriptor) => {
84
+ return !!descriptor && typeof descriptor?.value === "function";
85
+ };
86
+ /**
87
+ * * Type guard to check if a value is a Date object.
88
+ * @param value - The value to check.
89
+ * @returns `true` if the value is a Date object, otherwise `false`.
90
+ */
91
+ function isDate(value) {
92
+ return value instanceof Date;
93
+ }
94
+ /**
95
+ * * Type guard to check if a value is an array of a specific type.
96
+ * @param value - The value to check.
97
+ * @param typeCheck - The type guard function to check each item of the array.
98
+ * @returns `true` if the value is an array of the specified type, otherwise `false`.
99
+ */
100
+ function isArrayOfType(value, typeCheck) {
101
+ return isArray(value) && value?.every(typeCheck);
102
+ }
103
+ /**
104
+ * * Type guard to check if a value is a Promise.
105
+ * @param value - The value to check.
106
+ * @returns `true` if the value is a Promise, otherwise `false`.
107
+ */
108
+ function isPromise(value) {
109
+ return isObject(value) && isFunction(value.then);
110
+ }
111
+ /**
112
+ * * Type guard to check if a value is a Set.
113
+ * @param value - The value to check.
114
+ * @returns `true` if the value is a Set, otherwise `false`.
115
+ */
116
+ function isSet(value) {
117
+ return value instanceof Set;
118
+ }
119
+ /**
120
+ * * Type guard to check if a value is a Map.
121
+ * @param value - The value to check.
122
+ * @returns `true` if the value is a Map, otherwise `false`.
123
+ */
124
+ function isMap(value) {
125
+ return value instanceof Map;
126
+ }
127
+ /**
128
+ * * Type guard to check if a value is a RegExp.
129
+ * @param value - The value to check.
130
+ * @returns `true` if the value is a RegExp, otherwise `false`.
131
+ */
132
+ function isRegExp(value) {
133
+ return value instanceof RegExp;
134
+ }
135
+ /**
136
+ * * Type guard to check if a value is an Error object.
137
+ * @param value - The value to check.
138
+ * @returns `true` if the value is an Error object, otherwise `false`.
139
+ */
140
+ function isError(value) {
141
+ return value instanceof Error;
142
+ }
143
+ /**
144
+ * * Type guard to check if a string is valid JSON.
145
+ * @param value - The value to check.
146
+ * @returns `true` if the value is valid JSON, otherwise `false`.
147
+ */
148
+ function isJSON(value) {
149
+ if (!require_primitives.isString(value)) return false;
150
+ try {
151
+ JSON.parse(value);
152
+ return true;
153
+ } catch {
154
+ return false;
155
+ }
156
+ }
157
+ /**
158
+ * * Type guard to check if a function returns a Promise.
159
+ * @param fn - The function to check.
160
+ * @returns `true` if the function returns a Promise, otherwise `false`.
161
+ */
162
+ function isReturningPromise(fn) {
163
+ return isFunction(fn) && fn.constructor?.name === "AsyncFunction";
164
+ }
165
+
166
+ //#endregion
167
+ //#region src/guards/specials.ts
168
+ /**
169
+ * * Type guard to check if a value is a valid email string.
170
+ * @param value - The value to check.
171
+ * @returns `true` if the value is a valid email, otherwise `false`.
172
+ */
173
+ function isEmail(value) {
174
+ return require_primitives.isString(value) && /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value);
175
+ }
176
+ /**
177
+ * * Type guard to check if a value is an array of valid email strings.
178
+ * @param value - The value to check.
179
+ * @returns `true` if the value is an array of valid email strings, otherwise `false`.
180
+ */
181
+ function isEmailArray(value) {
182
+ return isArray(value) && value?.every(isEmail);
183
+ }
184
+ /**
185
+ * * Type guard to check if a value is a valid date string.
186
+ * @param value - The value to check.
187
+ * @returns `true` if the value is a valid date string, otherwise `false`.
188
+ */
189
+ function isDateString(value) {
190
+ return require_primitives.isString(value) && !isNaN(Date.parse(value));
191
+ }
192
+ /**
193
+ * * Type guard to check if a value is a valid UUID (`RFC4122` `v1`-`v8`).
194
+ * @param value - The value to check.
195
+ * @returns `true` if the value matches standard UUID pattern, otherwise `false`.
196
+ */
197
+ function isUUID(value) {
198
+ const h = "[0-9a-f]";
199
+ const expr = new RegExp(`^${h}{8}-${h}{4}-[1-8]${h}{3}-[89ab]${h}{3}-${h}{12}$`, "i");
200
+ return require_primitives.isString(value) && expr.test(value);
201
+ }
202
+ /**
203
+ * * Type guard to check if the code is running in a browser environment.
204
+ * @returns `true` if the code is running in a browser, otherwise `false`.
205
+ */
206
+ function isBrowser() {
207
+ return typeof window !== "undefined" && typeof document !== "undefined";
208
+ }
209
+ /**
210
+ * * Type guard to check if the code is running in a Node.js environment.
211
+ * @returns `true` if the code is running in Node.js, otherwise `false`.
212
+ */
213
+ function isNode() {
214
+ return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
215
+ }
216
+ /**
217
+ * * Type guard to check if a value is a valid URL.
218
+ * @param value - The value to check.
219
+ * @returns `true` if the value is a valid URL, otherwise `false`.
220
+ */
221
+ function isURL(value) {
222
+ try {
223
+ new URL(require_primitives.isString(value) ? value : "");
224
+ return true;
225
+ } catch {
226
+ return false;
227
+ }
228
+ }
229
+ /**
230
+ * * Type guard to check if a value is a valid Base64 encoded string.
231
+ * @param value - The value to check.
232
+ * @returns `true` if the value is a valid Base64 string, otherwise `false`.
233
+ */
234
+ function isBase64(value) {
235
+ return require_primitives.isString(value) && /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value);
236
+ }
237
+ /**
238
+ * * Type guard to check if a value is a valid hexadecimal byte sequence.
239
+ * @param value - The value to check, spaced between bytes or un-spaced.
240
+ * @returns `true` if the value is a valid hexadecimal byte sequence, otherwise `false`.
241
+ */
242
+ function isHexString(value) {
243
+ return require_primitives.isString(value) && /^[\da-fA-F\s]+$/.test(value) && value.replace(/\s+/g, "").length % 2 === 0;
244
+ }
245
+ /**
246
+ * * Type guard to check if a value is a valid binary byte sequence.
247
+ * @param value - The value to check, spaced between bytes or un-spaced.
248
+ * @returns `true` if the value is a valid binary byte sequence, otherwise `false`.
249
+ */
250
+ function isBinaryString(value) {
251
+ return require_primitives.isString(value) && /^[01\s]+$/.test(value) && value.replace(/\s+/g, "").length % 8 === 0;
252
+ }
253
+ /**
254
+ * * Type guard to check if a value is a valid phone number.
255
+ * @param value - The value to check.
256
+ * @returns `true` if the value is a valid phone number, otherwise `false`.
257
+ */
258
+ function isPhoneNumber(value) {
259
+ return require_primitives.isString(value) && /^\+?[1-9]\d{1,14}$/.test(value);
260
+ }
261
+ /**
262
+ * * Type guard to check if a value is a valid IP address (IPv4 or IPv6).
263
+ * @param value - The value to check.
264
+ * @returns `true` if the value is a valid IP address, otherwise `false`.
265
+ */
266
+ function isIPAddress(value) {
267
+ return require_primitives.isString(value) && /^(?:\d{1,3}\.){3}\d{1,3}$|^([a-f0-9:]+:+)+[a-f0-9]+$/i.test(value);
268
+ }
269
+ /**
270
+ * * Type guard to check if the current environment matches a given string.
271
+ * @param env - The expected environment (e.g., "production", "development").
272
+ * @returns `true` if the value is a numeric string parsable by `Number()`, otherwise `false`.
273
+ */
274
+ function isEnvironment(env) {
275
+ return process.env.NODE_ENV === env;
276
+ }
277
+ /**
278
+ * * Type guard to check if a value is a string representing a finite number.
279
+ *
280
+ * @remarks
281
+ * - Accepts strings like: `"42"`, `" -5.5 "`, `"0.123"`, `"-0"`, `"1e5"`.
282
+ * - Rejects strings like: `"NaN"`, `"Infinity"`, `"-Infinity"`, `"abc"`, `""`, `"42abc"`.
283
+ *
284
+ * @param value - The value to test.
285
+ * @returns `true` if the value is a string that fully represents a finite number.
286
+ */
287
+ function isNumericString(value) {
288
+ return require_primitives.isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
289
+ }
290
+
291
+ //#endregion
292
+ Object.defineProperty(exports, 'isArray', {
293
+ enumerable: true,
294
+ get: function () {
295
+ return isArray;
296
+ }
297
+ });
298
+ Object.defineProperty(exports, 'isArrayOfType', {
299
+ enumerable: true,
300
+ get: function () {
301
+ return isArrayOfType;
302
+ }
303
+ });
304
+ Object.defineProperty(exports, 'isBase64', {
305
+ enumerable: true,
306
+ get: function () {
307
+ return isBase64;
308
+ }
309
+ });
310
+ Object.defineProperty(exports, 'isBinaryString', {
311
+ enumerable: true,
312
+ get: function () {
313
+ return isBinaryString;
314
+ }
315
+ });
316
+ Object.defineProperty(exports, 'isBrowser', {
317
+ enumerable: true,
318
+ get: function () {
319
+ return isBrowser;
320
+ }
321
+ });
322
+ Object.defineProperty(exports, 'isDate', {
323
+ enumerable: true,
324
+ get: function () {
325
+ return isDate;
326
+ }
327
+ });
328
+ Object.defineProperty(exports, 'isDateString', {
329
+ enumerable: true,
330
+ get: function () {
331
+ return isDateString;
332
+ }
333
+ });
334
+ Object.defineProperty(exports, 'isEmail', {
335
+ enumerable: true,
336
+ get: function () {
337
+ return isEmail;
338
+ }
339
+ });
340
+ Object.defineProperty(exports, 'isEmailArray', {
341
+ enumerable: true,
342
+ get: function () {
343
+ return isEmailArray;
344
+ }
345
+ });
346
+ Object.defineProperty(exports, 'isEmptyObject', {
347
+ enumerable: true,
348
+ get: function () {
349
+ return isEmptyObject;
350
+ }
351
+ });
352
+ Object.defineProperty(exports, 'isEnvironment', {
353
+ enumerable: true,
354
+ get: function () {
355
+ return isEnvironment;
356
+ }
357
+ });
358
+ Object.defineProperty(exports, 'isError', {
359
+ enumerable: true,
360
+ get: function () {
361
+ return isError;
362
+ }
363
+ });
364
+ Object.defineProperty(exports, 'isFunction', {
365
+ enumerable: true,
366
+ get: function () {
367
+ return isFunction;
368
+ }
369
+ });
370
+ Object.defineProperty(exports, 'isHexString', {
371
+ enumerable: true,
372
+ get: function () {
373
+ return isHexString;
374
+ }
375
+ });
376
+ Object.defineProperty(exports, 'isIPAddress', {
377
+ enumerable: true,
378
+ get: function () {
379
+ return isIPAddress;
380
+ }
381
+ });
382
+ Object.defineProperty(exports, 'isJSON', {
383
+ enumerable: true,
384
+ get: function () {
385
+ return isJSON;
386
+ }
387
+ });
388
+ Object.defineProperty(exports, 'isMap', {
389
+ enumerable: true,
390
+ get: function () {
391
+ return isMap;
392
+ }
393
+ });
394
+ Object.defineProperty(exports, 'isMethodDescriptor', {
395
+ enumerable: true,
396
+ get: function () {
397
+ return isMethodDescriptor;
398
+ }
399
+ });
400
+ Object.defineProperty(exports, 'isNode', {
401
+ enumerable: true,
402
+ get: function () {
403
+ return isNode;
404
+ }
405
+ });
406
+ Object.defineProperty(exports, 'isNotEmptyObject', {
407
+ enumerable: true,
408
+ get: function () {
409
+ return isNotEmptyObject;
410
+ }
411
+ });
412
+ Object.defineProperty(exports, 'isNumericString', {
413
+ enumerable: true,
414
+ get: function () {
415
+ return isNumericString;
416
+ }
417
+ });
418
+ Object.defineProperty(exports, 'isObject', {
419
+ enumerable: true,
420
+ get: function () {
421
+ return isObject;
422
+ }
423
+ });
424
+ Object.defineProperty(exports, 'isObjectWithKeys', {
425
+ enumerable: true,
426
+ get: function () {
427
+ return isObjectWithKeys;
428
+ }
429
+ });
430
+ Object.defineProperty(exports, 'isPhoneNumber', {
431
+ enumerable: true,
432
+ get: function () {
433
+ return isPhoneNumber;
434
+ }
435
+ });
436
+ Object.defineProperty(exports, 'isPromise', {
437
+ enumerable: true,
438
+ get: function () {
439
+ return isPromise;
440
+ }
441
+ });
442
+ Object.defineProperty(exports, 'isRegExp', {
443
+ enumerable: true,
444
+ get: function () {
445
+ return isRegExp;
446
+ }
447
+ });
448
+ Object.defineProperty(exports, 'isReturningPromise', {
449
+ enumerable: true,
450
+ get: function () {
451
+ return isReturningPromise;
452
+ }
453
+ });
454
+ Object.defineProperty(exports, 'isSet', {
455
+ enumerable: true,
456
+ get: function () {
457
+ return isSet;
458
+ }
459
+ });
460
+ Object.defineProperty(exports, 'isURL', {
461
+ enumerable: true,
462
+ get: function () {
463
+ return isURL;
464
+ }
465
+ });
466
+ Object.defineProperty(exports, 'isUUID', {
467
+ enumerable: true,
468
+ get: function () {
469
+ return isUUID;
470
+ }
471
+ });
472
+ Object.defineProperty(exports, 'isValidArray', {
473
+ enumerable: true,
474
+ get: function () {
475
+ return isValidArray;
476
+ }
477
+ });
@@ -0,0 +1,108 @@
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 { g as UUIDVersion, m as UUID } from "./hash-NTpeKYB_.cjs";
18
+
19
+ //#region src/guards/specials.d.ts
20
+ /**
21
+ * * Type guard to check if a value is a valid email string.
22
+ * @param value - The value to check.
23
+ * @returns `true` if the value is a valid email, otherwise `false`.
24
+ */
25
+ declare function isEmail(value: unknown): value is string;
26
+ /**
27
+ * * Type guard to check if a value is an array of valid email strings.
28
+ * @param value - The value to check.
29
+ * @returns `true` if the value is an array of valid email strings, otherwise `false`.
30
+ */
31
+ declare function isEmailArray(value: unknown): value is string[];
32
+ /**
33
+ * * Type guard to check if a value is a valid date string.
34
+ * @param value - The value to check.
35
+ * @returns `true` if the value is a valid date string, otherwise `false`.
36
+ */
37
+ declare function isDateString(value: unknown): value is string;
38
+ /**
39
+ * * Type guard to check if a value is a valid UUID (`RFC4122` `v1`-`v8`).
40
+ * @param value - The value to check.
41
+ * @returns `true` if the value matches standard UUID pattern, otherwise `false`.
42
+ */
43
+ declare function isUUID(value: unknown): value is UUID<UUIDVersion>;
44
+ /**
45
+ * * Type guard to check if the code is running in a browser environment.
46
+ * @returns `true` if the code is running in a browser, otherwise `false`.
47
+ */
48
+ declare function isBrowser(): boolean;
49
+ /**
50
+ * * Type guard to check if the code is running in a Node.js environment.
51
+ * @returns `true` if the code is running in Node.js, otherwise `false`.
52
+ */
53
+ declare function isNode(): boolean;
54
+ /**
55
+ * * Type guard to check if a value is a valid URL.
56
+ * @param value - The value to check.
57
+ * @returns `true` if the value is a valid URL, otherwise `false`.
58
+ */
59
+ declare function isURL(value: unknown): value is string;
60
+ /**
61
+ * * Type guard to check if a value is a valid Base64 encoded string.
62
+ * @param value - The value to check.
63
+ * @returns `true` if the value is a valid Base64 string, otherwise `false`.
64
+ */
65
+ declare function isBase64(value: unknown): value is string;
66
+ /**
67
+ * * Type guard to check if a value is a valid hexadecimal byte sequence.
68
+ * @param value - The value to check, spaced between bytes or un-spaced.
69
+ * @returns `true` if the value is a valid hexadecimal byte sequence, otherwise `false`.
70
+ */
71
+ declare function isHexString(value: unknown): value is string;
72
+ /**
73
+ * * Type guard to check if a value is a valid binary byte sequence.
74
+ * @param value - The value to check, spaced between bytes or un-spaced.
75
+ * @returns `true` if the value is a valid binary byte sequence, otherwise `false`.
76
+ */
77
+ declare function isBinaryString(value: unknown): value is string;
78
+ /**
79
+ * * Type guard to check if a value is a valid phone number.
80
+ * @param value - The value to check.
81
+ * @returns `true` if the value is a valid phone number, otherwise `false`.
82
+ */
83
+ declare function isPhoneNumber(value: unknown): value is string;
84
+ /**
85
+ * * Type guard to check if a value is a valid IP address (IPv4 or IPv6).
86
+ * @param value - The value to check.
87
+ * @returns `true` if the value is a valid IP address, otherwise `false`.
88
+ */
89
+ declare function isIPAddress(value: unknown): value is string;
90
+ /**
91
+ * * Type guard to check if the current environment matches a given string.
92
+ * @param env - The expected environment (e.g., "production", "development").
93
+ * @returns `true` if the value is a numeric string parsable by `Number()`, otherwise `false`.
94
+ */
95
+ declare function isEnvironment(env: string): boolean;
96
+ /**
97
+ * * Type guard to check if a value is a string representing a finite number.
98
+ *
99
+ * @remarks
100
+ * - Accepts strings like: `"42"`, `" -5.5 "`, `"0.123"`, `"-0"`, `"1e5"`.
101
+ * - Rejects strings like: `"NaN"`, `"Infinity"`, `"-Infinity"`, `"abc"`, `""`, `"42abc"`.
102
+ *
103
+ * @param value - The value to test.
104
+ * @returns `true` if the value is a string that fully represents a finite number.
105
+ */
106
+ declare function isNumericString(value: unknown): value is `${number}`;
107
+ //#endregion
108
+ export { isEmail as a, isHexString as c, isNumericString as d, isPhoneNumber as f, isDateString as i, isIPAddress as l, isUUID as m, isBinaryString as n, isEmailArray as o, isURL as p, isBrowser as r, isEnvironment as s, isBase64 as t, isNode as u };