@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.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 (286) hide show
  1. package/{LICENSE.md → LICENSE} +3 -3
  2. package/README.md +69 -96
  3. package/dist/.references/index.d.cts +25 -0
  4. package/dist/.references/index.d.ts +25 -0
  5. package/dist/assertIsArray-DJXkjHZs.cjs +26 -0
  6. package/dist/assertIsArray-DJXkjHZs.cjs.map +1 -0
  7. package/dist/assertIsArray-bTA3XLjq.js +20 -0
  8. package/dist/assertIsArray-bTA3XLjq.js.map +1 -0
  9. package/dist/assertIsBoolean-C8WEXVr2.cjs +1283 -0
  10. package/dist/assertIsBoolean-C8WEXVr2.cjs.map +1 -0
  11. package/dist/assertIsBoolean-DR1SaXPD.js +1073 -0
  12. package/dist/assertIsBoolean-DR1SaXPD.js.map +1 -0
  13. package/dist/assertIsString-BiHQSrB2.cjs +26 -0
  14. package/dist/assertIsString-BiHQSrB2.cjs.map +1 -0
  15. package/dist/assertIsString-CEB07_83.js +20 -0
  16. package/dist/assertIsString-CEB07_83.js.map +1 -0
  17. package/dist/assertions/index.cjs +37 -40
  18. package/dist/assertions/index.cjs.map +1 -0
  19. package/dist/assertions/index.d.cts +12 -0
  20. package/dist/assertions/index.d.ts +10 -824
  21. package/dist/assertions/index.js +30 -13
  22. package/dist/assertions/index.js.map +1 -0
  23. package/dist/conversions/index.cjs +34 -103
  24. package/dist/conversions/index.d.cts +12 -0
  25. package/dist/conversions/index.d.ts +10 -1791
  26. package/dist/conversions/index.js +14 -24
  27. package/dist/conversions-BNIh_tCH.js +380 -0
  28. package/dist/conversions-BNIh_tCH.js.map +1 -0
  29. package/dist/conversions-D_Kh0a_C.cjs +446 -0
  30. package/dist/conversions-D_Kh0a_C.cjs.map +1 -0
  31. package/dist/events/index.cjs +55 -31
  32. package/dist/events/index.cjs.map +1 -0
  33. package/dist/events/index.d.cts +176 -0
  34. package/dist/events/index.d.ts +164 -166
  35. package/dist/events/index.js +50 -12
  36. package/dist/events/index.js.map +1 -0
  37. package/dist/formatEnvPort-B3OLxQk9.cjs +171 -0
  38. package/dist/formatEnvPort-B3OLxQk9.cjs.map +1 -0
  39. package/dist/formatEnvPort-ByFVLjSV.js +159 -0
  40. package/dist/formatEnvPort-ByFVLjSV.js.map +1 -0
  41. package/dist/formatters/index.cjs +21 -61
  42. package/dist/formatters/index.d.cts +12 -0
  43. package/dist/formatters/index.d.ts +10 -2152
  44. package/dist/formatters/index.js +10 -18
  45. package/dist/formatters--1m_vpE8.js +369 -0
  46. package/dist/formatters--1m_vpE8.js.map +1 -0
  47. package/dist/formatters-Cbij0XLU.cjs +429 -0
  48. package/dist/formatters-Cbij0XLU.cjs.map +1 -0
  49. package/dist/generators/index.cjs +165 -41
  50. package/dist/generators/index.cjs.map +1 -0
  51. package/dist/generators/index.d.cts +12 -0
  52. package/dist/generators/index.d.ts +10 -338
  53. package/dist/generators/index.js +158 -14
  54. package/dist/generators/index.js.map +1 -0
  55. package/dist/index-59zbLcPr.d.ts +340 -0
  56. package/dist/index-B6tawc8L.d.cts +1716 -0
  57. package/dist/index-C267akkJ.d.ts +2158 -0
  58. package/dist/index-CeBC2Vvl.d.cts +2361 -0
  59. package/dist/index-CgRDTI6f.d.ts +822 -0
  60. package/dist/index-CoiUBVmr.d.ts +720 -0
  61. package/dist/index-D4fcasfZ.d.cts +720 -0
  62. package/dist/index-DDrSQKIc.d.ts +1716 -0
  63. package/dist/index-DsGxO31H.d.cts +765 -0
  64. package/dist/index-Hg1qJkjl.d.ts +765 -0
  65. package/dist/index-Qm3iFwd0.d.cts +2158 -0
  66. package/dist/index-UPp94Agr.d.ts +2361 -0
  67. package/dist/index-gBA_8SuF.d.cts +340 -0
  68. package/dist/index-jyDqzicx.d.cts +822 -0
  69. package/dist/isBigInt-C4krUeAw.cjs +20 -0
  70. package/dist/isBigInt-C4krUeAw.cjs.map +1 -0
  71. package/dist/isBigInt-DKe0M6hp.js +14 -0
  72. package/dist/isBigInt-DKe0M6hp.js.map +1 -0
  73. package/dist/isEmptyObject-DCipFwxJ.js +25 -0
  74. package/dist/isEmptyObject-DCipFwxJ.js.map +1 -0
  75. package/dist/isEmptyObject-ZkSwRC_D.cjs +37 -0
  76. package/dist/isEmptyObject-ZkSwRC_D.cjs.map +1 -0
  77. package/dist/isEmptyString-BXzKAC2j.js +15 -0
  78. package/dist/isEmptyString-BXzKAC2j.js.map +1 -0
  79. package/dist/isEmptyString-UiiUsSQj.cjs +21 -0
  80. package/dist/isEmptyString-UiiUsSQj.cjs.map +1 -0
  81. package/dist/isEmptyValue-BQzcjVaL.cjs +30 -0
  82. package/dist/isEmptyValue-BQzcjVaL.cjs.map +1 -0
  83. package/dist/isEmptyValue-jqOr7OHD.js +24 -0
  84. package/dist/isEmptyValue-jqOr7OHD.js.map +1 -0
  85. package/dist/isEqual-BX49cF9m.js +87 -0
  86. package/dist/isEqual-BX49cF9m.js.map +1 -0
  87. package/dist/isEqual-BvumA3RA.cjs +111 -0
  88. package/dist/isEqual-BvumA3RA.cjs.map +1 -0
  89. package/dist/isFinite-BCnaDpod.js +15 -0
  90. package/dist/isFinite-BCnaDpod.js.map +1 -0
  91. package/dist/isFinite-D24ZaE6c.cjs +21 -0
  92. package/dist/isFinite-D24ZaE6c.cjs.map +1 -0
  93. package/dist/isInteger-Caeuz0rB.cjs +20 -0
  94. package/dist/isInteger-Caeuz0rB.cjs.map +1 -0
  95. package/dist/isInteger-naMbJsxJ.js +14 -0
  96. package/dist/isInteger-naMbJsxJ.js.map +1 -0
  97. package/dist/isPlainObject-BF-2-phb.d.cts +339 -0
  98. package/dist/isPlainObject-DxNDL8XU.d.ts +339 -0
  99. package/dist/isServer-BJHVnixd.cjs +20 -0
  100. package/dist/isServer-BJHVnixd.cjs.map +1 -0
  101. package/dist/isServer-Da3o3XSs.js +14 -0
  102. package/dist/isServer-Da3o3XSs.js.map +1 -0
  103. package/dist/isTypedArray-DuNA8tK6.js +31 -0
  104. package/dist/isTypedArray-DuNA8tK6.js.map +1 -0
  105. package/dist/isTypedArray-TJptiw2b.cjs +43 -0
  106. package/dist/isTypedArray-TJptiw2b.cjs.map +1 -0
  107. package/dist/isURL-C-kSk6KJ.js +14 -0
  108. package/dist/isURL-C-kSk6KJ.js.map +1 -0
  109. package/dist/isURL-DeUPO_oR.cjs +20 -0
  110. package/dist/isURL-DeUPO_oR.cjs.map +1 -0
  111. package/dist/isValidDomain-BB9IGhJs.cjs +1845 -0
  112. package/dist/isValidDomain-BB9IGhJs.cjs.map +1 -0
  113. package/dist/isValidDomain-DoE98yhJ.js +1827 -0
  114. package/dist/isValidDomain-DoE98yhJ.js.map +1 -0
  115. package/dist/next/index.cjs +119 -214
  116. package/dist/next/index.cjs.map +1 -0
  117. package/dist/next/index.d.cts +220 -0
  118. package/dist/next/index.d.ts +203 -214
  119. package/dist/next/index.js +117 -212
  120. package/dist/next/index.js.map +1 -0
  121. package/dist/next/server/index.cjs +25 -40
  122. package/dist/next/server/index.cjs.map +1 -0
  123. package/dist/next/server/index.d.cts +39 -0
  124. package/dist/next/server/index.d.ts +34 -35
  125. package/dist/next/server/index.js +23 -38
  126. package/dist/next/server/index.js.map +1 -0
  127. package/dist/noop-B13_ii35.cjs +18 -0
  128. package/dist/noop-B13_ii35.cjs.map +1 -0
  129. package/dist/noop-ubqAIbHD.js +12 -0
  130. package/dist/noop-ubqAIbHD.js.map +1 -0
  131. package/dist/normalizeSpaces-Bg2IZW7W.js +23 -0
  132. package/dist/normalizeSpaces-Bg2IZW7W.js.map +1 -0
  133. package/dist/normalizeSpaces-ZXnR4Qzp.cjs +29 -0
  134. package/dist/normalizeSpaces-ZXnR4Qzp.cjs.map +1 -0
  135. package/dist/normalizeString-BDdkaXui.js +15 -0
  136. package/dist/normalizeString-BDdkaXui.js.map +1 -0
  137. package/dist/normalizeString-BE6ELqEb.cjs +21 -0
  138. package/dist/normalizeString-BE6ELqEb.cjs.map +1 -0
  139. package/dist/operations/index.cjs +65 -32
  140. package/dist/operations/index.cjs.map +1 -0
  141. package/dist/operations/index.d.cts +139 -0
  142. package/dist/operations/index.d.ts +129 -134
  143. package/dist/operations/index.js +61 -17
  144. package/dist/operations/index.js.map +1 -0
  145. package/dist/parsers/index.cjs +12 -19
  146. package/dist/parsers/index.d.cts +239 -0
  147. package/dist/parsers/index.d.ts +234 -235
  148. package/dist/parsers/index.js +10 -12
  149. package/dist/parsers-BSBPgvsq.js +643 -0
  150. package/dist/parsers-BSBPgvsq.js.map +1 -0
  151. package/dist/parsers-OqDeffqc.cjs +649 -0
  152. package/dist/parsers-OqDeffqc.cjs.map +1 -0
  153. package/dist/parsing-Cao8b358.js +50 -0
  154. package/dist/parsing-Cao8b358.js.map +1 -0
  155. package/dist/parsing-DOGSCH6N.cjs +56 -0
  156. package/dist/parsing-DOGSCH6N.cjs.map +1 -0
  157. package/dist/predicates/index.cjs +91 -296
  158. package/dist/predicates/index.d.cts +13 -0
  159. package/dist/predicates/index.d.ts +12 -2482
  160. package/dist/predicates/index.js +23 -25
  161. package/dist/predicates-Bj6meyXV.js +256 -0
  162. package/dist/predicates-Bj6meyXV.js.map +1 -0
  163. package/dist/predicates-D0ubqgqy.cjs +412 -0
  164. package/dist/predicates-D0ubqgqy.cjs.map +1 -0
  165. package/dist/promises/index.cjs +76 -24
  166. package/dist/promises/index.cjs.map +1 -0
  167. package/dist/promises/index.d.cts +123 -0
  168. package/dist/promises/index.d.ts +116 -119
  169. package/dist/promises/index.js +73 -13
  170. package/dist/promises/index.js.map +1 -0
  171. package/dist/punyCode-8SrbMWfM.js +179 -0
  172. package/dist/punyCode-8SrbMWfM.js.map +1 -0
  173. package/dist/punyCode-D-Qu6nj6.cjs +185 -0
  174. package/dist/punyCode-D-Qu6nj6.cjs.map +1 -0
  175. package/dist/removeSpaces-Bmc5DX4F.js +19 -0
  176. package/dist/removeSpaces-Bmc5DX4F.js.map +1 -0
  177. package/dist/removeSpaces-CWIvhZHg.cjs +25 -0
  178. package/dist/removeSpaces-CWIvhZHg.cjs.map +1 -0
  179. package/dist/rzl-utils.global.js +20 -9
  180. package/dist/safeJsonParse-BP38mwlj.js +184 -0
  181. package/dist/safeJsonParse-BP38mwlj.js.map +1 -0
  182. package/dist/safeJsonParse-Sms2CJf4.cjs +208 -0
  183. package/dist/safeJsonParse-Sms2CJf4.cjs.map +1 -0
  184. package/dist/safeStableStringify-CJtP89qn.cjs +106 -0
  185. package/dist/safeStableStringify-CJtP89qn.cjs.map +1 -0
  186. package/dist/safeStableStringify-CXOZ9Ub8.js +88 -0
  187. package/dist/safeStableStringify-CXOZ9Ub8.js.map +1 -0
  188. package/dist/strings/index.cjs +79 -81
  189. package/dist/strings/index.cjs.map +1 -0
  190. package/dist/strings/index.d.cts +12 -0
  191. package/dist/strings/index.d.ts +10 -775
  192. package/dist/strings/index.js +62 -14
  193. package/dist/strings/index.js.map +1 -0
  194. package/dist/tailwind/index.cjs +19 -47
  195. package/dist/tailwind/index.d.cts +12 -0
  196. package/dist/tailwind/index.d.ts +11 -712
  197. package/dist/tailwind/index.js +10 -12
  198. package/dist/tailwind-B2ssevxq.js +199 -0
  199. package/dist/tailwind-B2ssevxq.js.map +1 -0
  200. package/dist/tailwind-CHIx9uxu.cjs +247 -0
  201. package/dist/tailwind-CHIx9uxu.cjs.map +1 -0
  202. package/dist/toStringArrayUnRecursive-C4zYCja7.cjs +51 -0
  203. package/dist/toStringArrayUnRecursive-C4zYCja7.cjs.map +1 -0
  204. package/dist/toStringArrayUnRecursive-DJGtPsFb.js +39 -0
  205. package/dist/toStringArrayUnRecursive-DJGtPsFb.js.map +1 -0
  206. package/dist/urls/index.cjs +130 -57
  207. package/dist/urls/index.cjs.map +1 -0
  208. package/dist/urls/index.d.cts +737 -0
  209. package/dist/urls/index.d.ts +699 -708
  210. package/dist/urls/index.js +122 -26
  211. package/dist/urls/index.js.map +1 -0
  212. package/package.json +203 -194
  213. package/dist/chunk-2AFQ33D3.cjs +0 -64
  214. package/dist/chunk-2CYDJVGM.js +0 -246
  215. package/dist/chunk-2MW4JDQ2.cjs +0 -598
  216. package/dist/chunk-2VTDXC3N.cjs +0 -1825
  217. package/dist/chunk-44XX2P34.js +0 -209
  218. package/dist/chunk-4YLBKLGS.cjs +0 -18
  219. package/dist/chunk-566CXQW7.cjs +0 -560
  220. package/dist/chunk-57EPKYID.cjs +0 -397
  221. package/dist/chunk-5MGEC3YG.js +0 -63
  222. package/dist/chunk-6EF52423.cjs +0 -249
  223. package/dist/chunk-6SCOKU3S.js +0 -109
  224. package/dist/chunk-6VUXD3CF.js +0 -119
  225. package/dist/chunk-7B76BSNK.cjs +0 -118
  226. package/dist/chunk-7Y6I2DSU.cjs +0 -101
  227. package/dist/chunk-A7S7E2EE.cjs +0 -308
  228. package/dist/chunk-AJZ6PMMZ.js +0 -16
  229. package/dist/chunk-AXGBL2IO.cjs +0 -251
  230. package/dist/chunk-B4TC6FBV.cjs +0 -678
  231. package/dist/chunk-BAV5T2E3.cjs +0 -15
  232. package/dist/chunk-BKIJBNIE.js +0 -21
  233. package/dist/chunk-BNIMTFK5.js +0 -59
  234. package/dist/chunk-BXW7YXB7.js +0 -1823
  235. package/dist/chunk-CFYZC4S6.js +0 -53
  236. package/dist/chunk-CSG4SCL3.js +0 -1587
  237. package/dist/chunk-CWQW7AKK.js +0 -676
  238. package/dist/chunk-DVMHRLKP.cjs +0 -16
  239. package/dist/chunk-EN7LVZBZ.js +0 -548
  240. package/dist/chunk-EV4Y7HCY.cjs +0 -26
  241. package/dist/chunk-F66VDYIZ.cjs +0 -18
  242. package/dist/chunk-FLJX37EL.cjs +0 -30
  243. package/dist/chunk-GKC3UDMC.cjs +0 -1623
  244. package/dist/chunk-H65I3GRZ.cjs +0 -106
  245. package/dist/chunk-HHYWB7VZ.js +0 -24
  246. package/dist/chunk-HNGGISFL.cjs +0 -65
  247. package/dist/chunk-HNSQAVSZ.cjs +0 -35
  248. package/dist/chunk-HSP6IWZK.js +0 -17
  249. package/dist/chunk-IDZS7J6T.js +0 -242
  250. package/dist/chunk-JS6R55VL.js +0 -302
  251. package/dist/chunk-JZVT5FK7.js +0 -232
  252. package/dist/chunk-KHO2SBNA.cjs +0 -16
  253. package/dist/chunk-KIDJCMNJ.js +0 -33
  254. package/dist/chunk-KOLEURVT.cjs +0 -38
  255. package/dist/chunk-L4V53MQK.cjs +0 -269
  256. package/dist/chunk-L5RDAVVH.js +0 -14
  257. package/dist/chunk-NODTV4F3.js +0 -16
  258. package/dist/chunk-NYK5K3V2.cjs +0 -211
  259. package/dist/chunk-ODUO3RTL.cjs +0 -113
  260. package/dist/chunk-ONZFBJVW.js +0 -14
  261. package/dist/chunk-PFXCTE37.js +0 -28
  262. package/dist/chunk-PPST7QAQ.js +0 -587
  263. package/dist/chunk-Q5IMYDFL.cjs +0 -33
  264. package/dist/chunk-QFFBIOJ4.js +0 -31
  265. package/dist/chunk-QNKGP5DY.js +0 -14
  266. package/dist/chunk-RRQHMOPE.cjs +0 -19
  267. package/dist/chunk-RU5OSRBU.js +0 -95
  268. package/dist/chunk-SDMPEJ4F.js +0 -35
  269. package/dist/chunk-SYNL5IKP.js +0 -115
  270. package/dist/chunk-TCDOWZQE.js +0 -16
  271. package/dist/chunk-TQPGXGKB.cjs +0 -123
  272. package/dist/chunk-TULOI4GL.js +0 -370
  273. package/dist/chunk-UBHCP4N5.cjs +0 -36
  274. package/dist/chunk-UCHF3M34.cjs +0 -56
  275. package/dist/chunk-UDA26MCU.cjs +0 -16
  276. package/dist/chunk-V3C4FYZL.cjs +0 -18
  277. package/dist/chunk-VAAHZFBF.js +0 -32
  278. package/dist/chunk-VJDDGRIK.cjs +0 -16
  279. package/dist/chunk-WVSPXFTY.js +0 -14
  280. package/dist/chunk-WYP76WXB.js +0 -101
  281. package/dist/chunk-YDE4ZBB7.cjs +0 -237
  282. package/dist/chunk-YKQEOO7C.cjs +0 -23
  283. package/dist/chunk-YSZC56SZ.js +0 -264
  284. package/dist/chunk-YWHHVDT4.js +0 -13
  285. package/dist/index.d.ts +0 -24
  286. package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
