@rzl-zone/utils-js 3.1.1-beta.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +56 -27
  2. package/dist/assertions/index.cjs +1 -1
  3. package/dist/assertions/index.js +1 -1
  4. package/dist/chunk-26XIKDJI.cjs +1 -0
  5. package/dist/chunk-2NWHDDM5.js +1 -0
  6. package/dist/chunk-2UIRWYE3.js +1 -0
  7. package/dist/chunk-4VCRMMAH.cjs +1 -0
  8. package/dist/chunk-5C2SMIGX.cjs +1 -0
  9. package/dist/chunk-5I2B5DOG.js +1 -0
  10. package/dist/chunk-5Y52H4VH.cjs +1 -0
  11. package/dist/chunk-7BXIZM57.cjs +1 -0
  12. package/dist/chunk-7H7IODCQ.cjs +1 -0
  13. package/dist/chunk-7KJBDGEP.js +1 -0
  14. package/dist/chunk-7PG6YKIY.cjs +1 -0
  15. package/dist/chunk-7YVINA3U.cjs +1 -0
  16. package/dist/chunk-AXWJJXJC.js +1 -0
  17. package/dist/chunk-CPLBRGST.js +1 -0
  18. package/dist/chunk-DQFU3KLE.cjs +1 -0
  19. package/dist/chunk-DUK2K4FB.js +1 -0
  20. package/dist/chunk-DVMHRLKP.cjs +1 -0
  21. package/dist/chunk-EBMHQW7X.cjs +1 -0
  22. package/dist/chunk-EXWCTDC3.cjs +1 -0
  23. package/dist/chunk-FIAAX3UE.js +1 -0
  24. package/dist/chunk-G2B35D5W.js +1 -0
  25. package/dist/chunk-GLUYWYOA.cjs +1 -0
  26. package/dist/chunk-GRSCNTOK.js +1 -0
  27. package/dist/chunk-I5X5IN4H.js +1 -0
  28. package/dist/chunk-I6NOFGAK.cjs +1 -0
  29. package/dist/chunk-INUFZJLX.cjs +1 -0
  30. package/dist/chunk-IRBPXCMR.js +1 -0
  31. package/dist/chunk-J2RGTPGK.cjs +1 -0
  32. package/dist/chunk-KHO2SBNA.cjs +1 -0
  33. package/dist/chunk-KXIXXSWX.cjs +1 -0
  34. package/dist/chunk-L73TOPX5.js +1 -0
  35. package/dist/chunk-MC3LXMCQ.js +1 -0
  36. package/dist/chunk-MHXVVDRQ.cjs +1 -0
  37. package/dist/chunk-MMSYCIJ2.cjs +1 -1
  38. package/dist/chunk-NHNBV5VS.cjs +1 -0
  39. package/dist/chunk-NXWPZDDX.js +1 -0
  40. package/dist/chunk-ODZQXH7E.cjs +1 -0
  41. package/dist/chunk-ONZFBJVW.js +1 -0
  42. package/dist/chunk-Q6NHYWVX.js +1 -0
  43. package/dist/chunk-QNKGP5DY.js +1 -0
  44. package/dist/chunk-QVRTHAM2.js +1 -0
  45. package/dist/chunk-RF34NETZ.js +1 -0
  46. package/dist/chunk-SAW7XS4K.js +1 -0
  47. package/dist/chunk-TSLYDPBJ.js +1 -0
  48. package/dist/chunk-UDA26MCU.cjs +1 -0
  49. package/dist/chunk-UET567YM.cjs +1 -0
  50. package/dist/chunk-URGK5UQT.js +1 -0
  51. package/dist/chunk-VEYMQ3UA.js +1 -0
  52. package/dist/chunk-W2W3L2M5.js +1 -0
  53. package/dist/chunk-WFPQO7KN.js +1 -0
  54. package/dist/chunk-WVSPXFTY.js +1 -0
  55. package/dist/chunk-WZE3XLKY.cjs +1 -0
  56. package/dist/chunk-X4PD3I5U.js +1 -0
  57. package/dist/chunk-XC2PYCT4.cjs +1 -0
  58. package/dist/chunk-XIXA5KDF.cjs +1 -0
  59. package/dist/chunk-XSFPU3YT.js +1 -0
  60. package/dist/chunk-XVHPXRUH.cjs +1 -0
  61. package/dist/chunk-Y44ZD3GG.js +1 -0
  62. package/dist/chunk-Y4O5KZF6.cjs +1 -0
  63. package/dist/chunk-YT3MSZKK.cjs +1 -0
  64. package/dist/chunk-YZR5OGJA.cjs +1 -0
  65. package/dist/chunk-ZR7GTJQX.cjs +1 -0
  66. package/dist/chunk-ZXIWDFEQ.js +1 -0
  67. package/dist/conversions/index.cjs +1 -1
  68. package/dist/conversions/index.d.ts +175 -40
  69. package/dist/conversions/index.js +1 -1
  70. package/dist/env/index.cjs +1 -1
  71. package/dist/env/index.js +1 -1
  72. package/dist/events/index.cjs +1 -1
  73. package/dist/events/index.js +1 -1
  74. package/dist/formatting/index.cjs +1 -1
  75. package/dist/formatting/index.js +1 -1
  76. package/dist/generator/index.cjs +1 -1
  77. package/dist/generator/index.js +1 -1
  78. package/dist/{is-array--YjXV-Wx.d.ts → is-array-Cymwrsmm.d.ts} +2 -90
  79. package/dist/next/index.cjs +1 -8
  80. package/dist/next/index.js +1 -8
  81. package/dist/next/server/index.cjs +1 -2
  82. package/dist/next/server/index.js +1 -2
  83. package/dist/operations/index.cjs +1 -1
  84. package/dist/operations/index.js +1 -1
  85. package/dist/or-DyZCRvaU.d.ts +89 -0
  86. package/dist/parsers/index.cjs +1 -1
  87. package/dist/parsers/index.js +1 -1
  88. package/dist/predicates/index.cjs +1 -1
  89. package/dist/predicates/index.d.ts +111 -17
  90. package/dist/predicates/index.js +1 -1
  91. package/dist/promise/index.cjs +1 -1
  92. package/dist/promise/index.js +1 -1
  93. package/dist/rzl-utils.global.js +1 -4
  94. package/dist/strings/index.cjs +1 -1
  95. package/dist/strings/index.js +1 -1
  96. package/dist/tailwind/index.cjs +1 -0
  97. package/dist/tailwind/index.d.ts +565 -0
  98. package/dist/tailwind/index.js +1 -0
  99. package/dist/types/index.d.ts +1 -1
  100. package/dist/urls/index.cjs +1 -1
  101. package/dist/urls/index.js +1 -1
  102. package/package.json +24 -23
  103. package/dist/chunk-26W3VZIK.cjs +0 -1
  104. package/dist/chunk-2KRCHXFG.cjs +0 -2
  105. package/dist/chunk-33ZLH266.js +0 -1
  106. package/dist/chunk-4L4EJTNZ.js +0 -1
  107. package/dist/chunk-56QBKKRE.js +0 -1
  108. package/dist/chunk-5Q37AP7P.js +0 -1
  109. package/dist/chunk-5SZUSNGZ.js +0 -1
  110. package/dist/chunk-7CHFAMS2.js +0 -1
  111. package/dist/chunk-7MMJZ6HS.js +0 -1
  112. package/dist/chunk-7TC6DE3J.cjs +0 -1
  113. package/dist/chunk-7VX33E3V.js +0 -1
  114. package/dist/chunk-7YWAQOA4.cjs +0 -1
  115. package/dist/chunk-BEZPD44N.cjs +0 -1
  116. package/dist/chunk-BI263OHW.js +0 -1
  117. package/dist/chunk-CII6WWLO.cjs +0 -1
  118. package/dist/chunk-D5TYPCWU.cjs +0 -1
  119. package/dist/chunk-EEQY5QUG.js +0 -1
  120. package/dist/chunk-ELDDNERR.js +0 -1
  121. package/dist/chunk-ESJYBIYH.js +0 -1
  122. package/dist/chunk-EWYPSKKM.js +0 -1
  123. package/dist/chunk-EXCOQLWX.cjs +0 -1
  124. package/dist/chunk-FIEZKTAZ.cjs +0 -1
  125. package/dist/chunk-FWQVTMYA.cjs +0 -1
  126. package/dist/chunk-G4EWCRKS.js +0 -1
  127. package/dist/chunk-G7R5XZRM.cjs +0 -1
  128. package/dist/chunk-GGEV7LXX.cjs +0 -1
  129. package/dist/chunk-HJOZOENU.cjs +0 -1
  130. package/dist/chunk-IRDZVLNZ.cjs +0 -1
  131. package/dist/chunk-IW73G523.cjs +0 -1
  132. package/dist/chunk-IY5OZAB3.cjs +0 -1
  133. package/dist/chunk-J4NCYYGS.js +0 -1
  134. package/dist/chunk-J7JAZAJD.js +0 -1
  135. package/dist/chunk-JYNSO7ZY.js +0 -1
  136. package/dist/chunk-K3UVKYEU.js +0 -1
  137. package/dist/chunk-LQ76EDZG.js +0 -1
  138. package/dist/chunk-MROH35V3.cjs +0 -1
  139. package/dist/chunk-NJSAV73S.js +0 -1
  140. package/dist/chunk-NNM7QCNB.js +0 -1
  141. package/dist/chunk-NR44SNYE.js +0 -1
  142. package/dist/chunk-NXMTWY77.js +0 -1
  143. package/dist/chunk-OZCQZO2V.cjs +0 -4
  144. package/dist/chunk-PUQXRLZH.cjs +0 -1
  145. package/dist/chunk-Q3NTKN5I.cjs +0 -1
  146. package/dist/chunk-QDNSC57Z.js +0 -4
  147. package/dist/chunk-QGXTL5ZH.js +0 -2
  148. package/dist/chunk-QSQDP7L2.cjs +0 -1
  149. package/dist/chunk-RV2VULM7.cjs +0 -1
  150. package/dist/chunk-S5M33A4O.js +0 -1
  151. package/dist/chunk-SGTHOQQ2.js +0 -1
  152. package/dist/chunk-SL3RQOWA.js +0 -1
  153. package/dist/chunk-SW6HYEW7.cjs +0 -1
  154. package/dist/chunk-SYJC7UAW.js +0 -1
  155. package/dist/chunk-SZPWZZYG.cjs +0 -1
  156. package/dist/chunk-UA4B7JBO.cjs +0 -1
  157. package/dist/chunk-UQDJF5RR.cjs +0 -1
  158. package/dist/chunk-UTQUYABU.cjs +0 -1
  159. package/dist/chunk-VPW3DRV5.js +0 -1
  160. package/dist/chunk-W32WALNU.js +0 -1
  161. package/dist/chunk-XGZ6K753.cjs +0 -1
  162. package/dist/chunk-YFTR64N5.cjs +0 -1
  163. package/dist/chunk-ZFDS7W6B.cjs +0 -1
  164. package/dist/chunk-ZQOLZE6Z.cjs +0 -1
  165. package/dist/index.cjs +0 -1
  166. package/dist/index.d.ts +0 -1
  167. package/dist/index.js +0 -1
  168. package/dist/stylings/index.cjs +0 -1
  169. package/dist/stylings/index.d.ts +0 -41
  170. package/dist/stylings/index.js +0 -1
