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,399 @@
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 { $ as Maybe, Ct as TimeZoneIdNative, J as FalsyPrimitive, Tt as UTCOffset, X as GenericFn, dt as $TimeZoneIdentifier, ft as ClockTime, it as Numeric, lt as ValidArray, st as Primitive, tt as NormalPrimitive, xt as TimeWithUnit, y as GenericObject, z as AsyncFunction } from "./object-B0TV3eHx.mjs";
18
+ import { b as RGB, g as HSLA, h as HSL, s as CSSColor, v as Hex6, x as RGBA, y as Hex8 } from "./Color-D38Xrw65.mjs";
19
+ import { a as isEmail, c as isHexString, d as isNumericString, f as isPhoneNumber, i as isDateString, l as isIPAddress, m as isUUID, n as isBinaryString, o as isEmailArray, p as isURL, r as isBrowser, s as isEnvironment, t as isBase64, u as isNode } from "./specials-D48_IZbd.mjs";
20
+
21
+ //#region src/colors/guards.d.ts
22
+ /**
23
+ * Checks if a color is in `Hex` format.
24
+ *
25
+ * @param color Color to check.
26
+ * @returns Boolean: `true` if it's a `Hex` color, `false` if not.
27
+ */
28
+ declare function isHex6(color: string): color is Hex6;
29
+ /**
30
+ * Checks if a color is in `Hex8` format.
31
+ *
32
+ * @param color Color to check.
33
+ * @returns Boolean: `true` if it's a `Hex8` color, `false` if not.
34
+ */
35
+ declare function isHex8(color: string): color is Hex8;
36
+ /**
37
+ * Checks if a color is in `RGB` format and within valid ranges.
38
+ *
39
+ * @param color Color to check.
40
+ * @returns `true` if it's a `RGB` color, `false` if not.
41
+ */
42
+ declare function isRGB(color: string): color is RGB;
43
+ /**
44
+ * Checks if a color is in `RGBA` format and within valid ranges.
45
+ *
46
+ * @param color Color to check.
47
+ * @returns `true` if it's a `RGBA` color, `false` if not.
48
+ */
49
+ declare function isRGBA(color: string): color is RGBA;
50
+ /**
51
+ * Checks if a color is in `HSL` format and within valid ranges.
52
+ *
53
+ * @param color Color to check.
54
+ * @returns `true` if it's a `HSL` color, `false` if not.
55
+ */
56
+ declare function isHSL(color: string): color is HSL;
57
+ /**
58
+ * Checks if a color is in `HSLA` format and within valid ranges.
59
+ *
60
+ * @param color Color to check.
61
+ * @returns `true` if it's a `HSLA` color, `false` if not.
62
+ */
63
+ declare function isHSLA(color: string): color is HSLA;
64
+ /** * Check if a string represents a valid `CSSColor`. */
65
+ declare function isCSSColor(value: string): value is CSSColor;
66
+ //#endregion
67
+ //#region src/date/guards.d.ts
68
+ /**
69
+ * * Checks if the provided value is a valid time string in "HH:MM" format.
70
+ *
71
+ * @param value - The value to check.
72
+ * @returns `true` if the value is a valid time string, `false` otherwise.
73
+ */
74
+ declare function isValidTime(value: unknown): value is ClockTime;
75
+ /**
76
+ * * Checks if the provided value is a valid `UTCOffset` (e.g. `UTC-01:30`).
77
+ *
78
+ * @param value - The value to check.
79
+ * @returns `true` if the value is a valid utc offset, `false` otherwise.
80
+ */
81
+ declare function isValidUTCOffset(value: unknown): value is UTCOffset;
82
+ /**
83
+ * * 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}.
84
+ *
85
+ * @remarks
86
+ * - Relies on a large constant map of time zone identifiers, which can increase bundle size in browser environments. Matches against `597` identifiers.
87
+ * - Prefer {@link isNativeTimeZoneId} when you want a lightweight, native-only validation approach. Matches against `418` identifiers.
88
+ *
89
+ * @param value Time zone identifier to validate.
90
+ * @returns `true` if the value is a valid IANA time zone identifier, otherwise `false`.
91
+ */
92
+ declare function isValidTimeZoneId(value: unknown): value is $TimeZoneIdentifier;
93
+ /**
94
+ * * Validates whether the provided value is a supported time zone identifier using the native JavaScript API (`Intl.supportedValuesOf('timeZone')`).
95
+ *
96
+ * @remarks
97
+ * - Uses only native {@link Intl} capabilities—minimal code footprint, highly performant. Matches against `418` identifiers.
98
+ * - Prefer {@link isValidTimeZoneId} when validation must align strictly with the full
99
+ * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones IANA TZ Database}. Matches against `597` identifiers.
100
+ *
101
+ * @param value Time zone identifier to validate.
102
+ * @returns `true` if the value is a valid native JS-supported time zone identifier, otherwise `false`.
103
+ */
104
+ declare function isNativeTimeZoneId(value: unknown): value is TimeZoneIdNative;
105
+ /**
106
+ * * Checks if the year is a leap year.
107
+ *
108
+ * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.
109
+ * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.
110
+ * @param year The year to check.
111
+ * @returns `true` if the year is a leap year, `false` otherwise.
112
+ */
113
+ declare function isLeapYear(year: Numeric): boolean;
114
+ /**
115
+ * * Checks if a value is a date-like object from `Date`, `Chronos`, `Moment.js`, `Day.js`, `Luxon`, `JS-Joda`, or `Temporal`
116
+ * @param value Value to check if it is date-like object.
117
+ * @returns `true` if the value is date-like object, otherwise `false`.
118
+ */
119
+ declare function isDateLike(value: unknown): boolean;
120
+ /** Checks if a value represents time value (number) with different forms of {@link TimeWithUnit units} */
121
+ declare function isTimeWithUnit(value: unknown): value is TimeWithUnit;
122
+ //#endregion
123
+ //#region src/guards/non-primitives.d.ts
124
+ /**
125
+ * * Type guard to check if a value is an array.
126
+ * @param value - The value to check.
127
+ * @returns `true` if the value is an array, otherwise `false`.
128
+ */
129
+ declare function isArray<T>(value: unknown): value is Array<T>;
130
+ /**
131
+ * * Type guard to check if a value is an array with length.
132
+ * @param value - The value to check.
133
+ * @returns `true` if the value is an array with length, otherwise `false`.
134
+ */
135
+ declare function isValidArray<T>(value: unknown): value is Array<T>;
136
+ /**
137
+ * * Type guard to check if a value is an object (excluding null).
138
+ * @param value - The value to check.
139
+ * @returns `true` if the value is an object, otherwise `false`.
140
+ */
141
+ declare function isObject(value: unknown): value is GenericObject;
142
+ /**
143
+ * * Type guard to check if a value is an object (excluding null) and has keys in it.
144
+ * @param value - The value to check.
145
+ * @returns `true` if the value is an object with valid keys, otherwise `false`.
146
+ */
147
+ declare function isNotEmptyObject(value: unknown): value is GenericObject;
148
+ /**
149
+ * * Type guard to check if a value is an object with specific keys.
150
+ * @param value - The value to check.
151
+ * @param keys - The list of keys the object should contain.
152
+ * @returns `true` if the value is an object with the specified keys, otherwise `false`.
153
+ */
154
+ declare function isObjectWithKeys<Key extends string>(value: unknown, keys: ValidArray<Key>): value is { [K in Key]: unknown };
155
+ /**
156
+ * * Type guard to check if a value is an empty object.
157
+ * @param value - The value to check.
158
+ * @returns `true` if the value is an empty object, otherwise `false`.
159
+ */
160
+ declare function isEmptyObject<T extends GenericObject>(value: T): boolean;
161
+ /**
162
+ * * Type guard to check if a value is a function.
163
+ * @param value - The value to check.
164
+ * @returns `true` if the value is a function, otherwise `false`.
165
+ */
166
+ declare function isFunction(value: unknown): value is GenericFn;
167
+ /**
168
+ * * Determines whether the provided property descriptor represents a method.
169
+ *
170
+ * @param descriptor - The property descriptor to check.
171
+ * @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.
172
+ */
173
+ declare const isMethodDescriptor: (descriptor: Maybe<PropertyDescriptor>) => boolean;
174
+ /**
175
+ * * Type guard to check if a value is a Date object.
176
+ * @param value - The value to check.
177
+ * @returns `true` if the value is a Date object, otherwise `false`.
178
+ */
179
+ declare function isDate(value: unknown): value is Date;
180
+ /**
181
+ * * Type guard to check if a value is an array of a specific type.
182
+ * @param value - The value to check.
183
+ * @param typeCheck - The type guard function to check each item of the array.
184
+ * @returns `true` if the value is an array of the specified type, otherwise `false`.
185
+ */
186
+ declare function isArrayOfType<T>(value: unknown, typeCheck: (item: unknown) => item is T): value is T[];
187
+ /**
188
+ * * Type guard to check if a value is a Promise.
189
+ * @param value - The value to check.
190
+ * @returns `true` if the value is a Promise, otherwise `false`.
191
+ */
192
+ declare function isPromise<T>(value: unknown): value is Promise<T>;
193
+ /**
194
+ * * Type guard to check if a value is a Set.
195
+ * @param value - The value to check.
196
+ * @returns `true` if the value is a Set, otherwise `false`.
197
+ */
198
+ declare function isSet<T>(value: unknown): value is Set<T>;
199
+ /**
200
+ * * Type guard to check if a value is a Map.
201
+ * @param value - The value to check.
202
+ * @returns `true` if the value is a Map, otherwise `false`.
203
+ */
204
+ declare function isMap<K, V>(value: unknown): value is Map<K, V>;
205
+ /**
206
+ * * Type guard to check if a value is a RegExp.
207
+ * @param value - The value to check.
208
+ * @returns `true` if the value is a RegExp, otherwise `false`.
209
+ */
210
+ declare function isRegExp(value: unknown): value is RegExp;
211
+ /**
212
+ * * Type guard to check if a value is an Error object.
213
+ * @param value - The value to check.
214
+ * @returns `true` if the value is an Error object, otherwise `false`.
215
+ */
216
+ declare function isError(value: unknown): value is Error;
217
+ /**
218
+ * * Type guard to check if a string is valid JSON.
219
+ * @param value - The value to check.
220
+ * @returns `true` if the value is valid JSON, otherwise `false`.
221
+ */
222
+ declare function isJSON(value: unknown): value is string;
223
+ /**
224
+ * * Type guard to check if a function returns a Promise.
225
+ * @param fn - The function to check.
226
+ * @returns `true` if the function returns a Promise, otherwise `false`.
227
+ */
228
+ declare function isReturningPromise<T>(fn: unknown): fn is AsyncFunction<T>;
229
+ //#endregion
230
+ //#region src/guards/primitives.d.ts
231
+ /**
232
+ * * Type guard to check whether a value is a finite number (excluding `NaN` and `Infinity`).
233
+ * @param value - The value to test.
234
+ * @returns `true` if the value is a finite number; otherwise `false`.
235
+ */
236
+ declare function isNumber(value: unknown): value is number;
237
+ /**
238
+ * * Type guard to check if a value is a string.
239
+ * @param value - The value to check.
240
+ * @returns `true` if the value is a string, otherwise `false`.
241
+ */
242
+ declare function isString(value: unknown): value is string;
243
+ /**
244
+ * * Type guard to check if a value is an integer.
245
+ * @param value - The value to check.
246
+ * @returns `true` if the value is an integer, otherwise `false`.
247
+ */
248
+ declare function isInteger(value: unknown): value is number;
249
+ /**
250
+ * * Type guard to check if a value is a positive integer.
251
+ * @param value - The value to check.
252
+ * @returns `true` if the value is a positive integer, otherwise `false`.
253
+ */
254
+ declare function isPositiveInteger(value: unknown): value is number;
255
+ /**
256
+ * * Type guard to check if a value is a boolean.
257
+ * @param value - The value to check.
258
+ * @returns `true` if the value is a boolean, otherwise `false`.
259
+ */
260
+ declare function isBoolean(value: unknown): value is boolean;
261
+ /**
262
+ * * Type guard to check if a value is null.
263
+ * @param value - The value to check.
264
+ * @returns `true` if the value is null, otherwise `false`.
265
+ */
266
+ declare function isNull(value: unknown): value is null;
267
+ /**
268
+ * * Type guard to check if a value is undefined.
269
+ * @param value - The value to check.
270
+ * @returns `true` if the value is undefined, otherwise `false`.
271
+ */
272
+ declare function isUndefined(value: unknown): value is undefined;
273
+ /**
274
+ * * Type guard to check if a value is a symbol.
275
+ * @param value - The value to check.
276
+ * @returns `true` if the value is a symbol, otherwise `false`.
277
+ */
278
+ declare function isSymbol(value: unknown): value is symbol;
279
+ /**
280
+ * * Type guard to check if a value is a BigInt.
281
+ * @param value - The value to check.
282
+ * @returns `true` if the value is a BigInt, otherwise `false`.
283
+ */
284
+ declare function isBigInt(value: unknown): value is bigint;
285
+ /**
286
+ * * Type guard to check if a value is a primitive (i.e. `string | number | boolean | symbol | bigint | null | undefined`).
287
+ * @param value - The value to check.
288
+ * @returns `true` if the value is a primitive, otherwise `false`.
289
+ */
290
+ declare function isPrimitive(value: unknown): value is Primitive;
291
+ /**
292
+ * * Type guard to check if a value is a normal primitive (i.e. `string | number | boolean | null | undefined`).
293
+ * @param value - The value to check.
294
+ * @returns `true` if the value is a primitive, otherwise `false`.
295
+ */
296
+ declare function isNormalPrimitive(value: unknown): value is NormalPrimitive;
297
+ /**
298
+ * * Type guard to check if a value is a non-empty string.
299
+ * @param value - The value to check.
300
+ * @returns `true` if the value is a non-empty string, otherwise `false`.
301
+ */
302
+ declare function isNonEmptyString(value: unknown): value is string;
303
+ /**
304
+ * * Type guard to check if a value is falsy.
305
+ * @param value - The value to check.
306
+ * @returns `true` if the value is falsy, otherwise `false`.
307
+ */
308
+ declare function isFalsy(value: unknown): value is FalsyPrimitive;
309
+ /**
310
+ * * Type guard to check if a value is truthy.
311
+ * @param value - The value to check.
312
+ * @returns `true` if the value is truthy (not null or undefined), otherwise `false`.
313
+ */
314
+ declare function isTruthy<T>(value: T): value is Exclude<T, FalsyPrimitive>;
315
+ //#endregion
316
+ //#region src/number/guards.d.ts
317
+ /**
318
+ * * Check if a number is even or not.
319
+ *
320
+ * @param input The number or numeric string to check.
321
+ * @returns Boolean: `true` if even and `false` if not even.
322
+ */
323
+ declare const isEven: (input: Numeric) => boolean;
324
+ /**
325
+ * * Checks if a number is odd or not.
326
+ *
327
+ * @param input The number or numeric string to check.
328
+ * @returns Boolean: `true` if odd and `false` if not odd.
329
+ */
330
+ declare const isOdd: (input: Numeric) => boolean;
331
+ /**
332
+ * * Checks if a number is a multiple of another number.
333
+ *
334
+ * @param input - The number to check.
335
+ * @param multipleOf - The number to check against.
336
+ * @returns `true` if `input` is a multiple of `multipleOf`, otherwise `false`.
337
+ */
338
+ declare const isMultiple: (input: number, multipleOf: number) => boolean;
339
+ /**
340
+ * * Checks if a number is a perfect square.
341
+ *
342
+ * @param num The number to check.
343
+ * @returns `true` if the number is a perfect square, otherwise `false`.
344
+ */
345
+ declare function isPerfectSquare(num: number): boolean;
346
+ /**
347
+ * * Checks if a number is part of the Fibonacci sequence.
348
+ *
349
+ * @param num The number to check.
350
+ * @returns `true` if the number is a Fibonacci number, otherwise `false`.
351
+ */
352
+ declare function isFibonacci(num: number): boolean;
353
+ /**
354
+ * * Checks whether any input is not a finite number.
355
+ *
356
+ * @param numbers - The list of numbers to validate.
357
+ * @returns `true` if any input is not finite.
358
+ */
359
+ declare function areInvalidNumbers(...numbers: number[]): boolean;
360
+ //#endregion
361
+ //#region src/string/guards.d.ts
362
+ /**
363
+ * * Checks if a string is a palindrome.
364
+ * @param input - The string to check.
365
+ * @returns True if the string is a palindrome, otherwise false.
366
+ */
367
+ declare const isPalindrome: (input: string) => boolean;
368
+ /**
369
+ * * Checks if a string is in camelCase format.
370
+ * @param str The string to check.
371
+ * @returns `true` if the string is in camelCase, otherwise `false`.
372
+ */
373
+ declare function isCamelCase(str: string): boolean;
374
+ /**
375
+ * * Checks if a string is in PascalCase format.
376
+ * @param str The string to check.
377
+ * @returns `true` if the string is in PascalCase, otherwise `false`.
378
+ */
379
+ declare function isPascalCase(str: string): boolean;
380
+ /**
381
+ * * Checks if a string is in snake_case format.
382
+ * @param str The string to check.
383
+ * @returns `true` if the string is in snake_case, otherwise `false`.
384
+ */
385
+ declare function isSnakeCase(str: string): boolean;
386
+ /**
387
+ * * Checks if a string is in kebab-case format.
388
+ * @param str The string to check.
389
+ * @returns `true` if the string is in kebab-case, otherwise `false`.
390
+ */
391
+ declare function isKebabCase(str: string): boolean;
392
+ /**
393
+ * * Checks if a string contains only emojis.
394
+ * @param str The string to check.
395
+ * @returns `true` if the string contains only emojis, otherwise `false`.
396
+ */
397
+ declare function isEmojiOnly(str: string): boolean;
398
+ //#endregion
399
+ export { areInvalidNumbers, areInvalidNumbers as areNumbersInvalid, areInvalidNumbers as isInvalidNumber, areInvalidNumbers as isNumberInvalid, isReturningPromise as doesReturnPromise, isReturningPromise, isArray, isArrayOfType, isValidArray as isArrayWithLength, isValidArray, isBase64, isBigInt, isBinaryString, isBoolean, isBrowser, isCSSColor, isCamelCase, isDate, isDateLike, isDateString, isEmail, isEmail as isValidEmail, isEmailArray, isEmojiOnly, isEmptyObject, isEmptyObject as isEmptyObjectGuard, isEmptyObject as isObjectEmpty, isEnvironment, isEnvironment as isExpectedNodeENV, isEnvironment as isNodeENV, isEnvironment as isNodeEnvironment, isError, isEven, isEven as isEvenNumber, isFalsy, isFibonacci, isFibonacci as isPartOfFibonacci, isFibonacci as isPartOfFibonacciSeries, isFunction, isHSL, isHSLA, isHex6, isHex8, isHexString, isIPAddress, isInteger, isJSON, isJSON as isJSONObject, isJSON as isValidJSON, isKebabCase, isLeapYear, isMap, isMap as isValidMap, isMethodDescriptor as isMethod, isMethodDescriptor, isMultiple, isNativeTimeZoneId, isNode, isNonEmptyString, isNormalPrimitive, isNotEmptyObject, isNotEmptyObject as isValidObject, isNull, isNumber, isNumericString, isObject, isObjectWithKeys, isOdd, isOdd as isOddNumber, isPalindrome, isPascalCase, isPerfectSquare, isPhoneNumber, isPositiveInteger, isPrimitive, isPromise, isRGB, isRGBA, isRegExp, isRegExp as isRegularExpression, isSet, isSet as isValidSet, isSnakeCase, isString, isSymbol, isTimeWithUnit, isTruthy, isURL, isURL as isValidURL, isUUID, isUndefined, isValidTime, isValidTime as isValidTimeString, isValidTimeZoneId, isValidUTCOffset as isValidUTC, isValidUTCOffset as isValidUTCOffSet, isValidUTCOffset };
@@ -0,0 +1,75 @@
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 { a as isNonEmptyString, c as isNumber, d as isString, f as isSymbol, i as isInteger, l as isPositiveInteger, m as isUndefined, n as isBoolean, o as isNormalPrimitive, p as isTruthy, r as isFalsy, s as isNull, t as isBigInt, u as isPrimitive } from "./primitives-KsFUp3kQ.mjs";
18
+ import { a as isHex8, i as isHex6, n as isHSL, o as isRGB, r as isHSLA, s as isRGBA, t as isCSSColor } from "./guards-3kaUX66g.mjs";
19
+ import { A as isSet, C as isMethodDescriptor, D as isPromise, E as isObjectWithKeys, O as isRegExp, S as isMap, T as isObject, _ as isDate, a as isEmail, b as isFunction, c as isHexString, d as isNumericString, f as isPhoneNumber, g as isArrayOfType, h as isArray, i as isDateString, j as isValidArray, k as isReturningPromise, l as isIPAddress, m as isUUID, n as isBinaryString, o as isEmailArray, p as isURL, r as isBrowser, s as isEnvironment, t as isBase64, u as isNode, v as isEmptyObject, w as isNotEmptyObject, x as isJSON, y as isError } from "./specials-uhDuRg8H.mjs";
20
+ import { a as isValidTime, i as isTimeWithUnit, n as isLeapYear, o as isValidTimeZoneId, r as isNativeTimeZoneId, s as isValidUTCOffset, t as isDateLike } from "./guards-DdyU4h4o.mjs";
21
+ import { d as isFibonacci, f as isMultiple, l as areInvalidNumbers, m as isPerfectSquare, p as isOdd, s as reverseString, u as isEven } from "./convert-Bn4jFomQ.mjs";
22
+
23
+ //#region src/string/guards.ts
24
+ /**
25
+ * * Checks if a string is a palindrome.
26
+ * @param input - The string to check.
27
+ * @returns True if the string is a palindrome, otherwise false.
28
+ */
29
+ const isPalindrome = (input) => {
30
+ const normalized = input.toLowerCase().replace(/[^a-z0-9]/g, "");
31
+ return normalized === reverseString(normalized);
32
+ };
33
+ /**
34
+ * * Checks if a string is in camelCase format.
35
+ * @param str The string to check.
36
+ * @returns `true` if the string is in camelCase, otherwise `false`.
37
+ */
38
+ function isCamelCase(str) {
39
+ return /^[a-z]+([A-Z][a-z]*)*$/.test(str);
40
+ }
41
+ /**
42
+ * * Checks if a string is in PascalCase format.
43
+ * @param str The string to check.
44
+ * @returns `true` if the string is in PascalCase, otherwise `false`.
45
+ */
46
+ function isPascalCase(str) {
47
+ return /^[A-Z][a-zA-Z]*$/.test(str);
48
+ }
49
+ /**
50
+ * * Checks if a string is in snake_case format.
51
+ * @param str The string to check.
52
+ * @returns `true` if the string is in snake_case, otherwise `false`.
53
+ */
54
+ function isSnakeCase(str) {
55
+ return /^[a-z]+(_[a-z]+)*$/.test(str);
56
+ }
57
+ /**
58
+ * * Checks if a string is in kebab-case format.
59
+ * @param str The string to check.
60
+ * @returns `true` if the string is in kebab-case, otherwise `false`.
61
+ */
62
+ function isKebabCase(str) {
63
+ return /^[a-z]+(-[a-z]+)*$/.test(str);
64
+ }
65
+ /**
66
+ * * Checks if a string contains only emojis.
67
+ * @param str The string to check.
68
+ * @returns `true` if the string contains only emojis, otherwise `false`.
69
+ */
70
+ function isEmojiOnly(str) {
71
+ return /^[\p{Emoji}]+$/u.test(str);
72
+ }
73
+
74
+ //#endregion
75
+ export { areInvalidNumbers, areInvalidNumbers as areNumbersInvalid, areInvalidNumbers as isInvalidNumber, areInvalidNumbers as isNumberInvalid, isReturningPromise as doesReturnPromise, isReturningPromise, isArray, isArrayOfType, isValidArray as isArrayWithLength, isValidArray, isBase64, isBigInt, isBinaryString, isBoolean, isBrowser, isCSSColor, isCamelCase, isDate, isDateLike, isDateString, isEmail, isEmail as isValidEmail, isEmailArray, isEmojiOnly, isEmptyObject, isEmptyObject as isEmptyObjectGuard, isEmptyObject as isObjectEmpty, isEnvironment, isEnvironment as isExpectedNodeENV, isEnvironment as isNodeENV, isEnvironment as isNodeEnvironment, isError, isEven, isEven as isEvenNumber, isFalsy, isFibonacci, isFibonacci as isPartOfFibonacci, isFibonacci as isPartOfFibonacciSeries, isFunction, isHSL, isHSLA, isHex6, isHex8, isHexString, isIPAddress, isInteger, isJSON, isJSON as isJSONObject, isJSON as isValidJSON, isKebabCase, isLeapYear, isMap, isMap as isValidMap, isMethodDescriptor as isMethod, isMethodDescriptor, isMultiple, isNativeTimeZoneId, isNode, isNonEmptyString, isNormalPrimitive, isNotEmptyObject, isNotEmptyObject as isValidObject, isNull, isNumber, isNumericString, isObject, isObjectWithKeys, isOdd, isOdd as isOddNumber, isPalindrome, isPascalCase, isPerfectSquare, isPhoneNumber, isPositiveInteger, isPrimitive, isPromise, isRGB, isRGBA, isRegExp, isRegExp as isRegularExpression, isSet, isSet as isValidSet, isSnakeCase, isString, isSymbol, isTimeWithUnit, isTruthy, isURL, isURL as isValidURL, isUUID, isUndefined, isValidTime, isValidTime as isValidTimeString, isValidTimeZoneId, isValidUTCOffset as isValidUTC, isValidUTCOffset as isValidUTCOffSet, isValidUTCOffset };
@@ -0,0 +1,131 @@
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 { V as Branded, it as Numeric, xt as TimeWithUnit, y as GenericObject } from "./object-B0TV3eHx.mjs";
18
+
19
+ //#region src/types/hash.d.ts
20
+ /** UUID versions as number from `1-8` */
21
+ type $UUIDVersion = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
22
+ /** UUID versions as string from `v1-v8` */
23
+ type UUIDVersion = `v${$UUIDVersion}`;
24
+ /** Supported UUID versions (without `v2`) as string */
25
+ type SupportedVersion = `v${Exclude<$UUIDVersion, 2>}`;
26
+ /** General 5 parts UUID string type */
27
+ type $UUID = `${string}-${string}-${string}-${string}-${string}`;
28
+ /** General 5 parts UUID string as {@link Branded} type */
29
+ type UUID<V extends UUIDVersion> = Branded<$UUID, V>;
30
+ /** * Options for generating UUID for `v3` and `v5` */
31
+ interface $UUIDOptionsV3V5<V extends 'v3' | 'v5'> extends $UUIDOptions<V> {
32
+ /** Namespace for `v3` and `v5` UUID (must be another valid UUID) */
33
+ namespace: $UUID;
34
+ /** Name for `v3` and `v5` UUID (must be a non-empty string) */
35
+ name: string;
36
+ }
37
+ /** * General Options for generating UUID */
38
+ interface $UUIDOptions<V extends SupportedVersion = 'v4'> {
39
+ /** UUID version, default `'v4'` */
40
+ version?: V | SupportedVersion;
41
+ /** Whether to use uppercase characters (default `false`) */
42
+ uppercase?: boolean;
43
+ }
44
+ /** * Options for generating UUID */
45
+ type UUIDOptions<V extends SupportedVersion = 'v4'> = V extends 'v3' | 'v5' ? $UUIDOptionsV3V5<V> : $UUIDOptions<V>;
46
+ /** Type representing decoded UUID info */
47
+ interface DecodedUUID {
48
+ /** Original UUID */
49
+ raw: UUID<UUIDVersion>;
50
+ /** Plain version of the UUID without hyphens (`-`) */
51
+ plain: string;
52
+ /** Version of the UUID as number */
53
+ version: $UUIDVersion;
54
+ /** Variant of the UUID */
55
+ variant: 'NCS' | 'RFC4122' | 'Microsoft' | 'Future';
56
+ /** Single integer value of the UUID in bigint */
57
+ singleInt: bigint;
58
+ /** Timestamp for `v1`, `v6`, `v7` and `v8` (in ms since epoch) */
59
+ timestamp?: number;
60
+ /** v1 node (MAC) */
61
+ node?: string;
62
+ }
63
+ /** Header for `Signet` */
64
+ type SignetHeader = {
65
+ /** Algorithm used. Currently supports `'HS256'` only */alg: 'HS256'; /** Type of token. Fixed `'SIGNET+JWT'` */
66
+ typ: 'SIGNET+JWT';
67
+ };
68
+ /** Options for token verification */
69
+ type VerifyOptions = {
70
+ /** Where the token is allowed to be used */audience?: string | string[]; /** Who the token is about */
71
+ subject?: string; /** From where/who the token is issued */
72
+ issuer?: string;
73
+ };
74
+ /** Token signing options */
75
+ interface SignOptions extends VerifyOptions {
76
+ /**
77
+ * * Specifies when the token expires after issuing it.
78
+ *
79
+ * @remarks
80
+ * - A numeric value (number or numeric string ({@link Numeric})) is interpreted as seconds count, e.g., `120` or `'120'` will be treated as `'120 seconds'`.
81
+ * - If you use time value with unit ({@link TimeWithUnit}) be sure you provide the time units (days, hours, etc.), otherwise it will return `NaN`, e.g., `'120 unknown'` will return `NaN`.
82
+ */
83
+ expiresIn?: TimeWithUnit | Numeric;
84
+ /**
85
+ * * Specifies when the token becomes active/valid in the future.
86
+ *
87
+ * @remarks
88
+ * - A numeric value (number or numeric string ({@link Numeric})) is interpreted as seconds count, e.g., `120` or `'120'` will be treated as `'120 seconds'`.
89
+ * - If you use time value with unit ({@link TimeWithUnit}) be sure you provide the time units (days, hours, etc.), otherwise it will return `NaN`, e.g., `'120 unknown'` will return `NaN`.
90
+ */
91
+ notBefore?: TimeWithUnit | Numeric;
92
+ }
93
+ /** 3-parts dot separated token string */
94
+ type TokenString = `${string}.${string}.${string}`;
95
+ /** Interface of token verification result if token is valid */
96
+ type $ValidToken<T extends GenericObject = GenericObject> = {
97
+ /** Whether the token is valid */isValid: true; /** Decoded payload after successful verification with common {@link SignetPayload} properties */
98
+ payload: SignetPayload<T>;
99
+ };
100
+ /** Interface of token verification result if token is invalid */
101
+ type $InvalidToken = {
102
+ /** Whether the token is valid */isValid: false; /** Error message if the token is invalid */
103
+ error: string;
104
+ };
105
+ /** Result of token verification */
106
+ type VerifiedToken<T extends GenericObject = GenericObject> = $ValidToken<T> | $InvalidToken;
107
+ /** Decoded `Signet` payload with `iat` and optional claims */
108
+ type SignetPayload<T extends GenericObject = GenericObject> = {
109
+ /** When the token was created (unix timestamp in seconds) */iat: number; /** When the token was created (as JavaScript {@link Date}) */
110
+ iatDate: Date; /** When the token expires (unix timestamp in seconds) */
111
+ exp?: number; /** When the token expires (as JavaScript {@link Date}) */
112
+ expDate?: Date; /** When the token becomes valid (unix timestamp in seconds) */
113
+ nbf?: number; /** When the token becomes valid (as JavaScript {@link Date}) */
114
+ nbfDate?: Date; /** Where the token is allowed to be used */
115
+ aud?: string | string[]; /** Who the token is about */
116
+ sub?: string; /** From where/who the token is issued */
117
+ iss?: string;
118
+ } & T;
119
+ /** Interface of a decoded token */
120
+ type DecodedToken<T extends GenericObject = GenericObject> = {
121
+ /** Token header info, algorithm, type etc. */header: SignetHeader; /** Decoded payload after with common {@link SignetPayload} properties */
122
+ payload: SignetPayload<T>;
123
+ /**
124
+ * The `Base64`-encoded signature from the token.
125
+ * This is the third part of the token string.
126
+ */
127
+ signature: string; /** The header and payload in encrypted `Base64` format.*/
128
+ signingInput: `${string}.${string}`;
129
+ };
130
+ //#endregion
131
+ export { VerifiedToken as _, $UUIDVersion as a, DecodedUUID as c, SignetPayload as d, SupportedVersion as f, UUIDVersion as g, UUIDOptions as h, $UUIDOptionsV3V5 as i, SignOptions as l, UUID as m, $UUID as n, $ValidToken as o, TokenString as p, $UUIDOptions as r, DecodedToken as s, $InvalidToken as t, SignetHeader as u, VerifyOptions as v };