@rzl-zone/utils-js 3.12.1-beta.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 (239) hide show
  1. package/README.md +7 -7
  2. package/dist/.references/index.d.cts +1 -1
  3. package/dist/.references/index.d.ts +1 -1
  4. package/dist/{assertIsArray-BChqwPiP.cjs → assertIsArray-DJXkjHZs.cjs} +3 -3
  5. package/dist/{assertIsArray-BChqwPiP.cjs.map → assertIsArray-DJXkjHZs.cjs.map} +1 -1
  6. package/dist/{assertIsArray-BfAbIUfa.js → assertIsArray-bTA3XLjq.js} +3 -3
  7. package/dist/{assertIsArray-BfAbIUfa.js.map → assertIsArray-bTA3XLjq.js.map} +1 -1
  8. package/dist/{assertIsBoolean-DozdtbNi.cjs → assertIsBoolean-C8WEXVr2.cjs} +8 -8
  9. package/dist/assertIsBoolean-C8WEXVr2.cjs.map +1 -0
  10. package/dist/{assertIsBoolean-BlBct0Fc.js → assertIsBoolean-DR1SaXPD.js} +8 -8
  11. package/dist/assertIsBoolean-DR1SaXPD.js.map +1 -0
  12. package/dist/{assertIsString-Bvk7bUL7.cjs → assertIsString-BiHQSrB2.cjs} +3 -3
  13. package/dist/{assertIsString-Bvk7bUL7.cjs.map → assertIsString-BiHQSrB2.cjs.map} +1 -1
  14. package/dist/{assertIsString-DqV9NwbI.js → assertIsString-CEB07_83.js} +3 -3
  15. package/dist/{assertIsString-DqV9NwbI.js.map → assertIsString-CEB07_83.js.map} +1 -1
  16. package/dist/assertions/index.cjs +5 -5
  17. package/dist/assertions/index.d.cts +2 -2
  18. package/dist/assertions/index.d.ts +2 -2
  19. package/dist/assertions/index.js +5 -5
  20. package/dist/conversions/index.cjs +6 -6
  21. package/dist/conversions/index.d.cts +2 -2
  22. package/dist/conversions/index.d.ts +2 -2
  23. package/dist/conversions/index.js +6 -6
  24. package/dist/{conversions-EMJa3g-D.js → conversions-BNIh_tCH.js} +16 -18
  25. package/dist/conversions-BNIh_tCH.js.map +1 -0
  26. package/dist/{conversions-CBs8-REq.cjs → conversions-D_Kh0a_C.cjs} +16 -18
  27. package/dist/conversions-D_Kh0a_C.cjs.map +1 -0
  28. package/dist/events/index.cjs +4 -4
  29. package/dist/events/index.cjs.map +1 -1
  30. package/dist/events/index.d.cts +153 -151
  31. package/dist/events/index.d.ts +153 -151
  32. package/dist/events/index.js +4 -4
  33. package/dist/events/index.js.map +1 -1
  34. package/dist/{formatEnvPort-hHNvOim-.cjs → formatEnvPort-B3OLxQk9.cjs} +9 -9
  35. package/dist/formatEnvPort-B3OLxQk9.cjs.map +1 -0
  36. package/dist/{formatEnvPort-DpIXzPAZ.js → formatEnvPort-ByFVLjSV.js} +9 -9
  37. package/dist/formatEnvPort-ByFVLjSV.js.map +1 -0
  38. package/dist/formatters/index.cjs +2 -2
  39. package/dist/formatters/index.d.cts +2 -2
  40. package/dist/formatters/index.d.ts +2 -2
  41. package/dist/formatters/index.js +2 -2
  42. package/dist/{formatters-QcZO_Cpx.js → formatters--1m_vpE8.js} +17 -15
  43. package/dist/formatters--1m_vpE8.js.map +1 -0
  44. package/dist/{formatters-lAYgA11L.cjs → formatters-Cbij0XLU.cjs} +17 -15
  45. package/dist/formatters-Cbij0XLU.cjs.map +1 -0
  46. package/dist/generators/index.cjs +12 -8
  47. package/dist/generators/index.cjs.map +1 -1
  48. package/dist/generators/index.d.cts +2 -2
  49. package/dist/generators/index.d.ts +2 -2
  50. package/dist/generators/index.js +12 -8
  51. package/dist/generators/index.js.map +1 -1
  52. package/dist/index-59zbLcPr.d.ts +340 -0
  53. package/dist/index-B6tawc8L.d.cts +1716 -0
  54. package/dist/index-C267akkJ.d.ts +2158 -0
  55. package/dist/index-CeBC2Vvl.d.cts +2361 -0
  56. package/dist/index-CgRDTI6f.d.ts +822 -0
  57. package/dist/index-CoiUBVmr.d.ts +720 -0
  58. package/dist/index-D4fcasfZ.d.cts +720 -0
  59. package/dist/index-DDrSQKIc.d.ts +1716 -0
  60. package/dist/index-DsGxO31H.d.cts +765 -0
  61. package/dist/index-Hg1qJkjl.d.ts +765 -0
  62. package/dist/index-Qm3iFwd0.d.cts +2158 -0
  63. package/dist/index-UPp94Agr.d.ts +2361 -0
  64. package/dist/index-gBA_8SuF.d.cts +340 -0
  65. package/dist/index-jyDqzicx.d.cts +822 -0
  66. package/dist/{isBigInt-B1cijjqm.cjs → isBigInt-C4krUeAw.cjs} +2 -2
  67. package/dist/{isBigInt-B1cijjqm.cjs.map → isBigInt-C4krUeAw.cjs.map} +1 -1
  68. package/dist/{isBigInt-C0bN0Rhu.js → isBigInt-DKe0M6hp.js} +2 -2
  69. package/dist/{isBigInt-C0bN0Rhu.js.map → isBigInt-DKe0M6hp.js.map} +1 -1
  70. package/dist/{isEmptyObject-DeLVIJpl.js → isEmptyObject-DCipFwxJ.js} +3 -3
  71. package/dist/{isEmptyObject-DeLVIJpl.js.map → isEmptyObject-DCipFwxJ.js.map} +1 -1
  72. package/dist/{isEmptyObject-DI42NEo0.cjs → isEmptyObject-ZkSwRC_D.cjs} +3 -3
  73. package/dist/{isEmptyObject-DI42NEo0.cjs.map → isEmptyObject-ZkSwRC_D.cjs.map} +1 -1
  74. package/dist/{isEmptyString-BTUWYTbw.js → isEmptyString-BXzKAC2j.js} +3 -3
  75. package/dist/{isEmptyString-BTUWYTbw.js.map → isEmptyString-BXzKAC2j.js.map} +1 -1
  76. package/dist/{isEmptyString-CCK3bP74.cjs → isEmptyString-UiiUsSQj.cjs} +3 -3
  77. package/dist/{isEmptyString-CCK3bP74.cjs.map → isEmptyString-UiiUsSQj.cjs.map} +1 -1
  78. package/dist/{isEmptyValue-DMSMFTU8.cjs → isEmptyValue-BQzcjVaL.cjs} +5 -5
  79. package/dist/{isEmptyValue-DMSMFTU8.cjs.map → isEmptyValue-BQzcjVaL.cjs.map} +1 -1
  80. package/dist/{isEmptyValue-fjnfQnt5.js → isEmptyValue-jqOr7OHD.js} +5 -5
  81. package/dist/{isEmptyValue-fjnfQnt5.js.map → isEmptyValue-jqOr7OHD.js.map} +1 -1
  82. package/dist/{isEqual-DhyP8fB_.js → isEqual-BX49cF9m.js} +4 -4
  83. package/dist/{isEqual-DhyP8fB_.js.map → isEqual-BX49cF9m.js.map} +1 -1
  84. package/dist/{isEqual-B1fRgEuU.cjs → isEqual-BvumA3RA.cjs} +4 -4
  85. package/dist/{isEqual-B1fRgEuU.cjs.map → isEqual-BvumA3RA.cjs.map} +1 -1
  86. package/dist/{isFinite-BYMOo0os.js → isFinite-BCnaDpod.js} +3 -3
  87. package/dist/{isFinite-BYMOo0os.js.map → isFinite-BCnaDpod.js.map} +1 -1
  88. package/dist/{isFinite-sFkps2TY.cjs → isFinite-D24ZaE6c.cjs} +3 -3
  89. package/dist/{isFinite-sFkps2TY.cjs.map → isFinite-D24ZaE6c.cjs.map} +1 -1
  90. package/dist/{isInteger-FTCthMre.cjs → isInteger-Caeuz0rB.cjs} +2 -2
  91. package/dist/{isInteger-FTCthMre.cjs.map → isInteger-Caeuz0rB.cjs.map} +1 -1
  92. package/dist/{isInteger-DS9V7l_f.js → isInteger-naMbJsxJ.js} +2 -2
  93. package/dist/{isInteger-DS9V7l_f.js.map → isInteger-naMbJsxJ.js.map} +1 -1
  94. package/dist/isPlainObject-BF-2-phb.d.cts +339 -0
  95. package/dist/isPlainObject-DxNDL8XU.d.ts +339 -0
  96. package/dist/{isServer-q-QLFCqE.cjs → isServer-BJHVnixd.cjs} +2 -2
  97. package/dist/{isServer-q-QLFCqE.cjs.map → isServer-BJHVnixd.cjs.map} +1 -1
  98. package/dist/{isServer-D1TXfOs3.js → isServer-Da3o3XSs.js} +2 -2
  99. package/dist/{isServer-D1TXfOs3.js.map → isServer-Da3o3XSs.js.map} +1 -1
  100. package/dist/{isTypedArray-47R0wdrc.js → isTypedArray-DuNA8tK6.js} +3 -3
  101. package/dist/{isTypedArray-47R0wdrc.js.map → isTypedArray-DuNA8tK6.js.map} +1 -1
  102. package/dist/{isTypedArray-DiCoqffZ.cjs → isTypedArray-TJptiw2b.cjs} +3 -3
  103. package/dist/{isTypedArray-DiCoqffZ.cjs.map → isTypedArray-TJptiw2b.cjs.map} +1 -1
  104. package/dist/{isURL-CQiowFq2.js → isURL-C-kSk6KJ.js} +2 -2
  105. package/dist/{isURL-CQiowFq2.js.map → isURL-C-kSk6KJ.js.map} +1 -1
  106. package/dist/{isURL-WZypXsax.cjs → isURL-DeUPO_oR.cjs} +2 -2
  107. package/dist/{isURL-WZypXsax.cjs.map → isURL-DeUPO_oR.cjs.map} +1 -1
  108. package/dist/{isValidDomain-BSXshgkC.cjs → isValidDomain-BB9IGhJs.cjs} +65 -8
  109. package/dist/isValidDomain-BB9IGhJs.cjs.map +1 -0
  110. package/dist/{isValidDomain-DwA2EN79.js → isValidDomain-DoE98yhJ.js} +54 -9
  111. package/dist/isValidDomain-DoE98yhJ.js.map +1 -0
  112. package/dist/next/index.cjs +7 -7
  113. package/dist/next/index.cjs.map +1 -1
  114. package/dist/next/index.d.cts +185 -191
  115. package/dist/next/index.d.ts +185 -191
  116. package/dist/next/index.js +7 -7
  117. package/dist/next/index.js.map +1 -1
  118. package/dist/next/server/index.cjs +2 -2
  119. package/dist/next/server/index.d.cts +26 -26
  120. package/dist/next/server/index.d.ts +26 -26
  121. package/dist/next/server/index.js +2 -2
  122. package/dist/{noop-B2mTBhW-.cjs → noop-B13_ii35.cjs} +2 -2
  123. package/dist/{noop-B2mTBhW-.cjs.map → noop-B13_ii35.cjs.map} +1 -1
  124. package/dist/{noop-BzktGBVz.js → noop-ubqAIbHD.js} +2 -2
  125. package/dist/{noop-BzktGBVz.js.map → noop-ubqAIbHD.js.map} +1 -1
  126. package/dist/{normalizeSpaces-WS_iERJk.js → normalizeSpaces-Bg2IZW7W.js} +3 -3
  127. package/dist/{normalizeSpaces-WS_iERJk.js.map → normalizeSpaces-Bg2IZW7W.js.map} +1 -1
  128. package/dist/{normalizeSpaces-DQHR3Tlr.cjs → normalizeSpaces-ZXnR4Qzp.cjs} +3 -3
  129. package/dist/{normalizeSpaces-DQHR3Tlr.cjs.map → normalizeSpaces-ZXnR4Qzp.cjs.map} +1 -1
  130. package/dist/{normalizeString-2WLth_Gj.js → normalizeString-BDdkaXui.js} +3 -3
  131. package/dist/{normalizeString-2WLth_Gj.js.map → normalizeString-BDdkaXui.js.map} +1 -1
  132. package/dist/{normalizeString-D8euBcRD.cjs → normalizeString-BE6ELqEb.cjs} +3 -3
  133. package/dist/{normalizeString-D8euBcRD.cjs.map → normalizeString-BE6ELqEb.cjs.map} +1 -1
  134. package/dist/operations/index.cjs +10 -10
  135. package/dist/operations/index.cjs.map +1 -1
  136. package/dist/operations/index.d.cts +120 -120
  137. package/dist/operations/index.d.ts +120 -120
  138. package/dist/operations/index.js +10 -10
  139. package/dist/operations/index.js.map +1 -1
  140. package/dist/parsers/index.cjs +2 -2
  141. package/dist/parsers/index.d.cts +222 -222
  142. package/dist/parsers/index.d.ts +222 -222
  143. package/dist/parsers/index.js +2 -2
  144. package/dist/{parsers-Dpuq-V4u.js → parsers-BSBPgvsq.js} +4 -4
  145. package/dist/{parsers-Dpuq-V4u.js.map → parsers-BSBPgvsq.js.map} +1 -1
  146. package/dist/{parsers-DXtpsDyj.cjs → parsers-OqDeffqc.cjs} +4 -4
  147. package/dist/{parsers-DXtpsDyj.cjs.map → parsers-OqDeffqc.cjs.map} +1 -1
  148. package/dist/{parsing-B43x1sxn.js → parsing-Cao8b358.js} +3 -3
  149. package/dist/{parsing-B43x1sxn.js.map → parsing-Cao8b358.js.map} +1 -1
  150. package/dist/{parsing-lRoxn1Nz.cjs → parsing-DOGSCH6N.cjs} +3 -3
  151. package/dist/{parsing-lRoxn1Nz.cjs.map → parsing-DOGSCH6N.cjs.map} +1 -1
  152. package/dist/predicates/index.cjs +15 -15
  153. package/dist/predicates/index.d.cts +3 -3
  154. package/dist/predicates/index.d.ts +3 -3
  155. package/dist/predicates/index.js +15 -15
  156. package/dist/{predicates-gNepszvo.js → predicates-Bj6meyXV.js} +13 -14
  157. package/dist/{predicates-gNepszvo.js.map → predicates-Bj6meyXV.js.map} +1 -1
  158. package/dist/{predicates-DiaYA7Ps.cjs → predicates-D0ubqgqy.cjs} +13 -14
  159. package/dist/{predicates-DiaYA7Ps.cjs.map → predicates-D0ubqgqy.cjs.map} +1 -1
  160. package/dist/promises/index.cjs +4 -4
  161. package/dist/promises/index.d.cts +101 -101
  162. package/dist/promises/index.d.ts +101 -101
  163. package/dist/promises/index.js +4 -4
  164. package/dist/{punyCode-hmiFzLWT.js → punyCode-8SrbMWfM.js} +6 -6
  165. package/dist/punyCode-8SrbMWfM.js.map +1 -0
  166. package/dist/{punyCode-CTWXVVFo.cjs → punyCode-D-Qu6nj6.cjs} +6 -6
  167. package/dist/punyCode-D-Qu6nj6.cjs.map +1 -0
  168. package/dist/{removeSpaces-BE8lfh-4.js → removeSpaces-Bmc5DX4F.js} +3 -3
  169. package/dist/removeSpaces-Bmc5DX4F.js.map +1 -0
  170. package/dist/{removeSpaces-DRRxNWlb.cjs → removeSpaces-CWIvhZHg.cjs} +3 -3
  171. package/dist/removeSpaces-CWIvhZHg.cjs.map +1 -0
  172. package/dist/rzl-utils.global.js +21 -0
  173. package/dist/{safeJsonParse-CXruaP0p.js → safeJsonParse-BP38mwlj.js} +9 -9
  174. package/dist/safeJsonParse-BP38mwlj.js.map +1 -0
  175. package/dist/{safeJsonParse-BBnQElk8.cjs → safeJsonParse-Sms2CJf4.cjs} +9 -9
  176. package/dist/safeJsonParse-Sms2CJf4.cjs.map +1 -0
  177. package/dist/{safeStableStringify-Cc62pfRp.cjs → safeStableStringify-CJtP89qn.cjs} +4 -4
  178. package/dist/{safeStableStringify-Cc62pfRp.cjs.map → safeStableStringify-CJtP89qn.cjs.map} +1 -1
  179. package/dist/{safeStableStringify-BNh3D0K0.js → safeStableStringify-CXOZ9Ub8.js} +4 -4
  180. package/dist/{safeStableStringify-BNh3D0K0.js.map → safeStableStringify-CXOZ9Ub8.js.map} +1 -1
  181. package/dist/strings/index.cjs +12 -9
  182. package/dist/strings/index.cjs.map +1 -1
  183. package/dist/strings/index.d.cts +2 -2
  184. package/dist/strings/index.d.ts +2 -2
  185. package/dist/strings/index.js +12 -9
  186. package/dist/strings/index.js.map +1 -1
  187. package/dist/tailwind/index.cjs +2 -2
  188. package/dist/tailwind/index.d.cts +2 -2
  189. package/dist/tailwind/index.d.ts +2 -2
  190. package/dist/tailwind/index.js +2 -2
  191. package/dist/{tailwind-IJvOdkZp.js → tailwind-B2ssevxq.js} +5 -5
  192. package/dist/tailwind-B2ssevxq.js.map +1 -0
  193. package/dist/{tailwind-DJ4cmLUw.cjs → tailwind-CHIx9uxu.cjs} +5 -5
  194. package/dist/tailwind-CHIx9uxu.cjs.map +1 -0
  195. package/dist/{toStringArrayUnRecursive-xUaU8Ot9.cjs → toStringArrayUnRecursive-C4zYCja7.cjs} +6 -6
  196. package/dist/{toStringArrayUnRecursive-xUaU8Ot9.cjs.map → toStringArrayUnRecursive-C4zYCja7.cjs.map} +1 -1
  197. package/dist/{toStringArrayUnRecursive-CFs0jTEg.js → toStringArrayUnRecursive-DJGtPsFb.js} +6 -6
  198. package/dist/{toStringArrayUnRecursive-CFs0jTEg.js.map → toStringArrayUnRecursive-DJGtPsFb.js.map} +1 -1
  199. package/dist/urls/index.cjs +15 -14
  200. package/dist/urls/index.cjs.map +1 -1
  201. package/dist/urls/index.d.cts +656 -659
  202. package/dist/urls/index.d.ts +656 -659
  203. package/dist/urls/index.js +15 -14
  204. package/dist/urls/index.js.map +1 -1
  205. package/package.json +2 -2
  206. package/dist/assertIsBoolean-BlBct0Fc.js.map +0 -1
  207. package/dist/assertIsBoolean-DozdtbNi.cjs.map +0 -1
  208. package/dist/conversions-CBs8-REq.cjs.map +0 -1
  209. package/dist/conversions-EMJa3g-D.js.map +0 -1
  210. package/dist/formatEnvPort-DpIXzPAZ.js.map +0 -1
  211. package/dist/formatEnvPort-hHNvOim-.cjs.map +0 -1
  212. package/dist/formatters-QcZO_Cpx.js.map +0 -1
  213. package/dist/formatters-lAYgA11L.cjs.map +0 -1
  214. package/dist/index-26W7ItWx.d.ts +0 -760
  215. package/dist/index-BPPQjAfs.d.cts +0 -2359
  216. package/dist/index-BXjlgBLz.d.cts +0 -2139
  217. package/dist/index-B_Wwo91H.d.ts +0 -2359
  218. package/dist/index-CpufydcI.d.cts +0 -704
  219. package/dist/index-Czc4O526.d.ts +0 -333
  220. package/dist/index-DPs1_p5G.d.cts +0 -760
  221. package/dist/index-DRpOyBSC.d.ts +0 -1703
  222. package/dist/index-DWWvtHUn.d.cts +0 -822
  223. package/dist/index-DnM0LD0n.d.cts +0 -333
  224. package/dist/index-GUZ9fK6T.d.ts +0 -2139
  225. package/dist/index-I4fAzwXV.d.ts +0 -704
  226. package/dist/index-JDrOl_19.d.ts +0 -822
  227. package/dist/index-b66P49Qe.d.cts +0 -1703
  228. package/dist/isPlainObject-DcFGh3_5.d.ts +0 -530
  229. package/dist/isPlainObject-doTI11Ib.d.cts +0 -530
  230. package/dist/isValidDomain-BSXshgkC.cjs.map +0 -1
  231. package/dist/isValidDomain-DwA2EN79.js.map +0 -1
  232. package/dist/punyCode-CTWXVVFo.cjs.map +0 -1
  233. package/dist/punyCode-hmiFzLWT.js.map +0 -1
  234. package/dist/removeSpaces-BE8lfh-4.js.map +0 -1
  235. package/dist/removeSpaces-DRRxNWlb.cjs.map +0 -1
  236. package/dist/safeJsonParse-BBnQElk8.cjs.map +0 -1
  237. package/dist/safeJsonParse-CXruaP0p.js.map +0 -1
  238. package/dist/tailwind-DJ4cmLUw.cjs.map +0 -1
  239. package/dist/tailwind-IJvOdkZp.js.map +0 -1