@@ -1,4 +1,4 @@
1
- import{A as AnyFunction,T as TypedArray,W as WebApiObjects,I as IntlObjects}from'../type-data-DDs-u2kq.js';import{N as NormalizeEmptyArraysRecursive,R as RemoveEmptyArrayElements,F as FixNeverArrayRecursive}from'../arrays-normalize-recursive-CnjYJ9xg.js';import{h as Nullish,a as KeepNull,b as KeepUndef}from'../nils-DMz3kU7M.js';import{I as IsAny}from'../any-BmdI8UbK.js';import{i as IfNotExtends,I as IfExtends}from'../extends-Bk_SBGdT.js';import{P as Prettify}from'../prettify-C4xLcYOP.js';import{N as NumberRangeUnion}from'../NumberRangeUnion-DC-C3_Kq.js';import'../if-CvT4R7Kh.js';import'../never-BfayMBF9.js';type ExcludeNil<T>=Exclude<T,null|undefined>;
1
+ import{A as AnyFunction,T as TypedArray,W as WebApiObjects,I as IntlObjects}from'../type-data-DDs-u2kq.js';import{N as NormalizeEmptyArraysRecursive,R as RemoveEmptyArrayElements,F as FixNeverArrayRecursive}from'../arrays-normalize-recursive-CnjYJ9xg.js';import{h as Nullish,a as KeepNull,b as KeepUndef}from'../nils-DMz3kU7M.js';import{I as IsAny}from'../any-BmdI8UbK.js';import{i as IfNotExtends,I as IfExtends,E as Extends}from'../extends-Bk_SBGdT.js';import{P as Prettify}from'../prettify-C4xLcYOP.js';import{N as NumberRangeUnion}from'../NumberRangeUnion-DC-C3_Kq.js';import{O as OrArr,a as AndArr}from'../or-DyZCRvaU.js';import'../if-CvT4R7Kh.js';import'../never-BfayMBF9.js';type ExcludeNil<T>=Exclude<T,null|undefined>;
2
2
  /** ----------------------------------------------------------
3
3
  * * ***Element extractor***
4
4
  * ----------------------------------------------------------
@@ -1030,7 +1030,9 @@ declare function removeObjectPaths<T extends Record<string,unknown>,K extends Co
1030
1030
  * -------------------------------------------------
1031
1031
  */
1032
1032
  type SafeStableStringifyOptions={
1033
- /** Whether to sort **object keys** alphabetically (recursively).
1033
+ /** -------------------------------------------------
1034
+ * * ***Whether to sort **object keys** alphabetically (recursively).***
1035
+ * -------------------------------------------------
1034
1036
  *
1035
1037
  * - `true` (default): object keys are sorted to ensure stable output.
1036
1038
  * - `false`: preserves original insertion order of keys.
@@ -1038,7 +1040,9 @@ type SafeStableStringifyOptions={
1038
1040
  * @default true
1039
1041
  */
1040
1042
  sortKeys?:boolean;
1041
- /** Whether to sort **primitive values inside arrays**.
1043
+ /** -------------------------------------------------
1044
+ * * ***Whether to sort **primitive values inside arrays**.***
1045
+ * -------------------------------------------------
1042
1046
  *
1043
1047
  * - `true`: primitive values in arrays are sorted to ensure stable output.
1044
1048
  * - `false` (default): arrays retain their original order; objects and nested arrays are not reordered.
@@ -1046,14 +1050,47 @@ sortKeys?:boolean;
1046
1050
  * @default false
1047
1051
  */
1048
1052
  sortArray?:boolean;
1049
- /** Whether to pretty-print JSON output with 2-space indentation.
1053
+ /** -------------------------------------------------
1054
+ * * ***Whether to pretty-print JSON output with 2-space indentation.***
1055
+ * -------------------------------------------------
1050
1056
  *
1051
1057
  * - `true`: output is formatted with indentation and newlines.
1052
1058
  * - `false` (default): produces compact single-line JSON.
1053
1059
  *
1054
1060
  * @default false
1055
1061
  */
1056
- pretty?:boolean;};
1062
+ pretty?:boolean;
1063
+ /** -------------------------------------------------
1064
+ * * ***Preserve `undefined` values instead of converting them to `null`.***
1065
+ * -------------------------------------------------
1066
+ * **Controls how the internal `deepProcess` step rewrites values
1067
+ * **before** the final `JSON.stringify` call.**
1068
+ * - **Default (`false`)** – Every `undefined` value
1069
+ * (object properties **and** array elements)
1070
+ * is replaced with `null` **before** serialization.
1071
+ * Because this happens first, the key is **not removed** by
1072
+ * `JSON.stringify`.
1073
+ * - **`true`** – Leaves `undefined` untouched so the final
1074
+ * `JSON.stringify` call behaves natively:
1075
+ * * Object properties with `undefined` are **removed**.
1076
+ * * Array elements that are `undefined` become `null`.
1077
+ * @default false
1078
+ * @example
1079
+ * // ✅ keepUndefined = true: behaves like native JSON.stringify
1080
+ * safeStableStringify({ a: undefined }, { keepUndefined: true });
1081
+ * // → '{}' // key removed
1082
+ *
1083
+ * // ✅ Default (false): convert undefined to null, key kept
1084
+ * safeStableStringify({ a: undefined });
1085
+ * // → '{"a":null}' // key present, value null
1086
+ *
1087
+ * // Arrays
1088
+ * safeStableStringify([undefined]);
1089
+ * // → '[null]' // same, but via pre-replacement
1090
+ * safeStableStringify([undefined], { keepUndefined: true });
1091
+ * // → '[null]' // element becomes null
1092
+ */
1093
+ keepUndefined?:boolean;};
1057
1094
  /** --------------------------------------------
1058
1095
  * * ***Utility: `safeStableStringify`.***
1059
1096
  * ---------------------------------------------
@@ -1083,6 +1120,15 @@ pretty?:boolean;};
1083
1120
  * - Compared to `JSON.stringify`, this ensures **stable output**:
1084
1121
  * - Same object structure always produces the same string.
1085
1122
  * - Useful for deep equality checks, hashing, caching keys, or snapshot tests.
1123
+ * - Controls how `undefined` is handled **before** the final `JSON.stringify` call, by `keepUndefined`
1124
+ * options, default: `false`.
1125
+ * - **false**: All `undefined` values (object properties and array elements) are replaced
1126
+ * with `null`, so object keys remain.
1127
+ * - **true**: Leaves `undefined` values as-is, and handling by native `JSON.stringify` then:
1128
+ * 1. Removes object properties that are `undefined`
1129
+ * 2. Converts `undefined` array elements to `null`
1130
+ * - Use `true` when you need native removal of keys or to preserve sparse arrays
1131
+ * exactly as `JSON.stringify` would.
1086
1132
  * @param {*} value
1087
1133
  * - Any JavaScript value to serialize, can be:
1088
1134
  * - Primitives (`number`, `string`, `boolean`, `bigint`, `null`, `undefined`)
@@ -1092,6 +1138,8 @@ pretty?:boolean;};
1092
1138
  * - Circular structures
1093
1139
  * @param {SafeStableStringifyOptions} [options]
1094
1140
  * - Configuration options for `safeStableStringify`:
1141
+ * - `keepUndefined` (boolean) – Control how `undefined` is handled **before** the final `JSON.stringify`
1142
+ * call, default: `false`.
1095
1143
  * - `sortKeys` (boolean) – Whether to sort object keys alphabetically (recursively), default: `true`.
1096
1144
  * - `sortArray` (boolean) – Whether to sort primitive values inside arrays, default: `false`.
1097
1145
  * - `pretty` (boolean) – Whether to pretty-print JSON output with 2-space indentation, default: `false`.
@@ -1117,6 +1165,14 @@ pretty?:boolean;};
1117
1165
  * });
1118
1166
  * // ➔ '[1,2,3]'
1119
1167
  *
1168
+ * // keepUndefined = true (native removal of keys)
1169
+ * safeStableStringify({ a: undefined }, { keepUndefined: true });
1170
+ * // ➔ '{}' // key `a` is removed, like native JSON.stringify
1171
+ *
1172
+ * // Default keepUndefined = false (convert to null, keep key)
1173
+ * safeStableStringify({ a: undefined });
1174
+ * // ➔ '{"a":null}'
1175
+ *
1120
1176
  * // Nested object + sortArray=true
1121
1177
  * safeStableStringify({ z: [3, 1, 2], x: { d: 4, c: 3 } }, {
1122
1178
  * sortKeys:true,
@@ -1158,7 +1214,7 @@ pretty?:boolean;};
1158
1214
  * safeStableStringify({ f: () => {}, s: Symbol("wow") });
1159
1215
  * // ➔ '{}'
1160
1216
  *
1161
- * // undefined, NaN, Infinity convert to null
1217
+ * // undefined, NaN, Infinity convert to null (keepUndefined = false or keepUndefined = true)
1162
1218
  * safeStableStringify([undefined, NaN, Infinity, -Infinity]);
1163
1219
  * // ➔ '[null,null,null,null]'
1164
1220
  *
@@ -1183,11 +1239,27 @@ declare const safeStableStringify:(value:unknown,options?:SafeStableStringifyOpt
1183
1239
  * - `"stringOrNumber"`: Converts strings and numbers to strings.
1184
1240
  * - `"primitives"`: Converts all primitives (number, string, boolean, bigint, undefined, null, NaN) to strings.
1185
1241
  * - `"all"`: Converts everything, including symbols, functions, Dates, RegExp, Maps, Sets, Errors, Promises,
1186
- * and deeply all object properties, to strings.
1242
+ * boxed primitives box (new Number, new String, new Boolean), and deeply all object properties, to strings.
1187
1243
  * - `false`: Leaves everything unchanged.
1188
1244
  * - **Special behaviors:**
1189
1245
  * - `NaN` ➔ `"NaN"` only in `"primitives"` or `"all"` mode.
1190
1246
  * - `Date` ➔ ISO string only in `"all"` mode.
1247
+ * - ***Primitives Boxed*** (`new Number`, `new String`, `new Boolean`):
1248
+ * - For `new String` we convert everything to string (behavior JS of new String):
1249
+ * - `new String("hi")` ➔ `.valueOf()` ➔ `"hi"`.
1250
+ * - `new String(true)` ➔ `.valueOf()` ➔ `"true"`.
1251
+ * - For `new Boolean` we convert to boolean (behavior JS of new Boolean) then convert to string:
1252
+ * - `new Boolean(true)` ➔ `.valueOf()` ➔ `true` ➔ `true.toString()` ➔ `"true"`.
1253
+ * - Special behavior JS of new Boolean, return `false` **(convert to string: `"false"`)**
1254
+ * for `false`, (`0` / `-0`), `""` (empty-string), `null`, `undefined`, `NaN`, otherwise
1255
+ * `true` **(convert to string: `"true"`)**.
1256
+ * - For `new Number`:
1257
+ * - `new Number(42)` ➔ `.valueOf()` ➔ `42` ➔ `42.toString()` ➔ `"42"`.
1258
+ * - `new Number(NaN)` ➔ `.valueOf()` ➔ `NaN` ➔ `NaN.toString()` ➔ `"NaN"`.
1259
+ * - `new Number(null)` ➔ `.valueOf()` ➔ `0` (`null` is `0` behavior JS of new Number) ➔ `0.toString()` ➔ `"0"`.
1260
+ * - `new Number(undefined)` ➔ `.valueOf()` ➔ `NaN` ➔ `NaN.toString()` ➔ `"NaN"`.
1261
+ * - `new Number(Infinity)` ➔ `Infinity` ➔ `Infinity` ➔ `Infinity.toString()` ➔ `"Infinity"`.
1262
+ * - `new Number(-Infinity)` ➔ `-Infinity` ➔ `-Infinity` ➔ `-Infinity.toString()` ➔ `"-Infinity"`.
1191
1263
  * - `RegExp` ➔ Source string (e.g. `/abc/i`) only in `"all"` mode.
1192
1264
  * - `Symbol` ➔ `Symbol(description)` string only in `"all"` mode.
1193
1265
  * - `Map` ➔ Array of [key, value] pairs with keys/values stringified deeply (only in `"all"` mode).
@@ -1206,6 +1278,12 @@ declare const safeStableStringify:(value:unknown,options?:SafeStableStringifyOpt
1206
1278
  * // ➔ "null"
1207
1279
  * toStringDeepForce(Symbol("x"), "all");
1208
1280
  * // ➔ "Symbol(x)"
1281
+ * toStringDeepForce(new String("hi"), "all");
1282
+ * // ➔ "hi"
1283
+ * toStringDeepForce(new Number(42), "all");
1284
+ * // ➔ "42"
1285
+ * toStringDeepForce(new Boolean(true), "all");
1286
+ * // ➔ "true"
1209
1287
  * toStringDeepForce({ a: 1, b: [2, NaN] }, "primitives");
1210
1288
  * // ➔ { a: "1", b: ["2", "NaN"] }
1211
1289
  * toStringDeepForce(new Date("2025-01-01"), "all");
@@ -1227,12 +1305,12 @@ declare const safeStableStringify:(value:unknown,options?:SafeStableStringifyOpt
1227
1305
  * toStringDeepForce([1, "a", { b: 2 }], false);
1228
1306
  * // ➔ [1, "a", { b: 2 }]
1229
1307
  */