@@ -0,0 +1,1073 @@
1
+ /*!
2
+ * ========================================================================
3
+ * @rzl-zone/utils-js
4
+ * ------------------------------------------------------------------------
5
+ * Version: `3.12.1-beta.1`
6
+ * Author: `Rizalvin Dwiky <rizalvindwiky@gmail.com>`
7
+ * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/utils-js`
8
+ * ========================================================================
9
+ */
10
+ const isBoolean = (value) => {
11
+ return typeof value === "boolean";
12
+ };
13
+ const isFunction = (value) => {
14
+ return typeof value === "function";
15
+ };
16
+ function isNil(value) {
17
+ return value == null;
18
+ }
19
+ function isArray(value) {
20
+ return Array.isArray(value);
21
+ }
22
+ function isObject(value) {
23
+ return typeof value === "object" && !isNil(value) && !isArray(value);
24
+ }
25
+ function isPlainObject(value) {
26
+ if (!isObject(value)) return false;
27
+ const proto = Object.getPrototypeOf(value);
28
+ return proto === Object.prototype || proto === null;
29
+ }
30
+ const isString = (value) => {
31
+ return typeof value === "string";
32
+ };
33
+ function isNumberObject(value) {
34
+ return isObject(value) && Object.prototype.toString.call(value) === "[object Number]";
35
+ }
36
+ function isNaN(value) {
37
+ return typeof value === "number" ? Number.isNaN(value) : isNumberObject(value) && Number.isNaN(value.valueOf());
38
+ }
39
+ const isNull = (val) => val === null;
40
+ function assertIsPlainObject(value, options = {}) {
41
+ if (isPlainObject(value)) return;
42
+ resolveErrorMessageAssertions({
43
+ value,
44
+ options,
45
+ requiredValidType: "plain object"
46
+ });
47
+ }
48
+ const isNumber = (value, options = {}) => {
49
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
50
+ const includeNaN = isPlainObject(options) && isBoolean(options.includeNaN) ? options.includeNaN : false;
51
+ assertIsBoolean(includeNaN, { message: ({ currentType, validType }) => `Parameter \`includeNaN\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
52
+ const aNumber = typeof value === "number";
53
+ return includeNaN ? aNumber : aNumber && !Number.isNaN(value);
54
+ };
55
+ const isSymbol = (value) => {
56
+ return typeof value === "symbol";
57
+ };
58
+ const isUndefined = (value) => {
59
+ return typeof value === "undefined";
60
+ };
61
+ function isObjectOrArray(value) {
62
+ return isArray(value) || isObject(value);
63
+ }
64
+ function hasOwnProp(obj, key, options = {}) {
65
+ if (!isString(obj) && !isObjectOrArray(obj) && !isFunction(obj)) return false;
66
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
67
+ const discardUndefined = options.discardUndefined === void 0 ? true : options.discardUndefined;
68
+ const discardNull = options.discardNull === void 0 ? false : options.discardNull;
69
+ assertIsBoolean(discardUndefined, { message: ({ currentType, validType }) => `Parameter \`discardUndefined\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
70
+ assertIsBoolean(discardNull, { message: ({ currentType, validType }) => `Parameter \`discardNull\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
71
+ const path = [];
72
+ if (isString(key) && key.trim().length > 0 || isNumber(key, { includeNaN: true })) (isNumber(key, { includeNaN: true }) ? String(key) : key).split(".").forEach((k) => {
73
+ const bracketMatch = k.match(/^\[(\d+)\]$/);
74
+ const symbolMatch = k.match(/^Symbol\((.+)\)$/);
75
+ if (bracketMatch) path.push(Number(bracketMatch[1]));
76
+ else if (symbolMatch) path.push(Symbol.for(symbolMatch[1]));
77
+ else if (!isNaN(Number(k))) path.push(Number(k));
78
+ else path.push(k);
79
+ });
80
+ else if (isSymbol(key)) path.push(key);
81
+ else return false;
82
+ let current = isString(obj) && obj.trim().length > 0 ? Object(obj) : obj;
83
+ for (const k of path) if (isString(k) && k.trim().length > 0 || isNumber(k, { includeNaN: true })) {
84
+ if (isNull(current) || !Object.prototype.hasOwnProperty.call(current, k)) return false;
85
+ current = current[k];
86
+ } else if (isSymbol(k)) {
87
+ if (isNull(current) || typeof current !== "object" && !isFunction(current)) return false;
88
+ const matched = Object.getOwnPropertySymbols(current).find((s) => s === k || s.description === k.description);
89
+ if (!matched) return false;
90
+ current = current[matched];
91
+ } else return false;
92
+ if (discardUndefined && isUndefined(current)) return false;
93
+ if (discardNull && isNull(current)) return false;
94
+ return true;
95
+ }
96
+ const isNonEmptyString = (value, options = {}) => {
97
+ if (!isString(value)) return false;
98
+ assertIsPlainObject(options, { message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
99
+ const trim = hasOwnProp(options, "trim") ? options.trim : true;
100
+ assertIsBoolean(trim, { message: ({ currentType, validType }) => `Parameter \`trim\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.` });
101
+ return (trim ? value.trim() : value).length > 0;
102
+ };
103
+ const isError = (error) => {
104
+ return Object.prototype.toString.call(error) === "[object Error]" || error instanceof Error;
105
+ };
106
+ const isBuffer = (value) => {
107
+ return typeof Buffer !== "undefined" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(value);
108
+ };
109
+ function isStringObject(value) {
110
+ return isObject(value) && Object.prototype.toString.call(value) === "[object String]";
111
+ }
112
+ function isBooleanObject(value) {
113
+ return isObject(value) && Object.prototype.toString.call(value) === "[object Boolean]";
114
+ }
115
+ function isInfinityNumber(value) {
116
+ if (typeof value === "number" || isNumberObject(value)) {
117
+ const num = Number(value);
118
+ return num === Infinity || num === -Infinity;
119
+ }
120
+ return false;
121
+ }
122
+ function isNonEmptyArray(value) {
123
+ return Array.isArray(value) && value.length > 0;
124
+ }
125
+ function isSet(value) {
126
+ return Object.prototype.toString.call(value) === "[object Set]" || value instanceof Set;
127
+ }
128
+ const validateCaseInputWordsCase = (input) => {
129
+ let result = "";
130
+ if (isArray(input)) result = input.map((x) => isNonEmptyString(x) ? x.trim() : "").filter((x) => x.length).join("-");
131
+ else if (isNonEmptyString(input)) result = input.trim();
132
+ return result.split(/[^\p{L}\p{N}]+/u).filter(Boolean);
133
+ };
134
+ const validateCaseIgnoreWordsCase = (ignoreWord) => {
135
+ const result = /* @__PURE__ */ new Set([]);
136
+ const normalizeWord = (word) => word.trim().split(/[^\p{L}\p{N}]+/u).filter(Boolean).join("");
137
+ if (isNonEmptyString(ignoreWord)) {
138
+ const clean = normalizeWord(ignoreWord);
139
+ if (clean) result.add(clean);
140
+ }
141
+ if (isNonEmptyArray(ignoreWord)) ignoreWord.forEach((w) => {
142
+ if (isNonEmptyString(w)) {
143
+ const clean = normalizeWord(w);
144
+ if (clean) result.add(clean);
145
+ }
146
+ });
147
+ if (isSet(ignoreWord)) ignoreWord.forEach((w) => {
148
+ if (isNonEmptyString(w)) {
149
+ const clean = normalizeWord(w);
150
+ if (clean) result.add(clean);
151
+ }
152
+ });
153
+ return result;
154
+ };
155
+ const slugify = (input, ignoreWord) => {
156
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
157
+ const wordsValidated = validateCaseInputWordsCase(input);
158
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
159
+ return wordsValidated.map((word) => {
160
+ if (ignoreWordsValidated.has(word)) return word;
161
+ return word.toLowerCase();
162
+ }).join("-").replace(/^-+|-+$/g, "");
163
+ };
164
+ const toDotCase = (input, ignoreWord) => {
165
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
166
+ const wordsValidated = validateCaseInputWordsCase(input);
167
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
168
+ return wordsValidated.map((word) => {
169
+ if (ignoreWordsValidated.has(word)) return word;
170
+ return word.toLowerCase();
171
+ }).join(".");
172
+ };
173
+ const toCamelCase = (input, ignoreWord) => {
174
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
175
+ const wordsValidated = validateCaseInputWordsCase(input);
176
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
177
+ return wordsValidated.map((word, index) => {
178
+ if (ignoreWordsValidated.has(word)) return word;
179
+ return index === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
180
+ }).join("");
181
+ };
182
+ const toKebabCase = (input, ignoreWord) => {
183
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
184
+ const wordsValidated = validateCaseInputWordsCase(input);
185
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
186
+ return wordsValidated.map((word) => {
187
+ if (ignoreWordsValidated.has(word)) return word;
188
+ return word.toLowerCase();
189
+ }).join("-");
190
+ };
191
+ const toSnakeCase = (input, ignoreWord) => {
192
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
193
+ const wordsValidated = validateCaseInputWordsCase(input);
194
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
195
+ return wordsValidated.map((word) => {
196
+ if (ignoreWordsValidated.has(word)) return word;
197
+ return word.toLowerCase();
198
+ }).join("_");
199
+ };
200
+ const toLowerCase = (input, ignoreWord) => {
201
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
202
+ const wordsValidated = validateCaseInputWordsCase(input);
203
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
204
+ return wordsValidated.map((word) => {
205
+ if (ignoreWordsValidated.has(word)) return word;
206
+ return word.toLowerCase();
207
+ }).join(" ");
208
+ };
209
+ const toPascalCase = (input, ignoreWord) => {
210
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
211
+ const wordsValidated = validateCaseInputWordsCase(input);
212
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
213
+ return wordsValidated.map((word) => {
214
+ if (ignoreWordsValidated.has(word)) return word;
215
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
216
+ }).join("");
217
+ };
218
+ const toPascalCaseSpace = (input, ignoreWord) => {
219
+ if (!isNonEmptyArray(input) && !isNonEmptyString(input)) return "";
220
+ const wordsValidated = validateCaseInputWordsCase(input);
221
+ const ignoreWordsValidated = validateCaseIgnoreWordsCase(ignoreWord);
222
+ return wordsValidated.map((word) => {
223
+ if (ignoreWordsValidated.has(word)) return word;
224
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
225
+ }).join(" ");
226
+ };
227
+ var PreciseType = class PreciseType {
228
+ static FIXES_RAW = Object.freeze({
229
+ string: "String",
230
+ number: "Number",
231
+ boolean: "Boolean",
232
+ bigint: "Bigint",
233
+ symbol: "Symbol",
234
+ undefined: "Undefined",
235
+ null: "Null",
236
+ regexp: "Reg Exp",
237
+ reflect: "Reflect",
238
+ proxy: "Proxy",
239
+ atomics: "Atomics",
240
+ array: "Array",
241
+ object: "Object",
242
+ function: "Function",
243
+ arguments: "Arguments",
244
+ asyncfunction: "Async Function",
245
+ generatorfunction: "Generator Function",
246
+ asyncgeneratorfunction: "Async Generator Function",
247
+ generator: "Generator",
248
+ promise: "Promise",
249
+ evalerror: "Eval Error",
250
+ rangeerror: "Range Error",
251
+ referenceerror: "Reference Error",
252
+ syntaxerror: "Syntax Error",
253
+ typeerror: "Type Error",
254
+ urierror: "URI Error",
255
+ aggregateerror: "Aggregate Error",
256
+ error: "Error",
257
+ int8array: "Int 8 Array",
258
+ uint8array: "Uint 8 Array",
259
+ uint8clampedarray: "Uint 8 Clamped Array",
260
+ int16array: "Int 16 Array",
261
+ uint16array: "Uint 16 Array",
262
+ int32array: "Int 32 Array",
263
+ uint32array: "Uint 32 Array",
264
+ float32array: "Float 32 Array",
265
+ float64array: "Float 64 Array",
266
+ bigint64array: "Big Int 64 Array",
267
+ biguint64array: "Big Uint 64 Array",
268
+ arraybuffer: "Array Buffer",
269
+ sharedarraybuffer: "Shared Array Buffer",
270
+ dataview: "Data View",
271
+ arraybufferview: "Array Buffer View",
272
+ map: "Map",
273
+ set: "Set",
274
+ weakmap: "Weak Map",
275
+ weakset: "Weak Set",
276
+ mapiterator: "Map Iterator",
277
+ weakmapiterator: "Weak Map Iterator",
278
+ setiterator: "Set Iterator",
279
+ weaksetiterator: "Weak Set Iterator",
280
+ arrayiterator: "Array Iterator",
281
+ stringiterator: "String Iterator",
282
+ asynciterator: "Async Iterator",
283
+ iteratorresult: "Iterator Result",
284
+ arrayiteratorresult: "Array Iterator Result",
285
+ readablestream: "Readable Stream",
286
+ writablestream: "Writable Stream",
287
+ transformstream: "Transform Stream",
288
+ readablestreamdefaultreader: "Readable Stream Default Reader",
289
+ writablestreamdefaultwriter: "Writable Stream Default Writer",
290
+ readablestreamdefaultcontroller: "Readable Stream Default Controller",
291
+ transformstreamdefaultcontroller: "Transform Stream Default Controller",
292
+ abortcontroller: "Abort Controller",
293
+ abortsignal: "Abort Signal",
294
+ fetch: "fetch",
295
+ request: "Request",
296
+ response: "Response",
297
+ headers: "Headers",
298
+ formdata: "FormData",
299
+ blob: "Blob",
300
+ file: "File",
301
+ filelist: "FileList",
302
+ filereader: "FileReader",
303
+ intl: "Intl",
304
+ collator: "Intl. Collator",
305
+ datetimeformat: "Intl. Date Time Format",
306
+ displaynames: "Intl. Display Names",
307
+ listformat: "Intl. List Format",
308
+ locale: "Intl. Locale",
309
+ numberformat: "Intl. Number Format",
310
+ pluralrules: "Intl. Plural Rules",
311
+ relativetimeformat: "Intl. Relative Time Format",
312
+ segmenter: "Intl. Segmenter",
313
+ weakref: "Weak Ref",
314
+ urlpattern: "URLPattern",
315
+ structuredclone: "structured Clone",
316
+ finalizationregistry: "Finalization Registry",
317
+ performance: "Performance",
318
+ performanceobserver: "Performance Observer",
319
+ performanceentry: "Performance Entry",
320
+ performancemark: "Performance Mark",
321
+ performancemeasure: "Performance Measure",
322
+ webassembly: "Web Assembly",
323
+ wasmmodule: "WebAssembly. Module",
324
+ wasminstance: "WebAssembly. Instance",
325
+ wasmmemory: "WebAssembly. Memory",
326
+ wasmtable: "WebAssembly. Table",
327
+ buffer: "Buffer",
328
+ process: "Process",
329
+ eventemitter: "Event Emitter",
330
+ stream: "Stream",
331
+ fs: "fs",
332
+ path: "path",
333
+ url: "URL",
334
+ urlsearchparams: "URL Search Params",
335
+ node: "Node",
336
+ element: "Element",
337
+ htmlelement: "HTML Element",
338
+ svgelement: "SVG Element",
339
+ document: "Document",
340
+ documentfragment: "Document Fragment",
341
+ shadowroot: "Shadow Root",
342
+ nodelist: "Node List",
343
+ htmlcollection: "HTML Collection",
344
+ resizeobserver: "Resize Observer",
345
+ mutationobserver: "Mutation Observer",
346
+ intersectionobserver: "Intersection Observer",
347
+ symboliterator: "Symbol. Iterator",
348
+ symbolasynciterator: "Symbol. Async Iterator",
349
+ symboltostringtag: "Symbol. To String Tag",
350
+ symbolspecies: "Symbol. Species",
351
+ symbolhasinstance: "Symbol. Has Instance",
352
+ symbolisconcatspreadable: "Symbol. Is Concat Spreadable",
353
+ symbolunscopables: "Symbol. Unscopables",
354
+ symbolmatch: "Symbol. Match",
355
+ symbolreplace: "Symbol. Replace",
356
+ symbolsearch: "Symbol. Search",
357
+ symbolsplit: "Symbol. Split",
358
+ symboltoprimitive: "Symbol. To Primitive",
359
+ symbolmatchall: "Symbol. Match All",
360
+ symbolarguments: "Symbol. Arguments",
361
+ math: "Math",
362
+ bigintconstructor: "Bigint Constructor",
363
+ numberconstructor: "Number Constructor",
364
+ stringconstructor: "String Constructor",
365
+ booleanconstructor: "Boolean Constructor",
366
+ formdataevent: "Form Data Event",
367
+ customevent: "Custom Event",
368
+ messagechannel: "Message Channel",
369
+ messageport: "Message Port",
370
+ messageevent: "Message Event",
371
+ websocket: "Web Socket",
372
+ eventsource: "Event Source",
373
+ indexeddb: "IndexedDB",
374
+ idbrequest: "IDB Request",
375
+ idbtransaction: "IDB Transaction",
376
+ idbobjectstore: "IDB Object Store",
377
+ idbcursor: "IDB Cursor",
378
+ localstorage: "Local Storage",
379
+ sessionstorage: "Session Storage",
380
+ navigator: "Navigator",
381
+ geolocation: "Geolocation",
382
+ clipboard: "Clipboard",
383
+ notification: "Notification",
384
+ canvas: "Canvas",
385
+ canvasrenderingcontext2d: "Canvas Rendering Context 2D",
386
+ offscreencanvas: "Offscreen Canvas",
387
+ webglrenderingcontext: "WebGL Rendering Context",
388
+ imagedata: "Image Data",
389
+ imagebitmap: "Image Bitmap",
390
+ mediastream: "Media Stream",
391
+ mediarecorder: "Media Recorder",
392
+ mediastreamtrack: "Media Stream Track",
393
+ audiocontext: "Audio Context",
394
+ audiobuffer: "Audio Buffer",
395
+ audioworklet: "Audio Worklet",
396
+ worker: "Worker",
397
+ sharedworker: "Shared Worker",
398
+ serviceworker: "Service Worker",
399
+ workerglobalscope: "Worker Global Scope",
400
+ structuredcloneerror: "Structured Clone Error",
401
+ transferable: "Transferable",
402
+ report: "Report",
403
+ console: "Console",
404
+ diagnosticreport: "Diagnostic Report",
405
+ domrect: "DOM Rect",
406
+ dompoint: "DOM Point",
407
+ dommatrix: "DOM Matrix",
408
+ domparser: "DOM Parser",
409
+ xmlhttprequest: "XML HTTP Request",
410
+ customelementregistry: "Custom Element Registry",
411
+ text: "Text",
412
+ comment: "Comment",
413
+ animation: "Animation",
414
+ documenttype: "Document Type",
415
+ characterdata: "Character Data",
416
+ animationevent: "Animation Event",
417
+ customemmetregistry: "Custom Emmet Registry",
418
+ websocketmessageevent: "WebSocket Message Event"
419
+ });
420
+ static SPECIAL_TYPE = Object.freeze([
421
+ "-Infinity",
422
+ "Infinity",
423
+ "NaN"
424
+ ]);
425
+ static ACRONYMS = Object.freeze([
426
+ "URI",
427
+ "URL",
428
+ "URN",
429
+ "HTTP",
430
+ "HTTPS",
431
+ "FTP",
432
+ "FTPS",
433
+ "SFTP",
434
+ "SSH",
435
+ "SMTP",
436
+ "POP3",
437
+ "IMAP",
438
+ "WS",
439
+ "WSS",
440
+ "TCP",
441
+ "UDP",
442
+ "IP",
443
+ "ICMP",
444
+ "ARP",
445
+ "RTP",
446
+ "RTSP",
447
+ "SIP",
448
+ "HTML",
449
+ "XHTML",
450
+ "XML",
451
+ "WBR",
452
+ "CSS",
453
+ "SVG",
454
+ "JSON",
455
+ "JSONP",
456
+ "DOM",
457
+ "IDB",
458
+ "DB",
459
+ "RTC",
460
+ "ICE",
461
+ "TLS",
462
+ "SSL",
463
+ "CORS",
464
+ "WASM",
465
+ "CSR",
466
+ "SSR",
467
+ "PWA",
468
+ "DPI",
469
+ "CDN",
470
+ "JS",
471
+ "TS",
472
+ "JSX",
473
+ "TSX",
474
+ "CLI",
475
+ "API",
476
+ "SDK",
477
+ "UI",
478
+ "UX",
479
+ "OS",
480
+ "ID",
481
+ "UUID",
482
+ "PID",
483
+ "NPM",
484
+ "YARN",
485
+ "ESM",
486
+ "CJS",
487
+ "BOM",
488
+ "MVC",
489
+ "MVVM",
490
+ "ORM",
491
+ "DAO",
492
+ "CRUD",
493
+ "FIFO",
494
+ "LIFO",
495
+ "OOP",
496
+ "FP",
497
+ "REPL",
498
+ "CSV",
499
+ "TSV",
500
+ "SQL",
501
+ "YAML",
502
+ "JSON",
503
+ "MD",
504
+ "INI",
505
+ "PDF",
506
+ "XLS",
507
+ "XLSX",
508
+ "RTF",
509
+ "XML",
510
+ "BMP",
511
+ "GIF",
512
+ "PNG",
513
+ "JPEG",
514
+ "WEBP",
515
+ "MP3",
516
+ "MP4",
517
+ "AVI",
518
+ "MOV",
519
+ "FLAC",
520
+ "MKV",
521
+ "WAV",
522
+ "URLSearchParams",
523
+ "XHR",
524
+ "2D",
525
+ "3D",
526
+ "GL",
527
+ "WebGL",
528
+ "TTL",
529
+ "UID",
530
+ "GID",
531
+ "MAC",
532
+ "IP",
533
+ "DNS",
534
+ "DHCP",
535
+ "VPN",
536
+ "LAN",
537
+ "WAN",
538
+ "SSID",
539
+ "IoT",
540
+ "API",
541
+ "SDK",
542
+ "CLI",
543
+ "LTS",
544
+ "EOL",
545
+ "CPU",
546
+ "GPU",
547
+ "RAM",
548
+ "ROM",
549
+ "SSD",
550
+ "HDD",
551
+ "BIOS",
552
+ "USB",
553
+ "PCI",
554
+ "SATA",
555
+ "DIMM",
556
+ "DDR",
557
+ "VGA",
558
+ "HDMI",
559
+ "KVM",
560
+ "ASIC",
561
+ "FPGA",
562
+ "SoC",
563
+ "NAS",
564
+ "SAN",
565
+ "TCP",
566
+ "UDP",
567
+ "IP",
568
+ "MAC",
569
+ "DNS",
570
+ "DHCP",
571
+ "VPN",
572
+ "LAN",
573
+ "WAN",
574
+ "SSID",
575
+ "NAT",
576
+ "QoS",
577
+ "MPLS",
578
+ "BGP",
579
+ "OSPF",
580
+ "ICMP",
581
+ "IGMP",
582
+ "LLDP",
583
+ "ARP",
584
+ "RARP",
585
+ "AES",
586
+ "RSA",
587
+ "OTP",
588
+ "MFA",
589
+ "PKI",
590
+ "VPN",
591
+ "IAM",
592
+ "ACL",
593
+ "CSP",
594
+ "XSS",
595
+ "CSRF",
596
+ "HSTS",
597
+ "WAF",
598
+ "DDoS",
599
+ "IDS",
600
+ "IPS",
601
+ "SOC",
602
+ "SIEM",
603
+ "AWS",
604
+ "GCP",
605
+ "AZURE",
606
+ "CI",
607
+ "CD",
608
+ "K8S",
609
+ "IaC",
610
+ "PaaS",
611
+ "SaaS",
612
+ "IaaS",
613
+ "API",
614
+ "CLI",
615
+ "SDK",
616
+ "REST",
617
+ "SOAP",
618
+ "JSON-RPC",
619
+ "gRPC",
620
+ "ELB",
621
+ "EKS",
622
+ "AKS",
623
+ "FaaS",
624
+ "CaaS",
625
+ "GUI",
626
+ "IDE",
627
+ "FAQ",
628
+ "UX",
629
+ "UI",
630
+ "CLI",
631
+ "API",
632
+ "SDK",
633
+ "LTS",
634
+ "EOL",
635
+ "WYSIWYG",
636
+ "CMS",
637
+ "CRM",
638
+ "GPS",
639
+ "LED",
640
+ "OLED",
641
+ "LCD",
642
+ "RFID",
643
+ "NFC",
644
+ "CPU",
645
+ "GPU",
646
+ "AI",
647
+ "ML",
648
+ "DL",
649
+ "DB",
650
+ "SQL",
651
+ "NoSQL",
652
+ "ORM",
653
+ "JSON",
654
+ "XML",
655
+ "CSV",
656
+ "HTTP",
657
+ "HTTPS",
658
+ "TDD",
659
+ "BDD",
660
+ "CI",
661
+ "CD",
662
+ "QA",
663
+ "SLA",
664
+ "SLO",
665
+ "MTTR",
666
+ "MTBF",
667
+ "UAT",
668
+ "RPA",
669
+ "KPI",
670
+ "OKR",
671
+ "ROI",
672
+ "RFP",
673
+ "SLA",
674
+ "CRM",
675
+ "ERP",
676
+ "PMO",
677
+ "SCRUM",
678
+ "KANBAN",
679
+ "FPS",
680
+ "HDR",
681
+ "VR",
682
+ "AR",
683
+ "3D",
684
+ "2D",
685
+ "MP3",
686
+ "MP4",
687
+ "GIF",
688
+ "PNG",
689
+ "JPEG",
690
+ "SVG",
691
+ "BMP",
692
+ "TIFF",
693
+ "POSIX",
694
+ "NTFS",
695
+ "FAT",
696
+ "EXT",
697
+ "EXT4",
698
+ "APFS",
699
+ "HFS",
700
+ "ISO",
701
+ "HTML",
702
+ "CSS",
703
+ "JS",
704
+ "TS",
705
+ "PHP",
706
+ "SQL",
707
+ "JSON",
708
+ "XML",
709
+ "YAML",
710
+ "BASH",
711
+ "ZSH",
712
+ "JSON",
713
+ "YAML",
714
+ "INI",
715
+ "DOTENV",
716
+ "VM",
717
+ "VMM",
718
+ "VPC",
719
+ "OCI",
720
+ "LXC",
721
+ "Docker",
722
+ "K8S",
723
+ "CRI",
724
+ "CNI"
725
+ ]);
726
+ static FIXES_CASTABLE_TABLE = Object.freeze(Object.entries(PreciseType.FIXES_RAW).reduce((acc, [k, v]) => {
727
+ acc[PreciseType.normalizeKeyForCase(k)] = v;
728
+ return acc;
729
+ }, {}));
730
+ formatCase = "toKebabCase";
731
+ useAcronyms = false;
732
+ constructor(params) {
733
+ this.formatCase = params?.formatCase;
734
+ this.useAcronyms = params?.useAcronyms;
735
+ }
736
+ determineOptions(options) {
737
+ return {
738
+ formatCase: options?.formatCase || this.formatCase,
739
+ useAcronyms: options?.useAcronyms ?? this.useAcronyms
740
+ };
741
+ }
742
+ getHtmlElementType(value, options) {
743
+ const { formatCase, useAcronyms } = this.determineOptions(options);
744
+ if (typeof HTMLElement === "undefined" || !(value instanceof HTMLElement)) return null;
745
+ const tagName = value.tagName;
746
+ const DEFAULTS = {
747
+ a: "Anchor",
748
+ abbr: "Abbreviation",
749
+ address: "Address",
750
+ area: "Area",
751
+ article: "Article",
752
+ aside: "Aside",
753
+ audio: "Audio",
754
+ b: "Bold",
755
+ base: "Base",
756
+ bdi: "BDI",
757
+ bdo: "BDO",
758
+ blockquote: "Blockquote",
759
+ body: "Body",
760
+ br: "Break",
761
+ button: "Button",
762
+ canvas: "Canvas",
763
+ caption: "Caption",
764
+ cite: "Cite",
765
+ code: "Code",
766
+ col: "Column",
767
+ colgroup: "Column Group",
768
+ data: "Data",
769
+ datalist: "Datalist",
770
+ dd: "Definition Description",
771
+ del: "Deleted Text",
772
+ details: "Details",
773
+ dfn: "Definition",
774
+ dialog: "Dialog",
775
+ div: "Div",
776
+ dl: "Definition List",
777
+ dt: "Definition Term",
778
+ em: "Emphasis",
779
+ embed: "Embed",
780
+ fieldset: "Fieldset",
781
+ figcaption: "Figcaption",
782
+ figure: "Figure",
783
+ footer: "Footer",
784
+ form: "Form",
785
+ h1: "Heading 1",
786
+ h2: "Heading 2",
787
+ h3: "Heading 3",
788
+ h4: "Heading 4",
789
+ h5: "Heading 5",
790
+ h6: "Heading 6",
791
+ head: "Head",
792
+ header: "Header",
793
+ hr: "Horizontal Rule",
794
+ html: "HTML",
795
+ i: "Italic",
796
+ iframe: "IFrame",
797
+ img: "Image",
798
+ input: "Input",
799
+ ins: "Inserted Text",
800
+ kbd: "Keyboard",
801
+ label: "Label",
802
+ legend: "Legend",
803
+ li: "List Item",
804
+ link: "Link",
805
+ main: "Main",
806
+ map: "Map",
807
+ mark: "Mark",
808
+ meta: "Meta",
809
+ meter: "Meter",
810
+ nav: "Nav",
811
+ noscript: "NoScript",
812
+ object: "Object",
813
+ ol: "Ordered List",
814
+ optgroup: "Option Group",
815
+ option: "Option",
816
+ output: "Output",
817
+ p: "Paragraph",
818
+ param: "Param",
819
+ picture: "Picture",
820
+ pre: "Preformatted",
821
+ progress: "Progress",
822
+ q: "Quote",
823
+ rp: "RP",
824
+ rt: "RT",
825
+ ruby: "Ruby",
826
+ s: "Strikethrough",
827
+ samp: "Sample",
828
+ script: "Script",
829
+ section: "Section",
830
+ select: "Select",
831
+ small: "Small",
832
+ source: "Source",
833
+ span: "Span",
834
+ strong: "Strong",
835
+ style: "Style",
836
+ sub: "Subscript",
837
+ summary: "Summary",
838
+ sup: "Superscript",
839
+ table: "Table",
840
+ tbody: "Table Body",
841
+ td: "Table Data",
842
+ template: "Template",
843
+ textarea: "Textarea",
844
+ tfoot: "Table Footer",
845
+ th: "Table Header",
846
+ thead: "Table Head",
847
+ time: "Time",
848
+ title: "Title",
849
+ tr: "Table Row",
850
+ track: "Track",
851
+ u: "Underline",
852
+ ul: "Unordered List",
853
+ var: "Variable",
854
+ video: "Video",
855
+ wbr: "WBR"
856
+ };
857
+ const displayName = PreciseType.FIXES_CASTABLE_TABLE[PreciseType.normalizeKeyForCase(tagName)] ?? (DEFAULTS[tagName] ? `HTML ${DEFAULTS[tagName]} Element` : "HTML Element");
858
+ return this.converter(displayName, {
859
+ formatCase,
860
+ useAcronyms
861
+ });
862
+ }
863
+ getCommentNodeType(value, options) {
864
+ const { formatCase, useAcronyms } = this.determineOptions(options);
865
+ if (value instanceof Comment) return this.converter(PreciseType.FIXES_CASTABLE_TABLE[PreciseType.normalizeKeyForCase("comment")] ?? "Comment", {
866
+ formatCase,
867
+ useAcronyms
868
+ });
869
+ return null;
870
+ }
871
+ getTextNodeType(value, options) {
872
+ const { formatCase, useAcronyms } = this.determineOptions(options);
873
+ if (value instanceof Text) return this.converter(PreciseType.FIXES_CASTABLE_TABLE[PreciseType.normalizeKeyForCase("text")] ?? "Text", {
874
+ formatCase,
875
+ useAcronyms
876
+ });
877
+ return null;
878
+ }
879
+ getOtherNodeType(value, options) {
880
+ const { formatCase, useAcronyms } = this.determineOptions(options);
881
+ if (typeof Node !== "undefined" && value instanceof Node) return this.converter(PreciseType.FIXES_CASTABLE_TABLE[PreciseType.normalizeKeyForCase("node")] ?? "Node", {
882
+ formatCase,
883
+ useAcronyms
884
+ });
885
+ return null;
886
+ }
887
+ getSymbolName(value, options) {
888
+ const { formatCase, useAcronyms } = this.determineOptions(options);
889
+ const key = new Map([
890
+ [Symbol.iterator, "symboliterator"],
891
+ [Symbol.asyncIterator, "symbolasynciterator"],
892
+ [Symbol.toStringTag, "symboltostringtag"],
893
+ [Symbol.species, "symbolspecies"],
894
+ [Symbol.hasInstance, "symbolhasinstance"],
895
+ [Symbol.isConcatSpreadable, "symbolisconcatspreadable"],
896
+ [Symbol.unscopables, "symbolunscopables"],
897
+ [Symbol.match, "symbolmatch"],
898
+ [Symbol.replace, "symbolreplace"],
899
+ [Symbol.search, "symbolsearch"],
900
+ [Symbol.split, "symbolsplit"],
901
+ [Symbol.toPrimitive, "symboltoprimitive"],
902
+ [Symbol.matchAll, "symbolmatchall"]
903
+ ]).get(value);
904
+ if (key) return this.converter(PreciseType.FIXES_CASTABLE_TABLE[PreciseType.normalizeKeyForCase(key)] ?? key, {
905
+ formatCase,
906
+ useAcronyms
907
+ });
908
+ return this.converter(PreciseType.FIXES_CASTABLE_TABLE[PreciseType.normalizeKeyForCase("symbol")] ?? "Symbol", {
909
+ formatCase,
910
+ useAcronyms
911
+ });
912
+ }
913
+ detectDomNodeType(value, options) {
914
+ const { formatCase, useAcronyms } = this.determineOptions(options);
915
+ try {
916
+ return this.getHtmlElementType(value, {
917
+ formatCase,
918
+ useAcronyms
919
+ }) || this.getCommentNodeType(value, {
920
+ formatCase,
921
+ useAcronyms
922
+ }) || this.getTextNodeType(value, {
923
+ formatCase,
924
+ useAcronyms
925
+ }) || this.getOtherNodeType(value, {
926
+ formatCase,
927
+ useAcronyms
928
+ });
929
+ } catch {
930
+ return null;
931
+ }
932
+ }
933
+ isProxy(value) {
934
+ if (isNull(value) || !isObjectOrArray(value)) return false;
935
+ const tag = Object.prototype.toString.call(value);
936
+ if ([
937
+ "[object Array]",
938
+ "[object Date]",
939
+ "[object RegExp]",
940
+ "[object Map]",
941
+ "[object Set]",
942
+ "[object WeakMap]",
943
+ "[object WeakSet]",
944
+ "[object Function]",
945
+ "[object Error]",
946
+ "[object Promise]",
947
+ "[object Generator]",
948
+ "[object GeneratorFunction]",
949
+ "[object AsyncFunction]"
950
+ ].includes(tag)) return false;
951
+ try {
952
+ Reflect.defineProperty(value, "__proxy_detect__", {
953
+ configurable: true,
954
+ value: 1
955
+ });
956
+ Reflect.deleteProperty(value, "__proxy_detect__");
957
+ return false;
958
+ } catch {
959
+ return true;
960
+ }
961
+ }
962
+ converter(input, options) {
963
+ const { formatCase, useAcronyms } = this.determineOptions(options);
964
+ const ignoreWord = useAcronyms ? PreciseType.ACRONYMS : [];
965
+ switch (formatCase) {
966
+ case "slugify": return slugify(input, ignoreWord);
967
+ case "toDotCase": return toDotCase(input, ignoreWord);
968
+ case "toCamelCase": return toCamelCase(input, ignoreWord);
969
+ case "toSnakeCase": return toSnakeCase(input, ignoreWord);
970
+ case "toLowerCase": return toLowerCase(input, ignoreWord);
971
+ case "toPascalCase": return toPascalCase(input, ignoreWord);
972
+ case "toPascalCaseSpace": return toPascalCaseSpace(input, ignoreWord);
973
+ default: return toKebabCase(input, ignoreWord);
974
+ }
975
+ }
976
+ static normalizeKeyForCase(k) {
977
+ return k.replace(/[\s_\-.]+/g, "").toLowerCase();
978
+ }
979
+ static get castableTable() {
980
+ return PreciseType.FIXES_CASTABLE_TABLE;
981
+ }
982
+ static get specialType() {
983
+ return this.SPECIAL_TYPE;
984
+ }
985
+ static get fixesRaw() {
986
+ return this.FIXES_RAW;
987
+ }
988
+ static get acronymsList() {
989
+ return this.ACRONYMS;
990
+ }
991
+ };
992
+ const getPreciseType = (() => {
993
+ const cache = /* @__PURE__ */ new Map();
994
+ const MAX_CACHE_SIZE = 25;
995
+ return (value, options = {}) => {
996
+ if (!isPlainObject(options)) options = {};
997
+ const key = JSON.stringify({
998
+ formatCase: options.formatCase || "toKebabCase",
999
+ useAcronyms: options.useAcronyms ?? false
1000
+ });
1001
+ let ClassPrecise = cache.get(key);
1002
+ if (!ClassPrecise) {
1003
+ if (cache.size >= MAX_CACHE_SIZE) cache.clear();
1004
+ ClassPrecise = new PreciseType(options);
1005
+ cache.set(key, ClassPrecise);
1006
+ }
1007
+ if (isNull(value)) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("null")] ?? "Null");
1008
+ if (isNaN(value)) return "NaN";
1009
+ if (isInfinityNumber(value)) return String(value);
1010
+ if (typeof BigInt !== "undefined" && value === BigInt) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("bigint constructor")] ?? "bigint constructor");
1011
+ if (isNumberObject(value) || value === Number) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("number constructor")] ?? "number constructor");
1012
+ if (isStringObject(value) || value === String) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("string constructor")] ?? "string constructor");
1013
+ if (isBooleanObject(value) || value === Boolean) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("boolean constructor")] ?? "boolean constructor");
1014
+ const prim = typeof value;
1015
+ if (!isObjectOrArray(value) && !isFunction(value) && prim !== "symbol") return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase(prim)] ?? prim);
1016
+ if (prim === "symbol") return ClassPrecise.getSymbolName(value);
1017
+ if (isObjectOrArray(value) && value.constructor?.name === "EventEmitter") return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("event emitter")] ?? "Event Emitter");
1018
+ const domType = ClassPrecise.detectDomNodeType(value);
1019
+ if (domType) return domType;
1020
+ if (isBuffer(value)) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("buffer")] ?? "Buffer");
1021
+ if (ClassPrecise.isProxy(value)) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("proxy")] ?? "Proxy");
1022
+ if (isObject(value) && isFunction(value?.next) && isFunction(value?.throw)) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("generator")] ?? "Generator");
1023
+ if (isError(value)) {
1024
+ const ctorName = value.constructor?.name ?? "Error";
1025
+ return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase(ctorName)] ?? PreciseType.castableTable[PreciseType.normalizeKeyForCase(ctorName.replace(/\s+/g, ""))] ?? ctorName);
1026
+ }
1027
+ if (isObjectOrArray(value) && "done" in value && "value" in value && Object.keys(value).length === 2) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("iterator result")] ?? "iterator result");
1028
+ if (isNull(Object.getPrototypeOf(value))) return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase("object")] ?? "Object");
1029
+ const tag = Object.prototype.toString.call(value).slice(8, -1) || "Object";
1030
+ const mapped = PreciseType.castableTable[PreciseType.normalizeKeyForCase(tag)];
1031
+ if (mapped) return ClassPrecise.converter(mapped);
1032
+ const ctorName = value?.constructor?.name;
1033
+ if (ctorName && ctorName !== "Object") return ClassPrecise.converter(PreciseType.castableTable[PreciseType.normalizeKeyForCase(ctorName)] ?? ctorName);
1034
+ return ClassPrecise.converter(tag);
1035
+ };
1036
+ })();
1037
+ const determineErrorTypeAssertion = (type, message) => {
1038
+ switch (type) {
1039
+ case "Error": throw new Error(message);
1040
+ case "EvalError": throw new EvalError(message);
1041
+ case "RangeError": throw new RangeError(message);
1042
+ case "ReferenceError": throw new ReferenceError(message);
1043
+ case "SyntaxError": throw new SyntaxError(message);
1044
+ case "URIError": throw new URIError(message);
1045
+ case "TypeError": throw new TypeError(message);
1046
+ default: throw new TypeError(message);
1047
+ }
1048
+ };
1049
+ function resolveErrorMessageAssertions(params) {
1050
+ const { requiredValidType, value, options } = params || {};
1051
+ const { message, formatCase, useAcronyms, errorType = "TypeError" } = isPlainObject(options) ? options : {};
1052
+ const validType = toKebabCase(requiredValidType);
1053
+ const currentType = getPreciseType(value, {
1054
+ formatCase,
1055
+ useAcronyms
1056
+ });
1057
+ const messageFnOptions = {
1058
+ currentType,
1059
+ validType
1060
+ };
1061
+ const defaultMessage = `Parameter input (\`value\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
1062
+ return determineErrorTypeAssertion(errorType, isFunction(message) ? isNonEmptyString(message(messageFnOptions)) ? message(messageFnOptions).trim() : defaultMessage : isNonEmptyString(message) ? message.trim() : defaultMessage);
1063
+ }
1064
+ const assertIsBoolean = (value, options = {}) => {
1065
+ if (isBoolean(value)) return;
1066
+ resolveErrorMessageAssertions({
1067
+ value,
1068
+ options,
1069
+ requiredValidType: "boolean"
1070
+ });
1071
+ };
1072
+ export { isPlainObject as A, isSymbol as C, isNaN as D, isNull as E, isBoolean as F, isArray as M, isNil as N, isNumberObject as O, isFunction as P, isUndefined as S, assertIsPlainObject as T, isBuffer as _, toPascalCase as a, hasOwnProp as b, toKebabCase as c, slugify as d, isSet as f, isStringObject as g, isBooleanObject as h, toPascalCaseSpace as i, isObject as j, isString as k, toCamelCase as l, isInfinityNumber as m, resolveErrorMessageAssertions as n, toLowerCase as o, isNonEmptyArray as p, getPreciseType as r, toSnakeCase as s, assertIsBoolean as t, toDotCase as u, isError as v, isNumber as w, isObjectOrArray as x, isNonEmptyString as y };
1073
+ //# sourceMappingURL=assertIsBoolean-DR1SaXPD.js.map