@@ -0,0 +1,2361 @@
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
+
11
+ import { i as ArrayFallback, r as IsHasKeysObject, t as IsPlainObjectResult } from "./isPlainObject-BF-2-phb.cjs";
12
+ import { AnObjectNonArray, AnyFunction, AnyString, CharAt, Extends, IsAny, IsArray, IsEmptyString, IsNever, IsPositive, IsStringLiteral, NumberRangeUnion, OrArr, ParseNumber, Prettify, Trim, TypedArray } from "@rzl-zone/ts-types-plus";
13
+ /** ----------------------------------------------------------
14
+ * * ***Predicate: `areArraysEqual`.***
15
+ * ----------------------------------------------------------
16
+ * **Compares two arrays deeply to check if they are equal.**
17
+ * @description Supports deep comparison of arrays containing nested arrays or objects,
18
+ * can also ignore the order of elements at all levels by recursively sorting.
19
+ * @param {unknown[]} array1
20
+ * ***The first array to compare, can contain nested arrays or objects.***
21
+ * @param {unknown[]} array2
22
+ * ***The second array to compare against, should match structure of `array1`.***
23
+ * @param {boolean|undefined} [ignoreOrder=false]
24
+ * ***Whether to ignore the order of elements when comparing.***
25
+ * - If `true`, will sort both arrays recursively before comparing, default is `false`.
26
+ * @returns {boolean}
27
+ * Returns `true` if both arrays are deeply equal, otherwise `false`.
28
+ * @throws **{@link TypeError | `TypeError`}** if `array1` or `array2` are not arrays, or if `ignoreOrder` is not a boolean.
29
+ * @example
30
+ * ```ts
31
+ * areArraysEqual([1, 2, 3], [1, 2, 3]);
32
+ * // ➔ true
33
+ * areArraysEqual([1, 2, 3], [3, 2, 1]);
34
+ * // ➔ false
35
+ * areArraysEqual([1, 2, 3], [3, 2, 1], true);
36
+ * // ➔ true (order ignored)
37
+ * areArraysEqual([{ x: 1 }, { y: 2 }], [{ y: 2 }, { x: 1 }], true);
38
+ * // ➔ true
39
+ * ```
40
+ */
41
+ declare const areArraysEqual: (array1: unknown[], array2: unknown[], ignoreOrder?: boolean) => boolean;
42
+ /** ---------------------------------
43
+ * * ***Predicate: `areObjectsEqual`.***
44
+ * ---------------------------------
45
+ * **Compares two objects for deep equality.**
46
+ * @template T1 The type of the first object.
47
+ * @template T2 The type of the second object.
48
+ * @param {*} object1 - The first object to compare.
49
+ * @param {*} object2 - The second object to compare.
50
+ * @returns {boolean} Return `true` if both objects are deeply equal, otherwise `false`.
51
+ * @example
52
+ * areObjectsEqual({ a: 1, b: 2 }, { a: 1, b: 2 });
53
+ * // ➔ true
54
+ * areObjectsEqual({ a: 1 }, { a: 1, b: undefined });
55
+ * // ➔ false
56
+ * areObjectsEqual([1, 2, 3], [1, 2, 3]);
57
+ * // ➔ true
58
+ */
59
+ declare const areObjectsEqual: (object1: unknown, object2: unknown) => boolean;
60
+ /** ---------------------------------
61
+ * * ***Predicate: `areURLsEqualPath`.***
62
+ * ---------------------------------
63
+ * **Checks if two URLs are the same, ignoring query parameters, this function compares only the protocol, host, and pathname.**
64
+ * @param {URL} urlA - The first URL to compare.
65
+ * @param {URL} urlB - The second URL to compare.
66
+ * @returns {boolean} Returns `true` if both URLs are the same (ignoring search parameters), otherwise `false`.
67
+ * @example
68
+ * // Same domain, same path, different query -> true
69
+ * areURLsEqualPath(
70
+ * new URL("https://example.com/page?a=1"),
71
+ * new URL("https://example.com/page?b=2")
72
+ * );
73
+ * // ➔ true
74
+ *
75
+ * // Same domain, different path -> false
76
+ * areURLsEqualPath(
77
+ * new URL("https://example.com/page1"),
78
+ * new URL("https://example.com/page2")
79
+ * );
80
+ * // ➔ false
81
+ *
82
+ * // Different protocol -> false
83
+ * areURLsEqualPath(
84
+ * new URL("http://example.com/page"),
85
+ * new URL("https://example.com/page")
86
+ * );
87
+ * // ➔ false
88
+ *
89
+ * // Same protocol, same host, same path (ignores query & hash) -> true
90
+ * areURLsEqualPath(
91
+ * new URL("https://example.com/page#section"),
92
+ * new URL("https://example.com/page")
93
+ * );
94
+ * // ➔ true
95
+ */
96
+ declare const areURLsEqualPath: (urlA: URL, urlB: URL) => boolean;
97
+ /** ---------------------------------
98
+ * * ***Predicate: `areURLsIdentical`.***
99
+ * ---------------------------------
100
+ * **Checks if two URLs are exactly the same, including protocol, host, pathname, and query parameters.**
101
+ * @param {URL} urlA - The first URL to compare.
102
+ * @param {URL} urlB - The second URL to compare.
103
+ * @returns {boolean} Returns `true` if both URLs are identical, otherwise `false`.
104
+ * @example
105
+ * // Identical URLs -> true
106
+ * areURLsIdentical(
107
+ * new URL("https://example.com/page?a=1"),
108
+ * new URL("https://example.com/page?a=1")
109
+ * );
110
+ * // ➔ true
111
+ *
112
+ * // Same path, different query parameter -> false
113
+ * areURLsIdentical(
114
+ * new URL("https://example.com/page?a=1"),
115
+ * new URL("https://example.com/page?b=2")
116
+ * );
117
+ * // ➔ false
118
+ *
119
+ * // Same host & query, but different protocol -> false
120
+ * areURLsIdentical(
121
+ * new URL("http://example.com/page?a=1"),
122
+ * new URL("https://example.com/page?a=1")
123
+ * );
124
+ * // ➔ false
125
+ *
126
+ * // Same everything except trailing slash -> false
127
+ * areURLsIdentical(
128
+ * new URL("https://example.com/page"),
129
+ * new URL("https://example.com/page/")
130
+ * );
131
+ * // ➔ false
132
+ */
133
+ declare const areURLsIdentical: (urlA: URL, urlB: URL) => boolean;
134
+ type OptionsTextContainsAll = {
135
+ /** If `true`, matches whole words only, defaultValue is `false`.
136
+ *
137
+ * @default false
138
+ */
139
+ exactMatch?: boolean;
140
+ /** Optional regex flags (default: `"i"` for case-insensitive).
141
+ *
142
+ * @default "i"
143
+ */
144
+ flags?: string;
145
+ };
146
+ /** ----------------------------------------------------------
147
+ * * ***Predicate: `textContainsAll`.***
148
+ * ----------------------------------------------------------
149
+ * **Checks if the given `text` contains all of the specified `searchWords`.**
150
+ * - **Behavior:**
151
+ * - Returns `false` if `text` or `searchWords` is `null`/`undefined`/invalid.
152
+ * - Uses **regular expressions** for flexible pattern matching.
153
+ * - **Escapes special characters** to prevent regex injection attacks.
154
+ * - **Trims input** to avoid false positives with empty spaces.
155
+ * - **Supports exact word matching** (optional).
156
+ * @param {string|null|undefined} text - The string text to search within.
157
+ * @param {string[]|null} [searchWords] - An array of words/phrases to match against the text.
158
+ * @param {OptionsTextContainsAll} [options] - Optional configuration object.
159
+ * @param {OptionsTextContainsAll["exactMatch"]} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.
160
+ * @param {OptionsTextContainsAll["flags"]} [options.flags="i"] - Optional regex flags (default: `"i"` for case-insensitive).
161
+ * @returns {boolean} Return `true` if all `searchWords` are found in `text`, otherwise `false`.
162
+ * @example
163
+ * textContainsAll("Hello world, WithAI APP", ["Hello", "world"]);
164
+ * // ➔ true
165
+ * textContainsAll("JavaScript and TypeScript", ["Java", "Script"]);
166
+ * // ➔ true
167
+ * textContainsAll("Machine Learning", ["AI", "Learning"]);
168
+ * // ➔ false
169
+ * textContainsAll("open-source", ["open"], { exactMatch: true });
170
+ * // ➔ false (because options `exactMatch=true`)
171
+ * textContainsAll(null, ["test"]);
172
+ * // ➔ false (invalid text)
173
+ * textContainsAll("Hello", null);
174
+ * // ➔ false (invalid searchWords)
175
+ */
176
+ declare const textContainsAll: <T extends string>(text?: T | null, searchWords?: T[] | string[] | null, options?: OptionsTextContainsAll) => boolean;
177
+ type OptionsTextContainsAny = {
178
+ /** If `true`, matches whole words only, defaultValue is `false`.
179
+ *
180
+ * @default false
181
+ */
182
+ exactMatch?: boolean;
183
+ /** Optional regex flags (default: `"i"` for case-insensitive).
184
+ *
185
+ * @default "i"
186
+ */
187
+ flags?: string;
188
+ };
189
+ /** ----------------------------------------------------------
190
+ * * ***Predicate: `textContainsAny`.***
191
+ * ----------------------------------------------------------
192
+ * **Checks if the given `text` contains at least one of the specified `searchWords`.**
193
+ * - **Behavior:**
194
+ * - Returns `false` if `text` or `searchWords` is `null`/`undefined`/invalid.
195
+ * - Uses **regular expressions** for flexible pattern matching.
196
+ * - **Escapes special characters** to prevent regex injection attacks.
197
+ * - **Trims input** to avoid false positives with empty spaces.
198
+ * - **Supports exact word matching** (optional).
199
+ * @param {string|null|undefined} text - The string text to search within.
200
+ * @param {string[]|null} [searchWords] - An array of words/phrases to match against the text.
201
+ * @param {OptionsTextContainsAny} [options] - Optional configuration object.
202
+ * @param {OptionsTextContainsAny["exactMatch"]} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.
203
+ * @param {OptionsTextContainsAny["flags"]} [options.flags="i"] - Optional regex flags (default: `"i"` for case-insensitive).
204
+ * @returns {boolean} Return `true` if at least one `searchWord` is found in `text`, otherwise `false`.
205
+ * @example
206
+ * textContainsAny("Hello world", ["hello", "test"]);
207
+ * // ➔ true
208
+ * textContainsAny("withAI APP", ["chat", "ai"]);
209
+ * // ➔ false
210
+ * textContainsAny("TypeScript is great!", ["script", "java"]);
211
+ * // ➔ true
212
+ * textContainsAny("open-source", ["open"], { exactMatch: true });
213
+ * // ➔ false (because options `exactMatch=true`)
214
+ * textContainsAny(null, ["test"]);
215
+ * // ➔ false (invalid text)
216
+ * textContainsAny("Hello", null);
217
+ * // ➔ false (invalid searchWords)
218
+ */
219
+ declare const textContainsAny: <T extends string>(text?: T | null, searchWords?: T[] | string[] | null, options?: OptionsTextContainsAny) => boolean;
220
+ /** ----------------------------------------------------------
221
+ * * ***Predicate: `doesKeyExist`.***
222
+ * ----------------------------------------------------------
223
+ * **Recursively checks if a given key exists in an object or array.**
224
+ * - **Behavior:**
225
+ * - **Supports deeply nested objects and arrays**, searching recursively.
226
+ * - Uses `Object.prototype.hasOwnProperty.call()` to safely check if the
227
+ * key exists at each level, even if its value is `null` or `undefined`.
228
+ * - Optimized to return `true` immediately when the key is found (short-circuits).
229
+ * - Handles edge cases gracefully:
230
+ * - Returns `false` for `null`, `undefined`, or non-object inputs.
231
+ * - Returns `false` if key is not found anywhere, even in deeply nested
232
+ * structures.
233
+ * - **ℹ️ Note:**
234
+ * - This function only checks for **the existence of the key itself**,
235
+ * not whether its value is non-null or non-undefined.
236
+ * - If you need to check for both existence and meaningful value, write a stricter function.
237
+ * @template T - The type of the input object or array.
238
+ * @param {T | Record<string, unknown> | unknown[]} object - The object or array to search.
239
+ * @param {PropertyKey} key - The key to look for (string, number, or symbol).
240
+ * @returns {boolean} Returns `true` if the key exists anywhere in the object or array (even with `null` / `undefined` value), otherwise `false`.
241
+ * @example
242
+ * doesKeyExist({ name: "John", age: 30 }, "age");
243
+ * // ➔ true
244
+ * doesKeyExist({ user: { profile: { email: "test@example.com" } } }, "email");
245
+ * // ➔ true
246
+ * doesKeyExist([{ id: 1 }, { id: 2 }], "id");
247
+ * // ➔ true
248
+ * doesKeyExist({ a: { b: { c: 10 } } }, "d");
249
+ * // ➔ false
250
+ * doesKeyExist(null, "name");
251
+ * // ➔ false
252
+ * doesKeyExist(undefined, "test");
253
+ * // ➔ false
254
+ *
255
+ * // Key exists even if value is null or undefined:
256
+ * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "a"); // ➔ true
257
+ * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "b"); // ➔ true
258
+ * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "d"); // ➔ true
259
+ *
260
+ * doesKeyExist({ a: 1 }, true);
261
+ * // ➔ ❌ Throws TypeError
262
+ * doesKeyExist({ a: 1 }, ["not", "valid"]);
263
+ * // ➔ ❌ Throws TypeError
264
+ */
265
+ declare const doesKeyExist: (object: Record<string, unknown> | unknown[], key: PropertyKey) => boolean;
266
+ /** ----------------------------------------------------------
267
+ * * ***Predicate: `arrayHasAnyMatch`.***
268
+ * ----------------------------------------------------------
269
+ * **Checks if at least one element from `targetArray` exists in `sourceArray`.**
270
+ * - **Behavior:**
271
+ * - Uses `Set` for **faster lookup** compared to `Array.prototype.includes()`.
272
+ * - Supports **any data type** (`number`, `string`, `boolean`, `object`, `array`, `function`, etc.).
273
+ * - Uses **reference equality** for non-primitive values (object, array, function).
274
+ * - Returns `false` if either array is missing, empty, or not an array.
275
+ * @template T - The expected type of array elements.
276
+ * @param {T[] | null | undefined} sourceArray - The array to search within.
277
+ * @param {T[] | null | undefined} targetArray - The array containing elements to match.
278
+ * @returns {boolean}
279
+ * ***Return:***
280
+ * - `true` if **at least one element from `targetArray` is strictly found
281
+ * in `sourceArray`**.
282
+ * - Comparison uses:
283
+ * - **Value equality** for primitives (`number`, `string`, `boolean`, `null`, `undefined`).
284
+ * - **Reference equality** for `objects`, `arrays`, and `functions`.
285
+ * - `false` if:
286
+ * - No matching elements exist,
287
+ * - Either array is not provided, not an actual array, or is empty.
288
+ * @example
289
+ * arrayHasAnyMatch(["apple", "banana", "cherry"], ["banana", "grape"]);
290
+ * // ➔ true
291
+ * arrayHasAnyMatch(["red", "blue"], ["green", "yellow"]);
292
+ * // ➔ false
293
+ * arrayHasAnyMatch([1, 2, 3], [3, 4, 5]);
294
+ * // ➔ true
295
+ * arrayHasAnyMatch([], ["test"]);
296
+ * // ➔ false
297
+ * arrayHasAnyMatch(["A", "B", "C"], []);
298
+ * // ➔ false
299
+ *
300
+ * const obj = { x: 1 };
301
+ * arrayHasAnyMatch([obj], [obj]);
302
+ * // ➔ true (same reference)
303
+ * arrayHasAnyMatch([{ x: 1 }], [{ x: 1 }]);
304
+ * // ➔ false (different reference)
305
+ *
306
+ * const fn = () => "hello";
307
+ * arrayHasAnyMatch([fn], [fn]);
308
+ * // ➔ true
309
+ * arrayHasAnyMatch([() => "hello"], [() => "hello"]);
310
+ * // ➔ false (different function reference)
311
+ *
312
+ * const arr = [1, 2];
313
+ * arrayHasAnyMatch([arr], [arr]);
314
+ * // ➔ true
315
+ * arrayHasAnyMatch([[1, 2]], [[1, 2]]);
316
+ * // ➔ false (different array object)
317
+ */
318
+ declare const arrayHasAnyMatch: <T>(sourceArray: T[] | null | undefined, targetArray: T[] | null | undefined) => boolean;
319
+ /**
320
+ * Restrict array indices to a fixed numeric range (1–25).
321
+ */
322
+ type ArrayIndex = NumberRangeUnion<1, 25>;
323
+ /**
324
+ * Remove `undefined` from a type.
325
+ */
326
+ type NonUndef<T> = T extends undefined ? never : T;
327
+ /**
328
+ * Remove `null` from a type.
329
+ */
330
+ type NonNull<T> = T extends null ? never : T;
331
+ /**
332
+ * Convert optional boolean for "discard undefined" to actual boolean.
333
+ */
334
+ type EffectiveDiscardUndefined<O extends boolean | undefined> = O extends boolean ? O : true;
335
+ /**
336
+ * Convert optional boolean for "discard null" to actual boolean.
337
+ */
338
+ type EffectiveDiscardNull<O extends boolean | undefined> = O extends boolean ? O : false;
339
+ /**
340
+ * Unwrap array type.
341
+ */
342
+ type UnwrapArray<T> = T extends (infer U)[] ? U : T extends readonly (infer U)[] ? U : T;
343
+ /**
344
+ * Force symbol key to be deep required.
345
+ */
346
+ type IsOptionalKey<T, K extends keyof T> = Record<never, never> extends Pick<T, K> ? true : false;
347
+ /** * ***Returns numeric keys of an object.***
348
+ *
349
+ * @private ***types for {@link hasOwnProp}.***
350
+ */
351
+ type NumericKeyOfHasOwnProp<Obj> = Extract<keyof Obj, number>;
352
+ /** * ***Generate all nested keys of an object or array in dot/bracket notation.***
353
+ *
354
+ * @private ***types for {@link hasOwnProp}.***
355
+ *
356
+ * Example:
357
+ * ```ts
358
+ * type Keys = NestedKeyOfHasOwnProp<{ users: { name: string }[] }>
359
+ * // Keys = "users" | "users.[number]" | "users.[number].name"
360
+ * ```
361
+ */
362
+ type NestedKeyOfHasOwnProp<T> = T extends readonly (infer U)[] ? `[${number}]` | `[${number}].${NestedKeyOfHasOwnProp<U>}` : T extends object ? { [K in keyof T & (string | number)]: K extends string | number ? NonNullable<T[K]> extends readonly unknown[] ? `${K}` | `${K}.[${ArrayIndex}]` | `${K}.[${ArrayIndex}].${NestedKeyOfHasOwnProp<UnwrapArray<T[K]>>}` : NonNullable<T[K]> extends object ? `${K}` | `${K}.${NestedKeyOfHasOwnProp<NonNullable<T[K]>>}` : `${K}` : never }[keyof T & (string | number)] : never;
363
+ /** Apply discard rules to the last key of a path.
364
+ *
365
+ * Rules:
366
+ * - If discardUndefined=true -> remove `undefined` from value
367
+ * - If discardNull=true -> remove `null` from value
368
+ *
369
+ * Order: first strip undefined (if requested), then strip null (if requested)
370
+ */
371
+ type ApplyLastRulesHasOwnProp<V, DiscardU extends boolean, DiscardN extends boolean> = DiscardU extends true ? DiscardN extends true ? NonNull<NonUndef<V>> : NonUndef<V> : DiscardN extends true ? NonNull<V> : V | Extract<V, undefined>;
372
+ /**
373
+ * Force an array index N to type U.
374
+ */
375
+ type RefineArrayAtIndex<T extends readonly unknown[], N extends number, U> = T & { [K in N]: U };
376
+ /** Narrow object/array type based on a path string.
377
+ *
378
+ * @template T - object type to narrow
379
+ * @template P - path string like "user.addresses.[2].zip"
380
+ * @template DU - discard undefined
381
+ * @template DN - discard null
382
+ */
383
+ type NarrowByPathHasOwnProp<T, P extends string, DU extends boolean = true, DN extends boolean = false> = P extends `${infer Head}.${infer Rest}` ? Head extends `[${infer N extends number}]` ? T extends readonly (infer U)[] ? RefineArrayAtIndex<T, N, NarrowByPathHasOwnProp<U, Rest, DU, DN>> : T : Head extends keyof T ? Rest extends `[${infer M extends number}]${infer R}` ? M extends R ? { [K in keyof T]-?: NarrowByPathHasOwnProp<EffectiveDiscardUndefined<DU> extends true ? NonUndef<T[K]> : EffectiveDiscardNull<DN> extends true ? NonNull<T[K]> : T[K], Rest, DU, DN> } : EffectiveDiscardUndefined<DU> extends true ? { [K in keyof T]-?: K extends Head ? Exclude<NarrowByPathHasOwnProp<EffectiveDiscardNull<DN> extends true ? Exclude<T[K], null> : EffectiveDiscardUndefined<DU> extends true ? Exclude<T[K], undefined> : T[K], Rest, DU, DN>, undefined> : EffectiveDiscardNull<DN> extends true ? Exclude<T[K], null> : EffectiveDiscardUndefined<DU> extends true ? Exclude<T[K], undefined> : T[K] } : { [K in keyof T]: K extends Head ? NarrowByPathHasOwnProp<EffectiveDiscardNull<DN> extends true ? Exclude<T[K], null> : EffectiveDiscardUndefined<DU> extends true ? Exclude<T[K], undefined> : T[K], Rest, DU, DN> : EffectiveDiscardNull<DN> extends true ? Exclude<T[K], null> : EffectiveDiscardUndefined<DU> extends true ? Exclude<T[K], undefined> : T[K] } : { [K in keyof T]: K extends Head ? NarrowByPathHasOwnProp<NonNullable<T[K]>, Rest, DU, DN> : T[K] } & { [K in Head]-?: NarrowByPathHasOwnProp<NonNullable<T[K]>, Rest, DU, DN> } : T : P extends `[${infer N extends number}]` ? T extends readonly (infer U)[] ? RefineArrayAtIndex<T, N, ApplyLastRulesHasOwnProp<NonNullable<U>, DU, DN>> : T : P extends keyof T ? DU extends true ? { [K in keyof T]: K extends P ? ApplyLastRulesHasOwnProp<T[K], DU, DN> : T[K] } & { [K in P]-?: ApplyLastRulesHasOwnProp<T[P], DU, DN> } : { [K in keyof T]: K extends P ? ApplyLastRulesHasOwnProp<T[K], DU, DN> : T[K] } : T;
384
+ /** * ***Expand an array/string/function into a nested type according
385
+ * to a dot/bracket path.***
386
+ *
387
+ * @private ***types for {@link hasOwnProp}.***
388
+ */
389
+ type SmartDetectStringHasOwnProp<Obj extends string | undefined | null, Key extends string | number> = Obj extends undefined ? undefined : Obj extends null ? null : IsPositive<ParseNumber<Key>> extends true ? Extends<IsStringLiteral<Obj>, true> extends true ? CharAt<Exclude<Obj, null | undefined>, ParseNumber<Key>> : string | undefined | null : IsPositive<ParseNumber<Key>> extends true ? string | undefined | null : AnyString | undefined | null;
390
+ /**
391
+ * ***types for {@link hasOwnProp}.***
392
+ */
393
+ type SmartDetectArrayFuncHasOwnProp<Obj extends unknown[] | AnyFunction, Key extends PropertyKey> = Prettify<Obj & DotToNestedSpecialSmartDetect<Key> & {
394
+ length: number;
395
+ }, {
396
+ recursive: false;
397
+ }>;
398
+ /** * ***Smartly detect nested path keys of an unknown object or function,
399
+ * falls-back to inferred nested structure when path is not valid.***
400
+ *
401
+ * @private ***types for {@link hasOwnProp}.***
402
+ */
403
+ type SmartDetectUnknownKeyHasOwnProp<Obj extends unknown | AnyFunction, Key extends PropertyKey, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false> = Trim<Key> extends "" ? Obj : Prettify<Obj & (Key extends NestedKeyOfHasOwnProp<Obj> ? GuardedHasOwnProp<Obj, Key, DiscardUndefined, DiscardNull> : DotToNestedSpecialSmartDetect<Key>), {
404
+ recursive: true;
405
+ }>;
406
+ /**
407
+ * Convert dot/bracket path string to nested object type with leaf value.
408
+ * Path not found in object key ➔ return unknown.
409
+ */
410
+ type DotToNestedSpecialSmartDetect<Path extends PropertyKey, Value = unknown> = IsEmptyString<Extract<Path, string>> extends true ? undefined : Path extends `${infer Head}.${infer Rest}` ? Head extends `[${number}]` ? DotToNestedSpecialSmartDetect<Rest, Value>[] : { [Key in Head]: DotToNestedSpecialSmartDetect<Rest, Value> } : Path extends `[${number}]` ? Value[] : { [Key in Path]: Value };
411
+ /** * ***Guarded wrapper for `NarrowByPathHasOwnProp` with `Prettify`.***
412
+ *
413
+ * @private ***types for {@link hasOwnProp}.***
414
+ */
415
+ type GuardedHasOwnProp<Obj, Key extends NestedKeyOfHasOwnProp<Obj>, DiscardUndefined extends boolean | undefined, DiscardNull extends boolean | undefined> = Prettify<Obj & NarrowByPathHasOwnProp<Obj, Key & string, EffectiveDiscardUndefined<DiscardUndefined>, EffectiveDiscardNull<DiscardNull>>, {
416
+ recursive: true;
417
+ }>;
418
+ /** * ***Make a specific symbol key deeply required in an object symbols.***
419
+ * **Used internally to enforce stronger type narrowing.**
420
+ *
421
+ * @private ***types for {@link hasOwnProp}.***
422
+ */
423
+ type DeepRequiredSymbolHasOwnProp<Obj, Sym extends symbol, DU extends boolean = true, DN extends boolean = false> = Prettify<Obj & ({ [K in keyof Obj & Sym as DU extends true ? K : never]-?: DN extends true ? NonNull<NonUndef<Obj[K]>> : NonUndef<Obj[K]> } & { [K in keyof Obj & Sym as DU extends true ? never : K]?: DN extends true ? NonNull<Obj[K]> : Obj[K] }), {
424
+ recursive: true;
425
+ }>;
426
+ /** * ***Apply discard rules to numeric keys in an object type.***
427
+ *
428
+ * - If `discardUndefined = true` ➔ undefined removed, key required
429
+ * - If `discardNull = true` ➔ null removed
430
+ *
431
+ * @private ***types for {@link hasOwnProp}.***
432
+ */
433
+ type NumericKeyHasOwnPropMapped<Obj extends object, K extends NumericKeyOfHasOwnProp<Obj>, DU extends boolean, DN extends boolean> = Prettify<Obj & (IsOptionalKey<Obj, K> extends true ? { [P in K]?: DN extends true ? NonNull<Obj[K]> : Obj[K] } & (DU extends true ? { [P in K]-?: NonUndef<Obj[K]> } : Record<never, never>) : { [P in K]-?: DN extends true ? NonNull<Obj[K]> : Obj[K] } & (DU extends true ? { [P in K]-?: NonUndef<Obj[K]> } : Record<never, never>)), {
434
+ recursive: true;
435
+ }>;
436
+ /** * ***Options to control `hasOwnProp` behavior.***
437
+ *
438
+ * @private ***types options for {@link hasOwnProp}.***
439
+ */
440
+ type HasOwnPropOptions<DiscardUndefined extends boolean = true, DiscardNull extends boolean = false> = {
441
+ /** If `true` ***(default)***, properties with `undefined` values are treated as non-existent.
442
+ *
443
+ * - **Effects:**
444
+ * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `undefined`.
445
+ * - **TypeScript narrowing:** The property's type is narrowed to exclude `undefined`.
446
+ * - **Example:**
447
+ * ```ts
448
+ * const obj = { a: undefined, b: 123 };
449
+ * hasOwnProp(obj, "a"); // ➔ false
450
+ * hasOwnProp(obj, "a", { discardUndefined: false }); // ➔ true
451
+ * ```
452
+ */
453
+ discardUndefined?: DiscardUndefined;
454
+ /** If `true` ***(default: `false`)***, properties with `null` values are treated as non-existent.
455
+ *
456
+ * - **Effects:**
457
+ * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `null`.
458
+ * - **TypeScript narrowing:** The property's type is narrowed to exclude `null`.
459
+ * - **Example:**
460
+ * ```ts
461
+ * const obj = { a: null, b: 123 };
462
+ * hasOwnProp(obj, "a"); // ➔ true (default discardNull = false)
463
+ * hasOwnProp(obj, "a", { discardNull: true }); // ➔ false
464
+ * ```
465
+ */
466
+ discardNull?: DiscardNull;
467
+ };
468
+ /** -------------------------------------------------------
469
+ * * ***Predicate: `hasOwnProp`.***
470
+ * -------------------------------------------------------
471
+ * **A **type-safe** replacement for `Object.prototype.hasOwnProperty` with runtime validation and **TypeScript-aware type narrowing**.**
472
+ * - #### Supported Targets:
473
+ * - **Plain objects** ➔ `{ foo: "bar" }`.
474
+ * - **Arrays** ➔ `[ { id: 1 }, { id: 2 } ]`.
475
+ * - **Strings** ➔ `"hello"` (as array-like objects with `.length`, index, etc.).
476
+ * - **Functions** ➔ callable objects with extra props.
477
+ * - **Symbols** ➔ own property symbols.
478
+ * - #### Key Advantages over `in` or `obj.hasOwnProperty(key)`:
479
+ * - Supports **dot/bracket path notation** (e.g. `"user.address.city"`, `"addresses[0].zip"`).
480
+ * - Handles **symbol** keys safely.
481
+ * - **Narrows** the type of `obj` in TypeScript (stronger type safety).
482
+ * - Configurable handling of **`undefined`** and **`null`**.
483
+ * - #### Runtime Behavior:
484
+ * - ***✅ Returns `true` if:***
485
+ * - Value `obj` is an object/array/string/function **and** the property
486
+ * exists **and**, it passes the `options` checks.
487
+ * - ***❌ Returns `false` if:***
488
+ * - Value `obj` is not a valid type.
489
+ * - The property does not exist.
490
+ * - The value is `undefined` and `discardUndefined: true` (**default**).
491
+ * - The value is `null` and `discardNull: true`.
492
+ * - The `key` (after trimming) is an **empty string** ➔ treated as **invalid**.
493
+ * - #### TypeScript Behavior:
494
+ * - ***Inside an `if (hasOwnProp(...)) {}` block:***
495
+ * - The property is **guaranteed to exist**.
496
+ * - Depending on `options`, the property type is narrowed to exclude
497
+ * `undefined` and/or `null`.
498
+ * - #### ⚠️ Caveats:
499
+ * - ***Empty keys are invalid:***
500
+ * - If the `key` string is empty (`""`) after trimming whitespace or other characters,
501
+ * it will **not** be considered a valid property and always returns `false`.
502
+ * - ***Arrays are limited by TypeScript inference:***
503
+ * - Checking index `[0]` only narrows **that specific index**, not the rest, example:
504
+ * 1. `hasOwnProp(users, "[0].id")` does **not** imply `users[1].id` exists.
505
+ * - 👉 For different indices, use **optional chaining** (`users[1]?.id`).
506
+ * - ***Autocomplete limitation for array indices:***
507
+ * - Autocompletion for `[index]` is only supported up to **25** (`[0]` ➔ `[24]`).
508
+ * - This limit is intentional for **performance and safety:**
509
+ * 1. Generating infinite union types for all possible indices would cause
510
+ * **TypeScript IntelliSense to hang or crash**.
511
+ * - ℹ️ You can still check higher indices manually (e.g. `"[999].id"`),
512
+ * but they will not show up in IntelliSense suggestions.
513
+ * @param {HasOwnPropOptions} [options] - ***Optional configuration object.***
514
+ * @param {HasOwnPropOptions["discardUndefined"]} [options.discardUndefined=true]
515
+ * ***If `true`, properties with `undefined` values are treated as **missing**, default: `true`.***
516
+ * @param {HasOwnPropOptions["discardNull"]} [options.discardNull=false]
517
+ * ***If `true`, properties with `null` values are treated as **missing**, default: `false`.***
518
+ * @param {*} obj ***The `object`, `array`, `string`, `function`, or `other value` to check against.***
519
+ * @param {PropertyKey} key
520
+ * ***The property key to check, can be:***
521
+ * - `string` (supports dot/bracket paths, e.g. `"user.address.city"`, `"[0].id"`).
522
+ * - `number` (array-like index).
523
+ * - `symbol` (own property symbols).
524
+ * @returns {boolean} Return `true` if the property exists (and passes `options`), otherwise `false`.
525
+ * @example
526
+ *
527
+ * - #### ✅ Objects:
528
+ * ```ts
529
+ * const obj: { name?: string | null } = {};
530
+ *
531
+ * if (hasOwnProp(obj, "name")) {
532
+ * // obj is now ➔ { name: string | null }
533
+ * console.log(obj.name); // string | null
534
+ * }
535
+ *
536
+ * if (hasOwnProp(obj, "name", { discardUndefined: true, discardNull: true })) {
537
+ * // obj is now ➔ { name: string }
538
+ * console.log(obj.name.toUpperCase()); // safe
539
+ * }
540
+ * ```
541
+ * - #### ✅ Arrays:
542
+ * ```ts
543
+ * const users = [{ id: 1 }, { id: 2 }];
544
+ *
545
+ * if (hasOwnProp(users, "[1].id")) {
546
+ * // ➔ users[1].id is guaranteed to exist
547
+ * console.log(users[1].id); // number
548
+ * }
549
+ *
550
+ * // ⚠️ Caveat: narrowing only applies to checked index
551
+ * if (hasOwnProp(users, "[0].id")) {
552
+ * console.log(users[0].id); // ✅ safe
553
+ * console.log(users[1].id); // ❌ not guaranteed!
554
+ * }
555
+ *
556
+ * // 👉 Solution: optional chaining
557
+ * console.log(users[1]?.id); // ➔ safe, even without narrowing
558
+ * ```
559
+ *
560
+ * - #### ✅ Symbols:
561
+ * ```ts
562
+ * const secret = Symbol("secret");
563
+ * const obj2 = { [secret]: 42 };
564
+ *
565
+ * if (hasOwnProp(obj2, secret)) {
566
+ * console.log(obj2[secret] + 1); // ➔ 43
567
+ * }
568
+ * ```
569
+ * - #### ✅ Strings:
570
+ * ```ts
571
+ * if (hasOwnProp("hello", "length")) {
572
+ * console.log("hello".length); // ➔ 5
573
+ * }
574
+ *
575
+ * if (hasOwnProp("hello", 1)) {
576
+ * console.log("hello"[1]); // ➔ "e"
577
+ * }
578
+ * ```
579
+ * - #### ✅ Functions:
580
+ * ```ts
581
+ * function fn() {}
582
+ * fn.extra = 123;
583
+ *
584
+ * if (hasOwnProp(fn, "extra")) {
585
+ * console.log(fn.extra); // ➔ 123
586
+ * }
587
+ * ```
588
+ * - #### ❌ Empty key:
589
+ * ```ts
590
+ * const obj = { a: 1 };
591
+ *
592
+ * hasOwnProp(obj, ""); // ➔ false (invalid key)
593
+ * hasOwnProp(obj, " "); // ➔ false (trimmed to empty)
594
+ * ```
595
+ */
596
+ declare function hasOwnProp<Obj>(obj: IsAny<Obj> extends true ? Obj : never, key: PropertyKey, options?: HasOwnPropOptions<boolean, boolean>): obj is unknown;
597
+ declare function hasOwnProp<Obj extends null | undefined>(obj: Obj, key: PropertyKey, options?: HasOwnPropOptions<boolean, boolean>): false;
598
+ declare function hasOwnProp<Obj extends object | AnyFunction, Key extends NestedKeyOfHasOwnProp<Obj>, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj | null | undefined, key: Key, options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>): obj is GuardedHasOwnProp<Obj, Key, DiscardUndefined, DiscardNull>;
599
+ declare function hasOwnProp<Obj extends object, Num extends NumericKeyOfHasOwnProp<Obj>, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj | null | undefined, key: Num, options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>): obj is NumericKeyHasOwnPropMapped<Obj, Num, DiscardUndefined, DiscardNull>;
600
+ declare function hasOwnProp<Obj extends object | AnyFunction, Sym extends symbol, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj | null | undefined, key: Sym, options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>): obj is DeepRequiredSymbolHasOwnProp<Obj, Sym, DiscardUndefined, DiscardNull>;
601
+ declare function hasOwnProp<Obj extends string | null | undefined, Key extends string | number>(obj: Obj | null | undefined, key: Key, options?: HasOwnPropOptions<boolean, boolean>): obj is IsStringLiteral<SmartDetectStringHasOwnProp<Obj, Key>> extends true ? AnyString | SmartDetectStringHasOwnProp<Obj, Key> : SmartDetectStringHasOwnProp<Obj, Key>;
602
+ declare function hasOwnProp<Obj extends unknown[] | AnyFunction, Key extends PropertyKey>(obj: Obj, key: Key, options?: HasOwnPropOptions<boolean, boolean>): obj is SmartDetectArrayFuncHasOwnProp<Obj, Key>;
603
+ declare function hasOwnProp<Obj extends unknown | AnyFunction, Key extends PropertyKey, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj, key: Key | "length" | (IsPlainObjectResult<Obj> extends never ? never : keyof Obj), options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>): obj is SmartDetectUnknownKeyHasOwnProp<Obj, Key, DiscardUndefined, DiscardNull>;
604
+ /** -------------------
605
+ * * ***Type guard: `isArguments`.***
606
+ * -------------------
607
+ * **Checks if `value` is likely an `arguments` object.**
608
+ * @param {*} value The value to check.
609
+ * @returns {boolean} Returns `true` if `value` is an ***[`IArguments`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments)*** object, else `false`.
610
+ * @example
611
+ * isArguments(function() { return arguments; }());
612
+ * // ➔ true
613
+ * isArguments([1, 2, 3]);
614
+ * // ➔ false
615
+ */
616
+ declare const isArguments: (value: unknown) => value is IArguments;
617
+ /** ----------------------------------------------------------
618
+ * * ***Type guard: `isArray`.***
619
+ * ----------------------------------------------------------
620
+ ***Checks if a value is an ***[`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)***.**
621
+ * - **Behavior:**
622
+ * - Uses ***[`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)*** for reliable and safe type checking.
623
+ * - Supports TypeScript **type narrowing** using `value is T[]`.
624
+ * - Handles edge cases like `null`, `undefined`, and non-array objects.
625
+ * @template T - The expected type of array elements.
626
+ * @param {*} value - The value to check.
627
+ * @returns {boolean} Returns `true` if the value is an `array`, otherwise `false`.
628
+ * @example
629
+ * isArray([1, 2, 3]);
630
+ * // ➔ true
631
+ * isArray([]);
632
+ * // ➔ true
633
+ * isArray("hello");
634
+ * // ➔ false
635
+ * isArray({ key: "value" });
636
+ * // ➔ false
637
+ * isArray(null);
638
+ * // ➔ false
639
+ * isArray(undefined);
640
+ * // ➔ false
641
+ */
642
+ declare function isArray(value: []): value is [];
643
+ declare function isArray<T>(value: T): value is ArrayFallback<T>;
644
+ declare function isArray(value: unknown): value is unknown[];
645
+ /** ----------------------------------------------------
646
+ * * ***Type guard: `isArrayBuffer`.***
647
+ * ----------------------------------------------------
648
+ * **Checks if `value` is classified as an `ArrayBuffer` object.**
649
+ * @param {*} value The value to check.
650
+ * @returns {boolean} Returns `true` if `value` is instance of ***[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)***, else `false`.
651
+ * @example
652
+ * isArrayBuffer(new ArrayBuffer(2));
653
+ * // ➔ true
654
+ * isArrayBuffer(new Array(2));
655
+ * // ➔ false
656
+ */
657
+ declare function isArrayBuffer(value: unknown): value is ArrayBuffer;
658
+ /** ----------------------------------------------------
659
+ * * ***Type guard: `isArrayLike`.***
660
+ * ----------------------------------------------------
661
+ * **Checks if `value` is array-like, a value is considered array-like if it's
662
+ * not a function and has a `value.length` that's an integer greater than or
663
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.**
664
+ * @template T - The type of the value being checked.
665
+ * @param {*} value The value to check.
666
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
667
+ * @example
668
+ * isArrayLike([1, 2, 3]);
669
+ * // ➔ true
670
+ * isArrayLike(document.body.children);
671
+ * // ➔ true
672
+ * isArrayLike(noop);
673
+ * // ➔ false
674
+ * isArrayLike('abc');
675
+ * // ➔ false
676
+ */
677
+ declare function isArrayLike<T extends {
678
+ __anyHack: unknown;
679
+ }>(value: T): boolean;
680
+ declare function isArrayLike(value: AnyFunction | null | undefined): value is never;
681
+ declare function isArrayLike(value: unknown): value is {
682
+ length: number;
683
+ };
684
+ /** ----------------------------------------------------
685
+ * * ***Type guard: `isArrayLikeObject`.***
686
+ * ----------------------------------------------------
687
+ * **This method is like ***`isArrayLike` utility function*** except that
688
+ * it also checks if `value` is an object.**
689
+ * @template T - The type of the value being checked.
690
+ * @param {*} value The value to check.
691
+ * @returns {boolean} Returns `true` if `value` is `array-like object`, else `false`.
692
+ * @example
693
+ * isArrayLikeObject([1, 2, 3]);
694
+ * // ➔ true
695
+ * isArrayLikeObject(document.body.children);
696
+ * // ➔ true
697
+ * isArrayLikeObject('abc');
698
+ * // ➔ false
699
+ * isArrayLikeObject(noop);
700
+ * // ➔ false
701
+ */
702
+ declare function isArrayLikeObject<T extends {
703
+ __anyHack: unknown;
704
+ }>(value: T): boolean;
705
+ declare function isArrayLikeObject(value: AnyFunction | string | boolean | number | null | undefined): value is never;
706
+ declare function isArrayLikeObject(value: unknown): value is object & {
707
+ length: number;
708
+ };
709
+ /** ----------------------------------------------------------
710
+ * * ***Type guard: `isBigInt`.***
711
+ * ----------------------------------------------------------
712
+ * **Checks if a value is of type **[`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)**.**
713
+ * - **Behavior:**
714
+ * - Uses `typeof value === "bigint"` for strict type checking.
715
+ * - Supports TypeScript type narrowing with `value is bigint`.
716
+ * - Returns `false` for `BigInt` object (object-wrapped), e.g:
717
+ * - `Object(BigInt(123))`.
718
+ * @param {*} value - The value to check.
719
+ * @returns {boolean} Return `true` if value is a primitive bigint.
720
+ * @example
721
+ * isBigInt(123n);
722
+ * // ➔ true
723
+ * isBigInt(BigInt(123));
724
+ * // ➔ true
725
+ * isBigInt("123");
726
+ * // ➔ false
727
+ * isBigInt(Object(BigInt(1)));
728
+ * // ➔ false
729
+ */
730
+ declare const isBigInt: (value: unknown) => value is bigint;
731
+ /** ----------------------------------------------------------
732
+ * * ***Type guard: `isBoolean`.***
733
+ * ----------------------------------------------------------
734
+ * **Checks if a value is of type **[`boolean`](https://developer.mozilla.org/en-US/docs/Glossary/Boolean/JavaScript)**.**
735
+ * @param {*} value - The value to check.
736
+ * @returns {boolean} Returns `true` if the value is a `boolean`, otherwise `false`.
737
+ * @example
738
+ * isBoolean(true); // ➔ true
739
+ * isBoolean(false); // ➔ true
740
+ * isBoolean("true"); // ➔ false
741
+ */
742
+ declare const isBoolean: (value: unknown) => value is boolean;
743
+ /** ----------------------------------------------------
744
+ * * ***Type guard: `isBooleanObject`.***
745
+ * ----------------------------------------------------
746
+ * **Checks if a value is a **`Boolean` object wrapper**
747
+ * (`new Boolean(...)`), not a primitive boolean.**
748
+ * @param {*} value The value to check.
749
+ * @returns {value is Boolean} Returns `true` if `value` is a `Boolean` object.
750
+ * @example
751
+ * isBooleanObject(new Boolean(true));
752
+ * // ➔ true
753
+ * isBooleanObject(true);
754
+ * // ➔ false
755
+ */
756
+ declare function isBooleanObject(value: unknown): value is Boolean;
757
+ /** ----------------------------------------------------
758
+ * * ***Type guard: `isBuffer`.***
759
+ * ----------------------------------------------------------
760
+ * **Checks if a value is a *****{@link Buffer | `Node.js - Buffer`}***** instance.**
761
+ * @param {*} value The value to check.
762
+ * @returns {boolean} Returns `true` if `value` is a `Buffer`, else `false`.
763
+ * @example
764
+ * isBuffer(new Buffer(2));
765
+ * // ➔ true
766
+ * isBuffer(Buffer.alloc(10));
767
+ * // ➔ true
768
+ * isBuffer(Buffer.from('foo'));
769
+ * // ➔ true
770
+ * isBuffer([]);
771
+ * // ➔ false
772
+ * isBuffer('a string');
773
+ * // ➔ false
774
+ * isBuffer(new Uint8Array(1024));
775
+ * // ➔ false
776
+ */
777
+ declare const isBuffer: (value: unknown) => value is Buffer;
778
+ /** -----------------------------------------------------------
779
+ * * ***Predicate: `isCurrencyLike`.***
780
+ * -----------------------------------------------------------
781
+ * **Determines if the given `input` can be interpreted as a currency-like number,
782
+ * using the same **multi-locale parsing logic** as ***`parseCurrencyString`***.**
783
+ * - **Highlights:**
784
+ * - *Supports strings or numbers like:*
785
+ * - `"15.000,10"` ***(European)***.
786
+ * - `"15,000.10"` ***(US)***.
787
+ * - `"15'000.10"` ***(Swiss)***.
788
+ * - `"15 000,10"` ***(French)***.
789
+ * - `"Rp 15.000,10"` or `"$15,000.10"`.
790
+ * - Also accepts simple numbers (`15300.95`).
791
+ * - **ℹ️ Note:**
792
+ * - Uses the same core logic as
793
+ * ***`parseCurrencyString`*** but
794
+ * just checks if a final parsed float is sensible.
795
+ * @param {*} input - The input value to check.
796
+ * @returns {boolean} Return `true` if it can be reasonably parsed into a currency-like number, `false` otherwise.
797
+ * @example
798
+ * isCurrencyLike(15300.95);
799
+ * // ➔ true
800
+ * isCurrencyLike("$15,000.10");
801
+ * // ➔ true
802
+ * isCurrencyLike("(15'000.10)");
803
+ * // ➔ true
804
+ * isCurrencyLike("Rp 15.000,10");
805
+ * // ➔ true
806
+ * isCurrencyLike("");
807
+ * // ➔ false
808
+ * isCurrencyLike("abc");
809
+ * // ➔ false
810
+ */
811
+ declare const isCurrencyLike: (input: unknown) => boolean;
812
+ type isDateOptions = {
813
+ /** * ***Skip the validity check (`!isNaN(date.getTime())`).***
814
+ *
815
+ * When `true`, the function only checks that the value is an
816
+ * instance of `Date` without verifying that it represents a valid
817
+ * date value, default: `false`.
818
+ *
819
+ * @default false
820
+ */
821
+ skipInvalidDate?: boolean;
822
+ };
823
+ /** ----------------------------------------------------------
824
+ * * ***Type guard: `isDate`.***
825
+ * ----------------------------------------------------------
826
+ * **Determines whether the given `value` is a real, valid JavaScript
827
+ * **[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** object.**
828
+ * - **Behavior:**
829
+ * - Returns **true** only if:
830
+ * - `value` is an instance of `Date`.
831
+ * - and, unless `options.skipInvalidDate` is `true`,
832
+ * the underlying time value is valid (`!isNaN(value.getTime())`).
833
+ * - Returns **false** for:
834
+ * - non-Date values (strings, numbers, etc.).
835
+ * - `Date` instances that represent an invalid time value
836
+ * (e.g. `new Date("bad")`), unless skipping is enabled.
837
+ * @param {*} value - The value to check.
838
+ * @param {isDateOptions} [options] - Optional settings.
839
+ * @returns {boolean} Return `true` if value is a valid Date object.
840
+ * @example
841
+ * isDate(new Date());
842
+ * // ➜ true
843
+ * isDate(new Date("invalid"));
844
+ * // ➜ false
845
+ * isDate("2024-01-01");
846
+ * // ➜ false
847
+ *
848
+ * // Skipping validity check:
849
+ * isDate(new Date("invalid"), { skipInvalidDate: true });
850
+ * // ➜ true
851
+ */
852
+ declare const isDate: (value: unknown, options?: isDateOptions) => value is Date;
853
+ /** ----------------------------------------------------------
854
+ * * ***Predicate: `isDeepEqual`.***
855
+ * ----------------------------------------------------------
856
+ * **Performs a deep equality check between two values.**
857
+ * - **Behavior:**
858
+ * - Compares nested `arrays`, `objects`, `Dates`, `RegExp`, `NaN`, `Symbols`,
859
+ * `Set`, and `Map`.
860
+ * - Handles special cases:
861
+ * - `NaN` is considered equal to `NaN`.
862
+ * - `Date` objects are equal if `.getTime()` is equal.
863
+ * - `RegExp` objects are equal if `.toString()` is equal.
864
+ * - `Symbol("x")` and `Symbol("x")` are treated equal if
865
+ * `.toString()` matches.
866
+ * - `Set` and `Map` are deeply compared by content (order-insensitive).
867
+ * - **ℹ️ Note:**
868
+ * - Does not support circular references.
869
+ * @param {*} a - First value to compare.
870
+ * @param {*} b - Second value to compare.
871
+ * @returns {boolean} `true` if both values are deeply equal, otherwise `false`.
872
+ * @example
873
+ * // ✅ Primitives
874
+ * isDeepEqual(1, 1);
875
+ * // ➔ true
876
+ * isDeepEqual(NaN, NaN);
877
+ * // ➔ true
878
+ * isDeepEqual("hello", "world");
879
+ * // ➔ false
880
+ *
881
+ * // ✅ Objects
882
+ * isDeepEqual({ x: 1 }, { x: 1 });
883
+ * // ➔ true
884
+ * isDeepEqual({ x: 1 }, { y: 1 });
885
+ * // ➔ false
886
+ *
887
+ * // ✅ Arrays
888
+ * isDeepEqual([1, 2], [1, 2]);
889
+ * // ➔ true
890
+ * isDeepEqual([1, 2], [2, 1]);
891
+ * // ➔ false
892
+ *
893
+ * // ✅ Dates
894
+ * isDeepEqual(new Date(123), new Date(123));
895
+ * // ➔ true
896
+ *
897
+ * // ✅ Sets
898
+ * isDeepEqual(new Set([1, 2]), new Set([2, 1]));
899
+ * // ➔ true
900
+ *
901
+ * // ✅ Maps
902
+ * isDeepEqual(new Map([["a", 1]]), new Map([["a", 1]]));
903
+ * // ➔ true
904
+ *
905
+ * // ❌ Different types
906
+ * isDeepEqual(1, "1");
907
+ * // ➔ false
908
+ */
909
+ declare const isDeepEqual: (a: unknown, b: unknown) => boolean;
910
+ /** ----------------------------------------------------
911
+ * * ***Type guard: `isElement`.***
912
+ * ----------------------------------------------------------
913
+ * **Checks if `value` is likely a
914
+ * **[`DOM Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**.**
915
+ * @template T - The type of the value being checked.
916
+ * @param {*} value The value to check.
917
+ * @returns {boolean} Returns `true` if `value` is extends instance of **[`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**, else `false`.
918
+ * @example
919
+ * isElement(document.body);
920
+ * // ➔ true
921
+ * isElement(document.createElement("div"));
922
+ * // ➔ true
923
+ * isElement('<body>');
924
+ * // ➔ false
925
+ * isElement(document);
926
+ * // ➔ false
927
+ * isElement({ tagName: "DIV" });
928
+ * // ➔ false
929
+ */
930
+ declare function isElement(value: []): value is [];
931
+ declare function isElement<T extends Element>(value: T): value is T;
932
+ declare function isElement(value: unknown): value is Element;
933
+ /**
934
+ * -------------------------------------------------------------------
935
+ * * ***Array-like structure interface.***
936
+ * -------------------------------------------------------------------
937
+ * **Represents objects with indexed elements and a `length` property,
938
+ * similar to arrays, but not necessarily full Array instances.**
939
+ * @template T The type of elements stored in the array-like object.
940
+ * @example
941
+ * ```ts
942
+ * function logArrayLike<T>(items: ArrayLike<T>) {
943
+ * for (let i = 0; i < items.length; i++) {
944
+ * console.log(items[i]);
945
+ * }
946
+ * }
947
+ *
948
+ * const myNodeList: ArrayLike<Element> = document.querySelectorAll("div");
949
+ * logArrayLike(myNodeList);
950
+ * ```
951
+ */
952
+ interface ArrayLike<T> {
953
+ /** * ***Number of elements in the array-like object.*** */
954
+ readonly length: number;
955
+ /** * ***Indexed access to elements.*** */
956
+ readonly [n: number]: T;
957
+ }
958
+ /** -------------------------------------------------------------------
959
+ * * ***Represents an object with no allowed properties.***
960
+ * -------------------------------------------------------------------
961
+ * **Useful for cases where you want to ensure a type has **no keys**.**
962
+ * @template T - The base type to convert into an empty object type.
963
+ * @example
964
+ * ```ts
965
+ * type Test = EmptyObject<{ a: number }>;
966
+ * // ➔ { a?: never }
967
+ * ```
968
+ */
969
+ type EmptyObject<T> = { [K in keyof T]?: never };
970
+ /** -------------------------------------------------------------------
971
+ * * ***Conditional empty object type.***
972
+ * -------------------------------------------------------------------
973
+ * **Produces `EmptyObject<T>` only if it is assignable to `T`.**
974
+ * @template T - The base type to check.
975
+ * @example
976
+ * ```ts
977
+ * type Test = EmptyObjectOf<{ a: number }>;
978
+ * // ➔ { a?: never } | never depending on assignability
979
+ * ```
980
+ */
981
+ type EmptyObjectOf<T> = EmptyObject<T> extends T ? EmptyObject<T> : never;
982
+ /** -------------------------------------------------------------------
983
+ * * ***List type alias.***
984
+ * -------------------------------------------------------------------
985
+ * **Represents any array-like structure.**
986
+ * @template T - The type of elements in the list.
987
+ * @example
988
+ * ```ts
989
+ * const arr: List<number> = [1, 2, 3];
990
+ * const nodeList: List<Element> = document.querySelectorAll("div");
991
+ * ```
992
+ */
993
+ type List<T> = ArrayLike<T>;
994
+ /** ----------------------------------------------------
995
+ * * ***Predicate: `isEmpty`.***
996
+ * ----------------------------------------------------------
997
+ * **Checks if `value` is an empty object, collection, map, or set.**
998
+ * - **Behavior:**
999
+ * - **Objects** are empty if they have no own enumerable string keyed properties.
1000
+ * - **Array-like values** (arrays, strings, `arguments`, typed arrays, buffers)
1001
+ * are empty if their `length` is `0`.
1002
+ * - **Maps** and **Sets** are empty if their `size` is `0`.
1003
+ * - **Booleans**, **numbers** (including `NaN`), **symbols**, and `null`/
1004
+ * `undefined` are treated as empty.
1005
+ * - **Functions** are considered empty if they have no own enumerable keys.
1006
+ * - **ℹ️ Note:**
1007
+ * - For more `Strict`, you can use
1008
+ * ***`isEmptyValue` utility function*** instead.
1009
+ * @template T - The type of the value being checked.
1010
+ * @param {*} value The value to check.
1011
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
1012
+ * @example
1013
+ * isEmpty(null);
1014
+ * // ➔ true
1015
+ * isEmpty(true);
1016
+ * // ➔ true
1017
+ * isEmpty(false);
1018
+ * // ➔ true
1019
+ * isEmpty(1);
1020
+ * // ➔ true
1021
+ * isEmpty(0);
1022
+ * // ➔ true
1023
+ * isEmpty(Symbol("x"));
1024
+ * // ➔ true
1025
+ * isEmpty(() => {});
1026
+ * // ➔ true
1027
+ * isEmpty("");
1028
+ * // ➔ true
1029
+ * isEmpty(" ");
1030
+ * // ➔ false
1031
+ * isEmpty([1, 2, 3]);
1032
+ * // ➔ false
1033
+ * isEmpty({ 'a': 1 });
1034
+ * // ➔ false
1035
+ */
1036
+ declare function isEmpty<T extends {
1037
+ __trapAny: any;
1038
+ }>(value?: T): boolean;
1039
+ declare function isEmpty(value: string): value is "";
1040
+ declare function isEmpty(value: Map<any, any> | Set<any> | List<any> | null | undefined): boolean;
1041
+ declare function isEmpty(value: object): boolean;
1042
+ declare function isEmpty<T extends object>(value: T | null | undefined): value is EmptyObjectOf<T> | null | undefined;
1043
+ declare function isEmpty(value: any): boolean;
1044
+ /** ----------------------------------------------------------
1045
+ * * ***Predicate: `isEmptyArray`.***
1046
+ * ----------------------------------------------------------
1047
+ * **Checks whether a given value is an empty array.**
1048
+ * - **Behavior:**
1049
+ * - Non-array inputs are considered ***`empty`*** ***(defensive strategy)***.
1050
+ * @param {*} [value] - The value to check.
1051
+ * @returns {boolean} Returns `true` if it's ***not an array*** or ***an empty-array***.
1052
+ * @example
1053
+ * isEmptyArray([]); // ➔ true
1054
+ * isEmptyArray([1, 2, 3]); // ➔ false
1055
+ * isEmptyArray("not an array"); // ➔ true
1056
+ * isEmptyArray(null); // ➔ true
1057
+ * isEmptyArray(undefined); // ➔ true
1058
+ *
1059
+ * if (isEmptyArray(data.items)) {
1060
+ * console.log("No items to display.");
1061
+ * }
1062
+ */
1063
+ declare const isEmptyArray: (value: unknown) => boolean;
1064
+ /** ----------------------------------------------------------
1065
+ * * ***Predicate: `isEmptyDeep`.***
1066
+ * ----------------------------------------------------------
1067
+ * **Recursively checks whether a value is **deeply empty**.**
1068
+ * - **Returns `true` for:**
1069
+ * - Empty objects: `{}`
1070
+ * - Empty arrays: `[]`
1071
+ * - Nested empty structures: `{ a: [], b: {} }`
1072
+ * - Falsy values (except numbers): `null`, `undefined`, `false`, `""`, `NaN`
1073
+ * - **Returns `false` for:**
1074
+ * - Non-zero numbers
1075
+ * - Objects or arrays containing non-empty values
1076
+ * - Non-empty strings, `true`, functions, symbols, etc.
1077
+ * @param {*} value - The value to deeply check.
1078
+ * @returns {boolean} `true` if the value is deeply empty, otherwise `false`.
1079
+ * @example
1080
+ * isEmptyDeep({});
1081
+ * // ➔ true
1082
+ * isEmptyDeep([]);
1083
+ * // ➔ true
1084
+ * isEmptyDeep({ a: {} });
1085
+ * // ➔ true
1086
+ * isEmptyDeep([[], {}]);
1087
+ * // ➔ true
1088
+ * isEmptyDeep({ a: [1] });
1089
+ * // ➔ false
1090
+ * isEmptyDeep([0]);
1091
+ * // ➔ false
1092
+ * isEmptyDeep("test");
1093
+ * // ➔ false
1094
+ * isEmptyDeep("");
1095
+ * // ➔ true
1096
+ * isEmptyDeep(0);
1097
+ * // ➔ false
1098
+ * isEmptyDeep(NaN);
1099
+ * // ➔ true
1100
+ */
1101
+ declare const isEmptyDeep: (value: unknown) => boolean;
1102
+ type IsEmptyObjectOptions = {
1103
+ /** Whether to check for symbol properties in addition to string keys, defaultValue: `false`.
1104
+ *
1105
+ * @default false
1106
+ */
1107
+ checkSymbols?: boolean;
1108
+ };
1109
+ /** ----------------------------------------------------------
1110
+ * * ***Predicate: `isEmptyObject`.***
1111
+ * ----------------------------------------------------------
1112
+ * **Checks if a value is a plain object with **no own enumerable string-key properties**,
1113
+ * and optionally **no own enumerable symbol-key properties** when `checkSymbols` is `true`.**
1114
+ * - **Behavior:**
1115
+ * - If the value is **not an object** (e.g. `null`, array, primitive), it is considered empty.
1116
+ * - If `options.checkSymbols` is `true`, **symbol properties** are also checked.
1117
+ * @param {*} value - The value to check.
1118
+ * @param {IsEmptyObjectOptions} [options] - Optional settings.
1119
+ * @param {IsEmptyObjectOptions["checkSymbols"]} [options.checkSymbols=false] - Whether to also check symbol properties.
1120
+ * @returns {boolean} Return `true` if the value is considered empty or not an object, false otherwise.
1121
+ * @example
1122
+ * isEmptyObject({});
1123
+ * // ➔ true
1124
+ * isEmptyObject({}, { checkSymbols: true });
1125
+ * // ➔ true
1126
+ * isEmptyObject({ a: 1 });
1127
+ * // ➔ false
1128
+ * isEmptyObject({ [Symbol('s')]: 1 });
1129
+ * // ➔ true
1130
+ * isEmptyObject({ [Symbol('s')]: 1 }, { checkSymbols: true });
1131
+ * // ➔ false
1132
+ * isEmptyObject(null);
1133
+ * // ➔ true (not object)
1134
+ * isEmptyObject([]);
1135
+ * // ➔ true (not plain object)
1136
+ * isEmptyObject(123);
1137
+ * // ➔ true (not object)
1138
+ */
1139
+ declare function isEmptyObject(value: unknown, options?: IsEmptyObjectOptions): boolean;
1140
+ type IsEmptyStringOptions = {
1141
+ /** Whether to trim the string before checking, defaultValue: `true`.
1142
+ *
1143
+ * @default true */
1144
+ trim?: boolean;
1145
+ };
1146
+ /** ----------------------------------------------------------
1147
+ * * ***Predicate: `isEmptyString`.***
1148
+ * ----------------------------------------------------------
1149
+ * **Checks whether a given value is an **empty-string**.**
1150
+ * - **Behavior:**
1151
+ * - Considers `""` and whitespace-only strings as
1152
+ * empty (if `trim` is enabled, which is the default).
1153
+ * - Non-string inputs are also considered empty.
1154
+ * @param {*} value - The value to check.
1155
+ * @param {IsEmptyStringOptions} [options] - Optional settings.
1156
+ * @param {IsEmptyStringOptions["trim"]} [options.trim=true] - Whether to trim the string before checking, defaultValue: `true`.
1157
+ * @returns {boolean} Returns `true` if the value is string not a string or value string is considered empty.
1158
+ * @example
1159
+ * isEmptyString("");
1160
+ * // ➔ true
1161
+ * isEmptyString(" ");
1162
+ * // ➔ true (default trims)
1163
+ * isEmptyString(" ", { trim: false });
1164
+ * // ➔ false
1165
+ * isEmptyString("hello");
1166
+ * // ➔ false
1167
+ * isEmptyString(undefined);
1168
+ * // ➔ true
1169
+ * isEmptyString(null);
1170
+ * // ➔ true
1171
+ * isEmptyString(123 as any);
1172
+ * // ➔ true
1173
+ *
1174
+ * // Used in validation
1175
+ * if (isEmptyString(form.name)) {
1176
+ * throw new Error("Name cannot be empty.");
1177
+ * }
1178
+ */
1179
+ declare const isEmptyString: (value: unknown, options?: IsEmptyStringOptions) => boolean;
1180
+ type IsEmptyValueOptions = {
1181
+ /** **Whether to check symbol properties when checking empty objects.**
1182
+ * - **DefaultValue:** `false`.
1183
+ *
1184
+ * @default false
1185
+ */
1186
+ checkSymbols?: boolean;
1187
+ };
1188
+ /** ----------------------------------------------------------
1189
+ * * ***Predicate: `isEmptyValue`.***
1190
+ * ----------------------------------------------------------
1191
+ * **Determines if a value is **`empty`**.**
1192
+ * - **Covering:**
1193
+ * - Empty objects: `{}`
1194
+ * - Empty arrays: `[]`
1195
+ * - Empty strings: `""` or whitespace-only (trimmed)
1196
+ * - `null`, `undefined`, `false`, or `NaN`
1197
+ * - **Returns **`false`** for:**
1198
+ * - Non-empty objects/arrays
1199
+ * - Non-empty strings
1200
+ * - Numbers (except `NaN`)
1201
+ * - `Functions`, `true`, `symbols`, `etc`.
1202
+ * @param {*} value - The value to evaluate.
1203
+ * @param {IsEmptyValueOptions} [options] - Optional settings.
1204
+ * @returns {boolean} Return `true` if the value is considered empty, otherwise `false`.
1205
+ * @example
1206
+ * isEmptyValue({});
1207
+ * // ➔ true
1208
+ * isEmptyValue([]);
1209
+ * // ➔ true
1210
+ * isEmptyValue({ key: "value" });
1211
+ * // ➔ false
1212
+ * isEmptyValue({ [Symbol("foo")]: 123 });
1213
+ * // ➔ true (default `checkSymbols` is `false`)
1214
+ * isEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: false });
1215
+ * // ➔ true (default `checkSymbols` is `false`)
1216
+ * isEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: true });
1217
+ * // ➔ false
1218
+ * isEmptyValue([1, 2, 3]);
1219
+ * // ➔ false
1220
+ * isEmptyValue(NaN);
1221
+ * // ➔ true
1222
+ * isEmptyValue(true);
1223
+ * // ➔ false
1224
+ * isEmptyValue(false);
1225
+ * // ➔ true
1226
+ * isEmptyValue(null);
1227
+ * // ➔ true
1228
+ * isEmptyValue(undefined);
1229
+ * // ➔ true
1230
+ * isEmptyValue("");
1231
+ * // ➔ true
1232
+ * isEmptyValue(" ");
1233
+ * // ➔ true
1234
+ * isEmptyValue(0);
1235
+ * // ➔ false
1236
+ * isEmptyValue(-1);
1237
+ * // ➔ false
1238
+ * isEmptyValue(2);
1239
+ * // ➔ false
1240
+ * isEmptyValue(() => {});
1241
+ * // ➔ false
1242
+ */
1243
+ declare const isEmptyValue: (value: unknown, options?: IsEmptyValueOptions) => boolean;
1244
+ /** ----------------------------------------------------
1245
+ * * ***Predicate: `isEqual`.***
1246
+ * ----------------------------------------------------------
1247
+ * **Performs a deep comparison between two values to determine if they are equivalent.**
1248
+ * @description
1249
+ * Checks whether two values are **deeply equal**, not just reference-equal (`===`).
1250
+ * - **✅ This method compares:**
1251
+ * - Arrays and TypedArrays
1252
+ * - ArrayBuffers
1253
+ * - Plain objects (`Object`) ➔ own enumerable properties only
1254
+ * - Booleans, Numbers, Strings, Symbols
1255
+ * - Dates
1256
+ * - Errors
1257
+ * - Maps
1258
+ * - Sets
1259
+ * - Regular expressions
1260
+ * - ❌ `Functions` and `DOM nodes` are ***not supported***.
1261
+ * @param {*} value The value to compare.
1262
+ * @param {*} other The other value to compare.
1263
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1264
+ * @example
1265
+ * const obj1 = { user: "fred" };
1266
+ * const obj2 = { user: "fred" };
1267
+ *
1268
+ * isEqual(obj1, obj2);
1269
+ * // ➔ true
1270
+ * obj1 === obj2;
1271
+ * // ➔ false (different references)
1272
+ * isEqual([1, 2, 3], [1, 2, 3]);
1273
+ * // ➔ true
1274
+ * isEqual(new Date("2020-01-01"), new Date("2020-01-01"));
1275
+ * // ➔ true
1276
+ * isEqual(new Set([1, 2]), new Set([2, 1]));
1277
+ * // ➔ true
1278
+ * isEqual(/abc/i, new RegExp("abc", "i"));
1279
+ * // ➔ true
1280
+ * isEqual({ a: 1 }, { a: 1, b: undefined });
1281
+ * // ➔ false
1282
+ */
1283
+ declare function isEqual(value: unknown, other: unknown): boolean;
1284
+ /** -------------------------------------------------------------------
1285
+ * * ***Customizer function for `isEqualWith`.***
1286
+ * -------------------------------------------------------------------
1287
+ * **Allows customizing how two values are compared for deep equality.**
1288
+ * @param value
1289
+ * - The current value being compared.
1290
+ * @param other
1291
+ * - The corresponding value from the other object.
1292
+ * @param indexOrKey
1293
+ * - The property key (for objects) or index (for arrays) of the current value.
1294
+ * @param parent
1295
+ * - The parent object or array containing `value`.
1296
+ * @param otherParent
1297
+ * - The parent object or array containing `other`.
1298
+ * @param stack
1299
+ * - WeakMap or tracking structure for already visited objects to handle circular references.
1300
+ * @returns
1301
+ * - `true` → Treat the values as equal.
1302
+ * - `false` → Treat the values as unequal.
1303
+ * - `undefined` → Fallback to default deep equality comparison.
1304
+ * @example
1305
+ * ```ts
1306
+ * const customizer: CustomizerIsEqualWith = (value, other, key) => {
1307
+ * if (typeof value === "string" && typeof other === "string") {
1308
+ * return value.toLowerCase() === other.toLowerCase();
1309
+ * }
1310
+ * return undefined;
1311
+ * };
1312
+ *
1313
+ * baseDeepEqual({ name: "Alice" }, { name: "alice" }, customizer);
1314
+ * // returns true
1315
+ * ```
1316
+ */
1317
+ type CustomizerIsEqualWith = (value: unknown, other: unknown, indexOrKey: PropertyKey, parent: unknown, otherParent: unknown, stack: unknown) => boolean | undefined;
1318
+ /** ----------------------------------------------------
1319
+ * * ***Predicate: `isEqualWith`.***
1320
+ * ----------------------------------------------------
1321
+ * **Performs a deep comparison between two values with support for a
1322
+ * customizer function.**
1323
+ * @description
1324
+ * This method is like ***`isEqual` utility function*** except that it
1325
+ * accepts a `customizer` which is invoked to compare values.
1326
+ * - **Behavior:**
1327
+ * - If `customizer` returns `undefined`, the comparison is handled by
1328
+ * the default deep equality algorithm.
1329
+ * - The `customizer` is invoked with up to six arguments:
1330
+ * - `(value, other, indexOrKey, parent, otherParent, stack)`,
1331
+ * see **{@link CustomizerIsEqualWith | `CustomizerIsEqualWith`}**.
1332
+ * - Supports comparing `arrays`, `objects`, `maps`, `sets`, `dates`,
1333
+ * `regexes`, `typed arrays`, `etc`.
1334
+ * - Functions and DOM nodes are **not** supported.
1335
+ * @param {*} value The value to compare.
1336
+ * @param {*} other The other value to compare.
1337
+ * @param {CustomizerIsEqualWith} [customizer] The function to customize comparisons.
1338
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1339
+ * @example
1340
+ * function isGreeting(value: unknown) {
1341
+ * return typeof value === "string" && /^h(?:i|ello)$/.test(value);
1342
+ * }
1343
+ *
1344
+ * function customizer(objValue: unknown, othValue: unknown) {
1345
+ * if (isGreeting(objValue) && isGreeting(othValue)) {
1346
+ * return true;
1347
+ * }
1348
+ * }
1349
+ *
1350
+ * const array = ["hello", "goodbye"];
1351
+ * const other = ["hi", "goodbye"];
1352
+ *
1353
+ * isEqualWith(array, other, customizer);
1354
+ * // ➔ true
1355
+ */
1356
+ declare function isEqualWith(value: unknown, other: unknown, customizer?: CustomizerIsEqualWith): boolean;
1357
+ /** ----------------------------------------------------------
1358
+ * * ***Type guard: `isError`.***
1359
+ * ----------------------------------------------------------
1360
+ * **Checks whether the given value is an ****[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** object**.**
1361
+ * - **Behavior:**
1362
+ * - Ensures that the provided value is a valid JavaScript error instance.
1363
+ * - Useful in TypeScript for narrowing types during error handling.
1364
+ * @param {*} error - The value to check.
1365
+ * @returns {boolean} Returns `true` if `value` is instance of **[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)**, else `false`.
1366
+ * @example
1367
+ * isError(new Error("Something went wrong"));
1368
+ * // ➔ true
1369
+ * isError("Error message");
1370
+ * // ➔ false
1371
+ * isError(null);
1372
+ * // ➔ false
1373
+ */
1374
+ declare const isError: (error: unknown) => error is Error;
1375
+ /** ----------------------------------------------------------
1376
+ * * ***Type guard: `isFinite`.***
1377
+ * -----------------------------------------------------------
1378
+ * **Checks if a value is a finite primitive number.**
1379
+ * @description
1380
+ * This function verifies that `value` is a **primitive number** and is **finite**
1381
+ * (i.e., not `NaN`, `Infinity`, or `-Infinity`).
1382
+ * - **Behavior:**
1383
+ * - Behaves like
1384
+ * [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite).
1385
+ * - But also works as a **TypeScript type guard**.
1386
+ * @param {*} value - The value to check.
1387
+ * @returns {boolean} Returns `true` if `value` is a finite primitive number, else `false`.
1388
+ * @example
1389
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1390
+ *
1391
+ * // Strict finite number check (only primitive numbers)
1392
+ * RzlUtilsJs.isFinite(3);
1393
+ * // ➔ true
1394
+ * RzlUtilsJs.isFinite(Number.MIN_VALUE);
1395
+ * // ➔ true
1396
+ * RzlUtilsJs.isFinite("3");
1397
+ * // ➔ false (string is not a number)
1398
+ * RzlUtilsJs.isFinite(NaN);
1399
+ * // ➔ false
1400
+ * RzlUtilsJs.isFinite(Infinity);
1401
+ * // ➔ false
1402
+ * RzlUtilsJs.isFinite(new Number(3));
1403
+ * // ➔ false (Number object is not primitive)
1404
+ *
1405
+ * // Comparison with global isFinite()
1406
+ * isFinite("3");
1407
+ * // ➔ true (global coerces string to number)
1408
+ * isFinite(new Number(3));
1409
+ * // ➔ true (object coerced to primitive number)
1410
+ */
1411
+ declare function isFinite(value: unknown): value is number;
1412
+ /** ----------------------------------------------------------
1413
+ * * ***Type guard: `isFunction`.***
1414
+ * -----------------------------------------------------------
1415
+ * **Checks if a value is a function.**
1416
+ * - **Behavior:**
1417
+ * - Uses `typeof value === "function"` for strict type checking.
1418
+ * - Safe alternative to `Function` type (doesn't trigger ESLint warning).
1419
+ * - Supports TypeScript type narrowing with `value is (...args: any[]) => any`.
1420
+ * @param {*} value - The value to check.
1421
+ * @returns {boolean} Return `true` if the value is a function.
1422
+ * @example
1423
+ * isFunction(() => {});
1424
+ * // ➔ true
1425
+ * isFunction(async () => {});
1426
+ * // ➔ true
1427
+ * isFunction(null);
1428
+ * // ➔ false
1429
+ * isFunction({});
1430
+ * // ➔ false
1431
+ */
1432
+ declare const isFunction: (value: unknown) => value is AnyFunction;
1433
+ /** ----------------------------------------------------
1434
+ * * ***Type guard: `isInfinityNumber`.***
1435
+ * ----------------------------------------------------
1436
+ * **Checks if a value is positive or negative
1437
+ * [`Infinity`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity).**
1438
+ * - **ℹ️ Note:**
1439
+ * - This is stricter than the global `isFinite`,
1440
+ * because it only returns `true` for `Infinity` or `-Infinity`,
1441
+ * not other non-finite values.
1442
+ * @param {*} value The value to check.
1443
+ * @returns {boolean} Returns `true` if `value` is `Infinity` or `-Infinity`, else `false`.
1444
+ * @example
1445
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1446
+ *
1447
+ * RzlUtilsJs.isInfinityNumber(Infinity);
1448
+ * // ➔ true
1449
+ * RzlUtilsJs.isInfinityNumber(-Infinity);
1450
+ * // ➔ true
1451
+ * RzlUtilsJs.isInfinityNumber(new Number(Infinity));
1452
+ * // ➔ true
1453
+ * RzlUtilsJs.isInfinityNumber(NaN);
1454
+ * // ➔ false
1455
+ * RzlUtilsJs.isInfinityNumber(123);
1456
+ * // ➔ false
1457
+ */
1458
+ declare function isInfinityNumber(value: unknown): boolean;
1459
+ /** ---------------------------------------------------------
1460
+ * * ***Type guard: `isInteger`.***
1461
+ * ----------------------------------------------------------
1462
+ * **Checks if a value is an integer number.**
1463
+ * - **ℹ️ Note:**
1464
+ * - This method is based on
1465
+ * [`Number.isInteger`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger).
1466
+ * @param {*} value The value to check.
1467
+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
1468
+ * @example
1469
+ * isInteger(3);
1470
+ * // ➔ true
1471
+ * isInteger(Number.MIN_VALUE);
1472
+ * // ➔ false
1473
+ * isInteger(NaN);
1474
+ * // ➔ false
1475
+ * isInteger(Infinity);
1476
+ * // ➔ false
1477
+ * isInteger(-Infinity);
1478
+ * // ➔ false
1479
+ * isInteger('3');
1480
+ * // ➔ false
1481
+ */
1482
+ declare function isInteger(value: unknown): value is number;
1483
+ /** ----------------------------------------
1484
+ * * ***Predicate: `isLength`.***
1485
+ * ----------------------------------------------------------
1486
+ * **Checks whether the given value is a **valid array-like length**.**
1487
+ * - **Behavior:**
1488
+ * - ✅ Ensures the value is a **non-negative integer**.
1489
+ * - ✅ Ensures the value is **not greater than `Number.MAX_SAFE_INTEGER`**.
1490
+ * - ❌ Excludes non-numeric values, `Infinity`, and fractional numbers.
1491
+ * - **ℹ️ Note:**
1492
+ * - This method is loosely based-on
1493
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1494
+ * - A valid length must be a non-negative integer and **not greater
1495
+ * than `Number.MAX_SAFE_INTEGER`**.
1496
+ * @param {*} value The value to check.
1497
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1498
+ * @example
1499
+ * isLength(3);
1500
+ * // ➔ true
1501
+ * isLength(Number.MAX_SAFE_INTEGER);
1502
+ * // ➔ true
1503
+ * isLength(Number.MAX_SAFE_INTEGER + 1);
1504
+ * // ➔ false
1505
+ * isLength("3");
1506
+ * // ➔ false
1507
+ * isLength(-1);
1508
+ * // ➔ false
1509
+ * isLength(3.14);
1510
+ * // ➔ false
1511
+ * isLength(Infinity);
1512
+ * // ➔ false
1513
+ * isLength(-Infinity);
1514
+ * // ➔ false
1515
+ * isLength(Number.MIN_VALUE);
1516
+ * // ➔ false
1517
+ */
1518
+ declare function isLength(value: unknown): boolean;
1519
+ /** --------------------------------------------------
1520
+ * * ***Type guard: `isMap`.***
1521
+ * ----------------------------------------------------------
1522
+ * **Checks whether the given value is a **[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) object**.**
1523
+ * - **Behavior:**
1524
+ * - Ensures that the provided value is an instance of **[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)**.
1525
+ * - Useful in TypeScript for narrowing types when working with collections.
1526
+ * @param {*} value The value to check.
1527
+ * @returns {boolean} Returns `true` if `value` is instance of **[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)**, else `false`.
1528
+ * @example
1529
+ * isMap(new Map());
1530
+ * // ➔ true
1531
+ * isMap(new WeakMap());
1532
+ * // ➔ false
1533
+ * isMap({});
1534
+ * // ➔ false
1535
+ */
1536
+ declare function isMap<K = unknown, V = unknown>(value: Map<K, V>): value is Map<K, V>;
1537
+ declare function isMap(value: unknown): value is Map<unknown, unknown>;
1538
+ /** ----------------------------------------------------
1539
+ * * ***Predicate: `isMatch`.***
1540
+ * ----------------------------------------------------
1541
+ * **Performs a partial deep comparison between `object` and `source`.**
1542
+ * @description
1543
+ * Determines whether `object` contains equivalent property values from `source`.
1544
+ * - **Behavior:**
1545
+ * - ✅ Returns `true` if **all properties** in `source` exist in `object` and are deeply equal.
1546
+ * - ❌ Does **not** require `object` and `source` to be the same shape—`object` may have extra properties.
1547
+ * - ⚠️ Arrays are treated as objects: only matching indexed keys are compared.
1548
+ * - **Remarks:**
1549
+ * - This is functionally equivalent to a partially applied `matches(source)` predicate.
1550
+ * - Special cases:
1551
+ * - An empty array (`[]`) in `source` matches any array in `object`.
1552
+ * - An empty object (`{}`) in `source` matches any object in `object`.
1553
+ * @param {object} object - The object to inspect.
1554
+ * @param {object} source - The object containing property values to match.
1555
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
1556
+ * @example
1557
+ * const object = { a: 1, b: 2 };
1558
+ *
1559
+ * isMatch(object, { b: 2 });
1560
+ * // ➔ true
1561
+ * isMatch(object, { b: 1 });
1562
+ * // ➔ false
1563
+ * isMatch([1, 2, 3], [1, 2]);
1564
+ * // ➔ true (treats arrays as objects with index keys)
1565
+ */
1566
+ declare function isMatch(object: object, source: object): boolean;
1567
+ /** -------------------------------------------------------------------
1568
+ * * ***Customizer function for `isMatchWith`.***
1569
+ * -------------------------------------------------------------------
1570
+ * **Allows customizing how two values are compared for partial/object match.**
1571
+ * @param value
1572
+ * - The current value from the object being tested.
1573
+ * @param other
1574
+ * - The corresponding value from the source object.
1575
+ * @param indexOrKey
1576
+ * - The property key (for objects) or index (for arrays) of the current value.
1577
+ * @param object
1578
+ * - The parent object containing `value`.
1579
+ * @param source
1580
+ * - The parent source object containing `other`.
1581
+ * @returns
1582
+ * - `true` → Treat the values as matching.
1583
+ * - `false` → Treat the values as not matching.
1584
+ * - `undefined` → Fallback to default match comparison.
1585
+ * @example
1586
+ * ```ts
1587
+ * const customizer: CustomizerIsMatchWith = (value, other) => {
1588
+ * if (typeof value === "string" && typeof other === "string") {
1589
+ * return value.toLowerCase() === other.toLowerCase();
1590
+ * }
1591
+ * return undefined;
1592
+ * };
1593
+ *
1594
+ * baseIsMatch({ name: "Alice" }, { name: "alice" }, customizer);
1595
+ * // returns true
1596
+ * ```
1597
+ */
1598
+ type CustomizerIsMatchWith = (value: unknown, other: unknown, indexOrKey: PropertyKey, object: object, source: object) => boolean | undefined;
1599
+ /** ----------------------------------------------------
1600
+ * * ***Predicate: `isMatchWith`.***
1601
+ * ----------------------------------------------------
1602
+ * **Performs a partial deep comparison between `object` and `source`, like `isMatch`, but with a `customizer` function to control comparisons.**
1603
+ * @description
1604
+ * If `customizer` returns a value other than `undefined`, that value is used
1605
+ * as the result of the comparison for the current property. Otherwise,
1606
+ * the comparison falls back to the default deep equality logic.
1607
+ * - **Behavior:**
1608
+ * - The `customizer` function is invoked with up to **five** arguments:
1609
+ * - `(objValue, srcValue, keyOrIndex, object, source)`,
1610
+ * see **{@link CustomizerIsMatchWith | `CustomizerIsMatchWith`}**.
1611
+ * - Returning `true` from `customizer` will short-circuit further comparison
1612
+ * for that key.
1613
+ * - Returning `false` will cause `isMatchWith` to return `false` immediately.
1614
+ * - Returning `undefined` allows default comparison to proceed.
1615
+ * @param {object} value - The object to inspect.
1616
+ * @param {object} other - The object of property values to match.
1617
+ * @param {CustomizerIsMatchWith} [customizer] - The function to customize comparisons.
1618
+ * @returns Returns `true` if `object` is a match, else `false`.
1619
+ * @example
1620
+ * function isGreeting(value: unknown) {
1621
+ * return typeof value === 'string' && /^h(?:i|ello)$/.test(value);
1622
+ * }
1623
+ *
1624
+ * function customizer(objValue: unknown, srcValue: unknown) {
1625
+ * if (isGreeting(objValue) && isGreeting(srcValue)) {
1626
+ * return true;
1627
+ * }
1628
+ * }
1629
+ *
1630
+ * const object = { greeting: 'hello' };
1631
+ * const source = { greeting: 'hi' };
1632
+ *
1633
+ * isMatchWith(object, source, customizer);
1634
+ * // ➔ true
1635
+ */
1636
+ declare function isMatchWith(value: object, other: object, customizer?: CustomizerIsMatchWith): boolean;
1637
+ /** ----------------------------------------------------
1638
+ * * ***Type guard: `isNaN`.***
1639
+ * ----------------------------------------------------
1640
+ * **Checks if a value is [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).**
1641
+ * - **ℹ️ Note:**
1642
+ * - This method is based on
1643
+ * [`Number.isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN)
1644
+ * and is **not** the same as the global
1645
+ * [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN),
1646
+ * which returns `true` for `undefined` and other non-number values.
1647
+ * @param {*} value The value to check.
1648
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1649
+ * @example
1650
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1651
+ *
1652
+ * RzlUtilsJs.isNaN(NaN);
1653
+ * // ➔ true
1654
+ * RzlUtilsJs.isNaN(new Number(NaN));
1655
+ * // ➔ true
1656
+ * RzlUtilsJs.isNaN(undefined);
1657
+ * // ➔ false
1658
+ *
1659
+ * // This global isNaN:
1660
+ * isNaN(undefined);
1661
+ * // ➔ true
1662
+ */
1663
+ declare function isNaN(value: unknown): boolean;
1664
+ /** ----------------------------------------------------
1665
+ * * ***Type guard: `isNative`.***
1666
+ * ----------------------------------------------------------
1667
+ * **Checks if a value is a **pristine native function**.**
1668
+ * - **ℹ️ Note:**
1669
+ * - This method may not reliably detect native functions when using packages
1670
+ * like `core-js`, as they override native behavior.
1671
+ * - Attempts to detect native functions in such environments may fail or
1672
+ * throw errors.
1673
+ * - This also affects packages like
1674
+ * **[`babel-polyfill`](https://www.npmjs.com/package/babel-polyfill).**
1675
+ * @param {*} value The value to check.
1676
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
1677
+ * @example
1678
+ * isNative(Array.prototype.push);
1679
+ * // ➔ true
1680
+ *
1681
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1682
+ * isNative(RzlUtilsJs);
1683
+ * // ➔ false
1684
+ */
1685
+ declare function isNative(value: unknown): value is AnyFunction;
1686
+ /** ----------------------------------------------------
1687
+ * * ***Type guard: `isNil`.***
1688
+ * ----------------------------------------------------------
1689
+ * **Checks if a value is **[`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null)** or **[`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)**.**
1690
+ * - **Behavior:**
1691
+ * - Narrows type to `null` or `undefined` when true.
1692
+ * @param {*} value - The value to check.
1693
+ * @returns {boolean} Returns `true` if the value is `null` or `undefined`, otherwise `false`.
1694
+ * @example
1695
+ * isNil(null);
1696
+ * // ➔ true
1697
+ * isNil(undefined);
1698
+ * // ➔ true
1699
+ * isNil(void 0);
1700
+ * // ➔ true
1701
+ * isNil(NaN);
1702
+ * // ➔ false
1703
+ */
1704
+ declare function isNil(value: unknown): value is null | undefined;
1705
+ /** ----------------------------------------------------------
1706
+ * * ***Type guard: `isNonEmptyArray`.***
1707
+ * ----------------------------------------------------------
1708
+ * **Checks if a value is a **non-empty array**.**
1709
+ * - **Behavior:**
1710
+ * - Ensures the value is an actual array using **[`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)**.
1711
+ * - Ensures the array contains at least one item.
1712
+ * - Narrows type to `T[]` (non-empty array) when true.
1713
+ * @template T - The type of the value being checked.
1714
+ * @param {*} value - The value to check.
1715
+ * @returns {boolean} Return `true` if value is a non-empty array.
1716
+ * @example
1717
+ * isNonEmptyArray([1, 2, 3]); // ➔ true
1718
+ * isNonEmptyArray([]); // ➔ false
1719
+ * isNonEmptyArray(null); // ➔ false
1720
+ * isNonEmptyArray("test"); // ➔ false
1721
+ */
1722
+ declare function isNonEmptyArray(value: []): value is [];
1723
+ declare function isNonEmptyArray<T>(value: T): value is ArrayFallback<T>;
1724
+ declare function isNonEmptyArray(value: unknown): value is unknown[];
1725
+ type IsNonEmptyStringOptions = {
1726
+ /** Whether to trim the string before checking, defaultValue: `true`.
1727
+ *
1728
+ * @default true
1729
+ */
1730
+ trim?: boolean;
1731
+ };
1732
+ /** ----------------------------------------------------------
1733
+ * * ***Type guard: `isNonEmptyString`.***
1734
+ * ----------------------------------------------------------
1735
+ * **Checks if a value is a **non-empty string**.**
1736
+ * @description
1737
+ * Determines whether the given `value` is a string containing at least one non-whitespace character, with optional trimming behavior.
1738
+ * - **Behavior:**
1739
+ * - Ensures the value is a string using ***`isString` utility function***.
1740
+ * - Optionally trims whitespace before checking (`trim` defaults to `true`).
1741
+ * - Narrows type to `string` when true.
1742
+ * @param {*} value - The value to test.
1743
+ * @param {IsNonEmptyStringOptions} [options] - Optional settings.
1744
+ * @param {boolean} options.trim - If `true`, trims the string before checking, defaults: `true`.
1745
+ * @returns {boolean} Return `true` if `value` is a non-empty string, otherwise `false`.
1746
+ * @example
1747
+ * isNonEmptyString("hello");
1748
+ * // ➔ true
1749
+ * isNonEmptyString(" ", { trim: true });
1750
+ * // ➔ false
1751
+ * isNonEmptyString(" ", { trim: false });
1752
+ * // ➔ true
1753
+ * isNonEmptyString("");
1754
+ * // ➔ false
1755
+ * isNonEmptyString(123);
1756
+ * // ➔ false
1757
+ * isNonEmptyString(undefined);
1758
+ * // ➔ false
1759
+ * isNonEmptyString(null);
1760
+ * // ➔ false
1761
+ * isNonEmptyString({});
1762
+ * // ➔ false
1763
+ * isNonEmptyString([]);
1764
+ * // ➔ false
1765
+ */
1766
+ declare const isNonEmptyString: (value: unknown, options?: IsNonEmptyStringOptions) => value is string;
1767
+ type IsNonEmptyValueOptions = {
1768
+ /** Whether to check symbol properties when checking empty objects, default: `false`.
1769
+ *
1770
+ * @default false
1771
+ */
1772
+ checkSymbols?: boolean;
1773
+ };
1774
+ /** ----------------------------------------------------------
1775
+ * * ***Predicated: `isNonEmptyValue`.***
1776
+ * ----------------------------------------------------------
1777
+ * **Determines if a value is a **non-empty** object (`{}` with props), **non-empty** array (`[]` with items) or generally truthy.**
1778
+ * - **Behavior:**
1779
+ * - Returns `true` for:
1780
+ * - Objects **with properties**
1781
+ * - Arrays **with items**
1782
+ * - Non-empty, non-whitespace strings
1783
+ * - Numbers (except `NaN`, includes `0`)
1784
+ * - Functions
1785
+ * - `true`
1786
+ * - Returns `false` for:
1787
+ * - Empty objects (`{}`)
1788
+ * - Empty arrays (`[]`)
1789
+ * - `null` or `undefined`
1790
+ * - Empty strings (`""`) or whitespace-only strings (`" "`)
1791
+ * - `false`
1792
+ * - `NaN`
1793
+ * - Safely handles `null`, `undefined`, and non-object types without throwing.
1794
+ * @param {*} value - The value to evaluate.
1795
+ * @param {IsNonEmptyValueOptions} [options] - Optional settings.
1796
+ * @returns {boolean} Return `true` if the value is considered non-empty/truthy, otherwise `false`.
1797
+ * @example
1798
+ * isNonEmptyValue({});
1799
+ * // ➔ false
1800
+ * isNonEmptyValue([]);
1801
+ * // ➔ false
1802
+ * isNonEmptyValue({ key: "value" });
1803
+ * // ➔ true
1804
+ * isNonEmptyValue({ [Symbol("foo")]: 123 });
1805
+ * // ➔ false (default `checkSymbols` is `false`)
1806
+ * isNonEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: false });
1807
+ * // ➔ false (default `checkSymbols` is `false`)
1808
+ * isNonEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: true });
1809
+ * // ➔ true
1810
+ * isNonEmptyValue([1, 2, 3]);
1811
+ * // ➔ true
1812
+ * isNonEmptyValue(NaN);
1813
+ * // ➔ false
1814
+ * isNonEmptyValue(true);
1815
+ * // ➔ true
1816
+ * isNonEmptyValue(false);
1817
+ * // ➔ false
1818
+ * isNonEmptyValue(null);
1819
+ * // ➔ false
1820
+ * isNonEmptyValue(undefined);
1821
+ * // ➔ false
1822
+ * isNonEmptyValue("");
1823
+ * // ➔ false
1824
+ * isNonEmptyValue(" ");
1825
+ * // ➔ false
1826
+ * isNonEmptyValue(0);
1827
+ * // ➔ true
1828
+ * isNonEmptyValue(-1);
1829
+ * // ➔ true
1830
+ * isNonEmptyValue(2);
1831
+ * // ➔ true
1832
+ * isNonEmptyValue(() => {});
1833
+ * // ➔ true
1834
+ */
1835
+ declare const isNonEmptyValue: (value: unknown, options?: IsNonEmptyValueOptions) => boolean;
1836
+ /** ---------------------------------------------------------
1837
+ * * ***Type guard: `isNull`.***
1838
+ * ----------------------------------------------------------
1839
+ * **Checks if a value is **[`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null)**.**
1840
+ * - **Behavior:**
1841
+ * - Narrows type to `null` when true.
1842
+ * - Strictly compares the value against `null`.
1843
+ * @param {*} val - The value to check.
1844
+ * @returns {boolean} Returns `true` if the value is `null`, otherwise `false`.
1845
+ * @example
1846
+ * isNull(null); // ➔ true
1847
+ * isNull(0); // ➔ false
1848
+ * isNull(undefined); // ➔ false
1849
+ */
1850
+ declare const isNull: (val: unknown) => val is null;
1851
+ /** ----------------------------------------------------
1852
+ * * ***Type guard: `isNumberObject`.***
1853
+ * ----------------------------------------------------
1854
+ * **Checks if a value is a **`Number` object wrapper**
1855
+ * (`new Number(...)`), not a primitive number.**
1856
+ * @param {*} value The value to check.
1857
+ * @returns {boolean} Returns `true` if `value` is a `Number` object.
1858
+ * @example
1859
+ * isNumberObject(new Number(42));
1860
+ * // ➔ true
1861
+ * isNumberObject(42);
1862
+ * // ➔ false
1863
+ */
1864
+ declare function isNumberObject(value: unknown): value is Number;
1865
+ type IsObject<T> = unknown extends T ? T & Record<PropertyKey, unknown> : T extends object ? T extends AnObjectNonArray ? T : IsHasKeysObject<T> extends false ? T & Record<PropertyKey, unknown> : IsArray<T> extends true ? Exclude<T, unknown[]> : T : never;
1866
+ /** ---------------------------------------------------------
1867
+ * * ***Type guard: `isObject`.***
1868
+ * ----------------------------------------------------------
1869
+ * **Checks if a value is an **object** (excluding `null` and `arrays`).**
1870
+ * - **✅ Returns `true` for any non-null object (arrays excluded), including:**
1871
+ * - Plain-objects (`{}`, `Object.create(null)`)
1872
+ * - Custom class instances
1873
+ * - Built-ins: `Date`, `RegExp`, `Error`, `URL`, `URLSearchParams`
1874
+ * - Collections: `Map`, `Set`, `WeakMap`, `WeakSet`
1875
+ * - Binary/typed data: `ArrayBuffer`, `DataView`, typed arrays (`Uint8Array`, `Int32Array`, etc.)
1876
+ * - DOM/Node objects: `HTMLElement`, `DocumentFragment`, etc.
1877
+ * - Proxies (wrapping any object type)
1878
+ * - **❌ Returns `false` for:**
1879
+ * - `null`
1880
+ * - Arrays (`[]`, `new Array()`)
1881
+ * - Functions (regular functions, arrow functions, class constructors)
1882
+ * - Primitives: `string`, `number`, `boolean`, `symbol`, `bigint`
1883
+ * - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`
1884
+ * - `undefined` (including `NaN`, which is a primitive number)
1885
+ * - **ℹ️ Note:**
1886
+ * - If you specifically need to check for ***plain-objects*** only, use ***`isPlainObject` utility function*** instead.
1887
+ * - If you specifically need to check for ***object***, ***plain-objects***, and include ***array***, use ***`isObjectOrArray` utility function*** instead.
1888
+ * @template T - The type of the value being checked.
1889
+ * @param {*} value - The value to check.
1890
+ * @returns {boolean} Returns `true` if the value is a ***plain-objects***, otherwise `false`.
1891
+ * @example
1892
+ * isObject({}); // ➔ true
1893
+ * isObject(Object.create(null)); // ➔ true
1894
+ * isObject(new Date()); // ➔ true
1895
+ * isObject(new Map()); // ➔ true
1896
+ * isObject(new Uint8Array()); // ➔ true
1897
+ * isObject(new String("x")); // ➔ true
1898
+ * isObject([]); // ➔ false
1899
+ * isObject(null); // ➔ false
1900
+ * isObject(undefined); // ➔ false
1901
+ * isObject(123); // ➔ false
1902
+ * isObject(() => {}); // ➔ false
1903
+ */
1904
+ declare function isObject<T extends object>(value: T): value is IsObject<T>;
1905
+ declare function isObject(value: unknown): value is Record<PropertyKey, unknown>;
1906
+ /** ----------------------------------------------------------
1907
+ * * ***Type guard: `isObjectLoose`.***
1908
+ * ----------------------------------------------------------
1909
+ * **Checks if a value is the
1910
+ * [ECMAScript language type ***Object***](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types).**
1911
+ * - **✅ Returns `true` for:**
1912
+ * - Plain objects (`{}`)
1913
+ * - Arrays (`[]`)
1914
+ * - Functions
1915
+ * - Regexes (`/abc/`)
1916
+ * - Boxed primitives:
1917
+ * - `new Number(0)`
1918
+ * - `new String("")`
1919
+ * - `new Boolean(false)`
1920
+ * - **❌ Returns `false` for:**
1921
+ * - `null`
1922
+ * - `undefined`
1923
+ * - Primitives:
1924
+ * - `string`
1925
+ * - `number`
1926
+ * - `boolean`
1927
+ * - `symbol`
1928
+ * - `bigint`
1929
+ * - **ℹ️ Note:**
1930
+ * - **For More Strict Object Use ***`isObject`*** or ***`isPlainObject` utility function*** instead.**
1931
+ * @template T - The type of the value being checked.
1932
+ * @param {*} value The value to check.
1933
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1934
+ * @example
1935
+ * isObjectLoose({});
1936
+ * // ➔ true
1937
+ * isObjectLoose([1, 2, 3]);
1938
+ * // ➔ true
1939
+ * isObjectLoose(()=> {});
1940
+ * // ➔ true
1941
+ * isObjectLoose(null);
1942
+ * // ➔ false
1943
+ * isObjectLoose(undefined);
1944
+ * // ➔ false
1945
+ */
1946
+ declare function isObjectLoose<T = object>(value: unknown): value is T;
1947
+ type IsObjectOrArray<T> = OrArr<[IsNever<T>, Extends<T, Record<PropertyKey, unknown>>, Extends<unknown, T>]> extends true ? T & Record<PropertyKey, unknown> & unknown[] : T extends object ? T extends unknown[] ? T : T extends AnObjectNonArray ? T : IsHasKeysObject<T> extends false ? T & Record<PropertyKey, unknown> : T : Extract<T, Record<PropertyKey, unknown> & unknown[]>;
1948
+ /** ---------------------------------------------------------
1949
+ * * ***Type guard: `isObjectOrArray`.***
1950
+ * ----------------------------------------------------------
1951
+ * **Checks if a value is an **object** or an **array**.**
1952
+ * - **✅ Returns `true` for:**
1953
+ * - Plain objects (`{}`, `Object.create(null)`)
1954
+ * - Custom objects
1955
+ * - Arrays (`[]`, `[1,2,3]`)
1956
+ * - **❌ Returns `false` for:**
1957
+ * - `null`
1958
+ * - `undefined`
1959
+ * - Primitives:
1960
+ * - `string`
1961
+ * - `number`
1962
+ * - `boolean`
1963
+ * - `symbol`
1964
+ * - `bigint`
1965
+ * - Functions
1966
+ * @template T - The type of the value being checked.
1967
+ * @param {*} value - The value to check.
1968
+ * @returns {boolean} Returns `true` if the value is an `object` or `array`.
1969
+ * @example
1970
+ * isObjectOrArray([1,2,3]); // ➔ true
1971
+ * isObjectOrArray({ name: "Alice" }); // ➔ true
1972
+ * isObjectOrArray(null); // ➔ false
1973
+ * isObjectOrArray(undefined); // ➔ false
1974
+ * isObjectOrArray("hello"); // ➔ false
1975
+ */
1976
+ declare function isObjectOrArray(value: []): value is [];
1977
+ declare function isObjectOrArray<T>(value: T): value is IsObjectOrArray<T>;
1978
+ /** ----------------------------------------------------------
1979
+ * * ***Type guard: `PropertyKey`.***
1980
+ * ----------------------------------------------------------
1981
+ * **Checks if a value is a valid `PropertyKey`.**
1982
+ * - **In JavaScript/TypeScript, a **`PropertyKey`** is any of:**
1983
+ * - **`string`**
1984
+ * - **`number`**
1985
+ * - **`symbol`**
1986
+ * - **This function ensures the given `value` is one of these types.**
1987
+ * - Narrows type to {@link PropertyKey | ***`PropertyKey`***} when true.
1988
+ * - Useful for working with dynamic object keys.
1989
+ * - Strictly rejects `null`, `undefined`, `boolean`, `object`, `function`, etc.
1990
+ * @param {*} value - The value to check.
1991
+ * @returns {boolean} Return `true` if `value` is a valid property key, otherwise `false`.
1992
+ * @example
1993
+ * isPropertyKey("foo");
1994
+ * // ➔ true
1995
+ * isPropertyKey(123);
1996
+ * // ➔ true
1997
+ * isPropertyKey(Symbol("id"));
1998
+ * // ➔ true
1999
+ * isPropertyKey({});
2000
+ * // ➔ false
2001
+ * isPropertyKey(null);
2002
+ * // ➔ false
2003
+ */
2004
+ declare function isPropertyKey(value: unknown): value is PropertyKey;
2005
+ /** ----------------------------------------------------------
2006
+ * * ***Type guard: `isRegExp`.***
2007
+ * ----------------------------------------------------------
2008
+ * **Checks if a value is a [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) instance.**
2009
+ * @param {*} value - The value to check.
2010
+ * @returns {boolean} Return `true` if value is an instance of **`RegExp`**.
2011
+ * @example
2012
+ * isRegExp(/abc/); // ➔ true
2013
+ * isRegExp(new RegExp("abc")); // ➔ true
2014
+ * isRegExp("abc"); // ➔ false
2015
+ */
2016
+ declare const isRegExp: (value: unknown) => value is RegExp;
2017
+ /** --------------------------------------------------
2018
+ * * ***Type guard: `isSafeInteger`.***
2019
+ * --------------------------------------------------
2020
+ * **Checks if `value` is a **[`Safe-Integer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger)**.**
2021
+ * - **Behavior:**
2022
+ * - Narrows type to `number` when true.
2023
+ * - **An integer is considered *safe* if:**
2024
+ * - It is an `IEEE-754` **double precision number**.
2025
+ * - It can be exactly represented without rounding errors.
2026
+ * - It lies within the range **-(2^53 - 1) to 2^53 - 1**.
2027
+ * - **Note:**
2028
+ * - This method is based on **{@link Number.isSafeInteger | `Number.isSafeInteger`}**.
2029
+ * @param {*} value - The value to check.
2030
+ * @returns {boolean} Return `true` if `value` is a safe integer, otherwise `false`.
2031
+ * @example
2032
+ * isSafeInteger(3);
2033
+ * // ➔ true
2034
+ * isSafeInteger(Number.MIN_VALUE);
2035
+ * // ➔ false
2036
+ * isSafeInteger(Infinity);
2037
+ * // ➔ false
2038
+ * isSafeInteger('3');
2039
+ * // ➔ false
2040
+ */
2041
+ declare function isSafeInteger(value: unknown): value is number;
2042
+ /** ---------------------------------------------------------
2043
+ * * ***Environment Predicate: `isServer`.***
2044
+ * ---------------------------------------------------------
2045
+ * **Detects whether the current code is executing in a
2046
+ * **non-browser JavaScript runtime** (server-side) rather
2047
+ * than in a web browser.**
2048
+ * @description
2049
+ * It simply checks for the absence of key browser globals like
2050
+ * [**`window`**](https://developer.mozilla.org/docs/Web/API/Window/window) and
2051
+ * [**`document`**](https://developer.mozilla.org/docs/Web/API/Window/document).
2052
+ * - *If those globals aren’t present, we treat the runtime as a server environment.*
2053
+ * @returns {boolean}
2054
+ * * ***true** – Code is executing on the `server`.*
2055
+ * * ***false** – Code is executing in a `browser`.*
2056
+ * @example
2057
+ * if (isServer()) {
2058
+ * console.log("Running on a server-side runtime");
2059
+ * } else {
2060
+ * console.log("Running in a browser");
2061
+ * }
2062
+ */
2063
+ declare const isServer: () => boolean;
2064
+ /** ---------------------------------------------------------
2065
+ * * ***Type guard: `isSet`.***
2066
+ * ----------------------------------------------------------
2067
+ * **Checks if a value is a **[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set)** object.**
2068
+ * - **Behavior:**
2069
+ * - Narrows type to `Set<T>` when true.
2070
+ * - Excludes `WeakSet`, arrays, plain objects, and other non-Set values.
2071
+ * @template T - The type of the value being checked.
2072
+ * @param {*} value - The value to check.
2073
+ * @returns {boolean} Returns `true` if the value is a `Set`, otherwise `false`.
2074
+ * @example
2075
+ * isSet(new Set);
2076
+ * // ➔ true
2077
+ * isSet(new WeakSet);
2078
+ * // ➔ false
2079
+ */
2080
+ declare function isSet<T = unknown>(value: Set<T>): value is Set<T>;
2081
+ declare function isSet(value: unknown): value is Set<unknown>;
2082
+ /** ---------------------------------------------------------
2083
+ * * ***Type guard: `isString`.***
2084
+ * ----------------------------------------------------------
2085
+ * **Checks if a value is of type
2086
+ * **[`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**.**
2087
+ * - **Behavior:**
2088
+ * - Narrows type to `string` when true.
2089
+ * - Uses the `typeof` operator for strict checking.
2090
+ * @param {*} value - The value to check.
2091
+ * @returns {boolean} Returns `true` if the value is a string, otherwise `false`.
2092
+ * @example
2093
+ * isString("hello"); // ➔ true
2094
+ * isString(123); // ➔ false
2095
+ *
2096
+ * // Usage in type narrowing
2097
+ * const value: unknown = getValue();
2098
+ * if (isString(value)) {
2099
+ * // TypeScript now knows `value` is a string
2100
+ * console.log(value.toUpperCase());
2101
+ * }
2102
+ */
2103
+ declare const isString: (value: unknown) => value is string;
2104
+ /** ----------------------------------------------------
2105
+ * * ***Type guard: `isStringObject`.***
2106
+ * ----------------------------------------------------
2107
+ * **Checks if a value is a **`String` object wrapper**
2108
+ * (`new String(...)`), not a primitive string.**
2109
+ * @param {*} value The value to check.
2110
+ * @returns {boolean} Returns `true` if `value` is a `String` object.
2111
+ * @example
2112
+ * isStringObject(new String("hello"));
2113
+ * // ➔ true
2114
+ * isStringObject("hello");
2115
+ * // ➔ false
2116
+ */
2117
+ declare function isStringObject(value: unknown): value is String;
2118
+ /** ----------------------------------------------------------
2119
+ * * ***Type guard: `isSymbol`.***
2120
+ * ----------------------------------------------------------
2121
+ * **Checks if a value is of type
2122
+ * **[`symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol)**.**
2123
+ * - **Behavior:**
2124
+ * - Narrows type to `symbol` when true.
2125
+ * - Uses the `typeof` operator for strict checking.
2126
+ * @param {*} value - The value to check.
2127
+ * @returns {boolean} Returns `true` if the value is a symbol, otherwise `false`.
2128
+ * @example
2129
+ * isSymbol(Symbol("id")); // ➔ true
2130
+ * isSymbol("not a symbol"); // ➔ false
2131
+ * isSymbol(123); // ➔ false
2132
+ * isSymbol(undefined); // ➔ false
2133
+ */
2134
+ declare const isSymbol: (value: unknown) => value is symbol;
2135
+ /** --------------------------------------------------
2136
+ * * ***Type guard: `isTypedArray`.***
2137
+ * ----------------------------------------------------------
2138
+ * **Checks if `value` is classified as a
2139
+ * **[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**.**
2140
+ * - **Behavior:**
2141
+ * - Validates that `value` is a non-null object.
2142
+ * - Uses `Object.prototype.toString` tag matching against known typed array tags.
2143
+ * - Narrows type to **{@link TypedArray | `TypedArray`}** when true.
2144
+ * @param {*} value - The value to check.
2145
+ * @returns {boolean} Returns `true` if the value is a typed array, otherwise `false`.
2146
+ * @example
2147
+ * isTypedArray(new Uint8Array); // ➔ true
2148
+ * isTypedArray(new Uint8Array()); // ➔ true
2149
+ * isTypedArray(new Float32Array()); // ➔ true
2150
+ * isTypedArray(new Uint8ClampedArray()); // ➔ true
2151
+ * isTypedArray([]); // ➔ false
2152
+ * isTypedArray(Buffer.from("hi")); // ➔ false
2153
+ */
2154
+ declare function isTypedArray(value: unknown): value is TypedArray;
2155
+ /** ---------------------------------------------------------
2156
+ * * ***Type guard: `isURL`.***
2157
+ * ----------------------------------------------------------
2158
+ * **Checks if a value is an instance of the
2159
+ * **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** class.**
2160
+ * - **Behavior:**
2161
+ * - Narrows type to `URL` when true.
2162
+ * - Excludes `strings`, `plain-objects`, and `other non-URL values`.
2163
+ * @param {*} value - The value to check.
2164
+ * @returns {boolean} Returns `true` if the value is an instance of `URL`, otherwise `false`.
2165
+ * @example
2166
+ * isURL(new URL("https://example.com"));
2167
+ * // ➔ true
2168
+ * isURL("https://example.com");
2169
+ * // ➔ false
2170
+ */
2171
+ declare const isURL: (value: unknown) => value is URL;
2172
+ /** ---------------------------------------------------------
2173
+ * * ***Type guard: `isUndefined`.***
2174
+ * ----------------------------------------------------------
2175
+ * **Checks if a value is
2176
+ * **[`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)**.**
2177
+ * - **Behavior:**
2178
+ * - Narrows type to `undefined` when true.
2179
+ * - Excludes `null`, `objects`, `arrays`, `strings`, `numbers`, and
2180
+ * `all other values`.
2181
+ * @param {*} value - The value to check.
2182
+ * @returns {boolean} Returns `true` if the value is `undefined`, otherwise `false`.
2183
+ * @example
2184
+ * isUndefined(undefined); // ➔ true
2185
+ * isUndefined([]); // ➔ false
2186
+ * isUndefined(123); // ➔ false
2187
+ * isUndefined(null); // ➔ false
2188
+ * isUndefined("abc"); // ➔ false
2189
+ */
2190
+ declare const isUndefined: (value: unknown) => value is undefined;
2191
+ /** ---------------------------------------------------------
2192
+ * * ***Options for `isValidDomain` predicate.***
2193
+ * ---------------------------------------------------------
2194
+ * **Customize the behavior of domain validation.**
2195
+ */
2196
+ type IsValidDomainOptions = {
2197
+ /** * ***Enable conversion of Unicode domains (IDN) to ASCII (punycode).***
2198
+ *
2199
+ * - Example: `"пример.рф"` ➔ `"xn--e1afmkfd.xn--p1ai"`
2200
+ * - Allows validating Unicode domains correctly.
2201
+ * - Default: `false`
2202
+ *
2203
+ * @defaultValue `false`.
2204
+ */
2205
+ allowUnicode?: boolean;
2206
+ /** * ***If `true`, validates **only top-level domains (TLDs)** that are not part of any SLD/second-level domain.***
2207
+ *
2208
+ * - Accepts country-code TLDs like `"ai"` or `"ai."` ✅
2209
+ * - Rejects common TLDs that are part of SLDs like `"com"` ❌
2210
+ * - Only the final label is checked; subdomains are ignored.
2211
+ * - Default: `false`
2212
+ *
2213
+ * @defaultValue `false`.
2214
+ */
2215
+ topLevel?: boolean;
2216
+ /** * ***Allow or disallow subdomains.***
2217
+ *
2218
+ * - Example: `"sub.example.com"` ✅ if `subdomain` is `true`, ❌ if `false`
2219
+ * - Wildcards and SLDs are considered when evaluating subdomains.
2220
+ * - Default: `true`
2221
+ *
2222
+ * @defaultValue `true`.
2223
+ */
2224
+ subdomain?: boolean;
2225
+ /** * ***Allow a wildcard `*` in the left-most label.***
2226
+ *
2227
+ * - Example: `"*.example.com"` ✅ if `wildcard` is `true`, ❌ if `false`
2228
+ * - Wildcards are only valid in the first label and require at least one additional label.
2229
+ * - Default: `false`
2230
+ *
2231
+ * @defaultValue `false`.
2232
+ */
2233
+ wildcard?: boolean;
2234
+ /** * ***Allow a port after the domain.***
2235
+ *
2236
+ * - Example: `"localhost:3000"` or `"example.com:8080"` ✅ if `allowPort` is `true`
2237
+ * - Validates that the port is a number between `1` and `65535`.
2238
+ * - Does not affect domain validation rules otherwise.
2239
+ * - Default: `false`
2240
+ *
2241
+ * @defaultValue `false`.
2242
+ */
2243
+ allowPort?: boolean;
2244
+ /** * ***Allow special domains like `localhost`.***
2245
+ *
2246
+ * - Example: `"localhost"` ✅ if `allowLocalhost` is `true`
2247
+ * - Works with or without a port if `allowPort` is enabled.
2248
+ * - Default: `false`
2249
+ *
2250
+ * @defaultValue `false`.
2251
+ */
2252
+ allowLocalhost?: boolean;
2253
+ /** * ***Allow URLs with protocol (`http`/`https`) and automatically extract the hostname.***
2254
+ *
2255
+ * - Example: `"https://example.com/foo/bar"` ➔ `"example.com"`
2256
+ * - The function will validate only the hostname part and ignore the path, query, and fragment.
2257
+ * - Default: `false`
2258
+ *
2259
+ * @defaultValue `false`.
2260
+ */
2261
+ allowProtocol?: boolean;
2262
+ };
2263
+ /** ---------------------------------------------------------
2264
+ * * ***Predicate: `isValidDomain`.***
2265
+ * ---------------------------------------------------------
2266
+ * **Validates whether a given string is a properly formatted domain name.**
2267
+ *
2268
+ * - **Supports options for:**
2269
+ * - `allowUnicode` ➔ allows internationalized domain names (IDN) with Unicode characters.
2270
+ * - `topLevel` ➔ validates **only top-level domains (TLDs)**; ignores subdomains and SLDs.
2271
+ * - `subdomain` ➔ allows or disallows subdomains.
2272
+ * - `wildcard` ➔ allows wildcard (`*`) in the left-most label.
2273
+ * - `allowPort` ➔ allows a port number after the domain (e.g., `example.com:8080`).
2274
+ * - `allowLocalhost` ➔ allows the special domain `"localhost"`.
2275
+ * - `allowProtocol` ➔ allows a URL with protocol (`http`/`https`) and extracts the hostname.
2276
+ *
2277
+ * - **Behavior:**
2278
+ * - ✅ Converts Unicode to ASCII (punycode) if `allowUnicode` is `true`.
2279
+ * - ✅ Checks label lengths (≤63 chars), valid characters, and punycode consistency.
2280
+ * - ✅ Validates port if `allowPort` is `true` (must be 1–65535).
2281
+ * - ✅ Accepts `"localhost"` if `allowLocalhost` is `true`.
2282
+ * - ✅ Extracts hostname from URLs if `allowProtocol` is `true`.
2283
+ * - ❌ Rejects invalid domains, labels starting/ending with `-`, double dots, malformed TLDs, or invalid port numbers.
2284
+ * - ✅ Handles both standard domains (example.com), URLs with protocols (https://example.com/foo), and IDNs (пример.рф).
2285
+ *
2286
+ * @param {*} value - The value to validate; only strings are valid domains.
2287
+ * @param {IsValidDomainOptions} [options] - Optional configuration for domain validation.
2288
+ * @param {boolean} [options.allowUnicode=false] - Enable punycode conversion for Unicode domains.
2289
+ * @param {boolean} [options.topLevel=false] - Validate only TLDs (e.g., `ai`, `uk.`); ignores SLDs like `com`.
2290
+ * @param {boolean} [options.subdomain=true] - Allow subdomains; set `false` to reject any subdomain.
2291
+ * @param {boolean} [options.wildcard=false] - Allow wildcard `*` in the left-most label (e.g., `*.example.com`).
2292
+ * @param {boolean} [options.allowPort=false] - Allow port number after domain (e.g., `:3000`); must be 1–65535.
2293
+ * @param {boolean} [options.allowLocalhost=false] - Allow special domain `"localhost"`.
2294
+ * @param {boolean} [options.allowProtocol=false] - Allow URLs with protocol (`http`/`https`) and extract hostname only.
2295
+ * @returns {boolean} Returns `true` if the value is a valid domain according to the rules and options; otherwise `false`.
2296
+ *
2297
+ * @example
2298
+ * isValidDomain("google.com");
2299
+ * // ➔ true
2300
+ * isValidDomain("пример.рф", { allowUnicode: true });
2301
+ * // ➔ true
2302
+ * isValidDomain("sub.example.com", { subdomain: false });
2303
+ * // ➔ false
2304
+ * isValidDomain("*.example.com", { wildcard: true });
2305
+ * // ➔ true
2306
+ * isValidDomain("com", { topLevel: true });
2307
+ * // ➔ false (common TLD rejected because it's part of SLD)
2308
+ * isValidDomain("ai.", { topLevel: true });
2309
+ * // ➔ true (country-code TLD accepted)
2310
+ * isValidDomain("localhost", { allowLocalhost: true });
2311
+ * // ➔ true
2312
+ * isValidDomain("localhost:3000", { allowLocalhost: true, allowPort: true });
2313
+ * // ➔ true
2314
+ * isValidDomain("example.com:8080", { allowPort: true });
2315
+ * // ➔ true
2316
+ * isValidDomain("https://example.com/foo/bar", { allowProtocol: true });
2317
+ * // ➔ true (protocol stripped and hostname validated)
2318
+ * isValidDomain("invalid_domain.com");
2319
+ * // ➔ false
2320
+ */
2321
+ declare function isValidDomain(value: unknown, options?: IsValidDomainOptions): boolean;
2322
+ /** ---------------------------------------------------------
2323
+ * * ***Predicate: `isValidURL`.***
2324
+ * ---------------------------------------------------------
2325
+ * **Validates whether a given string is a properly formatted URL.**
2326
+ * - **Ensures that the input is:**
2327
+ * - A non-empty string.
2328
+ * - A valid **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** with `http://` or `https://` scheme.
2329
+ * - **Behavior:**
2330
+ * - ✅ Includes decoding for percent-encoded URLs (e.g., `https%3A%2F%2F...`).
2331
+ * - ❌ Rejects invalid strings, unsupported schemes, and malformed domains.
2332
+ * @param {*} url - The value to validate.
2333
+ * @returns {boolean} Return `true` if the value is a **valid URL string**, otherwise `false`.
2334
+ * @example
2335
+ * isValidURL("https://example.com");
2336
+ * // ➔ true
2337
+ * isValidURL("ftp://example.com");
2338
+ * // ➔ false
2339
+ * isValidURL("not-a-url");
2340
+ * // ➔ false
2341
+ */
2342
+ declare const isValidURL: (url: unknown) => boolean;
2343
+ /** --------------------------------------------------
2344
+ * * ***Type guard: `isWeakMap`.***
2345
+ * ----------------------------------------------------------
2346
+ * **Checks if a value is a **[`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/WeakMap)** object.**
2347
+ * - **Behavior:**
2348
+ * - Narrows type to `WeakMap<K, V>` when true.
2349
+ * - Excludes `Map`, `arrays`, `plain-objects,` and `other non-WeakMap values`.
2350
+ * @template K - Keys must be objects.
2351
+ * @template V - Type of values stored in the WeakMap.
2352
+ * @param {*} value - The value to check.
2353
+ * @returns {boolean} Returns `true` if the value is a `WeakMap`, otherwise `false`.
2354
+ * @example
2355
+ * isWeakMap(new WeakMap);
2356
+ * // ➔ true
2357
+ * isWeakMap(new Map);
2358
+ * // ➔ false
2359
+ */
2360
+ declare function isWeakMap<K extends object = object, V = unknown>(value: unknown): value is WeakMap<K, V>;
2361
+ export { isArrayBuffer as $, isInteger as A, isEmptyDeep as B, isNil as C, isMatch as D, isMatchWith as E, isEqualWith as F, isDate as G, isEmpty as H, isEqual as I, isBooleanObject as J, isCurrencyLike as K, isEmptyValue as L, isFunction as M, isFinite as N, isMap as O, isError as P, isArrayLike as Q, isEmptyString as R, isNonEmptyArray as S, isNaN as T, isElement as U, isEmptyArray as V, isDeepEqual as W, isBigInt as X, isBoolean as Y, isArrayLikeObject as Z, isObject as _, isURL as a, textContainsAny as at, isNonEmptyValue as b, isStringObject as c, areURLsEqualPath as ct, isServer as d, isArray as et, isSafeInteger as f, isObjectLoose as g, isObjectOrArray as h, isUndefined as i, doesKeyExist as it, isInfinityNumber as j, isLength as k, isString as l, areObjectsEqual as lt, isPropertyKey as m, isValidURL as n, hasOwnProp as nt, isTypedArray as o, textContainsAll as ot, isRegExp as p, isBuffer as q, isValidDomain as r, arrayHasAnyMatch as rt, isSymbol as s, areURLsIdentical as st, isWeakMap as t, isArguments as tt, isSet as u, areArraysEqual as ut, isNumberObject as v, isNative as w, isNonEmptyString as x, isNull as y, isEmptyObject as z };