1230
- declare function toStringDeepForce(value:unknown,forceToString:false|"stringOrNumber"|"primitives"|"all"):unknown;
1308
+ declare function toStringDeepForce<T>(value:unknown,forceToString:false|"stringOrNumber"|"primitives"|"all"):T;
1231
1309
  /** ----------------------------------------------------------
1232
1310
  * * Normalize leaked `never[]` into literal empty array `[]`.
1233
1311
  * ----------------------------------------------------------
1234
1312
  */
1235
- type FixNeverArray$1<T>=[T] extends [never[]]?[]:T;
1313
+ type FixNeverArray$1<T,RemoveEmptyArrays extends boolean>=[T] extends [never[]]?RemoveEmptyArrays extends true?OrArr<[Extends<T,undefined>,Extends<undefined,T>]>extends true?undefined:never:[]:T;
1236
1314
  /** ----------------------------------------------------------
1237
1315
  * * Simplify object type to remove unnecessary TypeScript wrappers.
1238
1316
  * ----------------------------------------------------------
@@ -1249,24 +1327,19 @@ type Simplify$1<T>=T extends object?{[K in keyof T]:T[K];}:T;
1249
1327
  * @template RemoveEmptyArrays - Whether to remove empty arrays
1250
1328
  * @template IsRoot - Internal flag for root level
1251
1329
  */
1252
- type ConvertedDeepNumberInternal<T,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=[ T] extends [null|undefined]?IsRoot extends true?undefined:never:T extends number|`${number}`|string?number|undefined:T extends readonly(infer E)[]?FixNeverArray$1<T extends readonly [any,...any[]]?_MapTuple$1<T,RemoveEmptyObjects,RemoveEmptyArrays>:ConvertedDeepNumberInternal<E,RemoveEmptyObjects,RemoveEmptyArrays,false>[]>:T extends Set<infer V>?FixNeverArray$1<ConvertedDeepNumberInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,false>[]>:T extends Map<infer K,infer V>?FixNeverArray$1<[ ConvertedDeepNumberInternal<K,RemoveEmptyObjects,RemoveEmptyArrays,false>,ConvertedDeepNumberInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,false>][]>:T extends Buffer?RemoveEmptyArrays extends true?IsRoot extends true?(number|undefined)[]:never:(number|undefined)[]:T extends TypedArray?FixNeverArray$1<ConvertedDeepNumberInternal<number,RemoveEmptyObjects,RemoveEmptyArrays,false>[]>:T extends Date?_ConvertedObjectInternal$1<number,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:T extends RegExp|WebApiObjects|IntlObjects|{[Symbol.toStringTag]:"Proxy";}|typeof Reflect?RemoveEmptyObjects extends true?IsRoot extends true?{}:never:{}:T extends Record<string|number|symbol,unknown>?_ConvertedObjectInternal$1<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:never;
1253
- /** ----------------------------------------------------------
1254
- * * Recursively map tuples while preserving `never` removals.
1255
- * ----------------------------------------------------------
1256
- */
1257
- type _MapTuple$1<Arr extends readonly unknown[],RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean>=Arr extends readonly [infer H,...infer R]?Exclude<ConvertedDeepNumberInternal<H,RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer H2?[H2] extends [never]?_MapTuple$1<R,RemoveEmptyObjects,RemoveEmptyArrays>:[H2,..._MapTuple$1<R,RemoveEmptyObjects,RemoveEmptyArrays>]:never:[];
1330
+ type ConvertedDeepNumberInternal<T,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=[T] extends [null|undefined]?IsRoot extends true?undefined:never:T extends Date|boolean|Boolean?number:T extends string|String|Number|number|`${number}`?number|undefined:AndArr<[Extends<RemoveEmptyArrays,true>,Extends<T,undefined[]>]>extends true?never:T extends readonly(infer E)[]?OrArr<[ Extends<RemoveEmptyArrays,true>,AndArr<[Extends<RemoveEmptyArrays,true>,Extends<IsRoot,true>]>]>extends true?FixNeverArray$1<Exclude<ConvertedDeepNumberInternal<E,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>,RemoveEmptyArrays>[]|undefined:FixNeverArray$1<Exclude<ConvertedDeepNumberInternal<E,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends Set<infer V>?AndArr<[Extends<RemoveEmptyArrays,true>]>extends true?FixNeverArray$1<Exclude<ConvertedDeepNumberInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:FixNeverArray$1<Exclude<ConvertedDeepNumberInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends Map<infer K,infer V>?FixNeverArray$1<[ Exclude<ConvertedDeepNumberInternal<K,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>,Exclude<ConvertedDeepNumberInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>][],RemoveEmptyArrays>:T extends Buffer?FixNeverArray$1<Exclude<ConvertedDeepNumberInternal<string,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends TypedArray?FixNeverArray$1<Exclude<ConvertedDeepNumberInternal<string,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends Record<PropertyKey,unknown>?_ConvertedObjectInternal$1<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:never;
1258
1331
  /** ----------------------------------------------------------
1259
1332
  * * Internal object conversion utility.
1260
1333
  * * Removes empty objects/arrays based on flags.
1261
1334
  * ----------------------------------------------------------
1262
1335
  */
1263
- type _ConvertedObjectInternal$1<O extends Record<string|number|symbol,unknown>|number,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>={[K in keyof O as Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>?never:RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?O[K] extends TypedArray|Set<any>|Map<any,any>?K:never:K:K:K:never]:Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}&{[K in keyof O as Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>?RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?O[K] extends TypedArray|Set<any>|Map<any,any>?K:never:K:K:K:never:never]?:Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}extends infer M?RemoveEmptyObjects extends true?keyof M extends never?IsRoot extends true?{}:never:Simplify$1<M>:Simplify$1<M>:never;
1336
+ type _ConvertedObjectInternal$1<O extends Record<PropertyKey,unknown>|string|number,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>={[K in keyof O as Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>?never:RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?never:K:K:K:never]:Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}&{[K in keyof O as Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>?RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?never:K:K:K:never:never]?:Exclude<ConvertedDeepNumberInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}extends infer M?RemoveEmptyObjects extends true?keyof M extends never?IsRoot extends true?{}:never:_ProcessedObject$1<M,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:Simplify$1<M>:never;type AllPropsAreNumber$1<O>={[K in keyof O]:O[K] extends number|Number?true:O[K] extends Record<string,unknown>?AllPropsAreNumber$1<O[K]>:false;}[keyof O] extends false?false:true;type _ProcessedObject$1<M,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=M extends unknown[]?ConvertedDeepNumberInternal<M,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:Prettify<Simplify$1<{[K in keyof M]:M[K] extends Record<string,unknown>?AllPropsAreNumber$1<M[K]>extends true?{[ChildKey in keyof M[K]]:M[K][ChildKey] extends number|Number?M[K][ChildKey]|undefined:_ProcessedObject$1<M[K][ChildKey],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}|undefined:AndArr<[ Extends<RemoveEmptyArrays,true>,Extends<RemoveEmptyObjects,true>]>extends true?{[ChildKey in keyof M[K]]:_ProcessChild$1<M[K][ChildKey],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}|undefined:{[ChildKey in keyof M[K]]:_ProcessChild$1<M[K][ChildKey],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}:M[K] extends unknown[]?ConvertedDeepNumberInternal<M[K],RemoveEmptyObjects,RemoveEmptyArrays,false>:_ProcessedObject$1<M[K],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}>,{recursive:true;}>;type _ProcessChild$1<T,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=T extends number|number[]?ConvertedDeepNumberInternal<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:T extends Record<string,unknown>?_ProcessedObject$1<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:_ProcessedObject$1<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;
1264
1337
  /** ----------------------------------------------------------
1265
1338
  * * Public type: Deeply converts numbers/strings to `number | undefined`,
1266
1339
  * * applies empty object/array removal, preserves special types.
1267
1340
  * ----------------------------------------------------------
1268
1341
  */
1269
- type ConvertedDeepNumber<T,RemoveEmptyObjects extends boolean=false,RemoveEmptyArrays extends boolean=false>=[unknown] extends [T]?unknown:FixNeverArray$1<ConvertedDeepNumberInternal<T,RemoveEmptyObjects,RemoveEmptyArrays,true>>;type ToNumberDeepOptions<RemoveEmptyObjects extends boolean=false,RemoveEmptyArrays extends boolean=false>={
1342
+ type ConvertedDeepNumber<T,RemoveEmptyObjects extends boolean=false,RemoveEmptyArrays extends boolean=false>=[unknown] extends [T]?unknown:FixNeverArray$1<ConvertedDeepNumberInternal<T,RemoveEmptyObjects,RemoveEmptyArrays,true>,RemoveEmptyArrays>;type ToNumberDeepOptions<RemoveEmptyObjects extends boolean=false,RemoveEmptyArrays extends boolean=false>={
1270
1343
  /** Whether to remove empty objects (`{}`) from the result.
1271
1344
  *
1272
1345
  * - `true` ➔ remove empty objects recursively.
@@ -1288,13 +1361,45 @@ removeEmptyArrays?:RemoveEmptyArrays;};
1288
1361
  * ---------------------------------------------------
1289
1362
  * **Converts deeply nested arrays, objects, buffers, sets, maps, or typed arrays into numbers while preserving structure.**
1290
1363
  * - **Features:**
1291
- * - Removes `null`, `undefined`, `NaN`, `Infinity`, `-Infinity`, empty-string, non-numeric strings, and functions.
1292
- * - Recursively processes nested objects, arrays, buffers, sets, maps, and typed arrays.
1293
- * - Converts numeric strings to numbers (e.g., `"3.5"` ➔ `3.5`).
1294
- * - Keeps empty objects `{}` unless `removeEmptyObjects: true`.
1295
- * - Keeps empty arrays `[]` unless `removeEmptyArrays: true`.
1296
- * - Buffers and TypedArrays are converted into arrays of numbers.
1297
- * - Date objects are converted into their timestamp (`number`).
1364
+ * - Converts numeric strings, number to numbers:
1365
+ * - `3.5` `3.5`.
1366
+ * - `"3.5"` ➔ `3.5`.
1367
+ * - Converts boolean to number:
1368
+ * - `true` `1`.
1369
+ * - `false` `0`.
1370
+ * - Converts Date to getTime (timestamp) `Date number`, if invalid Date value will return `0`:
1371
+ * - `new Date("invalid")` ➔ `0`.
1372
+ * - `new Date("11-09-2025 22:04:11")` ➔ `1762700651000`.
1373
+ * - Converts `Buffer`, `TypedArray`, `Set`, `Map`, and `arrays` recursively to `arrays of numbers`.
1374
+ * - Converts boxed primitives box into their primitive equivalents then convert to number:
1375
+ * - For `new String` we convert everything to number (behavior JS of new String):
1376
+ * - `new String(123)` ➔ `.valueOf()` ➔ `"123"` ➔ `Number("123")` ➔ `123`.
1377
+ * - `new String("123")` ➔ `.valueOf()` ➔ `"123"` ➔ `Number("123")` ➔ `123`.
1378
+ * - `new String(true)` ➔ `.valueOf()` ➔ `"true"` ➔ `Number(true)` ➔ `1`.
1379
+ * - `new String(false)` ➔ `.valueOf()` ➔ `"false"` ➔ `Number(false)` ➔ `0`.
1380
+ * - If result from `valueOf()` is `NaN` or `Infinity` ***(will removing)***:
1381
+ * - `new String("hi")` ➔ `.valueOf()` ➔ `"hi"` ➔ `Number("hi")` ➔ `NaN` ***(remove)***.
1382
+ * - `new String(()=>{})` ➔ `.valueOf()` ➔ `"()=>{}"` ➔ `Number("()=>{}")` ➔ `NaN` ***(remove)***.
1383
+ * - For `new Boolean` we convert to boolean (behavior JS of new Boolean) then convert to number:
1384
+ * - `new Boolean(true)` ➔ `.valueOf()` ➔ `true` ➔ `Number(true)` ➔ `1`.
1385
+ * - `new Boolean(false)` ➔ `.valueOf()` ➔ `false` ➔ `Number(false)` ➔ `0`.
1386
+ * - Special behavior JS of new Boolean, return `false` **(convert to number: `0`)**
1387
+ * for `false`, (`0` / `-0`), `""` (empty-string),
1388
+ * `null`, `undefined`, `NaN`, otherwise `true` **(convert to number: `1`)**.
1389
+ * - For `new Number`:
1390
+ * - `new Number(42)` ➔ `.valueOf()` ➔ `42`.
1391
+ * - `new Number("42")` ➔ `.valueOf()` ➔ `42`.
1392
+ * - `new Number(null)` ➔ `.valueOf()` ➔ `0` (`null` is `0` behavior JS of new Number).
1393
+ * - If result from `valueOf()` is `NaN` or `Infinity` ***(will removing)***:
1394
+ * - `new Number(NaN)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.
1395
+ * - `new Number(undefined)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.
1396
+ * - `new Number(Infinity)` ➔ `.valueOf()` ➔ `Infinity` ***(remove)***.
1397
+ * - `new Number(-Infinity)` ➔ `.valueOf()` ➔ `-Infinity` ***(remove)***.
1398
+ * - Recursively processes `nested objects`, `arrays`, `buffers`, `sets`, `maps`, and `typed arrays`.
1399
+ * - Removes `empty-string`, `non-numeric strings`.
1400
+ * - Removes `null`, `undefined`, `NaN`, `Infinity`, `-Infinity`.
1401
+ * - Removes `unsupported` types like `functions` , `RegExp`, `symbols`, and `BigInt`.
1402
+ * - Can optionally remove empty arrays (`[]`) and/or empty objects (`{}`) **recursively**.
1298
1403
  * @template T - The input type.
1299
1404
  * @template RemoveEmptyObjects - Whether to remove empty objects.
1300
1405
  * @template RemoveEmptyArrays - Whether to remove empty arrays.
@@ -1335,7 +1440,7 @@ declare function toNumberDeep(input?:null|undefined,options?:ToNumberDeepOptions
1335
1440
  /** ----------------------------------------------------------
1336
1441
  * * Normalize leaked `never[]` into literal empty array `[]`.
1337
1442
  * ---------------------------------------------------------- */
1338
- type FixNeverArray<T,RemoveEmptyArrays extends boolean>=[T] extends [never[]]?RemoveEmptyArrays extends true?T extends undefined?undefined:never:[]:T;
1443
+ type FixNeverArray<T,RemoveEmptyArrays extends boolean>=[T] extends [never[]]?RemoveEmptyArrays extends true?OrArr<[Extends<T,undefined>,Extends<undefined,T>]>extends true?undefined:never:[]:T;
1339
1444
  /** ----------------------------------------------------------
1340
1445
  * * Simplify object type to remove unnecessary TypeScript wrappers.
1341
1446
  * ---------------------------------------------------------- */
@@ -1345,16 +1450,12 @@ type Simplify<T>=T extends object?{[K in keyof T]:T[K];}:T;
1345
1450
  * * recursively handling arrays, tuples, Sets, Maps, TypedArrays,
1346
1451
  * * Buffer, and objects. Special types like Date remain unchanged.
1347
1452
  * ---------------------------------------------------------- */
1348
- type ConvertedDeepStringInternal<T,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=[T] extends [null|undefined]?IsRoot extends true?undefined:never:T extends number|string|Date|RegExp|WebApiObjects|IntlObjects|{[Symbol.toStringTag]:"Proxy";}|typeof Reflect?string:T extends readonly(infer E)[]?FixNeverArray<T extends readonly [any,...any[]]?_MapTuple<T,RemoveEmptyObjects,RemoveEmptyArrays>:ConvertedDeepStringInternal<E,RemoveEmptyObjects,RemoveEmptyArrays,false>[],RemoveEmptyArrays>:T extends Set<infer V>?FixNeverArray<ConvertedDeepStringInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,false>[],RemoveEmptyArrays>:T extends Map<infer K,infer V>?FixNeverArray<[ ConvertedDeepStringInternal<K,RemoveEmptyObjects,RemoveEmptyArrays,false>,ConvertedDeepStringInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,false>][],RemoveEmptyArrays>:T extends Buffer?FixNeverArray<ConvertedDeepStringInternal<string,RemoveEmptyObjects,RemoveEmptyArrays,false>[],RemoveEmptyArrays>:T extends TypedArray?FixNeverArray<ConvertedDeepStringInternal<string,RemoveEmptyObjects,RemoveEmptyArrays,false>[],RemoveEmptyArrays>:T extends Record<string|number|symbol,unknown>?_ConvertedObjectInternal<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:never;
1349
- /** ----------------------------------------------------------
1350
- * * Remove undefined and keep only items for tuples
1351
- * ---------------------------------------------------------- */
1352
- type _MapTuple<Arr extends readonly unknown[],RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean>=Arr extends readonly [infer H,...infer R]?Exclude<ConvertedDeepStringInternal<H,RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer H2?[H2] extends [never]?_MapTuple<R,RemoveEmptyObjects,RemoveEmptyArrays>:[H2,..._MapTuple<R,RemoveEmptyObjects,RemoveEmptyArrays>]:never:[];
1453
+ type ConvertedDeepStringInternal<T,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=[T] extends [null|undefined]?IsRoot extends true?undefined:never:T extends string|boolean|String|Boolean|Date|RegExp|WebApiObjects|IntlObjects|{[Symbol.toStringTag]:"Proxy";}|typeof Reflect?string:T extends Number|number|`${number}`?string|undefined:AndArr<[Extends<RemoveEmptyArrays,true>,Extends<T,undefined[]>]>extends true?never:T extends readonly(infer E)[]?OrArr<[ Extends<RemoveEmptyArrays,true>,AndArr<[Extends<RemoveEmptyArrays,true>,Extends<IsRoot,true>]>]>extends true?FixNeverArray<Exclude<ConvertedDeepStringInternal<E,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>,RemoveEmptyArrays>[]|undefined:FixNeverArray<Exclude<ConvertedDeepStringInternal<E,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends Set<infer V>?AndArr<[Extends<RemoveEmptyArrays,true>]>extends true?FixNeverArray<Exclude<ConvertedDeepStringInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>,RemoveEmptyArrays>:FixNeverArray<Exclude<ConvertedDeepStringInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends Map<infer K,infer V>?FixNeverArray<[ Exclude<ConvertedDeepStringInternal<K,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>,Exclude<ConvertedDeepStringInternal<V,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>][],RemoveEmptyArrays>:T extends Buffer?FixNeverArray<Exclude<ConvertedDeepStringInternal<string,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends TypedArray?FixNeverArray<Exclude<ConvertedDeepStringInternal<string,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>,undefined>[],RemoveEmptyArrays>:T extends Record<PropertyKey,unknown>?_ConvertedObjectInternal<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:never;
1353
1454
  /** ----------------------------------------------------------
1354
1455
  * * Internal object conversion utility.
1355
1456
  * * Removes empty objects/arrays based on flags.
1356
1457
  * ---------------------------------------------------------- */
1357
- type _ConvertedObjectInternal<O extends Record<string|number|symbol,unknown>|string,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>={[K in keyof O as Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>?never:RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?never:K:K:K:never]:Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}&{[K in keyof O as Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>?RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?never:K:K:K:never:never]?:Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}extends infer M?RemoveEmptyObjects extends true?keyof M extends never?IsRoot extends true?{}:never:Simplify<M>:Simplify<M>:never;
1458
+ type _ConvertedObjectInternal<O extends Record<string|number|symbol,unknown>|string,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>={[K in keyof O as Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>?never:RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?never:K:K:K:never]:Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}&{[K in keyof O as Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>extends infer Convert?[Convert] extends [never]?never:undefined extends ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>?RemoveEmptyArrays extends true?Convert extends readonly unknown[]?[Convert] extends [[]]?never:K:K:K:never:never]?:Exclude<ConvertedDeepStringInternal<O[K],RemoveEmptyObjects,RemoveEmptyArrays,false>,undefined>;}extends infer M?RemoveEmptyObjects extends true?keyof M extends never?IsRoot extends true?{}:never:_ProcessedObject<M,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:Simplify<M>:never;type AllPropsAreNumber<O>={[K in keyof O]:O[K] extends number|Number?true:O[K] extends Record<string,unknown>?AllPropsAreNumber<O[K]>:false;}[keyof O] extends false?false:true;type _ProcessedObject<M,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=M extends unknown[]?ConvertedDeepStringInternal<M,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:Prettify<Simplify<{[K in keyof M]:M[K] extends Record<string,unknown>?AllPropsAreNumber<M[K]>extends true?{[ChildKey in keyof M[K]]:M[K][ChildKey] extends number|Number?M[K][ChildKey]|undefined:_ProcessedObject<M[K][ChildKey],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}|undefined:AndArr<[ Extends<RemoveEmptyArrays,true>,Extends<RemoveEmptyObjects,true>]>extends true?{[ChildKey in keyof M[K]]:_ProcessChild<M[K][ChildKey],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}|undefined:{[ChildKey in keyof M[K]]:_ProcessChild<M[K][ChildKey],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}:M[K] extends unknown[]?ConvertedDeepStringInternal<M[K],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:_ProcessedObject<M[K],RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;}>,{recursive:true;}>;type _ProcessChild<T,RemoveEmptyObjects extends boolean,RemoveEmptyArrays extends boolean,IsRoot extends boolean>=T extends number|Number[]?ConvertedDeepStringInternal<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:T extends Record<string,unknown>?_ProcessedObject<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>:_ProcessedObject<T,RemoveEmptyObjects,RemoveEmptyArrays,IsRoot>;
1358
1459
  /** ----------------------------------------------------------
1359
1460
  * * Public type: Deeply converts numbers/strings to `string`,
1360
1461
  * * applies empty object/array removal, preserves special types.
@@ -1381,15 +1482,39 @@ removeEmptyArrays?:RemoveEmptyArrays;};
1381
1482
  * ---------------------------------------------------
1382
1483
  * **Converts all values in an array, object, Set, Map, or deeply nested structure to string.**
1383
1484
  * - **Features:**
1384
- * - Converts numbers and strings to string (e.g., `123` ➔ `"123"`).
1485
+ * - Converts numbers and strings to string:
1486
+ * - `3.5` ➔ `"3.5"`.
1487
+ * - `"3.5"` ➔ `"3.5"`.
1488
+ * - Converts boolean to string:
1489
+ * - `true` ➔ `"true"`.
1490
+ * - `false` ➔ `"false"`.
1385
1491
  * - Converts Date to ISO string (`Date ➔ string`).
1386
1492
  * - Converts RegExp to string (e.g., `/abc/ ➔ "/abc/"`).
1387
- * - Converts Buffer, TypedArray, Set, Map, and arrays recursively to arrays of strings.
1493
+ * - Converts `Buffer`, `TypedArray`, `Set`, `Map`, and `arrays` recursively to `arrays of strings`.
1494
+ * - Converts boxed primitives box into their primitive equivalents then convert to string:
1495
+ * - For `new String` we convert everything to string (behavior JS of new String):
1496
+ * - `new String("hi")` ➔ `.valueOf()` ➔ `"hi"`.
1497
+ * - `new String(true)` ➔ `.valueOf()` ➔ `"true"`.
1498
+ * - For `new Boolean` we convert to boolean (behavior JS of new Boolean) then convert to string:
1499
+ * - `new Boolean(true)` ➔ `.valueOf()` ➔ `true` ➔ `true.toString()` ➔ `"true"`.
1500
+ * - Special behavior JS of new Boolean, return `false` **(convert to string: `"false"`)**
1501
+ * for `false`, (`0` / `-0`), `""` (empty-string), `null`, `undefined`, `NaN`, otherwise
1502
+ * `true` **(convert to string: `"true"`)**.
1503
+ * - For `new Number`:
1504
+ * - `new Number(42)` ➔ `.valueOf()` ➔ `42` ➔ `42.toString()` ➔ `"42"`.
1505
+ * - `new Number("42")` ➔ `.valueOf()` ➔ `42` ➔ `42.toString()` ➔ `"42"`.
1506
+ * - `new Number(null)` ➔ `.valueOf()` ➔ `0` (`null` is `0` behavior JS of new Number) ➔ `0.toString()` ➔ `"0"`.
1507
+ * - If result from `valueOf()` is `NaN` or `Infinity` ***(will removing)***:
1508
+ * - `new Number(NaN)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.
1509
+ * - `new Number("abc")` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.
1510
+ * - `new Number(undefined)` ➔ `.valueOf()` ➔ `NaN` ***(remove)***.
1511
+ * - `new Number(Infinity)` ➔ `.valueOf()` ➔ `Infinity` ***(remove)***.
1512
+ * - `new Number(-Infinity)` ➔ `.valueOf()` ➔ `-Infinity` ***(remove)***.
1513
+ * - Recursively processes `nested objects`, `arrays`, `buffers`, `sets`, `maps`, and `typed arrays`.
1388
1514
  * - Removes `null`, `undefined`, `NaN`, `Infinity`, `-Infinity`.
1389
- * - Removes unsupported types like functions, symbols, and BigInt.
1390
- * - Recursively processes nested objects, arrays, Sets, and Maps.
1515
+ * - Removes `unsupported` types like `functions`, `symbols`, and `BigInt`.
1391
1516
  * - Can optionally remove empty arrays (`[]`) and/or empty objects (`{}`) **recursively**.
1392
- * @template T - The input data type (primitive, object, array, Set, Map, or any nested combination).
1517
+ * @template T - The input data type (`primitive`, `object`, `array`, `Set`, `Map`, or `any nested combination`).
1393
1518
  * @template RemoveEmptyObjects - If `true`, empty objects `{}` will be removed recursively.
1394
1519
  * @template RemoveEmptyArrays - If `true`, empty arrays `[]` will be removed recursively (including arrays nested in `objects` / `arrays` / `Sets` / `Maps`).
1395
1520
  * @param {*} input - The data to convert.
@@ -1402,13 +1527,23 @@ removeEmptyArrays?:RemoveEmptyArrays;};
1402
1527
  * toStringDeep([1, "2", 3]);
1403
1528
  * // ➔ ["1", "2", "3"]
1404
1529
  *
1530
+ * // Simple top-level conversion
1531
+ * toStringDeep(123);
1532
+ * // ➔ "123"
1533
+ * toStringDeep("123");
1534
+ * // ➔ "123"
1535
+ * toStringDeep(true);
1536
+ * // ➔ "true"
1537
+ * toStringDeep(false);
1538
+ * // ➔ "false"
1539
+ *
1405
1540
  * // Nested arrays
1406
- * toStringDeep([1, ["2", [3, [null, "4"]]]]);
1407
- * // ➔ ["1", ["2", ["3", ["4"]]]]
1541
+ * toStringDeep([1, ["2", [3, [null, "4", true, false]]]]);
1542
+ * // ➔ ["1", ["2", ["3", ["4", "true", "false"]]]]
1408
1543
  *
1409
1544
  * // Object with nested values
1410
- * toStringDeep({ a: 1, b: "2", c: { d: 3, e: null } });
1411
- * // ➔ { a: "1", b: "2", c: { d: "3" } }
1545
+ * toStringDeep({ a: 1, b: "2", c: { d: 3, e: null, f: true, g: false } });
1546
+ * // ➔ { a: "1", b: "2", c: { d: "3", f: "true", g: "false" } }
1412
1547
  *
1413
1548
  * // Removing empty objects
1414
1549
  * toStringDeep({ a: {}, b: "1" }, { removeEmptyObjects: true });
@@ -1 +1 @@
1
- export{f as convertType,g as removeObjectPaths,b as toBooleanContent,c as toBooleanContentDeep,d as toBooleanExplicit,e as toBooleanLoose,a as toNumberArrayUnRecursive,h as toNumberDeep,i as toStringDeep}from'../chunk-VPW3DRV5.js';export{b as cleanParsedData,a as extractDigits,c as parseCustomDate,d as safeJsonParse}from'../chunk-EEQY5QUG.js';import'../chunk-J7JAZAJD.js';export{c as dedupeArray,b as filterNilArray,d as toStringArrayUnRecursive,a as toStringDeepForce}from'../chunk-W32WALNU.js';import'../chunk-7MMJZ6HS.js';import'../chunk-LQ76EDZG.js';import'../chunk-SL3RQOWA.js';export{a as parseCurrencyString}from'../chunk-7VX33E3V.js';import'../chunk-ESJYBIYH.js';import'../chunk-SYJC7UAW.js';import'../chunk-7CHFAMS2.js';import'../chunk-NJSAV73S.js';export{c as safeStableStringify}from'../chunk-J4NCYYGS.js';import'../chunk-5SZUSNGZ.js';import'../chunk-EWYPSKKM.js';
1
+ export{convertType,removeObjectPaths,toBooleanContent,toBooleanContentDeep,toBooleanExplicit,toBooleanLoose,toNumberArrayUnRecursive,toNumberDeep,toStringDeep}from"../chunk-WFPQO7KN.js";export{cleanParsedData,extractDigits,parseCustomDate,safeJsonParse}from"../chunk-G2B35D5W.js";import"../chunk-NXWPZDDX.js";export{dedupeArray,filterNilArray,toStringArrayUnRecursive,toStringDeepForce}from"../chunk-Y44ZD3GG.js";import"../chunk-X4PD3I5U.js";import"../chunk-GRSCNTOK.js";import"../chunk-ZXIWDFEQ.js";export{parseCurrencyString}from"../chunk-VEYMQ3UA.js";import"../chunk-DUK2K4FB.js";import"../chunk-FIAAX3UE.js";import"../chunk-TSLYDPBJ.js";import"../chunk-W2W3L2M5.js";export{safeStableStringify}from"../chunk-L73TOPX5.js";import"../chunk-QNKGP5DY.js";import"../chunk-2UIRWYE3.js";
@@ -1 +1 @@
1
- 'use strict';require('../chunk-MMSYCIJ2.cjs');var chunkSW6HYEW7_cjs=require('../chunk-SW6HYEW7.cjs');Object.defineProperty(exports,"isServer",{enumerable:true,get:function(){return chunkSW6HYEW7_cjs.a}});
1
+ "use strict";require("../chunk-MMSYCIJ2.cjs");var e=require("../chunk-J2RGTPGK.cjs");Object.defineProperty(exports,"isServer",{enumerable:!0,get:function(){return e.isServer}});
package/dist/env/index.js CHANGED
@@ -1 +1 @@
1
- import'../chunk-G5LXIEFO.js';export{a as isServer}from'../chunk-56QBKKRE.js';
1
+ import"../chunk-G5LXIEFO.js";export{isServer}from"../chunk-MC3LXMCQ.js";
@@ -1 +1 @@
1
- 'use strict';var chunkGGEV7LXX_cjs=require('../chunk-GGEV7LXX.cjs');require('../chunk-SW6HYEW7.cjs'),require('../chunk-BEZPD44N.cjs'),require('../chunk-CII6WWLO.cjs');Object.defineProperty(exports,"disableUserInteraction",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.a}});Object.defineProperty(exports,"enableUserInteraction",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.b}});Object.defineProperty(exports,"removeElementFocus",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.c}});Object.defineProperty(exports,"scrollToTop",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.d}});
1
+ "use strict";var e=require("../chunk-KXIXXSWX.cjs");require("../chunk-J2RGTPGK.cjs"),require("../chunk-Y4O5KZF6.cjs"),require("../chunk-INUFZJLX.cjs"),Object.defineProperty(exports,"disableUserInteraction",{enumerable:!0,get:function(){return e.disableUserInteraction}}),Object.defineProperty(exports,"enableUserInteraction",{enumerable:!0,get:function(){return e.enableUserInteraction}}),Object.defineProperty(exports,"removeElementFocus",{enumerable:!0,get:function(){return e.removeElementFocus}}),Object.defineProperty(exports,"scrollToTop",{enumerable:!0,get:function(){return e.scrollToTop}});
@@ -1 +1 @@
1
- export{a as disableUserInteraction,b as enableUserInteraction,c as removeElementFocus,d as scrollToTop}from'../chunk-S5M33A4O.js';import'../chunk-56QBKKRE.js';import'../chunk-NJSAV73S.js';import'../chunk-EWYPSKKM.js';
1
+ export{disableUserInteraction,enableUserInteraction,removeElementFocus,scrollToTop}from"../chunk-5I2B5DOG.js";import"../chunk-MC3LXMCQ.js";import"../chunk-W2W3L2M5.js";import"../chunk-2UIRWYE3.js";
@@ -1 +1 @@
1
- 'use strict';var chunkHJOZOENU_cjs=require('../chunk-HJOZOENU.cjs');require('../chunk-QSQDP7L2.cjs'),require('../chunk-Q3NTKN5I.cjs'),require('../chunk-MROH35V3.cjs'),require('../chunk-UTQUYABU.cjs'),require('../chunk-BEZPD44N.cjs'),require('../chunk-PUQXRLZH.cjs'),require('../chunk-26W3VZIK.cjs'),require('../chunk-7YWAQOA4.cjs'),require('../chunk-CII6WWLO.cjs');Object.defineProperty(exports,"censorEmail",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.h}});Object.defineProperty(exports,"chunkString",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.i}});Object.defineProperty(exports,"formatCurrency",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.a}});Object.defineProperty(exports,"formatDateFns",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.f}});Object.defineProperty(exports,"formatDateIntl",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.e}});Object.defineProperty(exports,"formatDateTime",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.d}});Object.defineProperty(exports,"formatNumber",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.b}});Object.defineProperty(exports,"formatPhoneNumber",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.c}});Object.defineProperty(exports,"getGMTOffset",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.g}});Object.defineProperty(exports,"truncateString",{enumerable:true,get:function(){return chunkHJOZOENU_cjs.j}});
1
+ "use strict";var e=require("../chunk-5Y52H4VH.cjs");require("../chunk-7BXIZM57.cjs"),require("../chunk-YZR5OGJA.cjs"),require("../chunk-XC2PYCT4.cjs"),require("../chunk-EBMHQW7X.cjs"),require("../chunk-Y4O5KZF6.cjs"),require("../chunk-DVMHRLKP.cjs"),require("../chunk-DQFU3KLE.cjs"),require("../chunk-UDA26MCU.cjs"),require("../chunk-INUFZJLX.cjs"),Object.defineProperty(exports,"censorEmail",{enumerable:!0,get:function(){return e.censorEmail}}),Object.defineProperty(exports,"chunkString",{enumerable:!0,get:function(){return e.chunkString}}),Object.defineProperty(exports,"formatCurrency",{enumerable:!0,get:function(){return e.formatCurrency}}),Object.defineProperty(exports,"formatDateFns",{enumerable:!0,get:function(){return e.formatDateFns}}),Object.defineProperty(exports,"formatDateIntl",{enumerable:!0,get:function(){return e.formatDateIntl}}),Object.defineProperty(exports,"formatDateTime",{enumerable:!0,get:function(){return e.formatDateTime}}),Object.defineProperty(exports,"formatNumber",{enumerable:!0,get:function(){return e.formatNumber}}),Object.defineProperty(exports,"formatPhoneNumber",{enumerable:!0,get:function(){return e.formatPhoneNumber}}),Object.defineProperty(exports,"getGMTOffset",{enumerable:!0,get:function(){return e.getGMTOffset}}),Object.defineProperty(exports,"truncateString",{enumerable:!0,get:function(){return e.truncateString}});
@@ -1 +1 @@
1
- export{h as censorEmail,i as chunkString,a as formatCurrency,f as formatDateFns,e as formatDateIntl,d as formatDateTime,b as formatNumber,c as formatPhoneNumber,g as getGMTOffset,j as truncateString}from'../chunk-G4EWCRKS.js';import'../chunk-7VX33E3V.js';import'../chunk-ESJYBIYH.js';import'../chunk-NR44SNYE.js';import'../chunk-7CHFAMS2.js';import'../chunk-NJSAV73S.js';import'../chunk-ELDDNERR.js';import'../chunk-J4NCYYGS.js';import'../chunk-5SZUSNGZ.js';import'../chunk-EWYPSKKM.js';
1
+ export{censorEmail,chunkString,formatCurrency,formatDateFns,formatDateIntl,formatDateTime,formatNumber,formatPhoneNumber,getGMTOffset,truncateString}from"../chunk-RF34NETZ.js";import"../chunk-VEYMQ3UA.js";import"../chunk-DUK2K4FB.js";import"../chunk-Q6NHYWVX.js";import"../chunk-TSLYDPBJ.js";import"../chunk-W2W3L2M5.js";import"../chunk-WVSPXFTY.js";import"../chunk-L73TOPX5.js";import"../chunk-QNKGP5DY.js";import"../chunk-2UIRWYE3.js";
@@ -1 +1 @@
1
- 'use strict';var chunkSZPWZZYG_cjs=require('../chunk-SZPWZZYG.cjs'),chunkRV2VULM7_cjs=require('../chunk-RV2VULM7.cjs');require('../chunk-PUQXRLZH.cjs'),require('../chunk-26W3VZIK.cjs'),require('../chunk-7YWAQOA4.cjs'),require('../chunk-CII6WWLO.cjs');Object.defineProperty(exports,"getRandomItem",{enumerable:true,get:function(){return chunkSZPWZZYG_cjs.a}});Object.defineProperty(exports,"randomInt",{enumerable:true,get:function(){return chunkSZPWZZYG_cjs.b}});Object.defineProperty(exports,"randomIntByLength",{enumerable:true,get:function(){return chunkSZPWZZYG_cjs.c}});Object.defineProperty(exports,"randomStr",{enumerable:true,get:function(){return chunkSZPWZZYG_cjs.d}});Object.defineProperty(exports,"noop",{enumerable:true,get:function(){return chunkRV2VULM7_cjs.a}});
1
+ "use strict";var e=require("../chunk-7H7IODCQ.cjs"),r=require("../chunk-5C2SMIGX.cjs");require("../chunk-DVMHRLKP.cjs"),require("../chunk-DQFU3KLE.cjs"),require("../chunk-UDA26MCU.cjs"),require("../chunk-INUFZJLX.cjs"),Object.defineProperty(exports,"getRandomItem",{enumerable:!0,get:function(){return e.getRandomItem}}),Object.defineProperty(exports,"randomInt",{enumerable:!0,get:function(){return e.randomInt}}),Object.defineProperty(exports,"randomIntByLength",{enumerable:!0,get:function(){return e.randomIntByLength}}),Object.defineProperty(exports,"randomStr",{enumerable:!0,get:function(){return e.randomStr}}),Object.defineProperty(exports,"noop",{enumerable:!0,get:function(){return r.noop}});
@@ -1 +1 @@
1
- export{a as getRandomItem,b as randomInt,c as randomIntByLength,d as randomStr}from'../chunk-5Q37AP7P.js';export{a as noop}from'../chunk-SYJC7UAW.js';import'../chunk-ELDDNERR.js';import'../chunk-J4NCYYGS.js';import'../chunk-5SZUSNGZ.js';import'../chunk-EWYPSKKM.js';
1
+ export{getRandomItem,randomInt,randomIntByLength,randomStr}from"../chunk-IRBPXCMR.js";export{noop}from"../chunk-FIAAX3UE.js";import"../chunk-WVSPXFTY.js";import"../chunk-L73TOPX5.js";import"../chunk-QNKGP5DY.js";import"../chunk-2UIRWYE3.js";
@@ -1,47 +1,4 @@
1
- import{I as IfExtends,E as Extends,N as Not,a as NotExtends}from'./extends-Bk_SBGdT.js';import{I as If}from'./if-CvT4R7Kh.js';import{T as Trim,I as IfNot}from'./string-XA-til3C.js';import{I as IsNever}from'./never-BfayMBF9.js';import{I as IsAny}from'./any-BmdI8UbK.js';import{P as Prettify}from'./prettify-C4xLcYOP.js';
2
- /** -------------------------------------------------------
3
- * * ***And.***
4
- * -------------------------------------------------------
5
- * Performs a **logical AND** operation between two boolean types.
6
- * - Returns `true` if **both** conditions extend `true`.
7
- * - Returns `false` otherwise.
8
- *
9
- * @template Condition1 - The first condition.
10
- * @template Condition2 - The second condition.
11
- * @example
12
- * ```ts
13
- * type Case1 = And<true, true>;
14
- * // ➔ true
15
- * type Case2 = And<false, true>;
16
- * // ➔ false
17
- * type Case3 = And<true, false>;
18
- * // ➔ false
19
- * type Case4 = And<false, false>;
20
- * // ➔ false
21
- * ```
22
- */
23
- type And<Condition1,Condition2>=IfExtends<Condition1,true,Extends<Condition2,true>>;
24
- /** -------------------------------------------------------
25
- * * ***AndArr.***
26
- * -------------------------------------------------------
27
- * Performs a **logical AND** operation across all elements in an array of boolean types.
28
- * - Returns `true` if **all elements** extend `true`.
29
- * - Returns `false` if **any element** is not `true`.
30
- *
31
- * @template Conditions - A readonly array of boolean conditions.
32
- * @example
33
- * ```ts
34
- * type Case1 = AndArr<[true, true, true]>;
35
- * // ➔ true
36
- * type Case2 = AndArr<[true, true, false]>;
37
- * // ➔ false
38
- * type Case3 = AndArr<[false, false, false]>;
39
- * // ➔ false
40
- * type Case4 = AndArr<[]>;
41
- * // ➔ true (vacuous truth)
42
- * ```
43
- */
44
- type AndArr<Conditions extends readonly unknown[]>=Extends<Conditions[number],true>;
1
+ import{O as OrArr,A as And,a as AndArr}from'./or-DyZCRvaU.js';import{E as Extends,N as Not,I as IfExtends,a as NotExtends}from'./extends-Bk_SBGdT.js';import{I as If}from'./if-CvT4R7Kh.js';import{T as Trim,I as IfNot}from'./string-XA-til3C.js';import{I as IsNever}from'./never-BfayMBF9.js';import{I as IsAny}from'./any-BmdI8UbK.js';import{P as Prettify}from'./prettify-C4xLcYOP.js';
45
2
  /** -------------------------------------------------------
46
3
  * * ***IsStringLiteral.***
47
4
  * -------------------------------------------------------
@@ -54,51 +11,6 @@ type AndArr<Conditions extends readonly unknown[]>=Extends<Conditions[number],tr
54
11
  * type Case3 = IsStringLiteral<string>; // ➔ false
55
12
  */
56
13
  type IsStringLiteral<T>=If<Extends<T,string>,Extends<string,T>extends true?false:true,false>;
57
- /** -------------------------------------------------------
58
- * * ***Or.***
59
- * -------------------------------------------------------
60
- *
61
- * Computes the logical OR of two type-level boolean conditions.
62
- *
63
- * @template Condition1 - First boolean condition.
64
- * @template Condition2 - Second boolean condition.
65
- *
66
- * @example
67
- * ```ts
68
- * type Case1 = Or<true, true>; // true
69
- * type Case2 = Or<false, true>; // true
70
- * type Case3 = Or<false, false>; // false
71
- * type Case4 = Or<true, false>; // true
72
- * ```
73
- *
74
- * @remarks
75
- * - Uses {@link IfExtends} to determine if either condition is `true`.
76
- * - Returns `true` if at least one of the two conditions is `true`.
77
- * - Returns `false` only if both are `false`.
78
- */
79
- type Or<Condition1,Condition2>=IfExtends<Condition1,true,true,IfExtends<Condition2,true>>;
80
- /** -------------------------------------------------------
81
- * * ***OrArr.***
82
- * -------------------------------------------------------
83
- *
84
- * Computes the logical OR of all elements inside a tuple or array of boolean types.
85
- *
86
- * @template Conditions - An array of boolean type elements.
87
- *
88
- * @example
89
- * ```ts
90
- * type Case1 = OrArr<[true, true, true]>; // true
91
- * type Case2 = OrArr<[true, true, false]>; // true
92
- * type Case3 = OrArr<[false, false, false]>; // false
93
- * type Case4 = OrArr<[]>; // false
94
- * ```
95
- *
96
- * @remarks
97
- * - Uses TypeScript's indexed access types and conditional type inference.
98
- * - Returns `true` if at least one element in the array is `true`.
99
- * - Returns `false` if all elements are `false` or array is empty.
100
- */
101
- type OrArr<Conditions extends readonly unknown[]>=true extends Conditions[number]?true:false;
102
14
  /** -------------------------------------------------------
103
15
  * * ***Push.***
104
16
  * -------------------------------------------------------
@@ -1204,4 +1116,4 @@ type IsMutableArray<T>=And<IsArray<T>,NotExtends<Readonly<T>,T>>;
1204
1116
  * type Case2 = IsReadonlyArray<[]>;
1205
1117
  * // ➔ false
1206
1118
  */
1207
- type IsReadonlyArray<T>=And<IsArray<T>,NotExtends<T,Mutable<T>>>;export type{PositiveInteger as $,And as A,IfPositiveFloat as B,CharAt as C,IfPositiveInteger as D,Even as E,Float as F,Integer as G,IsNegativeFloat as H,IsStringLiteral as I,IsOdd as J,IsPositiveFloat as K,IsPositiveInteger as L,Mutable as M,Negate as N,Or as O,ParseNumber as P,IsScientificNumber as Q,Repeat as R,Split as S,Negative as T,NegativeFloat as U,NegativeInteger as V,Odd as W,OddDigit as X,ParseScientificNumber as Y,Positive as Z,PositiveFloat as _,IsNegative as a,IfUnknown as a0,UnknownifyProperties as a1,UnknownifyPropertiesOptions as a2,Abs as b,IsFloat as c,IsUnknown as d,IsNegativeInteger as e,OrArr as f,AndArr as g,IsInteger as h,Push as i,IfNegative as j,IsPositive as k,IsEven as l,IsReadonlyArray as m,IfPositive as n,IsArray as o,IsMutableArray as p,MutableExcept as q,MutableOnly as r,MutableOptions as s,EvenDigit as t,IfEven as u,IfFloat as v,IfInteger as w,IfNegativeFloat as x,IfNegativeInteger as y,IfOdd as z};
1119
+ type IsReadonlyArray<T>=And<IsArray<T>,NotExtends<T,Mutable<T>>>;export type{Abs as A,IsNegativeFloat as B,CharAt as C,IsOdd as D,Even as E,Float as F,IsPositiveFloat as G,IsPositiveInteger as H,IsStringLiteral as I,IsScientificNumber as J,Negative as K,NegativeFloat as L,Mutable as M,Negate as N,NegativeInteger as O,ParseNumber as P,Odd as Q,Repeat as R,Split as S,OddDigit as T,ParseScientificNumber as U,Positive as V,PositiveFloat as W,PositiveInteger as X,IfUnknown as Y,UnknownifyProperties as Z,UnknownifyPropertiesOptions as _,IsNegative as a,IsFloat as b,IsUnknown as c,IsNegativeInteger as d,IsInteger as e,Push as f,IfNegative as g,IsPositive as h,IsEven as i,IsReadonlyArray as j,IfPositive as k,IsArray as l,IsMutableArray as m,MutableExcept as n,MutableOnly as o,MutableOptions as p,EvenDigit as q,IfEven as r,IfFloat as s,IfInteger as t,IfNegativeFloat as u,IfNegativeInteger as v,IfOdd as w,IfPositiveFloat as x,IfPositiveInteger as y,Integer as z};
@@ -1,8 +1 @@
1
- 'use strict';var chunkOZCQZO2V_cjs=require('../chunk-OZCQZO2V.cjs'),chunkMROH35V3_cjs=require('../chunk-MROH35V3.cjs'),chunkUTQUYABU_cjs=require('../chunk-UTQUYABU.cjs'),chunkBEZPD44N_cjs=require('../chunk-BEZPD44N.cjs');require('../chunk-PUQXRLZH.cjs');var chunk26W3VZIK_cjs=require('../chunk-26W3VZIK.cjs');require('../chunk-7YWAQOA4.cjs');var chunkCII6WWLO_cjs=require('../chunk-CII6WWLO.cjs');function N(e,t){if(!chunkCII6WWLO_cjs.g(e)||chunkUTQUYABU_cjs.a(e))throw new TypeError(`\u274C 'generateRoute' Failed:
2
- - Invalid 'route' value.
3
- - Must be of type \`string\` and non-empty string, but received: "${chunkCII6WWLO_cjs.E(e)}": \`${chunk26W3VZIK_cjs.c(e)}\`.`);if(!/[\\[\]]/.test(e))return e;if(chunkCII6WWLO_cjs.j(t,{message:({validType:o})=>`\u274C 'generateRoute' Failed cause in route "${e}":
4
- - Missing or invalid parameters \`${o}\` for route: "${e}", must be of type \`${o}\` mapping parameters.`}),chunkCII6WWLO_cjs.c(t))throw new TypeError(`\u274C 'generateRoute' Failed cause in route "${e}":
5
- - Missing parameters \`plain-object\` for route: "${e}".`);let n=["?","&","#","=","/","'",'"',"(",")","+",";","%","@",":"],r=[],s=Array.from(e.matchAll(/\[(\w+)\]/g)).map(o=>o[1]);for(let o of s){let i=t[o];if(!chunkCII6WWLO_cjs.g(i)){r.push(`- Invalid parameter: "${o}" must be of type \`string\`, but received: \`${chunkCII6WWLO_cjs.E(i)}\`.`);continue}if(chunkUTQUYABU_cjs.a(i)){r.push(`- Parameter "${o}" cannot be empty string.`);continue}let p=n.filter(g=>i.includes(g));if(/\s/.test(i)&&p.push("white-space(s)"),p.length>0){let g=p.map(a=>a==="`"?"backtick - (`)":`\`${a}\``);n.includes("white-space(s)")||n.push("white-space(s)");let m=n.map(a=>a==="`"?"backtick - (`)":`\`${a}\``);r.push(`- Parameter "${o}" contains invalid characters (${g.join(", ")}). These characters are not allowed because they could cause issues in URL structure. The following characters are forbidden in route parameters: (${m.join(", ")}).`);}}if(chunkCII6WWLO_cjs.r(r))throw new Error(`\u274C 'generateRoute' Failed cause in route "${e}":
6
- ${r.join(`
7
- `)}.`);return e.replace(/\[(\w+)\]/g,(o,i)=>(chunkCII6WWLO_cjs.p(t[i])?t[i]:"").trim().replace(/^\/+|\/+$/g,"")).replace(/\/+/g,"/")}var q=(e,t={})=>{try{let p=function(m,a){return `${m.replace(/\/+$/,"")}/${a.replace(/^\/+/,"")}`};var n=p;chunkBEZPD44N_cjs.a(chunkCII6WWLO_cjs.c(e)?"":e,{message({currentType:m,validType:a}){return `First parameter (\`pathname\`) must be of type \`${a}\`, but received: \`${m}\`.`}}),chunkCII6WWLO_cjs.f(t)||(t={});let{prefix:r="/api",withOrigin:s=!0}=t;if(!chunkCII6WWLO_cjs.m(r)&&!chunkCII6WWLO_cjs.g(r))throw new TypeError(`Parameter \`prefix\` property of the \`options\` (second parameter) must be of type \`string\`, but received: \`${chunkCII6WWLO_cjs.E(r)}\`.`);chunkCII6WWLO_cjs.G(s,{message:({currentType:m,validType:a})=>`Parameter \`withOrigin\` property of the \`options\` (second parameter) must be of type \`${a}\`, but received: \`${m}\`.`}),e=chunkOZCQZO2V_cjs.c(e),r=chunkOZCQZO2V_cjs.c(r);let o=r.endsWith("/")?r:r+"/";(e===r||e===r+"/"||e.startsWith(o))&&(e=e.slice(r.length),e=chunkOZCQZO2V_cjs.c(e));let i=b({suffix:r});return p(s?i:new URL(i).pathname,e).replace(/\/+$/,"")}catch(r){throw chunkCII6WWLO_cjs.C(r)?r:new Error("Failed to generate backend API URL in `createBeApiUrl()`, Error: "+new Error(String(r)).message.trim())}};var b=({suffix:e="/"}={})=>{chunkBEZPD44N_cjs.a(e,{message({currentType:t,validType:n}){return `Parameter \`suffix\` property of the first parameter must be of type \`${n}\`, but received: \`${t}\`.`}});try{let t=process.env.NEXT_PUBLIC_BACKEND_API_URL?.trim();if(t){t=chunkMROH35V3_cjs.c(t);let s=new URL(t);!!!s.port&&process.env.NEXT_PUBLIC_PORT_BE&&(t=s.origin+chunkOZCQZO2V_cjs.d(process.env.NEXT_PUBLIC_PORT_BE,{prefixColon:!0}));}else t="http://localhost"+chunkOZCQZO2V_cjs.d(process.env.NEXT_PUBLIC_PORT_BE||"8000",{prefixColon:!0});e=chunkMROH35V3_cjs.c(e).length?chunkMROH35V3_cjs.c(e):"/";let n=new URL(t.replace(/\/+$/,"")).origin,r=e==="/"?"/":`${e.startsWith("/")?"":"/"}${e.replace(/\/+$/,"")}`;return `${n}${r}`}catch(t){throw new Error("Invalid `NEXT_PUBLIC_BACKEND_API_URL`, failed to generate from `getBeApiUrl()`, Error:"+t)}};var te=()=>{try{let e=process.env.NEXT_PUBLIC_BASE_URL?.trim(),t=process.env.NEXT_PUBLIC_PORT_FE?.trim(),n=e||"http://localhost";n=chunkMROH35V3_cjs.c(n).replace(/\/+$/,"");let r=/:\/\/[^/]+:\d+/.test(n);!r&&t?n+=chunkOZCQZO2V_cjs.d(t,{prefixColon:!0}):!r&&!e&&(n+=":3000");let s=new URL(n);return `${s.protocol}//${s.hostname}${s.port?`:${s.port}`:""}`}catch(e){throw new Error("Invalid `NEXT_PUBLIC_BASE_URL`, failed to generate from `getBaseUrl()`, Error:"+e)}};
8
- exports.createBeApiUrl=q;exports.generateRoute=N;exports.getBaseUrl=te;exports.getBeApiUrl=b;
1
+ "use strict";var e=require("../chunk-WZE3XLKY.cjs"),r=require("../chunk-XC2PYCT4.cjs"),t=require("../chunk-EBMHQW7X.cjs"),n=require("../chunk-Y4O5KZF6.cjs");require("../chunk-DVMHRLKP.cjs");var s=require("../chunk-DQFU3KLE.cjs");require("../chunk-UDA26MCU.cjs");var i=require("../chunk-INUFZJLX.cjs");var a=({suffix:t="/"}={})=>{var s;n.assertIsString(t,{message:({currentType:e,validType:r})=>`Parameter \`suffix\` property of the first parameter must be of type \`${r}\`, but received: \`${e}\`.`});try{let n=null==(s=process.env.NEXT_PUBLIC_BACKEND_API_URL)?void 0:s.trim();if(n){n=r.removeSpaces(n);const t=new URL(n);!!!t.port&&process.env.NEXT_PUBLIC_PORT_BE&&(n=t.origin+e.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE,{prefixColon:!0}))}else n="http://localhost"+e.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE||"8000",{prefixColon:!0});t=r.removeSpaces(t).length?r.removeSpaces(t):"/";const i=new URL(n.replace(/\/+$/,"")).origin;return`${i}${"/"===t?"/":`${t.startsWith("/")?"":"/"}${t.replace(/\/+$/,"")}`}`}catch(e){throw new Error("Invalid `NEXT_PUBLIC_BACKEND_API_URL`, failed to generate from `getBeApiUrl()`, Error:"+e)}};exports.createBeApiUrl=(r,t={})=>{try{let s=function(e,r){return`${e.replace(/\/+$/,"")}/${r.replace(/^\/+/,"")}`};n.assertIsString(i.isNil(r)?"":r,{message:({currentType:e,validType:r})=>`First parameter (\`pathname\`) must be of type \`${r}\`, but received: \`${e}\`.`}),i.isPlainObject(t)||(t={});let{prefix:o="/api",withOrigin:c=!0}=t;if(!i.isUndefined(o)&&!i.isString(o))throw new TypeError(`Parameter \`prefix\` property of the \`options\` (second parameter) must be of type \`string\`, but received: \`${i.getPreciseType(o)}\`.`);i.assertIsBoolean(c,{message:({currentType:e,validType:r})=>`Parameter \`withOrigin\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),r=e.normalizePathname(r),o=e.normalizePathname(o);const p=o.endsWith("/")?o:o+"/";(r===o||r===o+"/"||r.startsWith(p))&&(r=r.slice(o.length),r=e.normalizePathname(r));const u=a({suffix:o});return s(c?u:new URL(u).pathname,r).replace(/\/+$/,"")}catch(e){throw i.isError(e)?e:new Error("Failed to generate backend API URL in `createBeApiUrl()`, Error: "+new Error(String(e)).message.trim())}},exports.generateRoute=function(e,r){if(!i.isString(e)||t.isEmptyString(e))throw new TypeError(`❌ 'generateRoute' Failed:\n- Invalid 'route' value.\n- Must be of type \`string\` and non-empty string, but received: "${i.getPreciseType(e)}": \`${s.safeStableStringify(e)}\`.`);if(!/[\\[\]]/.test(e))return e;if(i.assertIsPlainObject(r,{message:({validType:r})=>`❌ 'generateRoute' Failed cause in route "${e}":\n- Missing or invalid parameters \`${r}\` for route: "${e}", must be of type \`${r}\` mapping parameters.`}),i.isNil(r))throw new TypeError(`❌ 'generateRoute' Failed cause in route "${e}":\n- Missing parameters \`plain-object\` for route: "${e}".`);const n=["?","&","#","=","/","'",'"',"(",")","+",";","%","@",":"],a=[],o=Array.from(e.matchAll(/\[(\w+)\]/g)).map(e=>e[1]);for(const e of o){const s=r[e];if(!i.isString(s)){a.push(`- Invalid parameter: "${e}" must be of type \`string\`, but received: \`${i.getPreciseType(s)}\`.`);continue}if(t.isEmptyString(s)){a.push(`- Parameter "${e}" cannot be empty string.`);continue}const o=n.filter(e=>s.includes(e));if(/\s/.test(s)&&o.push("white-space(s)"),o.length>0){const r=o.map(e=>"`"===e?"backtick - (`)":`\`${e}\``);n.includes("white-space(s)")||n.push("white-space(s)");const t=n.map(e=>"`"===e?"backtick - (`)":`\`${e}\``);a.push(`- Parameter "${e}" contains invalid characters (${r.join(", ")}). These characters are not allowed because they could cause issues in URL structure. The following characters are forbidden in route parameters: (${t.join(", ")}).`)}}if(i.isNonEmptyArray(a))throw new Error(`❌ 'generateRoute' Failed cause in route "${e}":\n${a.join("\n")}.`);return e.replace(/\[(\w+)\]/g,(e,t)=>(i.isNonEmptyString(r[t])?r[t]:"").trim().replace(/^\/+|\/+$/g,"")).replace(/\/+/g,"/")},exports.getBaseUrl=()=>{var t,n;try{const s=null==(t=process.env.NEXT_PUBLIC_BASE_URL)?void 0:t.trim(),i=null==(n=process.env.NEXT_PUBLIC_PORT_FE)?void 0:n.trim();let a=s||"http://localhost";a=r.removeSpaces(a).replace(/\/+$/,"");const o=/:\/\/[^/]+:\d+/.test(a);!o&&i?a+=e.formatEnvPort(i,{prefixColon:!0}):o||s||(a+=":3000");const c=new URL(a);return`${c.protocol}//${c.hostname}${c.port?`:${c.port}`:""}`}catch(e){throw new Error("Invalid `NEXT_PUBLIC_BASE_URL`, failed to generate from `getBaseUrl()`, Error:"+e)}},exports.getBeApiUrl=a;