@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/README.md +56 -27
  2. package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +23 -23
  3. package/dist/any-BmdI8UbK.d.ts +56 -56
  4. package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +66 -66
  5. package/dist/assertions/index.cjs +1 -1
  6. package/dist/assertions/index.d.ts +398 -418
  7. package/dist/assertions/index.js +1 -1
  8. package/dist/chunk-26XIKDJI.cjs +1 -0
  9. package/dist/chunk-2NWHDDM5.js +1 -0
  10. package/dist/chunk-2UIRWYE3.js +1 -0
  11. package/dist/chunk-3KBHD3BS.cjs +1 -0
  12. package/dist/chunk-4HD2O5A4.js +1 -0
  13. package/dist/chunk-5C2SMIGX.cjs +1 -0
  14. package/dist/chunk-5I2B5DOG.js +1 -0
  15. package/dist/chunk-6HQDHIOD.js +1 -0
  16. package/dist/chunk-735HJXBT.cjs +1 -0
  17. package/dist/chunk-7BXIZM57.cjs +1 -0
  18. package/dist/chunk-7KJBDGEP.js +1 -0
  19. package/dist/chunk-7U44T63D.cjs +1 -0
  20. package/dist/chunk-AJ65QFV2.js +1 -0
  21. package/dist/chunk-APHDUCVQ.js +1 -0
  22. package/dist/chunk-BSVZRN7C.js +1 -0
  23. package/dist/chunk-C6JFHUR2.cjs +1 -0
  24. package/dist/chunk-CPLBRGST.js +1 -0
  25. package/dist/chunk-CTBRLEOG.js +1 -0
  26. package/dist/chunk-DUK2K4FB.js +1 -0
  27. package/dist/chunk-DVMHRLKP.cjs +1 -0
  28. package/dist/chunk-E63WVPZE.cjs +1 -0
  29. package/dist/chunk-EBMHQW7X.cjs +1 -0
  30. package/dist/chunk-EGNZCW4K.js +1 -0
  31. package/dist/chunk-FEKDB32T.js +1 -0
  32. package/dist/chunk-FIAAX3UE.js +1 -0
  33. package/dist/chunk-FUS3DVLB.cjs +1 -0
  34. package/dist/chunk-GGRMHIFJ.cjs +1 -0
  35. package/dist/chunk-HQ5GQTEE.js +1 -0
  36. package/dist/chunk-I5X5IN4H.js +1 -0
  37. package/dist/chunk-I7YGXQPI.cjs +1 -0
  38. package/dist/chunk-INUFZJLX.cjs +1 -0
  39. package/dist/chunk-IREHUBF7.js +1 -0
  40. package/dist/chunk-J2RGTPGK.cjs +1 -0
  41. package/dist/chunk-KHO2SBNA.cjs +1 -0
  42. package/dist/chunk-KXIXXSWX.cjs +1 -0
  43. package/dist/chunk-LBMEEJWA.js +1 -0
  44. package/dist/chunk-MC3LXMCQ.js +1 -0
  45. package/dist/chunk-MMSYCIJ2.cjs +1 -1
  46. package/dist/chunk-NU3N4WHD.cjs +1 -0
  47. package/dist/chunk-ODZQXH7E.cjs +1 -0
  48. package/dist/chunk-ONZFBJVW.js +1 -0
  49. package/dist/chunk-PXDRHFIE.js +1 -0
  50. package/dist/chunk-Q6NHYWVX.js +1 -0
  51. package/dist/chunk-QNKGP5DY.js +1 -0
  52. package/dist/chunk-S6Z6I2EG.cjs +1 -0
  53. package/dist/chunk-SMADKXZE.js +1 -0
  54. package/dist/chunk-TSLYDPBJ.js +1 -0
  55. package/dist/chunk-TVXADXCC.cjs +1 -0
  56. package/dist/chunk-UDA26MCU.cjs +1 -0
  57. package/dist/chunk-UET567YM.cjs +1 -0
  58. package/dist/chunk-VEYMQ3UA.js +1 -0
  59. package/dist/chunk-W2W3L2M5.js +1 -0
  60. package/dist/chunk-WBWTXKMC.cjs +1 -0
  61. package/dist/chunk-WVSPXFTY.js +1 -0
  62. package/dist/chunk-XC2PYCT4.cjs +1 -0
  63. package/dist/chunk-XIXA5KDF.cjs +1 -0
  64. package/dist/chunk-Y4O5KZF6.cjs +1 -0
  65. package/dist/chunk-YRM7IJLX.js +1 -0
  66. package/dist/chunk-YT3MSZKK.cjs +1 -0
  67. package/dist/chunk-YXHCULSO.cjs +1 -0
  68. package/dist/chunk-YZR5OGJA.cjs +1 -0
  69. package/dist/chunk-Z4DXK7A6.cjs +1 -0
  70. package/dist/chunk-ZXIWDFEQ.js +1 -0
  71. package/dist/conversions/index.cjs +1 -1
  72. package/dist/conversions/index.d.ts +1368 -1515
  73. package/dist/conversions/index.js +1 -1
  74. package/dist/env/index.cjs +1 -1
  75. package/dist/env/index.d.ts +14 -17
  76. package/dist/env/index.js +1 -1
  77. package/dist/events/index.cjs +1 -1
  78. package/dist/events/index.d.ts +111 -108
  79. package/dist/events/index.js +1 -1
  80. package/dist/extends-Bk_SBGdT.d.ts +367 -0
  81. package/dist/formatting/index.cjs +1 -1
  82. package/dist/formatting/index.d.ts +878 -840
  83. package/dist/formatting/index.js +1 -1
  84. package/dist/generator/index.cjs +1 -1
  85. package/dist/generator/index.d.ts +173 -150
  86. package/dist/generator/index.js +1 -1
  87. package/dist/if-CvT4R7Kh.d.ts +16 -16
  88. package/dist/is-array-Cymwrsmm.d.ts +1119 -0
  89. package/dist/isPlainObject-BVhBAPHX.d.ts +169 -0
  90. package/dist/never-BfayMBF9.d.ts +64 -64
  91. package/dist/next/index.cjs +1 -8
  92. package/dist/next/index.d.ts +196 -176
  93. package/dist/next/index.js +1 -8
  94. package/dist/next/server/index.cjs +1 -2
  95. package/dist/next/server/index.d.ts +26 -40
  96. package/dist/next/server/index.js +1 -2
  97. package/dist/nils-DMz3kU7M.d.ts +155 -155
  98. package/dist/omit-VvmIsZmX.d.ts +25 -25
  99. package/dist/operations/index.cjs +1 -1
  100. package/dist/operations/index.d.ts +121 -176
  101. package/dist/operations/index.js +1 -1
  102. package/dist/or-DyZCRvaU.d.ts +89 -0
  103. package/dist/parsers/index.cjs +1 -1
  104. package/dist/parsers/index.d.ts +35 -36
  105. package/dist/parsers/index.js +1 -1
  106. package/dist/predicates/index.cjs +1 -1
  107. package/dist/predicates/index.d.ts +1797 -1677
  108. package/dist/predicates/index.js +1 -1
  109. package/dist/prettify-C4xLcYOP.d.ts +328 -328
  110. package/dist/promise/index.cjs +1 -1
  111. package/dist/promise/index.d.ts +29 -38
  112. package/dist/promise/index.js +1 -1
  113. package/dist/rzl-utils.global.js +1 -4
  114. package/dist/string-XA-til3C.d.ts +351 -0
  115. package/dist/strings/index.cjs +1 -1
  116. package/dist/strings/index.d.ts +712 -787
  117. package/dist/strings/index.js +1 -1
  118. package/dist/tailwind/index.cjs +1 -0
  119. package/dist/tailwind/index.d.ts +565 -0
  120. package/dist/tailwind/index.js +1 -0
  121. package/dist/type-data-DDs-u2kq.d.ts +241 -241
  122. package/dist/types/index.d.ts +3266 -3266
  123. package/dist/urls/index.cjs +1 -1
  124. package/dist/urls/index.d.ts +384 -409
  125. package/dist/urls/index.js +1 -1
  126. package/package.json +61 -18
  127. package/dist/array-CIZRbqTF.d.ts +0 -223
  128. package/dist/chunk-2TRAPBZ7.cjs +0 -1
  129. package/dist/chunk-3D74QO5D.cjs +0 -1
  130. package/dist/chunk-4DK3RCC4.js +0 -2
  131. package/dist/chunk-4JOQ45HL.js +0 -1
  132. package/dist/chunk-55CZALRS.js +0 -1
  133. package/dist/chunk-56QBKKRE.js +0 -1
  134. package/dist/chunk-5JFV3GDE.cjs +0 -4
  135. package/dist/chunk-5SZUSNGZ.js +0 -1
  136. package/dist/chunk-62HX5Z45.cjs +0 -1
  137. package/dist/chunk-7NA6DUHR.cjs +0 -2
  138. package/dist/chunk-7YWAQOA4.cjs +0 -1
  139. package/dist/chunk-BVPMMWDL.cjs +0 -1
  140. package/dist/chunk-BYZAD3XN.cjs +0 -1
  141. package/dist/chunk-CEFYHEM4.cjs +0 -1
  142. package/dist/chunk-CN53M4QZ.cjs +0 -1
  143. package/dist/chunk-D47MHBSD.cjs +0 -1
  144. package/dist/chunk-DGH75GJD.js +0 -1
  145. package/dist/chunk-E5NUI7PN.js +0 -1
  146. package/dist/chunk-ELDDNERR.js +0 -1
  147. package/dist/chunk-EXZ47NOW.js +0 -1
  148. package/dist/chunk-FDITZ5C6.cjs +0 -1
  149. package/dist/chunk-FF76ISQ2.js +0 -1
  150. package/dist/chunk-FIEZKTAZ.cjs +0 -1
  151. package/dist/chunk-FSSV24W7.cjs +0 -1
  152. package/dist/chunk-GCGU2WB7.js +0 -1
  153. package/dist/chunk-GECI2YBP.js +0 -1
  154. package/dist/chunk-GQE4OVHC.cjs +0 -1
  155. package/dist/chunk-GRVZXQXL.cjs +0 -1
  156. package/dist/chunk-I4AVNHPA.cjs +0 -1
  157. package/dist/chunk-JFRL7NKU.js +0 -4
  158. package/dist/chunk-JWHM3WZQ.cjs +0 -1
  159. package/dist/chunk-KCQDDZJE.cjs +0 -1
  160. package/dist/chunk-L54ZPSYJ.js +0 -1
  161. package/dist/chunk-LVKAYEZ4.js +0 -1
  162. package/dist/chunk-MBDWTK54.cjs +0 -1
  163. package/dist/chunk-MNGGDB2G.js +0 -1
  164. package/dist/chunk-MY7BA4GI.cjs +0 -1
  165. package/dist/chunk-N2IJPIND.cjs +0 -1
  166. package/dist/chunk-NIMNTEGV.js +0 -1
  167. package/dist/chunk-NNM7QCNB.js +0 -1
  168. package/dist/chunk-PUQXRLZH.cjs +0 -1
  169. package/dist/chunk-PVJF2JHM.js +0 -1
  170. package/dist/chunk-QCFXEUKL.js +0 -1
  171. package/dist/chunk-QFCGBBSY.js +0 -1
  172. package/dist/chunk-QQYAUPSK.cjs +0 -1
  173. package/dist/chunk-RN3TP3S3.js +0 -1
  174. package/dist/chunk-RV2VULM7.cjs +0 -1
  175. package/dist/chunk-SW6HYEW7.cjs +0 -1
  176. package/dist/chunk-SYJC7UAW.js +0 -1
  177. package/dist/chunk-TC4VBE4Y.cjs +0 -1
  178. package/dist/chunk-TUXDINHF.cjs +0 -1
  179. package/dist/chunk-U5Y2FXMN.cjs +0 -1
  180. package/dist/chunk-UUPQI6ND.cjs +0 -1
  181. package/dist/chunk-VYCGZ2S6.js +0 -1
  182. package/dist/chunk-W5EDKJK3.js +0 -1
  183. package/dist/chunk-WHAVUFEU.js +0 -1
  184. package/dist/chunk-XCFIOTCV.js +0 -1
  185. package/dist/chunk-XE27XPJR.js +0 -1
  186. package/dist/chunk-XH6MCRLP.js +0 -1
  187. package/dist/chunk-XVB3ZZEB.js +0 -1
  188. package/dist/chunk-ZBSIGJFO.cjs +0 -1
  189. package/dist/chunk-ZYAML74V.js +0 -1
  190. package/dist/extends-Mp81Hq9-.d.ts +0 -145
  191. package/dist/index.cjs +0 -1
  192. package/dist/index.d.ts +0 -1
  193. package/dist/index.js +0 -1
  194. package/dist/is-array-Ckm_47hw.d.ts +0 -1557
  195. package/dist/isPlainObject-BKYaI6a8.d.ts +0 -182
  196. package/dist/stylings/index.cjs +0 -1
  197. package/dist/stylings/index.d.ts +0 -49
  198. package/dist/stylings/index.js +0 -1
@@ -1,220 +1,283 @@
1
- import{m as IsPositive,P as ParseNumber,I as IsStringLiteral,C as CharAt,o as AnyString,a as IsEmptyString,T as Trim,e as IsUnknown,p as IsReadonlyArray,t as IsArray,h as OrArr}from'../is-array-Ckm_47hw.js';import{I as IsAny}from'../any-BmdI8UbK.js';import{A as AnyFunction,a as AnObjectNonArray,T as TypedArray}from'../type-data-DDs-u2kq.js';import{E as Extends}from'../extends-Mp81Hq9-.js';import{P as Prettify}from'../prettify-C4xLcYOP.js';import{N as NumberRangeUnion}from'../NumberRangeUnion-DC-C3_Kq.js';import{a as IsPlainObjectResult}from'../isPlainObject-BKYaI6a8.js';export{G as GetPreciseTypeOptions,I as IsNumberOptions,g as getPreciseType,i as isNumber,b as isPlainObject}from'../isPlainObject-BKYaI6a8.js';import{I as IsNever}from'../never-BfayMBF9.js';import'../if-CvT4R7Kh.js';import'../array-CIZRbqTF.js';type EmptyObject<T>={[K in keyof T]?:never;};type EmptyObjectOf<T>=EmptyObject<T>extends T?EmptyObject<T>:never;type List<T>=ArrayLike<T>;type IsEqualCustomizer=(value:unknown,other:unknown,indexOrKey:PropertyKey,parent:unknown,otherParent:unknown,stack:unknown)=>boolean|undefined;type isMatchWithCustomizer=(value:unknown,other:unknown,indexOrKey:PropertyKey,object:object,source:object)=>boolean|undefined;
1
+ import{h as IsPositive,P as ParseNumber,I as IsStringLiteral,C as CharAt,c as IsUnknown,j as IsReadonlyArray,l as IsArray}from'../is-array-Cymwrsmm.js';import{A as AnyString,a as IsEmptyString,T as Trim}from'../string-XA-til3C.js';import{I as IsAny}from'../any-BmdI8UbK.js';import{A as AnyFunction,a as AnObjectNonArray,T as TypedArray}from'../type-data-DDs-u2kq.js';import{E as Extends}from'../extends-Bk_SBGdT.js';import{P as Prettify}from'../prettify-C4xLcYOP.js';import{N as NumberRangeUnion}from'../NumberRangeUnion-DC-C3_Kq.js';import{a as IsPlainObjectResult}from'../isPlainObject-BVhBAPHX.js';export{G as GetPreciseTypeOptions,I as IsNumberOptions,g as getPreciseType,i as isNumber,b as isPlainObject}from'../isPlainObject-BVhBAPHX.js';import{I as IsNever}from'../never-BfayMBF9.js';import{O as OrArr}from'../or-DyZCRvaU.js';import'../if-CvT4R7Kh.js';type EmptyObject<T>={[K in keyof T]?:never;};type EmptyObjectOf<T>=EmptyObject<T>extends T?EmptyObject<T>:never;type List<T>=ArrayLike<T>;type CustomizerIsEqualWith=(value:unknown,other:unknown,indexOrKey:PropertyKey,parent:unknown,otherParent:unknown,stack:unknown)=>boolean|undefined;type CustomizerIsMatchWith=(value:unknown,other:unknown,indexOrKey:PropertyKey,object:object,source:object)=>boolean|undefined;
2
2
  /** ----------------------------------------------------------
3
- * * ***Compares two arrays deeply to check if they are equal.***
4
- * ----------------------------------------------------------
5
- *
6
- * Supports deep comparison of arrays containing nested arrays or objects.
7
- * Can also ignore the order of elements at all levels by recursively sorting.
8
- *
9
- * ----------------------------------------------------------
10
- *
11
- * @param {unknown[]} array1
12
- * The first array to compare. Can contain nested arrays or objects.
13
- *
14
- * @param {unknown[]} array2
15
- * The second array to compare against. Should match structure of `array1`.
16
- *
17
- * @param {boolean} [ignoreOrder=false]
18
- * Whether to ignore the order of elements when comparing.
19
- * If `true`, will sort both arrays recursively before comparing.
20
- * Default is `false`.
21
- *
22
- * @returns {boolean}
23
- * Returns `true` if both arrays are deeply equal, otherwise `false`.
24
- *
25
- * @throws {TypeError}
26
- * Throws if `array1` or `array2` are not arrays, or if `ignoreOrder` is not a boolean.
27
- *
28
- * @example
29
- * ```ts
30
- * areArraysEqual([1, 2, 3], [1, 2, 3]);
31
- * // → true
32
- *
33
- * areArraysEqual([1, 2, 3], [3, 2, 1]);
34
- * // → false
35
- *
36
- * areArraysEqual([1, 2, 3], [3, 2, 1], true);
37
- * // → true (order ignored)
38
- *
39
- * areArraysEqual([{ x: 1 }, { y: 2 }], [{ y: 2 }, { x: 1 }], true);
40
- * // → true
41
- * ```
42
- */
3
+ * * ***Predicate: `areArraysEqual`.***
4
+ * ----------------------------------------------------------
5
+ * **Compares two arrays deeply to check if they are equal.**
6
+ * @description Supports deep comparison of arrays containing nested arrays or objects,
7
+ * can also ignore the order of elements at all levels by recursively sorting.
8
+ * @param {unknown[]} array1
9
+ * The first array to compare. Can contain nested arrays or objects.
10
+ * @param {unknown[]} array2
11
+ * The second array to compare against. Should match structure of `array1`.
12
+ * @param {boolean|undefined} [ignoreOrder=false]
13
+ * Whether to ignore the order of elements when comparing.
14
+ * - If `true`, will sort both arrays recursively before comparing, default is `false`.
15
+ * @returns {boolean}
16
+ * Returns `true` if both arrays are deeply equal, otherwise `false`.
17
+ * @throws {TypeError}
18
+ * Throws if `array1` or `array2` are not arrays, or if `ignoreOrder` is not a boolean.
19
+ * @example
20
+ * ```ts
21
+ * areArraysEqual([1, 2, 3], [1, 2, 3]);
22
+ * // ➔ true
23
+ * areArraysEqual([1, 2, 3], [3, 2, 1]);
24
+ * // ➔ false
25
+ * areArraysEqual([1, 2, 3], [3, 2, 1], true);
26
+ * // true (order ignored)
27
+ * areArraysEqual([{ x: 1 }, { y: 2 }], [{ y: 2 }, { x: 1 }], true);
28
+ * // ➔ true
29
+ * ```
30
+ */
43
31
  declare const areArraysEqual:(array1:unknown[],array2:unknown[],ignoreOrder?:boolean)=>boolean;
44
32
  /** ---------------------------------
45
- * * ***Compares two objects for deep equality.***
46
- * ---------------------------------
47
- *
48
- * @template T1 The type of the first object.
49
- * @template T2 The type of the second object.
50
- * @param {T1} object1 - The first object to compare.
51
- * @param {T2} object2 - The second object to compare.
52
- * @returns {boolean} `true` if both objects are deeply equal, otherwise `false`.
53
- *
54
- * @example
55
- * areObjectsEqual({ a: 1, b: 2 }, { a: 1, b: 2 }); // Returns true
56
- * areObjectsEqual({ a: 1 }, { a: 1, b: undefined }); // Returns false
57
- * areObjectsEqual([1, 2, 3], [1, 2, 3]); // Returns true
58
- */
33
+ * * ***Predicate: `areObjectsEqual`.***
34
+ * ---------------------------------
35
+ * **Compares two objects for deep equality.**
36
+ * @template T1 The type of the first object.
37
+ * @template T2 The type of the second object.
38
+ * @param {*} object1 - The first object to compare.
39
+ * @param {*} object2 - The second object to compare.
40
+ * @returns {boolean} Return `true` if both objects are deeply equal, otherwise `false`.
41
+ * @example
42
+ * areObjectsEqual({ a: 1, b: 2 }, { a: 1, b: 2 });
43
+ * // true
44
+ * areObjectsEqual({ a: 1 }, { a: 1, b: undefined });
45
+ * // false
46
+ * areObjectsEqual([1, 2, 3], [1, 2, 3]);
47
+ * // ➔ true
48
+ */
59
49
  declare const areObjectsEqual:(object1:unknown,object2:unknown)=>boolean;
60
50
  /** ---------------------------------
61
- * * ***Checks if two URLs are the same, ignoring query parameters.***
62
- * ---------------------------------
63
- *
64
- * This function compares only the protocol, host, and pathname.
65
- *
66
- * @param {URL} urlA - The first URL to compare.
67
- * @param {URL} urlB - The second URL to compare.
68
- * @returns {boolean} Returns `true` if both URLs are the same (ignoring search parameters), otherwise `false`.
69
- */
51
+ * * ***Predicate: `areURLsEqualPath`.***
52
+ * ---------------------------------
53
+ * **Checks if two URLs are the same, ignoring query parameters, this function compares only the protocol, host, and pathname.**
54
+ * @param {URL} urlA - The first URL to compare.
55
+ * @param {URL} urlB - The second URL to compare.
56
+ * @returns {boolean} Returns `true` if both URLs are the same (ignoring search parameters), otherwise `false`.
57
+ * @example
58
+ * // Same domain, same path, different query -> true
59
+ * areURLsEqualPath(new URL("https://example.com/page?a=1"), new URL("https://example.com/page?b=2"));
60
+ * // ➔ true
61
+ *
62
+ * // Same domain, different path -> false
63
+ * areURLsEqualPath(new URL("https://example.com/page1"), new URL("https://example.com/page2"));
64
+ * // ➔ false
65
+ *
66
+ * // Different protocol -> false
67
+ * areURLsEqualPath(new URL("http://example.com/page"), new URL("https://example.com/page"));
68
+ * // ➔ false
69
+ *
70
+ * // Same protocol, same host, same path (ignores query & hash) -> true
71
+ * areURLsEqualPath(new URL("https://example.com/page#section"), new URL("https://example.com/page"));
72
+ * // ➔ true
73
+ */
70
74
  declare const areURLsEqualPath:(urlA:URL,urlB:URL)=>boolean;
71
75
  /** ---------------------------------
72
- * * ***Checks if two URLs are exactly the same, including protocol, host, pathname, and query parameters.***
73
- * ---------------------------------
74
- *
75
- * @param {URL} urlA - The first URL to compare.
76
- * @param {URL} urlB - The second URL to compare.
77
- * @returns {boolean} Returns `true` if both URLs are identical, otherwise `false`.
78
- */
79
- declare const areURLsIdentical:(urlA:URL,urlB:URL)=>boolean;
80
- /** ----------------------------------------------------------
81
- * * ***Checks if the given `text` contains all of the specified `searchWords`.***
82
- * ----------------------------------------------------------
83
- *
84
- * - Uses **regular expressions** for flexible pattern matching.
85
- * - **Escapes special characters** to prevent regex injection attacks.
86
- * - ✅ **Trims input** to avoid false positives with empty spaces.
87
- * - **Supports exact word matching** (optional).
88
- *
89
- * @param {string} text - The text to search within.
90
- * @param {string[]} searchWords - An array of words/phrases to match against the text.
91
- * @param {boolean} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.
92
- * @param {string} [options.flags="i"] - Optional regex flags (default: `"i"` for case-insensitive).
93
- * @returns {boolean} - `true` if all `searchWords` are found in `text`, otherwise `false`.
94
- *
95
- * @example
96
- * textContainsAll("Hello world, WithAI APP", ["Hello", "world"]); // true
97
- * textContainsAll("JavaScript and TypeScript", ["Java", "Script"]); // true
98
- * textContainsAll("Machine Learning", ["AI", "Learning"]); // false
99
- * textContainsAll("open-source", ["open"], { exactMatch: true }); // false (because options `exactMatch=true`)
100
- */
101
- declare const textContainsAll:<T extends string>(text:T,searchWords:T[]|string[],options?:{
102
- /** If `true`, matches whole words only, defaultValue is `false`. */
76
+ * * ***Predicate: `areURLsIdentical`.***
77
+ * ---------------------------------
78
+ * **Checks if two URLs are exactly the same, including protocol, host, pathname, and query parameters.**
79
+ * @param {URL} urlA - The first URL to compare.
80
+ * @param {URL} urlB - The second URL to compare.
81
+ * @returns {boolean} Returns `true` if both URLs are identical, otherwise `false`.
82
+ * @example
83
+ * // Identical URLs -> true
84
+ * areURLsIdentical(new URL("https://example.com/page?a=1"), new URL("https://example.com/page?a=1"));
85
+ * // true
86
+ *
87
+ * // Same path, different query parameter -> false
88
+ * areURLsIdentical(new URL("https://example.com/page?a=1"), new URL("https://example.com/page?b=2"));
89
+ * // false
90
+ *
91
+ * // Same host & query, but different protocol -> false
92
+ * areURLsIdentical(new URL("http://example.com/page?a=1"), new URL("https://example.com/page?a=1"));
93
+ * // false
94
+ *
95
+ * // Same everything except trailing slash -> false
96
+ * areURLsIdentical(new URL("https://example.com/page"), new URL("https://example.com/page/"));
97
+ * // false
98
+ */
99
+ declare const areURLsIdentical:(urlA:URL,urlB:URL)=>boolean;type OptionsTextContainsAll={
100
+ /** If `true`, matches whole words only, defaultValue is `false`.
101
+ *
102
+ * @default false
103
+ */
103
104
  exactMatch?:boolean;
104
- /** Optional regex flags (default: `"i"` for case-insensitive). */
105
- flags?:string;})=>boolean;
105
+ /** Optional regex flags (default: `"i"` for case-insensitive).
106
+ *
107
+ * @default "i"
108
+ */
109
+ flags?:string;};
106
110
  /** ----------------------------------------------------------
107
- * * ***Checks if the given `text` contains at least one of the specified `searchWords`.***
108
- * ----------------------------------------------------------
109
- *
110
- * - ✅ Uses **regular expressions** for flexible pattern matching.
111
- * - **Escapes special characters** to prevent regex injection attacks.
112
- * - **Trims input** to avoid false positives with empty spaces.
113
- * - **Supports exact word matching** (optional).
114
- *
115
- * @param {string} text - The text to search within.
116
- * @param {string[]} searchWords - An array of words/phrases to match against the text.
117
- * @param {boolean} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.
118
- * @param {string} [options.flags="i"] - Optional regex flags (default: `"i"` for case-insensitive).
119
- * @returns {boolean} - `true` if at least one `searchWord` is found in `text`, otherwise `false`.
120
- *
121
- * @example
122
- * textContainsAny("Hello world", ["hello", "test"]); // true
123
- * textContainsAny("withAI APP", ["chat", "ai"]); // false
124
- * textContainsAny("TypeScript is great!", ["script", "java"]); // true
125
- * textContainsAny("open-source", ["open"], { exactMatch: true }); // false (because options `exactMatch=true`)
126
- */
127
- declare const textContainsAny:<T extends string>(text:T,searchWords:T[]|string[],options?:{
128
- /** If `true`, matches whole words only, defaultValue is `false`. */
111
+ * * ***Predicate: `textContainsAll`.***
112
+ * ----------------------------------------------------------
113
+ * **Checks if the given `text` contains all of the specified `searchWords`.**
114
+ * - **Behavior:**
115
+ * - Returns `false` if `text` or `searchWords` is `null`/`undefined`/invalid.
116
+ * - Uses **regular expressions** for flexible pattern matching.
117
+ * - **Escapes special characters** to prevent regex injection attacks.
118
+ * - **Trims input** to avoid false positives with empty spaces.
119
+ * - **Supports exact word matching** (optional).
120
+ * @param {string|null|undefined} text - The string text to search within.
121
+ * @param {string[]|null} [searchWords] - An array of words/phrases to match against the text.
122
+ * @param {OptionsTextContainsAll} [options] - Optional configuration object.
123
+ * @param {OptionsTextContainsAll["exactMatch"]} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.
124
+ * @param {OptionsTextContainsAll["flags"]} [options.flags="i"] - Optional regex flags (default: `"i"` for case-insensitive).
125
+ * @returns {boolean} Return `true` if all `searchWords` are found in `text`, otherwise `false`.
126
+ * @example
127
+ * textContainsAll("Hello world, WithAI APP", ["Hello", "world"]);
128
+ * // true
129
+ * textContainsAll("JavaScript and TypeScript", ["Java", "Script"]);
130
+ * // ➔ true
131
+ * textContainsAll("Machine Learning", ["AI", "Learning"]);
132
+ * // false
133
+ * textContainsAll("open-source", ["open"], { exactMatch: true });
134
+ * // ➔ false (because options `exactMatch=true`)
135
+ * textContainsAll(null, ["test"]);
136
+ * // ➔ false (invalid text)
137
+ * textContainsAll("Hello", null);
138
+ * // ➔ false (invalid searchWords)
139
+ */
140
+ declare const textContainsAll:<T extends string>(text?:T|null,searchWords?:T[]|string[]|null,options?:OptionsTextContainsAll)=>boolean;type OptionsTextContainsAny={
141
+ /** If `true`, matches whole words only, defaultValue is `false`.
142
+ *
143
+ * @default false
144
+ */
129
145
  exactMatch?:boolean;
130
- /** Optional regex flags (default: `"i"` for case-insensitive). */
131
- flags?:string;})=>boolean;
146
+ /** Optional regex flags (default: `"i"` for case-insensitive).
147
+ *
148
+ * @default "i"
149
+ */
150
+ flags?:string;};
151
+ /** ----------------------------------------------------------
152
+ * * ***Predicate: `textContainsAny`.***
153
+ * ----------------------------------------------------------
154
+ * **Checks if the given `text` contains at least one of the specified `searchWords`.**
155
+ * - **Behavior:**
156
+ * - Returns `false` if `text` or `searchWords` is `null`/`undefined`/invalid.
157
+ * - Uses **regular expressions** for flexible pattern matching.
158
+ * - **Escapes special characters** to prevent regex injection attacks.
159
+ * - **Trims input** to avoid false positives with empty spaces.
160
+ * - **Supports exact word matching** (optional).
161
+ * @param {string|null|undefined} text - The string text to search within.
162
+ * @param {string[]|null} [searchWords] - An array of words/phrases to match against the text.
163
+ * @param {OptionsTextContainsAny} [options] - Optional configuration object.
164
+ * @param {OptionsTextContainsAny["exactMatch"]} [options.exactMatch=false] - If `true`, matches whole words only, defaultValue is `false`.
165
+ * @param {OptionsTextContainsAny["flags"]} [options.flags="i"] - Optional regex flags (default: `"i"` for case-insensitive).
166
+ * @returns {boolean} Return `true` if at least one `searchWord` is found in `text`, otherwise `false`.
167
+ * @example
168
+ * textContainsAny("Hello world", ["hello", "test"]);
169
+ * // ➔ true
170
+ * textContainsAny("withAI APP", ["chat", "ai"]);
171
+ * // ➔ false
172
+ * textContainsAny("TypeScript is great!", ["script", "java"]);
173
+ * // ➔ true
174
+ * textContainsAny("open-source", ["open"], { exactMatch: true });
175
+ * // ➔ false (because options `exactMatch=true`)
176
+ * textContainsAny(null, ["test"]);
177
+ * // ➔ false (invalid text)
178
+ * textContainsAny("Hello", null);
179
+ * // ➔ false (invalid searchWords)
180
+ */
181
+ declare const textContainsAny:<T extends string>(text?:T|null,searchWords?:T[]|string[]|null,options?:OptionsTextContainsAny)=>boolean;
132
182
  /** ----------------------------------------------------------
133
- * * ***Recursively checks if a given key exists in an object or array.***
134
- * ----------------------------------------------------------
135
- *
136
- * - **Supports deeply nested objects and arrays**, searching recursively.
137
- * - Uses `Object.prototype.hasOwnProperty.call()` to safely check if the key exists at each level,
138
- * even if its value is `null` or `undefined`.
139
- * - Optimized to return `true` immediately when the key is found (short-circuits).
140
- * - Handles edge cases gracefully:
141
- * - Returns `false` for `null`, `undefined`, or non-object inputs.
142
- * - Returns `false` if key is not found anywhere, even in deeply nested structures.
143
- *
144
- * ⚠️ Note: This function only checks for **the existence of the key itself**,
145
- * not whether its value is non-null or non-undefined.
146
- * If you need to check for both existence and meaningful value, write a stricter function.
147
- *
148
- * @template T - The type of the input object or array.
149
- * @param {T | Record<string, unknown> | unknown[]} object - The object or array to search.
150
- * @param {PropertyKey} key - The key to look for (string, number, or symbol).
151
- * @returns {boolean} Returns `true` if the key exists anywhere in the object or array (even with `null` / `undefined` value), otherwise `false`.
152
- *
153
- * @example
154
- * doesKeyExist({ name: "John", age: 30 }, "age"); // true
155
- * doesKeyExist({ user: { profile: { email: "test@example.com" } } }, "email"); // true
156
- * doesKeyExist([{ id: 1 }, { id: 2 }], "id"); // true
157
- * doesKeyExist({ a: { b: { c: 10 } } }, "d"); // false
158
- * doesKeyExist(null, "name"); // false
159
- * doesKeyExist(undefined, "test"); // false
160
- *
161
- * @example
162
- * // Key exists even if value is null or undefined:
163
- * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "a"); // true
164
- * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "b"); // true
165
- * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "d"); // true
166
- *
167
- * @example
168
- * doesKeyExist({ a: 1 }, true); // Throws TypeError
169
- * doesKeyExist({ a: 1 }, ["not", "valid"]); // Throws TypeError
170
- */
183
+ * * ***Predicate: `doesKeyExist`.***
184
+ * ----------------------------------------------------------
185
+ * **Recursively checks if a given key exists in an object or array.**
186
+ * - **Behavior:**
187
+ * - **Supports deeply nested objects and arrays**, searching recursively.
188
+ * - Uses `Object.prototype.hasOwnProperty.call()` to safely check if the
189
+ * key exists at each level, even if its value is `null` or `undefined`.
190
+ * - Optimized to return `true` immediately when the key is found (short-circuits).
191
+ * - Handles edge cases gracefully:
192
+ * - Returns `false` for `null`, `undefined`, or non-object inputs.
193
+ * - Returns `false` if key is not found anywhere, even in deeply nested
194
+ * structures.**
195
+ * - **ℹ️ Note:**
196
+ * - This function only checks for **the existence of the key itself**,
197
+ * not whether its value is non-null or non-undefined.
198
+ * - If you need to check for both existence and meaningful value, write a stricter function.
199
+ * @template T - The type of the input object or array.
200
+ * @param {T | Record<string, unknown> | unknown[]} object - The object or array to search.
201
+ * @param {PropertyKey} key - The key to look for (string, number, or symbol).
202
+ * @returns {boolean} Returns `true` if the key exists anywhere in the object or array (even with `null` / `undefined` value), otherwise `false`.
203
+ * @example
204
+ * doesKeyExist({ name: "John", age: 30 }, "age");
205
+ * // true
206
+ * doesKeyExist({ user: { profile: { email: "test@example.com" } } }, "email");
207
+ * // true
208
+ * doesKeyExist([{ id: 1 }, { id: 2 }], "id");
209
+ * // true
210
+ * doesKeyExist({ a: { b: { c: 10 } } }, "d");
211
+ * // ➔ false
212
+ * doesKeyExist(null, "name");
213
+ * // false
214
+ * doesKeyExist(undefined, "test");
215
+ * // false
216
+ *
217
+ * // Key exists even if value is null or undefined:
218
+ * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "a"); // true
219
+ * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "b"); // true
220
+ * doesKeyExist({ a: null, b: undefined, c: { d: null } }, "d"); // ➔ true
221
+ *
222
+ * doesKeyExist({ a: 1 }, true);
223
+ * // ➔ ❌ Throws TypeError
224
+ * doesKeyExist({ a: 1 }, ["not", "valid"]);
225
+ * // ➔ ❌ Throws TypeError
226
+ */
171
227
  declare const doesKeyExist:(object:Record<string,unknown>|unknown[],key:PropertyKey)=>boolean;
172
228
  /** ----------------------------------------------------------
173
- * * ***Checks if at least one element from `targetArray` exists in `sourceArray`.***
174
- * ----------------------------------------------------------
175
- *
176
- * - ✅ Uses `Set` for **faster lookup** compared to `Array.prototype.includes()`.
177
- * - Supports **any data type** (`number`, `string`, `boolean`, `object`, `array`, `function`, etc.).
178
- * - Uses **reference equality** for non-primitive values (object, array, function).
179
- * - Returns `false` if either array is missing, empty, or not an array.
180
- *
181
- * @template T - The expected type of array elements.
182
- *
183
- * @param {T[]} [sourceArray] - The array to search within.
184
- * @param {T[]} [targetArray] - The array containing elements to match.
185
- *
186
- * @returns {boolean}
187
- * - `true` if **at least one element from `targetArray` is strictly found in `sourceArray`**.
188
- * - Comparison uses:
189
- * - **Value equality** for primitives (`number`, `string`, `boolean`, `null`, `undefined`).
190
- * - **Reference equality** for objects, arrays, and functions.
191
- * - `false` if:
192
- * - No matching elements exist,
193
- * - Either array is not provided, not an actual array, or is empty.
194
- *
195
- * @example
196
- * arrayHasAnyMatch(["apple", "banana", "cherry"], ["banana", "grape"]); // true
197
- * arrayHasAnyMatch(["red", "blue"], ["green", "yellow"]); // → false
198
- * arrayHasAnyMatch([1, 2, 3], [3, 4, 5]); // true
199
- * arrayHasAnyMatch([], ["test"]); // → false
200
- * arrayHasAnyMatch(["A", "B", "C"], []); // false
201
- *
202
- * @example
203
- * const obj = { x: 1 };
204
- * arrayHasAnyMatch([obj], [obj]); // true (same reference)
205
- * arrayHasAnyMatch([{ x: 1 }], [{ x: 1 }]); // → false (different reference)
206
- *
207
- * @example
208
- * const fn = () => "hello";
209
- * arrayHasAnyMatch([fn], [fn]); // → true
210
- * arrayHasAnyMatch([() => "hello"], [() => "hello"]); // false (different function reference)
211
- *
212
- * @example
213
- * const arr = [1, 2];
214
- * arrayHasAnyMatch([arr], [arr]); // true
215
- * arrayHasAnyMatch([[1, 2]], [[1, 2]]); // → false (different array object)
216
- */
217
- declare const arrayHasAnyMatch:<T>(sourceArray?:T[],targetArray?:T[])=>boolean;
229
+ * * ***Predicate: `arrayHasAnyMatch`.***
230
+ * ----------------------------------------------------------
231
+ * **Checks if at least one element from `targetArray` exists in `sourceArray`.**
232
+ * - **Behavior:**
233
+ * - Uses `Set` for **faster lookup** compared to `Array.prototype.includes()`.
234
+ * - Supports **any data type** (`number`, `string`, `boolean`, `object`, `array`, `function`, etc.).
235
+ * - Uses **reference equality** for non-primitive values (object, array, function).
236
+ * - Returns `false` if either array is missing, empty, or not an array.
237
+ * @template T - The expected type of array elements.
238
+ * @param {T[] | null | undefined} sourceArray - The array to search within.
239
+ * @param {T[] | null | undefined} targetArray - The array containing elements to match.
240
+ * @returns {boolean}
241
+ * ***Return:***
242
+ * - `true` if **at least one element from `targetArray` is strictly found
243
+ * in `sourceArray`**.
244
+ * - Comparison uses:
245
+ * - **Value equality** for primitives (`number`, `string`, `boolean`, `null`, `undefined`).
246
+ * - **Reference equality** for `objects`, `arrays`, and `functions`.
247
+ * - `false` if:
248
+ * - No matching elements exist,
249
+ * - Either array is not provided, not an actual array, or is empty.
250
+ * @example
251
+ * arrayHasAnyMatch(["apple", "banana", "cherry"], ["banana", "grape"]);
252
+ * // true
253
+ * arrayHasAnyMatch(["red", "blue"], ["green", "yellow"]);
254
+ * // false
255
+ * arrayHasAnyMatch([1, 2, 3], [3, 4, 5]);
256
+ * // true
257
+ * arrayHasAnyMatch([], ["test"]);
258
+ * // ➔ false
259
+ * arrayHasAnyMatch(["A", "B", "C"], []);
260
+ * // false
261
+ *
262
+ * const obj = { x: 1 };
263
+ * arrayHasAnyMatch([obj], [obj]);
264
+ * // true (same reference)
265
+ * arrayHasAnyMatch([{ x: 1 }], [{ x: 1 }]);
266
+ * // false (different reference)
267
+ *
268
+ * const fn = () => "hello";
269
+ * arrayHasAnyMatch([fn], [fn]);
270
+ * // true
271
+ * arrayHasAnyMatch([() => "hello"], [() => "hello"]);
272
+ * // ➔ false (different function reference)
273
+ *
274
+ * const arr = [1, 2];
275
+ * arrayHasAnyMatch([arr], [arr]);
276
+ * // ➔ true
277
+ * arrayHasAnyMatch([[1, 2]], [[1, 2]]);
278
+ * // ➔ false (different array object)
279
+ */
280
+ declare const arrayHasAnyMatch:<T>(sourceArray:T[]|null|undefined,targetArray:T[]|null|undefined)=>boolean;
218
281
  /** Restrict array indices to a fixed numeric range (1–25). */
219
282
  type ArrayIndex=NumberRangeUnion<1,25>;
220
283
  /** Remove `undefined` from a type. */
@@ -232,232 +295,212 @@ type IsOptionalKey<T,K extends keyof T>=Record<never,never>extends Pick<T,K>?tru
232
295
  /** Returns numeric keys of an object. */
233
296
  type NumericKeyOfHasOwnProp<Obj>=Extract<keyof Obj,number>;
234
297
  /** Generate all nested keys of an object or array in dot/bracket notation.
235
- *
236
- * Example:
237
- * ```ts
238
- * type Keys = NestedKeyOfHasOwnProp<{ users: { name: string }[] }>
239
- * // Keys = "users" | "users.[number]" | "users.[number].name"
240
- * ```
241
- */
298
+ *
299
+ * Example:
300
+ * ```ts
301
+ * type Keys = NestedKeyOfHasOwnProp<{ users: { name: string }[] }>
302
+ * // Keys = "users" | "users.[number]" | "users.[number].name"
303
+ * ```
304
+ */
242
305
  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;
243
306
  /** Apply discard rules to the last key of a path.
244
- *
245
- * Rules:
246
- * - If discardUndefined=true -> remove `undefined` from value
247
- * - If discardNull=true -> remove `null` from value
248
- *
249
- * Order: first strip undefined (if requested), then strip null (if requested)
250
- */
307
+ *
308
+ * Rules:
309
+ * - If discardUndefined=true -> remove `undefined` from value
310
+ * - If discardNull=true -> remove `null` from value
311
+ *
312
+ * Order: first strip undefined (if requested), then strip null (if requested)
313
+ */
251
314
  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>;
252
315
  /** Force an array index N to type U. */
253
316
  type RefineArrayAtIndex<T extends readonly unknown[],N extends number,U>=T &{[K in N]:U;};
254
317
  /** Narrow object/array type based on a path string.
255
- *
256
- * @template T - object type to narrow
257
- * @template P - path string like "user.addresses.[2].zip"
258
- * @template DU - discard undefined
259
- * @template DN - discard null
260
- */
318
+ *
319
+ * @template T - object type to narrow
320
+ * @template P - path string like "user.addresses.[2].zip"
321
+ * @template DU - discard undefined
322
+ * @template DN - discard null
323
+ */
261
324
  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;
262
325
  /** Expand an array/string/function into a nested type according to a dot/bracket path. */
263
326
  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;type SmartDetectArrayFuncHasOwnProp<Obj extends unknown[]|AnyFunction,Key extends PropertyKey>=Prettify<Obj & DotToNestedSpecialSmartDetect<Key>&{length:number;},{recursive:false;}>;
264
327
  /** Smartly detect nested path keys of an unknown object or function, falls-back to inferred nested structure when path is not valid. */
265
328
  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>),{recursive:true;}>;
266
329
  /** Convert dot/bracket path string to nested object type with leaf value.
267
- * Path not found in object key → return unknown.
268
- */
330
+ * Path not found in object key → return unknown.
331
+ */
269
332
  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;};
270
333
  /** Guarded wrapper for `NarrowByPathHasOwnProp` with `Prettify`. */
271
334
  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>>,{recursive:true;}>;
272
335
  /** Make a specific symbol key deeply required in an object symbols.
273
- *
274
- * Used internally to enforce stronger type narrowing.
275
- */
336
+ *
337
+ * Used internally to enforce stronger type narrowing.
338
+ */
276
339
  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];}),{recursive:true;}>;
277
340
  /** Apply discard rules to numeric keys in an object type.
278
- *
279
- * - If `discardUndefined = true` → undefined removed, key required
280
- * - If `discardNull = true` → null removed
281
- */
341
+ *
342
+ * - If `discardUndefined = true` → undefined removed, key required
343
+ * - If `discardNull = true` → null removed
344
+ */
282
345
  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>)),{recursive:true;}>;
283
346
  /** Options to control `hasOwnProp` behavior. */
284
347
  type HasOwnPropOptions<DiscardUndefined extends boolean=true,DiscardNull extends boolean=false>={
285
- /**
286
- * If `true` (default), properties with `undefined` values are treated as non-existent.
287
- *
288
- * **Effects:**
289
- * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `undefined`.
290
- * - **TypeScript narrowing:** The property's type is narrowed to exclude `undefined`.
291
- *
292
- * **Example:**
293
- * ```ts
294
- * const obj = { a: undefined, b: 123 };
295
- * hasOwnProp(obj, "a"); // false
296
- * hasOwnProp(obj, "a", { discardUndefined: false }); // true
297
- * ```
298
- */
348
+ /** If `true` ***(default)***, properties with `undefined` values are treated as non-existent.
349
+ *
350
+ * - **Effects:**
351
+ * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `undefined`.
352
+ * - **TypeScript narrowing:** The property's type is narrowed to exclude `undefined`.
353
+ * - **Example:**
354
+ * ```ts
355
+ * const obj = { a: undefined, b: 123 };
356
+ * hasOwnProp(obj, "a"); // ➔ false
357
+ * hasOwnProp(obj, "a", { discardUndefined: false }); // ➔ true
358
+ * ```
359
+ */
299
360
  discardUndefined?:DiscardUndefined;
300
- /**
301
- * If `true` (default: `false`), properties with `null` values are treated as non-existent.
302
- *
303
- * **Effects:**
304
- * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `null`.
305
- * - **TypeScript narrowing:** The property's type is narrowed to exclude `null`.
306
- *
307
- * **Example:**
308
- * ```ts
309
- * const obj = { a: null, b: 123 };
310
- * hasOwnProp(obj, "a"); // true (default discardNull = false)
311
- * hasOwnProp(obj, "a", { discardNull: true }); // false
312
- * ```
313
- */
361
+ /** If `true` ***(default: `false`)***, properties with `null` values are treated as non-existent.
362
+ *
363
+ * - **Effects:**
364
+ * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `null`.
365
+ * - **TypeScript narrowing:** The property's type is narrowed to exclude `null`.
366
+ * - **Example:**
367
+ * ```ts
368
+ * const obj = { a: null, b: 123 };
369
+ * hasOwnProp(obj, "a"); // ➔ true (default discardNull = false)
370
+ * hasOwnProp(obj, "a", { discardNull: true }); // ➔ false
371
+ * ```
372
+ */
314
373
  discardNull?:DiscardNull;};
315
374
  /** -------------------------------------------------------
316
- * * ***A **type-safe** replacement for `Object.prototype.hasOwnProperty`
317
- * with runtime validation and **TypeScript-aware type narrowing**.***
318
- * -------------------------------------------------------
319
- *
320
- * ---
321
- * #### Supported Targets
322
- * - **Plain objects** ➔ `{ foo: "bar" }`
323
- * - **Arrays** ➔ `[ { id: 1 }, { id: 2 } ]`
324
- * - **Strings** ➔ `"hello"` (as array-like objects with `.length`, index, etc.)
325
- * - **Functions** callable objects with extra props
326
- * - **Symbols** own property symbols
327
- *
328
- * ---
329
- * #### Key Advantages over `in` or `obj.hasOwnProperty(key)`
330
- * - Supports **dot/bracket path notation** (e.g. `"user.address.city"`, `"addresses[0].zip"`)
331
- * - Handles **symbol** keys safely
332
- * - **Narrows** the type of `obj` in TypeScript (stronger type safety)
333
- * - Configurable handling of **`undefined`** and **`null`**
334
- *
335
- * ---
336
- * #### Runtime Behavior
337
- * Returns `true` if:
338
- * - `obj` is an object/array/string/function **and**
339
- * - the property exists **and**
340
- * - it passes the `options` checks
341
- *
342
- * Returns `false` if:
343
- * - `obj` is not a valid type
344
- * - the property does not exist
345
- * - the value is `undefined` and `discardUndefined: true` (default)
346
- * - the value is `null` and `discardNull: true`
347
- * - the `key` (after trimming) is an **empty string** ➔ treated as **invalid**
348
- *
349
- * ---
350
- * #### TypeScript Behavior
351
- * Inside an `if (hasOwnProp(...)) {}` block:
352
- * - The property is **guaranteed to exist**
353
- * - Depending on `options`, the property type is narrowed to exclude
354
- * `undefined` and/or `null`
355
- *
356
- * ---
357
- * #### ⚠️ Caveats
358
- * - **Empty keys are invalid**:
359
- * - If the `key` string is empty (`""`) after trimming whitespace or other characters,
360
- * it will **not** be considered a valid property and always returns `false`.
361
- *
362
- * - **Arrays are limited by TypeScript inference**:
363
- * - Checking index `[0]` only narrows **that specific index**, not the rest.
364
- * - Example:
365
- * - `hasOwnProp(users, "[0].id")` does **not** imply `users[1].id` exists.
366
- * - 👉 For different indices, use **optional chaining** (`users[1]?.id`).
367
- *
368
- * - **Autocomplete limitation for array indices**:
369
- * - Autocompletion for `[index]` is only supported up to **25** (`[0]` ➔ `[24]`).
370
- * - This limit is intentional for **performance and safety**:
371
- * generating infinite union types for all possible indices would cause
372
- * **TypeScript IntelliSense to hang or crash**.
373
- * You can still check higher indices manually (e.g. `"[999].id"`),
374
- * but they will not show up in IntelliSense suggestions.
375
- *
376
- * ---
377
- * #### Options
378
- * @param options.discardUndefined - Default `true`.
379
- * If `true`, properties with `undefined` values are treated as **missing**.
380
- *
381
- * @param options.discardNull - Default `false`.
382
- * If `true`, properties with `null` values are treated as **missing**.
383
- *
384
- * ---
385
- * @example
386
- *
387
- * #### ✅ Objects
388
- * ```ts
389
- * const obj: { name?: string | null } = {};
390
- *
391
- * if (hasOwnProp(obj, "name")) {
392
- * // obj is now { name: string | null }
393
- * console.log(obj.name); // string | null
394
- * }
395
- *
396
- * if (hasOwnProp(obj, "name", { discardUndefined: true, discardNull: true })) {
397
- * // obj is now ➔ { name: string }
398
- * console.log(obj.name.toUpperCase()); // safe
399
- * }
400
- * ```
401
- *
402
- * #### Arrays
403
- * ```ts
404
- * const users = [{ id: 1 }, { id: 2 }];
405
- *
406
- * if (hasOwnProp(users, "[1].id")) {
407
- * // ➔ users[1].id is guaranteed to exist
408
- * console.log(users[1].id); // number
409
- * }
410
- *
411
- * // ⚠️ Caveat: narrowing only applies to checked index
412
- * if (hasOwnProp(users, "[0].id")) {
413
- * console.log(users[0].id); // ✅ safe
414
- * console.log(users[1].id); // ❌ not guaranteed!
415
- * }
416
- *
417
- * // 👉 Solution: optional chaining
418
- * console.log(users[1]?.id); // safe, even without narrowing
419
- * ```
420
- *
421
- * #### Symbols
422
- * ```ts
423
- * const secret = Symbol("secret");
424
- * const obj2 = { [secret]: 42 };
425
- *
426
- * if (hasOwnProp(obj2, secret)) {
427
- * console.log(obj2[secret] + 1); // ➔ 43
428
- * }
429
- * ```
430
- *
431
- * #### ✅ Strings
432
- * ```ts
433
- * if (hasOwnProp("hello", "length")) {
434
- * console.log("hello".length); // ➔ 5
435
- * }
436
- *
437
- * if (hasOwnProp("hello", 1)) {
438
- * console.log("hello"[1]); // ➔ "e"
439
- * }
440
- * ```
441
- *
442
- *
443
- * #### ✅ Functions
444
- * ```ts
445
- * function fn() {}
446
- * fn.extra = 123;
447
- *
448
- * if (hasOwnProp(fn, "extra")) {
449
- * console.log(fn.extra); // ➔ 123
450
- * }
451
- * ```
452
- *
453
- * #### ❌ Empty key
454
- * ```ts
455
- * const obj = { a: 1 };
456
- *
457
- * hasOwnProp(obj, ""); // ➔ false (invalid key)
458
- * hasOwnProp(obj, " "); // ➔ false (trimmed to empty)
459
- * ```
460
- */
375
+ * * ***Utility: `hasOwnProp`.***
376
+ * -------------------------------------------------------
377
+ * **A **type-safe** replacement for `Object.prototype.hasOwnProperty` with runtime validation and **TypeScript-aware type narrowing**.**
378
+ * - #### Supported Targets:
379
+ * - **Plain objects** ➔ `{ foo: "bar" }`
380
+ * - **Arrays** `[ { id: 1 }, { id: 2 } ]`
381
+ * - **Strings** ➔ `"hello"` (as array-like objects with `.length`, index, etc.)
382
+ * - **Functions** ➔ callable objects with extra props
383
+ * - **Symbols** ➔ own property symbols
384
+ * - #### Key Advantages over `in` or `obj.hasOwnProperty(key)`:
385
+ * - Supports **dot/bracket path notation** (e.g. `"user.address.city"`, `"addresses[0].zip"`)
386
+ * - Handles **symbol** keys safely
387
+ * - **Narrows** the type of `obj` in TypeScript (stronger type safety)
388
+ * - Configurable handling of **`undefined`** and **`null`**
389
+ * - #### Runtime Behavior:
390
+ * - ***✅ Returns `true` if:***
391
+ * - `obj` is an object/array/string/function **and**
392
+ * - the property exists **and**
393
+ * - it passes the `options` checks
394
+ * - ***❌ Returns `false` if:***
395
+ * - `obj` is not a valid type
396
+ * - the property does not exist
397
+ * - the value is `undefined` and `discardUndefined: true` (default)
398
+ * - the value is `null` and `discardNull: true`
399
+ * - the `key` (after trimming) is an **empty string** ➔ treated as **invalid**
400
+ * - #### TypeScript Behavior:
401
+ * - ***Inside an `if (hasOwnProp(...)) {}` block:***
402
+ * - The property is **guaranteed to exist**.
403
+ * - Depending on `options`, the property type is narrowed to exclude
404
+ * `undefined` and/or `null`.
405
+ * - #### ⚠️ Caveats:
406
+ * - ***Empty keys are invalid:***
407
+ * - If the `key` string is empty (`""`) after trimming whitespace or other characters,
408
+ * it will **not** be considered a valid property and always returns `false`.
409
+ * - ***Arrays are limited by TypeScript inference:***
410
+ * - Checking index `[0]` only narrows **that specific index**, not the rest, example:
411
+ * 1. `hasOwnProp(users, "[0].id")` does **not** imply `users[1].id` exists.
412
+ * - 👉 For different indices, use **optional chaining** (`users[1]?.id`).
413
+ * - ***Autocomplete limitation for array indices:***
414
+ * - Autocompletion for `[index]` is only supported up to **25** (`[0]` ➔ `[24]`).
415
+ * - This limit is intentional for **performance and safety:**
416
+ * 1. Generating infinite union types for all possible indices would cause
417
+ * **TypeScript IntelliSense to hang or crash**.
418
+ * - ℹ️ You can still check higher indices manually (e.g. `"[999].id"`),
419
+ * but they will not show up in IntelliSense suggestions.
420
+ * - #### Options
421
+ * @param {HasOwnPropOptions} [options] - Optional configuration object.
422
+ * @param {HasOwnPropOptions["discardUndefined"]} [options.discardUndefined=true]
423
+ * If `true`, properties with `undefined` values are treated as **missing**, default: `true`.
424
+ * @param {HasOwnPropOptions["discardNull"]} [options.discardNull=false]
425
+ * If `true`, properties with `null` values are treated as **missing**, default: `false`.
426
+ * @param {*} obj - The `object`, `array`, `string`, `function`, or `other value` to check against.
427
+ * @param {PropertyKey} key
428
+ * The property key to check, can be:
429
+ * - `string` (supports dot/bracket paths, e.g. `"user.address.city"`, `"[0].id"`)
430
+ * - `number` (array-like index)
431
+ * - `symbol` (own property symbols)
432
+ * @returns {boolean} Return `true` if the property exists (and passes `options`), otherwise `false`.
433
+ * @example
434
+ *
435
+ * - #### ✅ Objects:
436
+ * ```ts
437
+ * const obj: { name?: string | null } = {};
438
+ *
439
+ * if (hasOwnProp(obj, "name")) {
440
+ * // obj is now { name: string | null }
441
+ * console.log(obj.name); // string | null
442
+ * }
443
+ *
444
+ * if (hasOwnProp(obj, "name", { discardUndefined: true, discardNull: true })) {
445
+ * // obj is now ➔ { name: string }
446
+ * console.log(obj.name.toUpperCase()); // safe
447
+ * }
448
+ * ```
449
+ * - #### ✅ Arrays:
450
+ * ```ts
451
+ * const users = [{ id: 1 }, { id: 2 }];
452
+ *
453
+ * if (hasOwnProp(users, "[1].id")) {
454
+ * // ➔ users[1].id is guaranteed to exist
455
+ * console.log(users[1].id); // number
456
+ * }
457
+ *
458
+ * // ⚠️ Caveat: narrowing only applies to checked index
459
+ * if (hasOwnProp(users, "[0].id")) {
460
+ * console.log(users[0].id); // ✅ safe
461
+ * console.log(users[1].id); // not guaranteed!
462
+ * }
463
+ *
464
+ * // 👉 Solution: optional chaining
465
+ * console.log(users[1]?.id); // ➔ safe, even without narrowing
466
+ * ```
467
+ *
468
+ * - #### ✅ Symbols:
469
+ * ```ts
470
+ * const secret = Symbol("secret");
471
+ * const obj2 = { [secret]: 42 };
472
+ *
473
+ * if (hasOwnProp(obj2, secret)) {
474
+ * console.log(obj2[secret] + 1); // ➔ 43
475
+ * }
476
+ * ```
477
+ * - #### Strings:
478
+ * ```ts
479
+ * if (hasOwnProp("hello", "length")) {
480
+ * console.log("hello".length); // 5
481
+ * }
482
+ *
483
+ * if (hasOwnProp("hello", 1)) {
484
+ * console.log("hello"[1]); // ➔ "e"
485
+ * }
486
+ * ```
487
+ * - #### ✅ Functions:
488
+ * ```ts
489
+ * function fn() {}
490
+ * fn.extra = 123;
491
+ *
492
+ * if (hasOwnProp(fn, "extra")) {
493
+ * console.log(fn.extra); // ➔ 123
494
+ * }
495
+ * ```
496
+ * - #### Empty key:
497
+ * ```ts
498
+ * const obj = { a: 1 };
499
+ *
500
+ * hasOwnProp(obj, ""); // ➔ false (invalid key)
501
+ * hasOwnProp(obj, " "); // ➔ false (trimmed to empty)
502
+ * ```
503
+ */
461
504
  declare function hasOwnProp<Obj>(obj:IsAny<Obj>extends true?Obj:never,key:PropertyKey,options?:HasOwnPropOptions<boolean,boolean>
462
505
  /** @ts-expect-error we force `any` to `unknown` at result */
463
506
  ):obj is unknown;declare function hasOwnProp<Obj extends null|undefined>(obj:Obj,key:PropertyKey,options?:HasOwnPropOptions<boolean,boolean>):false;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>
@@ -472,1368 +515,1445 @@ declare function hasOwnProp<Obj>(obj:IsAny<Obj>extends true?Obj:never,key:Proper
472
515
  /** @ts-expect-error we force to override recursive type result */
473
516
  ):obj is SmartDetectUnknownKeyHasOwnProp<Obj,Key,DiscardUndefined,DiscardNull>;
474
517
  /** -------------------
475
- * * ***Type guard: `isArguments`.***
476
- * -------------------
477
- * @description Checks if `value` is likely an `arguments` object.
478
- *
479
- * @param {*} value The value to check.
480
- * @returns {boolean} Returns `true` if `value` is an **[IArguments](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments)** object,
481
- * else `false`.
482
- * @example
483
- * isArguments(function() { return arguments; }());
484
- * // ➔ true
485
- * isArguments([1, 2, 3]);
486
- * // ➔ false
487
- */
518
+ * * ***Type guard: `isArguments`.***
519
+ * -------------------
520
+ * **Checks if `value` is likely an `arguments` object.**
521
+ * @param {*} value The value to check.
522
+ * @returns {boolean} Returns `true` if `value` is an ***[`IArguments`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments)*** object, else `false`.
523
+ * @example
524
+ * isArguments(function() { return arguments; }());
525
+ * // ➔ true
526
+ * isArguments([1, 2, 3]);
527
+ * // ➔ false
528
+ */
488
529
  declare const isArguments:(value:unknown)=>value is IArguments;
489
530
  /** @deprecated bugs */
490
531
  type IsArrayResult<T>=IsUnknown<T>extends true?unknown[] & T:IsNever<T>extends true?[]:IsReadonlyArray<T>extends true?T:IsArray<T>extends true?T:unknown[];
491
532
  /** ----------------------------------------------------------
492
- * * ***Type guard: `isArray`.***
493
- * ----------------------------------------------------------
494
- * @description Checks if a value is an [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
495
- *
496
- * - Uses **[`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)** for reliable and safe type checking.
497
- * - Supports TypeScript **type narrowing** using `value is T[]`.
498
- * - Handles edge cases like `null`, `undefined`, and non-array objects.
499
- *
500
- * @template T - The expected type of array elements.
501
- * @param {*} value - The value to check.
502
- * @returns {boolean} Returns `true` if the value is an `array`, otherwise `false`.
503
- * @example
504
- * isArray([1, 2, 3]);
505
- * // ➔ true
506
- * isArray([]);
507
- * // ➔ true
508
- * isArray("hello");
509
- * // false
510
- * isArray({ key: "value" });
511
- * // ➔ false
512
- * isArray(null);
513
- * // ➔ false
514
- * isArray(undefined);
515
- * // ➔ false
516
- */
533
+ * * ***Type guard: `isArray`.***
534
+ * ----------------------------------------------------------
535
+ ***Checks if a value is an ***[`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)***.**
536
+ * - **Behavior:**
537
+ * - Uses ***[`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)*** for reliable and safe type checking.
538
+ * - Supports TypeScript **type narrowing** using `value is T[]`.
539
+ * - Handles edge cases like `null`, `undefined`, and non-array objects.
540
+ * @template T - The expected type of array elements.
541
+ * @param {*} value - The value to check.
542
+ * @returns {boolean} Returns `true` if the value is an `array`, otherwise `false`.
543
+ * @example
544
+ * isArray([1, 2, 3]);
545
+ * // true
546
+ * isArray([]);
547
+ * // ➔ true
548
+ * isArray("hello");
549
+ * // ➔ false
550
+ * isArray({ key: "value" });
551
+ * // false
552
+ * isArray(null);
553
+ * // ➔ false
554
+ * isArray(undefined);
555
+ * // ➔ false
556
+ */
517
557
  declare function isArray<T extends unknown[]>(value:T):value is Extract<T,unknown[]>;declare function isArray<T extends readonly unknown[]>(value:T):value is Extract<T,readonly unknown[]>;declare function isArray(value:unknown):value is unknown[];
518
558
  /** ----------------------------------------------------
519
- * * ***Type guard: `isArrayBuffer`.***
520
- * ----------------------------------------------------
521
- * @description Checks if `value` is classified as an `ArrayBuffer` object.
522
- * @param {*} value The value to check.
523
- * @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`.
524
- * @example
525
- * isArrayBuffer(new ArrayBuffer(2));
526
- * // ➔ true
527
- * isArrayBuffer(new Array(2));
528
- * // ➔ false
529
- */
559
+ * * ***Type guard: `isArrayBuffer`.***
560
+ * ----------------------------------------------------
561
+ * **Checks if `value` is classified as an `ArrayBuffer` object.**
562
+ * @param {*} value The value to check.
563
+ * @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`.
564
+ * @example
565
+ * isArrayBuffer(new ArrayBuffer(2));
566
+ * // ➔ true
567
+ * isArrayBuffer(new Array(2));
568
+ * // ➔ false
569
+ */
530
570
  declare function isArrayBuffer(value:unknown):value is ArrayBuffer;
531
571
  /** ----------------------------------------------------
532
- * * ***Type guard: `isArrayLike`.***
533
- * ----------------------------------------------------
534
- * @description Checks if `value` is array-like. A value is considered array-like if it's
535
- * not a function and has a `value.length` that's an integer greater than or
536
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
537
- *
538
- * @template T - The type of the value being checked.
539
- * @param {*} value The value to check.
540
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
541
- * @example
542
- * isArrayLike([1, 2, 3]);
543
- * // ➔ true
544
- * isArrayLike(document.body.children);
545
- * // ➔ true
546
- * isArrayLike(noop);
547
- * // ➔ false
548
- * isArrayLike('abc');
549
- * // ➔ false
550
- */
572
+ * * ***Type guard: `isArrayLike`.***
573
+ * ----------------------------------------------------
574
+ * **Checks if `value` is array-like, a value is considered array-like if it's
575
+ * not a function and has a `value.length` that's an integer greater than or
576
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.**
577
+ * @template T - The type of the value being checked.
578
+ * @param {*} value The value to check.
579
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
580
+ * @example
581
+ * isArrayLike([1, 2, 3]);
582
+ * // true
583
+ * isArrayLike(document.body.children);
584
+ * // ➔ true
585
+ * isArrayLike(noop);
586
+ * // ➔ false
587
+ * isArrayLike('abc');
588
+ * // ➔ false
589
+ */
551
590
  declare function isArrayLike<T extends{__anyHack:unknown;}>(value:T):boolean;declare function isArrayLike(value:AnyFunction|null|undefined):value is never;declare function isArrayLike(value:unknown):value is{length:number;};
552
591
  /** ----------------------------------------------------
553
- * * ***Type guard: `isArrayLikeObject`.***
554
- * ----------------------------------------------------
555
- * @description This method is like **{@link isArrayLike}** except that it also checks if `value` is an object.
556
- * @template T - The type of the value being checked.
557
- * @param {*} value The value to check.
558
- * @returns {boolean} Returns `true` if `value` is `array-like object`, else `false`.
559
- * @example
560
- * isArrayLikeObject([1, 2, 3]);
561
- * // true
562
- * isArrayLikeObject(document.body.children);
563
- * // ➔ true
564
- * isArrayLikeObject('abc');
565
- * // ➔ false
566
- * isArrayLikeObject(noop);
567
- * // ➔ false
568
- */
592
+ * * ***Type guard: `isArrayLikeObject`.***
593
+ * ----------------------------------------------------
594
+ * **This method is like ***{@link isArrayLike | `isArrayLike`}*** except that
595
+ * it also checks if `value` is an object.**
596
+ * @template T - The type of the value being checked.
597
+ * @param {*} value The value to check.
598
+ * @returns {boolean} Returns `true` if `value` is `array-like object`, else `false`.
599
+ * @example
600
+ * isArrayLikeObject([1, 2, 3]);
601
+ * // ➔ true
602
+ * isArrayLikeObject(document.body.children);
603
+ * // ➔ true
604
+ * isArrayLikeObject('abc');
605
+ * // ➔ false
606
+ * isArrayLikeObject(noop);
607
+ * // ➔ false
608
+ */
569
609
  declare function isArrayLikeObject<T extends{__anyHack:unknown;}>(value:T):boolean;declare function isArrayLikeObject(value:AnyFunction|string|boolean|number|null|undefined):value is never;declare function isArrayLikeObject(value:unknown):value is object &{length:number;};
570
610
  /** ----------------------------------------------------------
571
- * * ***Type guard: `isBigInt`.***
572
- * ----------------------------------------------------------
573
- * @description Checks if a value is of type bigint.
574
- * - Uses `typeof value === "bigint"` for strict type checking.
575
- * - Supports TypeScript type narrowing with `value is bigint`.
576
- * - Returns `false` for `BigInt` object (object-wrapped), e.g. `Object(BigInt(123))`.
577
- *
578
- * @param {*} value - The value to check.
579
- * @returns {boolean} Return `true` if value is a primitive **[`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)**.
580
- * @example
581
- * isBigInt(123n);
582
- * // ➔ true
583
- * isBigInt(BigInt(123));
584
- * // ➔ true
585
- * isBigInt("123");
586
- * // ➔ false
587
- * isBigInt(Object(BigInt(1)));
588
- * // ➔ false
589
- */
611
+ * * ***Type guard: `isBigInt`.***
612
+ * ----------------------------------------------------------
613
+ * **Checks if a value is of type bigint.**
614
+ * - **Behavior:**
615
+ * - Uses `typeof value === "bigint"` for strict type checking.
616
+ * - Supports TypeScript type narrowing with `value is bigint`.
617
+ * - Returns `false` for `BigInt` object (object-wrapped), e.g:
618
+ * - `Object(BigInt(123))`.
619
+ * @param {*} value - The value to check.
620
+ * @returns {boolean} Return `true` if value is a primitive **[`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)**.
621
+ * @example
622
+ * isBigInt(123n);
623
+ * // ➔ true
624
+ * isBigInt(BigInt(123));
625
+ * // ➔ true
626
+ * isBigInt("123");
627
+ * // ➔ false
628
+ * isBigInt(Object(BigInt(1)));
629
+ * // ➔ false
630
+ */
590
631
  declare const isBigInt:(value:unknown)=>value is bigint;
591
632
  /** ----------------------------------------------------------
592
- * * ***Type guard: `isBoolean`.***
593
- * ----------------------------------------------------------
594
- * @description Checks if a value is of type boolean.
595
- * @param {*} value - The value to check.
596
- * @returns {boolean} Returns `true` if the value is a **[`boolean`](https://developer.mozilla.org/en-US/docs/Glossary/Boolean/JavaScript)**, otherwise `false`.
597
- * @example
598
- * isBoolean(true); // ➔ true
599
- * isBoolean(false); // ➔ true
600
- * isBoolean("true"); // ➔ false
601
- */
633
+ * * ***Type guard: `isBoolean`.***
634
+ * ----------------------------------------------------------
635
+ * **Checks if a value is of type boolean.**
636
+ * @param {*} value - The value to check.
637
+ * @returns {boolean} Returns `true` if the value is a **[`boolean`](https://developer.mozilla.org/en-US/docs/Glossary/Boolean/JavaScript)**, otherwise `false`.
638
+ * @example
639
+ * isBoolean(true); // ➔ true
640
+ * isBoolean(false); // ➔ true
641
+ * isBoolean("true"); // ➔ false
642
+ */
602
643
  declare const isBoolean:(value:unknown)=>value is boolean;
603
644
  /** ----------------------------------------------------
604
- * * ***Type guard: `isBuffer`.***
605
- * ----------------------------------------------------------
606
- * @description Checks if a value is a **Node.js Buffer** instance.
607
- * @param {*} value The value to check.
608
- * @returns {boolean} Returns `true` if `value` is a **{@link Buffer}**, else `false`.
609
- * @example
610
- * isBuffer(new Buffer(2));
611
- * // true
612
- * isBuffer(Buffer.alloc(10));
613
- * // ➔ true
614
- * isBuffer(Buffer.from('foo'));
615
- * // ➔ true
616
- * isBuffer([]);
617
- * // ➔ false
618
- * isBuffer('a string');
619
- * // ➔ false
620
- * isBuffer(new Uint8Array(1024));
621
- * // false
622
- */
645
+ * * ***Type guard: `isBooleanObject`.***
646
+ * ----------------------------------------------------
647
+ * **Checks if a value is a **`Boolean` object wrapper**
648
+ * (`new Boolean(...)`), not a primitive boolean.**
649
+ * @param {*} value The value to check.
650
+ * @returns {value is Boolean} Returns `true` if `value` is a `Boolean` object.
651
+ * @example
652
+ * isBooleanObject(new Boolean(true));
653
+ * // ➔ true
654
+ * isBooleanObject(true);
655
+ * // ➔ false
656
+ */
657
+ declare function isBooleanObject(value:unknown):value is Boolean;
658
+ /** ----------------------------------------------------
659
+ * * ***Type guard: `isBuffer`.***
660
+ * ----------------------------------------------------------
661
+ * **Checks if a value is a **Node.js Buffer** instance.**
662
+ * @param {*} value The value to check.
663
+ * @returns {boolean} Returns `true` if `value` is a ***{@link Buffer | `Buffer`}***, else `false`.
664
+ * @example
665
+ * isBuffer(new Buffer(2));
666
+ * // ➔ true
667
+ * isBuffer(Buffer.alloc(10));
668
+ * // ➔ true
669
+ * isBuffer(Buffer.from('foo'));
670
+ * // ➔ true
671
+ * isBuffer([]);
672
+ * // ➔ false
673
+ * isBuffer('a string');
674
+ * // ➔ false
675
+ * isBuffer(new Uint8Array(1024));
676
+ * // ➔ false
677
+ */
623
678
  declare const isBuffer:(value:unknown)=>value is Buffer;
624
679
  /** -----------------------------------------------------------
625
- * * ***Checks whether a value looks like a currency or number string.***
626
- * -----------------------------------------------------------
627
- * Determines if the given `input` can be interpreted as a currency-like number,
628
- * using the same **multi-locale parsing logic** as **{@link parseCurrencyString}**.
629
- *
630
- * Highlights:
631
- * - Supports strings or numbers like:
632
- * - "15.000,10" (European)
633
- * - "15,000.10" (US)
634
- * - "15'000.10" (Swiss)
635
- * - "15 000,10" (French)
636
- * - "Rp 15.000,10" or "$15,000.10"
637
- * - Also accepts simple numbers (15300.95).
638
- *
639
- * Uses the same core logic as **{@link parseCurrencyString}** but
640
- * just checks if a final parsed float is sensible.
641
- *
642
- * @param {*} input - The input value to check.
643
- *
644
- * @returns {boolean} Return `true` if it can be reasonably parsed into a currency-like number, `false` otherwise.
645
- *
646
- * @example
647
- * isCurrencyLike(15300.95);
648
- * // ➔ true
649
- * isCurrencyLike("$15,000.10");
650
- * // ➔ true
651
- * isCurrencyLike("(15'000.10)");
652
- * // ➔ true
653
- * isCurrencyLike("Rp 15.000,10");
654
- * // ➔ true
655
- * isCurrencyLike("");
656
- * // ➔ false
657
- * isCurrencyLike("abc");
658
- * // false
659
- */
660
- declare const isCurrencyLike:(input:unknown)=>boolean;
680
+ * * ***Checks whether a value looks like a currency or number string.***
681
+ * -----------------------------------------------------------
682
+ * **Determines if the given `input` can be interpreted as a currency-like number,
683
+ * using the same **multi-locale parsing logic** as ***{@link parseCurrencyString | `parseCurrencyString`}***.**
684
+ * - **Highlights:**
685
+ * - Supports strings or numbers like:
686
+ * - `"15.000,10"` ***(European)***.
687
+ * - `"15,000.10"` ***(US)***.
688
+ * - `"15'000.10"` ***(Swiss)***.
689
+ * - `"15 000,10"` ***(French)***.
690
+ * - `"Rp 15.000,10"` or `"$15,000.10"`.
691
+ * - Also accepts simple numbers (`15300.95`).
692
+ * - **ℹ️ Note:**
693
+ * - Uses the same core logic as
694
+ * ***{@link parseCurrencyString | `parseCurrencyString`}*** but
695
+ * just checks if a final parsed float is sensible.
696
+ * @param {*} input - The input value to check.
697
+ * @returns {boolean} Return `true` if it can be reasonably parsed into a currency-like number, `false` otherwise.
698
+ * @example
699
+ * isCurrencyLike(15300.95);
700
+ * // ➔ true
701
+ * isCurrencyLike("$15,000.10");
702
+ * // ➔ true
703
+ * isCurrencyLike("(15'000.10)");
704
+ * // ➔ true
705
+ * isCurrencyLike("Rp 15.000,10");
706
+ * // ➔ true
707
+ * isCurrencyLike("");
708
+ * // ➔ false
709
+ * isCurrencyLike("abc");
710
+ * // ➔ false
711
+ */
712
+ declare const isCurrencyLike:(input:unknown)=>boolean;type isDateOptions={
713
+ /** * ***Skip the validity check (`!isNaN(date.getTime())`).***
714
+ *
715
+ * When `true`, the function only checks that the value is an
716
+ * instance of `Date` without verifying that it represents a valid
717
+ * date value.
718
+ *
719
+ * @default false
720
+ */
721
+ skipInvalidDate?:boolean;};
661
722
  /** ----------------------------------------------------------
662
- * * ***Type guard: `isDate`.***
663
- * ----------------------------------------------------------
664
- * @description Determines whether the given `value` is a real, valid JavaScript **[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** object.
665
- * - Checks if value is an instance of `Date`.
666
- * - Ensures the date is valid (`!isNaN(date.getTime())`).
667
- * - Returns false for strings or invalid date objects.
668
- *
669
- * @param {*} value - The value to check.
670
- * @returns {boolean} Return `true` if value is a valid Date object.
671
- * @example
672
- * isDate(new Date());
673
- * // true
674
- * isDate(new Date("invalid"));
675
- * // false
676
- * isDate("2024-01-01");
677
- * // ➔ false
678
- */
679
- declare const isDate:(value:unknown)=>value is Date;
723
+ * * ***Type guard: `isDate`.***
724
+ * ----------------------------------------------------------
725
+ * **Determines whether the given `value` is a real, valid JavaScript
726
+ * **[`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** object.**
727
+ * - **Behavior:**
728
+ * - Returns **true** only if:
729
+ * - `value` is an instance of `Date`.
730
+ * - and, unless `options.skipInvalidDate` is `true`,
731
+ * the underlying time value is valid (`!isNaN(value.getTime())`).
732
+ * - Returns **false** for:
733
+ * - non-Date values (strings, numbers, etc.).
734
+ * - `Date` instances that represent an invalid time value
735
+ * (e.g. `new Date("bad")`), unless skipping is enabled.
736
+ * @param {*} value - The value to check.
737
+ * @returns {boolean} Return `true` if value is a valid Date object.
738
+ * @example
739
+ * isDate(new Date());
740
+ * // true
741
+ * isDate(new Date("invalid"));
742
+ * // ➜ false
743
+ * isDate("2024-01-01");
744
+ * // ➜ false
745
+ *
746
+ * // Skipping validity check:
747
+ * isDate(new Date("invalid"), { skipInvalidDate: true });
748
+ * // ➜ true
749
+ */
750
+ declare const isDate:(value:unknown,options?:isDateOptions)=>value is Date;
680
751
  /** ----------------------------------------------------------
681
- * * ***Performs a deep equality check between two values.***
682
- * ----------------------------------------------------------
683
- * - Compares nested arrays, objects, Dates, RegExp, NaN, Symbols, Set, and Map.
684
- * - Handles special cases:
685
- * - `NaN` is considered equal to `NaN`.
686
- * - `Date` objects are equal if `.getTime()` is equal.
687
- * - `RegExp` objects are equal if `.toString()` is equal.
688
- * - `Symbol("x")` and `Symbol("x")` are treated equal if `.toString()` matches.
689
- * - `Set` and `Map` are deeply compared by content (order-insensitive).
690
- * - Does not support circular references.
691
- *
692
- * @param {*} a - First value to compare.
693
- * @param {*} b - Second value to compare.
694
- * @returns {boolean} `true` if both values are deeply equal, otherwise `false`.
695
- * @example
696
- * // Primitives
697
- * isDeepEqual(1, 1);
698
- * // true
699
- * isDeepEqual(NaN, NaN);
700
- * // true
701
- * isDeepEqual("hello", "world");
702
- * // ➔ false
703
- *
704
- * // Objects
705
- * isDeepEqual({ x: 1 }, { x: 1 });
706
- * // ➔ true
707
- * isDeepEqual({ x: 1 }, { y: 1 });
708
- * // false
709
- *
710
- * // Arrays
711
- * isDeepEqual([1, 2], [1, 2]);
712
- * // ➔ true
713
- * isDeepEqual([1, 2], [2, 1]);
714
- * // false
715
- *
716
- * // Dates
717
- * isDeepEqual(new Date(123), new Date(123));
718
- * // ➔ true
719
- *
720
- * // ✅ Sets
721
- * isDeepEqual(new Set([1, 2]), new Set([2, 1]));
722
- * // ➔ true
723
- *
724
- * // ✅ Maps
725
- * isDeepEqual(new Map([["a", 1]]), new Map([["a", 1]]));
726
- * // ➔ true
727
- *
728
- * // Different types
729
- * isDeepEqual(1, "1");
730
- * // ➔ false
731
- */
752
+ * * ***Predicate: `isDeepEqual`.***
753
+ * ----------------------------------------------------------
754
+ * **Performs a deep equality check between two values.**
755
+ * - **Behavior:**
756
+ * - Compares nested `arrays`, `objects`, `Dates`, `RegExp`, `NaN`, `Symbols`,
757
+ * `Set`, and `Map`.
758
+ * - Handles special cases:
759
+ * - `NaN` is considered equal to `NaN`.
760
+ * - `Date` objects are equal if `.getTime()` is equal.
761
+ * - `RegExp` objects are equal if `.toString()` is equal.
762
+ * - `Symbol("x")` and `Symbol("x")` are treated equal if
763
+ * `.toString()` matches.
764
+ * - `Set` and `Map` are deeply compared by content (order-insensitive).
765
+ * - **ℹ️ Note:**
766
+ * - Does not support circular references.
767
+ * @param {*} a - First value to compare.
768
+ * @param {*} b - Second value to compare.
769
+ * @returns {boolean} `true` if both values are deeply equal, otherwise `false`.
770
+ * @example
771
+ * // Primitives
772
+ * isDeepEqual(1, 1);
773
+ * // ➔ true
774
+ * isDeepEqual(NaN, NaN);
775
+ * // true
776
+ * isDeepEqual("hello", "world");
777
+ * // ➔ false
778
+ *
779
+ * // Objects
780
+ * isDeepEqual({ x: 1 }, { x: 1 });
781
+ * // true
782
+ * isDeepEqual({ x: 1 }, { y: 1 });
783
+ * // ➔ false
784
+ *
785
+ * // Arrays
786
+ * isDeepEqual([1, 2], [1, 2]);
787
+ * // true
788
+ * isDeepEqual([1, 2], [2, 1]);
789
+ * // ➔ false
790
+ *
791
+ * // ✅ Dates
792
+ * isDeepEqual(new Date(123), new Date(123));
793
+ * // ➔ true
794
+ *
795
+ * // ✅ Sets
796
+ * isDeepEqual(new Set([1, 2]), new Set([2, 1]));
797
+ * // ➔ true
798
+ *
799
+ * // Maps
800
+ * isDeepEqual(new Map([["a", 1]]), new Map([["a", 1]]));
801
+ * // ➔ true
802
+ *
803
+ * // ❌ Different types
804
+ * isDeepEqual(1, "1");
805
+ * // ➔ false
806
+ */
732
807
  declare const isDeepEqual:(a:unknown,b:unknown)=>boolean;
733
808
  /** ----------------------------------------------------
734
- * * ***Type guard: `isElement`.***
735
- * ----------------------------------------------------------
736
- * @description Checks if `value` is likely a **[`DOM Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**.
737
- * @template T - The type of the value being checked.
738
- * @param {*} value The value to check.
739
- * @returns {boolean} Returns `true` if `value` is extends instance of **[`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**, else `false`.
740
- * @example
741
- * isElement(document.body);
742
- * // ➔ true
743
- * isElement(document.createElement("div"));
744
- * // ➔ true
745
- * isElement('<body>');
746
- * // ➔ false
747
- * isElement(document);
748
- * // ➔ false
749
- * isElement({ tagName: "DIV" });
750
- * // false
751
- */
809
+ * * ***Type guard: `isElement`.***
810
+ * ----------------------------------------------------------
811
+ * **Checks if `value` is likely a
812
+ * **[`DOM Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**.**
813
+ * @template T - The type of the value being checked.
814
+ * @param {*} value The value to check.
815
+ * @returns {boolean} Returns `true` if `value` is extends instance of **[`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)**, else `false`.
816
+ * @example
817
+ * isElement(document.body);
818
+ * // ➔ true
819
+ * isElement(document.createElement("div"));
820
+ * // ➔ true
821
+ * isElement('<body>');
822
+ * // ➔ false
823
+ * isElement(document);
824
+ * // false
825
+ * isElement({ tagName: "DIV" });
826
+ * // ➔ false
827
+ */
752
828
  declare function isElement(value:[]):value is [];declare function isElement<T extends Element>(value:T):value is T;declare function isElement(value:unknown):value is Element;
753
829
  /** ----------------------------------------------------
754
- * * ***Utility: `isEmpty`.***
755
- * ----------------------------------------------------------
756
- * @description Checks if `value` is an empty object, collection, map, or set.
757
- * - **Objects** are empty if they have no own enumerable string keyed properties.
758
- * - **Array-like values** (arrays, strings, `arguments`, typed arrays, buffers) are empty if their `length` is `0`.
759
- * - **Maps** and **Sets** are empty if their `size` is `0`.
760
- * - **Booleans**, **numbers** (including `NaN`), **symbols**, and `null`/`undefined` are treated as empty.
761
- * - **Functions** are considered empty if they have no own enumerable keys.
762
- *
763
- * **⚠️ Notes:** For More Strict, you can use **{@link isEmptyValue}**.
764
- *
765
- * @template T - The type of the value being checked.
766
- * @param {*} value The value to check.
767
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
768
- * @example
769
- * isEmpty(null);
770
- * // true
771
- * isEmpty(true);
772
- * // ➔ true
773
- * isEmpty(false);
774
- * // ➔ true
775
- * isEmpty(1);
776
- * // ➔ true
777
- * isEmpty(0);
778
- * // ➔ true
779
- * isEmpty(Symbol("x"));
780
- * // ➔ true
781
- * isEmpty(() => {});
782
- * // ➔ true
783
- * isEmpty("");
784
- * // true
785
- * isEmpty(" ");
786
- * // ➔ false
787
- * isEmpty([1, 2, 3]);
788
- * // ➔ false
789
- * isEmpty({ 'a': 1 });
790
- * // false
791
- */
830
+ * * ***Utility: `isEmpty`.***
831
+ * ----------------------------------------------------------
832
+ * **Checks if `value` is an empty object, collection, map, or set.**
833
+ * - **Behavior:**
834
+ * - **Objects** are empty if they have no own enumerable string keyed properties.
835
+ * - **Array-like values** (arrays, strings, `arguments`, typed arrays, buffers)
836
+ * are empty if their `length` is `0`.
837
+ * - **Maps** and **Sets** are empty if their `size` is `0`.
838
+ * - **Booleans**, **numbers** (including `NaN`), **symbols**, and `null`/
839
+ * `undefined` are treated as empty.
840
+ * - **Functions** are considered empty if they have no own enumerable keys.
841
+ * - **ℹ️ Note:**
842
+ * - For more `Strict`, you can use
843
+ * **{@link isEmptyValue | `isEmptyValue`}** instead.
844
+ * @template T - The type of the value being checked.
845
+ * @param {*} value The value to check.
846
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
847
+ * @example
848
+ * isEmpty(null);
849
+ * // ➔ true
850
+ * isEmpty(true);
851
+ * // ➔ true
852
+ * isEmpty(false);
853
+ * // ➔ true
854
+ * isEmpty(1);
855
+ * // ➔ true
856
+ * isEmpty(0);
857
+ * // true
858
+ * isEmpty(Symbol("x"));
859
+ * // ➔ true
860
+ * isEmpty(() => {});
861
+ * // ➔ true
862
+ * isEmpty("");
863
+ * // true
864
+ * isEmpty(" ");
865
+ * // false
866
+ * isEmpty([1, 2, 3]);
867
+ * // ➔ false
868
+ * isEmpty({ 'a': 1 });
869
+ * // ➔ false
870
+ */
792
871
  declare function isEmpty<T extends{__trapAny:any;}>(value?:T):boolean;declare function isEmpty(value:string):value is"";declare function isEmpty(value:Map<any,any>|Set<any>|List<any>|null|undefined):boolean;declare function isEmpty(value:object):boolean;declare function isEmpty<T extends object>(value:T|null|undefined):value is EmptyObjectOf<T>|null|undefined;declare function isEmpty(value:any):boolean;
793
872
  /** ----------------------------------------------------------
794
- * * ***Type guard: `isEmptyArray`.***
795
- * ----------------------------------------------------------
796
- * @description
797
- * - Checks whether a given value is an empty array.
798
- * - Non-array inputs are considered "empty" (defensive strategy).
799
- *
800
- * @param {*} [value] - The value to check.
801
- * @returns {boolean} Returns `true` if it's not an array or an empty array.
802
- * @example
803
- * isEmptyArray([]); // ➔ true
804
- * isEmptyArray([1, 2, 3]); // ➔ false
805
- * isEmptyArray("not an array"); // ➔ true
806
- * isEmptyArray(null); // ➔ true
807
- * isEmptyArray(undefined); // ➔ true
808
- *
809
- * if (isEmptyArray(data.items)) {
810
- * console.log("No items to display.");
811
- * }
812
- */
873
+ * * ***Type guard: `isEmptyArray`.***
874
+ * ----------------------------------------------------------
875
+ * **Checks whether a given value is an empty array.**
876
+ * - **Behavior:**
877
+ * - Non-array inputs are considered ***`empty`*** ***(defensive strategy)***.
878
+ * @param {*} [value] - The value to check.
879
+ * @returns {boolean} Returns `true` if it's ***not an array*** or ***an empty-array***.
880
+ * @example
881
+ * isEmptyArray([]); // ➔ true
882
+ * isEmptyArray([1, 2, 3]); // ➔ false
883
+ * isEmptyArray("not an array"); // ➔ true
884
+ * isEmptyArray(null); // ➔ true
885
+ * isEmptyArray(undefined); // ➔ true
886
+ *
887
+ * if (isEmptyArray(data.items)) {
888
+ * console.log("No items to display.");
889
+ * }
890
+ */
813
891
  declare const isEmptyArray:(value:unknown)=>boolean;
814
892
  /** ----------------------------------------------------------
815
- * * ***Predicate: `isEmptyDeep`.***
816
- * ----------------------------------------------------------
817
- * @description
818
- * Recursively checks whether a value is **deeply empty**.
819
- *
820
- * - Returns `true` for:
821
- * - Empty objects: `{}`
822
- * - Empty arrays: `[]`
823
- * - Nested empty structures: `{ a: [], b: {} }`
824
- * - Falsy values (except numbers): `null`, `undefined`, `false`, `""`, `NaN`
825
- *
826
- * - Returns `false` for:
827
- * - Non-zero numbers
828
- * - Objects or arrays containing non-empty values
829
- * - Non-empty strings, `true`, functions, symbols, etc.
830
- *
831
- * @param {*} value - The value to deeply check.
832
- * @returns {boolean} `true` if the value is deeply empty, otherwise `false`.
833
- * @example
834
- * isEmptyDeep({});
835
- * // ➔ true
836
- * isEmptyDeep([]);
837
- * // ➔ true
838
- * isEmptyDeep({ a: {} });
839
- * // ➔ true
840
- * isEmptyDeep([[], {}]);
841
- * // ➔ true
842
- * isEmptyDeep({ a: [1] });
843
- * // ➔ false
844
- * isEmptyDeep([0]);
845
- * // ➔ false
846
- * isEmptyDeep("test");
847
- * // ➔ false
848
- * isEmptyDeep("");
849
- * // ➔ true
850
- * isEmptyDeep(0);
851
- * // ➔ false
852
- * isEmptyDeep(NaN);
853
- * // ➔ true
854
- */
893
+ * * ***Predicate: `isEmptyDeep`.***
894
+ * ----------------------------------------------------------
895
+ * **Recursively checks whether a value is **deeply empty**.**
896
+ * - **Returns `true` for:**
897
+ * - Empty objects: `{}`
898
+ * - Empty arrays: `[]`
899
+ * - Nested empty structures: `{ a: [], b: {} }`
900
+ * - Falsy values (except numbers): `null`, `undefined`, `false`, `""`, `NaN`
901
+ * - **Returns `false` for:**
902
+ * - Non-zero numbers
903
+ * - Objects or arrays containing non-empty values
904
+ * - Non-empty strings, `true`, functions, symbols, etc.
905
+ * @param {*} value - The value to deeply check.
906
+ * @returns {boolean} `true` if the value is deeply empty, otherwise `false`.
907
+ * @example
908
+ * isEmptyDeep({});
909
+ * // true
910
+ * isEmptyDeep([]);
911
+ * // ➔ true
912
+ * isEmptyDeep({ a: {} });
913
+ * // ➔ true
914
+ * isEmptyDeep([[], {}]);
915
+ * // ➔ true
916
+ * isEmptyDeep({ a: [1] });
917
+ * // ➔ false
918
+ * isEmptyDeep([0]);
919
+ * // ➔ false
920
+ * isEmptyDeep("test");
921
+ * // ➔ false
922
+ * isEmptyDeep("");
923
+ * // ➔ true
924
+ * isEmptyDeep(0);
925
+ * // ➔ false
926
+ * isEmptyDeep(NaN);
927
+ * // ➔ true
928
+ */
855
929
  declare const isEmptyDeep:(value:unknown)=>boolean;type IsEmptyObjectOptions={
856
- /** Whether to check for symbol properties in addition to string keys.
857
- *
858
- * DefaultValue: `false`.
859
- *
860
- * @default false
861
- */
930
+ /** Whether to check for symbol properties in addition to string keys, defaultValue: `false`.
931
+ *
932
+ * @default false
933
+ */
862
934
  checkSymbols?:boolean;};
863
935
  /** ----------------------------------------------------------
864
- * * ***Predicate: `isEmptyObject`.***
865
- * ----------------------------------------------------------
866
- * @description Checks if a value is a plain object with **no own enumerable string-key properties**,
867
- * and optionally **no own enumerable symbol-key properties** when `checkSymbols` is `true`.
868
- *
869
- * - If the value is **not an object** (e.g. `null`, array, primitive), it is considered empty.
870
- * - If `options.checkSymbols` is `true`, symbol properties are also checked.
871
- *
872
- * @param {*} value - The value to check.
873
- * @param {IsEmptyObjectOptions} [options] - Optional settings.
874
- * @param {boolean} [options.checkSymbols=false] - Whether to also check symbol properties.
875
- * @returns {boolean} Return `true` if the value is considered empty or not an object, false otherwise.
876
- * @example
877
- * isEmptyObject({});
878
- * // true
879
- * isEmptyObject({}, { checkSymbols: true });
880
- * // true
881
- * isEmptyObject({ a: 1 });
882
- * // false
883
- * isEmptyObject({ [Symbol('s')]: 1 });
884
- * // true
885
- * isEmptyObject({ [Symbol('s')]: 1 }, { checkSymbols: true });
886
- * // ➔ false
887
- * isEmptyObject(null);
888
- * // ➔ true (not object)
889
- * isEmptyObject([]);
890
- * // ➔ true (not plain object)
891
- * isEmptyObject(123);
892
- * // ➔ true (not object)
893
- */
936
+ * * ***Predicate: `isEmptyObject`.***
937
+ * ----------------------------------------------------------
938
+ * **Checks if a value is a plain object with **no own enumerable string-key properties**,
939
+ * and optionally **no own enumerable symbol-key properties** when `checkSymbols` is `true`.**
940
+ * - **Behavior:**
941
+ * - If the value is **not an object** (e.g. `null`, array, primitive), it is considered empty.
942
+ * - If `options.checkSymbols` is `true`, **symbol properties** are also checked.
943
+ * @param {*} value - The value to check.
944
+ * @param {IsEmptyObjectOptions} [options] - Optional settings.
945
+ * @param {IsEmptyObjectOptions["checkSymbols"]} [options.checkSymbols=false] - Whether to also check symbol properties.
946
+ * @returns {boolean} Return `true` if the value is considered empty or not an object, false otherwise.
947
+ * @example
948
+ * isEmptyObject({});
949
+ * // ➔ true
950
+ * isEmptyObject({}, { checkSymbols: true });
951
+ * // true
952
+ * isEmptyObject({ a: 1 });
953
+ * // false
954
+ * isEmptyObject({ [Symbol('s')]: 1 });
955
+ * // true
956
+ * isEmptyObject({ [Symbol('s')]: 1 }, { checkSymbols: true });
957
+ * // false
958
+ * isEmptyObject(null);
959
+ * // ➔ true (not object)
960
+ * isEmptyObject([]);
961
+ * // ➔ true (not plain object)
962
+ * isEmptyObject(123);
963
+ * // ➔ true (not object)
964
+ */
894
965
  declare function isEmptyObject(value:unknown,options?:IsEmptyObjectOptions):boolean;type IsEmptyStringOptions={
895
- /** Whether to trim the string before checking.
896
- *
897
- * DefaultValue: `true`.
898
- *
899
- * @default `true` */
966
+ /** Whether to trim the string before checking, defaultValue: `true`.
967
+ *
968
+ * @default `true` */
900
969
  trim?:boolean;};
901
970
  /** ----------------------------------------------------------
902
- * * ***Predicate: `isEmptyString`.***
903
- * ----------------------------------------------------------
904
- * @description Checks whether a given value is an **empty string**.
905
- *
906
- * - Considers `""` and whitespace-only strings as empty (if `trim` is enabled, which is the default).
907
- * - Non-string inputs are also considered empty.
908
- *
909
- * @param {*} [value] - The value to check.
910
- * @param {IsEmptyStringOptions | undefined} [options] - Optional settings.
911
- * @param {boolean} [options.trim=true] - Whether to trim the string before checking, defaultValue `true`.
912
- * @returns {boolean} Returns `true` if the value is string not a string or value string is considered empty.
913
- * @example
914
- * isEmptyString("");
915
- * // ➔ true
916
- * isEmptyString(" ");
917
- * // ➔ true (default trims)
918
- * isEmptyString(" ", { trim: false });
919
- * // ➔ false
920
- * isEmptyString("hello");
921
- * // ➔ false
922
- * isEmptyString(undefined);
923
- * // ➔ true
924
- * isEmptyString(null);
925
- * // ➔ true
926
- * isEmptyString(123 as any);
927
- * // ➔ true
928
- *
929
- * // Used in validation
930
- * if (isEmptyString(form.name)) {
931
- * throw new Error("Name cannot be empty.");
932
- * }
933
- */
971
+ * * ***Predicate: `isEmptyString`.***
972
+ * ----------------------------------------------------------
973
+ * **Checks whether a given value is an **empty string**.**
974
+ * - **Behavior:**
975
+ * - Considers `""` and whitespace-only strings as
976
+ * empty (if `trim` is enabled, which is the default).
977
+ * - Non-string inputs are also considered empty.
978
+ * @param {*} value - The value to check.
979
+ * @param {IsEmptyStringOptions} [options] - Optional settings.
980
+ * @param {IsEmptyStringOptions["trim"]} [options.trim=true] - Whether to trim the string before checking, defaultValue: `true`.
981
+ * @returns {boolean} Returns `true` if the value is string not a string or value string is considered empty.
982
+ * @example
983
+ * isEmptyString("");
984
+ * // ➔ true
985
+ * isEmptyString(" ");
986
+ * // ➔ true (default trims)
987
+ * isEmptyString(" ", { trim: false });
988
+ * // ➔ false
989
+ * isEmptyString("hello");
990
+ * // ➔ false
991
+ * isEmptyString(undefined);
992
+ * // ➔ true
993
+ * isEmptyString(null);
994
+ * // ➔ true
995
+ * isEmptyString(123 as any);
996
+ * // ➔ true
997
+ *
998
+ * // Used in validation
999
+ * if (isEmptyString(form.name)) {
1000
+ * throw new Error("Name cannot be empty.");
1001
+ * }
1002
+ */
934
1003
  declare const isEmptyString:(value:unknown,options?:IsEmptyStringOptions)=>boolean;type IsEmptyValueOptions={
935
1004
  /** Whether to check symbol properties when checking empty objects.
936
- *
937
- * DefaultValue: `false`.
938
- *
939
- * @default false
940
- */
1005
+ *
1006
+ * DefaultValue: `false`.
1007
+ *
1008
+ * @default false
1009
+ */
941
1010
  checkSymbols?:boolean;};
942
1011
  /** ----------------------------------------------------------
943
- * * ***Predicate: `isEmptyValue`.***
944
- * ----------------------------------------------------------
945
- * @description Determines if a value is **`empty`**, covering:
946
- *
947
- * - Empty objects: `{}`
948
- * - Empty arrays: `[]`
949
- * - Empty strings: `""` or whitespace-only (trimmed)
950
- * - `null`, `undefined`, `false`, or `NaN`
951
- *
952
- * Returns **`false`** for:
953
- * - Non-empty objects/arrays
954
- * - Non-empty strings
955
- * - Numbers (except `NaN`)
956
- * - Functions, `true`, symbols, etc.
957
- *
958
- * @param {*} value - The value to evaluate.
959
- * @param {IsEmptyValueOptions} options - Optional settings.
960
- * @returns {boolean} Return `true` if the value is considered empty, otherwise `false`.
961
- *
962
- * @example
963
- * isEmptyValue({});
964
- * // true
965
- * isEmptyValue([]);
966
- * // true
967
- * isEmptyValue({ key: "value" });
968
- * // false
969
- * isEmptyValue({ [Symbol("foo")]: 123 });
970
- * // true (default `checkSymbols` is `false`)
971
- * isEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: false });
972
- * // ➔ true (default `checkSymbols` is `false`)
973
- * isEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: true });
974
- * // ➔ false
975
- * isEmptyValue([1, 2, 3]);
976
- * // ➔ false
977
- * isEmptyValue(NaN);
978
- * // ➔ true
979
- * isEmptyValue(true);
980
- * // ➔ false
981
- * isEmptyValue(false);
982
- * // ➔ true
983
- * isEmptyValue(null);
984
- * // ➔ true
985
- * isEmptyValue(undefined);
986
- * // ➔ true
987
- * isEmptyValue("");
988
- * // ➔ true
989
- * isEmptyValue(" ");
990
- * // ➔ true
991
- * isEmptyValue(0);
992
- * // ➔ false
993
- * isEmptyValue(-1);
994
- * // false
995
- * isEmptyValue(2);
996
- * // ➔ false
997
- * isEmptyValue(() => {});
998
- * // ➔ false
999
- */
1012
+ * * ***Predicate: `isEmptyValue`.***
1013
+ * ----------------------------------------------------------
1014
+ * **Determines if a value is **`empty`**.**
1015
+ * - **Covering:**
1016
+ * - Empty objects: `{}`
1017
+ * - Empty arrays: `[]`
1018
+ * - Empty strings: `""` or whitespace-only (trimmed)
1019
+ * - `null`, `undefined`, `false`, or `NaN`
1020
+ * - **Returns **`false`** for:**
1021
+ * - Non-empty objects/arrays
1022
+ * - Non-empty strings
1023
+ * - Numbers (except `NaN`)
1024
+ * - `Functions`, `true`, `symbols`, `etc`.
1025
+ * @param {*} value - The value to evaluate.
1026
+ * @param {IsEmptyValueOptions} [options] - Optional settings.
1027
+ * @returns {boolean} Return `true` if the value is considered empty, otherwise `false`.
1028
+ * @example
1029
+ * isEmptyValue({});
1030
+ * // ➔ true
1031
+ * isEmptyValue([]);
1032
+ * // ➔ true
1033
+ * isEmptyValue({ key: "value" });
1034
+ * // ➔ false
1035
+ * isEmptyValue({ [Symbol("foo")]: 123 });
1036
+ * // ➔ true (default `checkSymbols` is `false`)
1037
+ * isEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: false });
1038
+ * // ➔ true (default `checkSymbols` is `false`)
1039
+ * isEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: true });
1040
+ * // false
1041
+ * isEmptyValue([1, 2, 3]);
1042
+ * // false
1043
+ * isEmptyValue(NaN);
1044
+ * // true
1045
+ * isEmptyValue(true);
1046
+ * // ➔ false
1047
+ * isEmptyValue(false);
1048
+ * // ➔ true
1049
+ * isEmptyValue(null);
1050
+ * // ➔ true
1051
+ * isEmptyValue(undefined);
1052
+ * // ➔ true
1053
+ * isEmptyValue("");
1054
+ * // ➔ true
1055
+ * isEmptyValue(" ");
1056
+ * // ➔ true
1057
+ * isEmptyValue(0);
1058
+ * // ➔ false
1059
+ * isEmptyValue(-1);
1060
+ * // ➔ false
1061
+ * isEmptyValue(2);
1062
+ * // ➔ false
1063
+ * isEmptyValue(() => {});
1064
+ * // ➔ false
1065
+ */
1000
1066
  declare const isEmptyValue:(value:unknown,options?:IsEmptyValueOptions)=>boolean;
1001
1067
  /** ----------------------------------------------------
1002
- * * ***Performs a deep comparison between two values to determine if they are equivalent.***
1003
- * ----------------------------------------------------------
1004
- * @description
1005
- * Checks whether two values are **deeply equal**, not just reference-equal (`===`).
1006
- *
1007
- * - This method compares:
1008
- * - Arrays and TypedArrays
1009
- * - ArrayBuffers
1010
- * - Plain objects (`Object`) own enumerable properties only
1011
- * - Booleans, Numbers, Strings, Symbols
1012
- * - Dates
1013
- * - Errors
1014
- * - Maps
1015
- * - Sets
1016
- * - Regular expressions
1017
- *
1018
- * Functions and DOM nodes are **not supported**.
1019
- *
1020
- * @param {*} value The value to compare.
1021
- * @param {*} other The other value to compare.
1022
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1023
- * @example
1024
- * const obj1 = { user: "fred" };
1025
- * const obj2 = { user: "fred" };
1026
- *
1027
- * isEqual(obj1, obj2);
1028
- * // ➔ true
1029
- * obj1 === obj2;
1030
- * // ➔ false (different references)
1031
- * isEqual([1, 2, 3], [1, 2, 3]);
1032
- * // ➔ true
1033
- * isEqual(new Date("2020-01-01"), new Date("2020-01-01"));
1034
- * // ➔ true
1035
- * isEqual(new Set([1, 2]), new Set([2, 1]));
1036
- * // ➔ true
1037
- * isEqual(/abc/i, new RegExp("abc", "i"));
1038
- * // ➔ true
1039
- * isEqual({ a: 1 }, { a: 1, b: undefined });
1040
- * // ➔ false
1041
- */
1068
+ * * ***Predicate: `isEqual`.***
1069
+ * ----------------------------------------------------------
1070
+ * **Performs a deep comparison between two values to determine if they are equivalent.**
1071
+ * @description
1072
+ * Checks whether two values are **deeply equal**, not just reference-equal (`===`).
1073
+ * - **✅ This method compares:**
1074
+ * - Arrays and TypedArrays
1075
+ * - ArrayBuffers
1076
+ * - Plain objects (`Object`) own enumerable properties only
1077
+ * - Booleans, Numbers, Strings, Symbols
1078
+ * - Dates
1079
+ * - Errors
1080
+ * - Maps
1081
+ * - Sets
1082
+ * - Regular expressions
1083
+ * - ❌ `Functions` and `DOM nodes` are ***not supported***.
1084
+ * @param {*} value The value to compare.
1085
+ * @param {*} other The other value to compare.
1086
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1087
+ * @example
1088
+ * const obj1 = { user: "fred" };
1089
+ * const obj2 = { user: "fred" };
1090
+ *
1091
+ * isEqual(obj1, obj2);
1092
+ * // ➔ true
1093
+ * obj1 === obj2;
1094
+ * // ➔ false (different references)
1095
+ * isEqual([1, 2, 3], [1, 2, 3]);
1096
+ * // ➔ true
1097
+ * isEqual(new Date("2020-01-01"), new Date("2020-01-01"));
1098
+ * // ➔ true
1099
+ * isEqual(new Set([1, 2]), new Set([2, 1]));
1100
+ * // ➔ true
1101
+ * isEqual(/abc/i, new RegExp("abc", "i"));
1102
+ * // ➔ true
1103
+ * isEqual({ a: 1 }, { a: 1, b: undefined });
1104
+ * // ➔ false
1105
+ */
1042
1106
  declare function isEqual(value:unknown,other:unknown):boolean;
1043
1107
  /** ----------------------------------------------------
1044
- * * ***Performs a deep comparison between two values with support for a customizer function.***
1045
- * ----------------------------------------------------
1046
- * @description
1047
- * This method is like **{@link isEqual}** except that it accepts a `customizer`
1048
- * which is invoked to compare values.
1049
- * - If `customizer` returns `undefined`,
1050
- * the comparison is handled by the default deep equality algorithm.
1051
- *
1052
- * - The `customizer` is invoked with up to six arguments:
1053
- * - `(value, other, indexOrKey, parent, otherParent, stack)`.
1054
- *
1055
- * - Supports comparing arrays, objects, maps, sets, dates, regexes, typed arrays, etc.
1056
- * - Functions and DOM nodes are **not** supported.
1057
- *
1058
- * @param {*} value The value to compare.
1059
- * @param {*} other The other value to compare.
1060
- * @param {IsEqualCustomizer} [customizer] The function to customize comparisons.
1061
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1062
- * @example
1063
- * function isGreeting(value: unknown) {
1064
- * return typeof value === "string" && /^h(?:i|ello)$/.test(value);
1065
- * }
1066
- *
1067
- * function customizer(objValue: unknown, othValue: unknown) {
1068
- * if (isGreeting(objValue) && isGreeting(othValue)) {
1069
- * return true;
1070
- * }
1071
- * }
1072
- *
1073
- * const array = ["hello", "goodbye"];
1074
- * const other = ["hi", "goodbye"];
1075
- *
1076
- * console.log(isEqualWith(array, other, customizer));
1077
- * // ➔ true
1078
- */
1079
- declare function isEqualWith(value:unknown,other:unknown,customizer?:IsEqualCustomizer):boolean;
1108
+ * * ***Predicate: `isEqualWith`.***
1109
+ * ----------------------------------------------------
1110
+ * **Performs a deep comparison between two values with support for a
1111
+ * customizer function.**
1112
+ * @description
1113
+ * This method is like **{@link isEqual | `isEqual`}** except that it
1114
+ * accepts a `customizer` which is invoked to compare values.
1115
+ * - **Behavior:**
1116
+ * - If `customizer` returns `undefined`, the comparison is handled by
1117
+ * the default deep equality algorithm.
1118
+ * - The `customizer` is invoked with up to six arguments:
1119
+ * - `(value, other, indexOrKey, parent, otherParent, stack)`,
1120
+ * see **{@link CustomizerIsEqualWith | `CustomizerIsEqualWith`}**.
1121
+ * - Supports comparing `arrays`, `objects`, `maps`, `sets`, `dates`,
1122
+ * `regexes`, `typed arrays`, `etc`.
1123
+ * - Functions and DOM nodes are **not** supported.
1124
+ * @param {*} value The value to compare.
1125
+ * @param {*} other The other value to compare.
1126
+ * @param {CustomizerIsEqualWith} [customizer] The function to customize comparisons.
1127
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1128
+ * @example
1129
+ * function isGreeting(value: unknown) {
1130
+ * return typeof value === "string" && /^h(?:i|ello)$/.test(value);
1131
+ * }
1132
+ *
1133
+ * function customizer(objValue: unknown, othValue: unknown) {
1134
+ * if (isGreeting(objValue) && isGreeting(othValue)) {
1135
+ * return true;
1136
+ * }
1137
+ * }
1138
+ *
1139
+ * const array = ["hello", "goodbye"];
1140
+ * const other = ["hi", "goodbye"];
1141
+ *
1142
+ * isEqualWith(array, other, customizer);
1143
+ * // ➔ true
1144
+ */
1145
+ declare function isEqualWith(value:unknown,other:unknown,customizer?:CustomizerIsEqualWith):boolean;
1080
1146
  /** ----------------------------------------------------------
1081
- * * ***Type guard: `isError`.***
1082
- * ----------------------------------------------------------
1083
- * @description Checks whether the given value is an **`Error` object**.
1084
- *
1085
- * - Ensures that the provided value is a valid JavaScript error instance.
1086
- * - Useful in TypeScript for narrowing types during error handling.
1087
- *
1088
- * @param {*} error - The value to check.
1089
- * @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`.
1090
- * @example
1091
- * isError(new Error("Something went wrong"));
1092
- * // ➔ true
1093
- * isError("Error message");
1094
- * // ➔ false
1095
- * isError(null);
1096
- * // ➔ false
1097
- */
1147
+ * * ***Type guard: `isError`.***
1148
+ * ----------------------------------------------------------
1149
+ * **Checks whether the given value is an **`Error` object**.**
1150
+ * - **Behavior:**
1151
+ * - Ensures that the provided value is a valid JavaScript error instance.
1152
+ * - Useful in TypeScript for narrowing types during error handling.
1153
+ * @param {*} error - The value to check.
1154
+ * @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`.
1155
+ * @example
1156
+ * isError(new Error("Something went wrong"));
1157
+ * // true
1158
+ * isError("Error message");
1159
+ * // ➔ false
1160
+ * isError(null);
1161
+ * // ➔ false
1162
+ */
1098
1163
  declare const isError:(error:unknown)=>error is Error;
1099
- /** -----------------------------------------------------------------------------
1100
- * * ***Checks if a value is a finite primitive number.***
1101
- * -----------------------------------------------------------------------------
1102
- * @description
1103
- * This function verifies that `value` is a **primitive number** and is **finite**
1104
- * (i.e., not `NaN`, `Infinity`, or `-Infinity`).
1105
- *
1106
- * - Behaves like [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite).
1107
- * - But also works as a **TypeScript type guard**.
1108
- *
1109
- * @param {*} value - The value to check.
1110
- * @returns {boolean} Returns `true` if `value` is a finite primitive number, else `false`.
1111
- *
1112
- * @example
1113
- * import * as RzlUtilsJs from "@rzl-zone/utils-js";
1114
- *
1115
- * // Strict finite number check (only primitive numbers)
1116
- * RzlUtilsJs.isFinite(3);
1117
- * // ➔ true
1118
- * RzlUtilsJs.isFinite(Number.MIN_VALUE);
1119
- * // ➔ true
1120
- * RzlUtilsJs.isFinite("3");
1121
- * // ➔ false (string is not a number)
1122
- * RzlUtilsJs.isFinite(NaN);
1123
- * // ➔ false
1124
- * RzlUtilsJs.isFinite(Infinity);
1125
- * // ➔ false
1126
- * RzlUtilsJs.isFinite(new Number(3));
1127
- * // ➔ false (Number object is not primitive)
1128
- *
1129
- * // Comparison with global isFinite()
1130
- * isFinite("3");
1131
- * // ➔ true (global coerces string to number)
1132
- * isFinite(new Number(3));
1133
- * // ➔ true (object coerced to primitive number)
1134
- */
1164
+ /** ----------------------------------------------------------
1165
+ * * ***Type guard: `isFinite`.***
1166
+ * -----------------------------------------------------------
1167
+ * **Checks if a value is a finite primitive number.**
1168
+ * @description
1169
+ * This function verifies that `value` is a **primitive number** and is **finite**
1170
+ * (i.e., not `NaN`, `Infinity`, or `-Infinity`).
1171
+ * - **Behavior:**
1172
+ * - Behaves like
1173
+ * [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite).
1174
+ * - But also works as a **TypeScript type guard**.
1175
+ * @param {*} value - The value to check.
1176
+ * @returns {boolean} Returns `true` if `value` is a finite primitive number, else `false`.
1177
+ * @example
1178
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1179
+ *
1180
+ * // Strict finite number check (only primitive numbers)
1181
+ * RzlUtilsJs.isFinite(3);
1182
+ * // ➔ true
1183
+ * RzlUtilsJs.isFinite(Number.MIN_VALUE);
1184
+ * // ➔ true
1185
+ * RzlUtilsJs.isFinite("3");
1186
+ * // ➔ false (string is not a number)
1187
+ * RzlUtilsJs.isFinite(NaN);
1188
+ * // ➔ false
1189
+ * RzlUtilsJs.isFinite(Infinity);
1190
+ * // ➔ false
1191
+ * RzlUtilsJs.isFinite(new Number(3));
1192
+ * // ➔ false (Number object is not primitive)
1193
+ *
1194
+ * // Comparison with global isFinite()
1195
+ * isFinite("3");
1196
+ * // ➔ true (global coerces string to number)
1197
+ * isFinite(new Number(3));
1198
+ * // ➔ true (object coerced to primitive number)
1199
+ */
1135
1200
  declare function isFinite(value:unknown):value is number;
1136
1201
  /** ----------------------------------------------------------
1137
- * * ***Type guard: `isFunction`.***
1138
- * ----------------------------------------------------------
1139
- * @description Checks if a value is a function.
1140
- * - Uses `typeof value === "function"` for strict type checking.
1141
- * - Supports TypeScript type narrowing with `value is (...args: any[]) => any`.
1142
- * - Safe alternative to `Function` type (doesn't trigger ESLint warning).
1143
- *
1144
- * @param {*} value - The value to check.
1145
- * @returns {boolean} Return `true` if the value is a function.
1146
- *
1147
- * @example
1148
- * isFunction(() => {});
1149
- * // true
1150
- * isFunction(async () => {});
1151
- * // ➔ true
1152
- * isFunction(null);
1153
- * // ➔ false
1154
- * isFunction({});
1155
- * // ➔ false
1156
- */
1202
+ * * ***Type guard: `isFunction`.***
1203
+ * -----------------------------------------------------------
1204
+ * **Checks if a value is a function.**
1205
+ * - **Behavior:**
1206
+ * - Uses `typeof value === "function"` for strict type checking.
1207
+ * - Safe alternative to `Function` type (doesn't trigger ESLint warning).
1208
+ * - Supports TypeScript type narrowing with `value is (...args: any[]) => any`.
1209
+ * @param {*} value - The value to check.
1210
+ * @returns {boolean} Return `true` if the value is a function.
1211
+ * @example
1212
+ * isFunction(() => {});
1213
+ * // true
1214
+ * isFunction(async () => {});
1215
+ * // true
1216
+ * isFunction(null);
1217
+ * // ➔ false
1218
+ * isFunction({});
1219
+ * // ➔ false
1220
+ */
1157
1221
  declare const isFunction:(value:unknown)=>value is AnyFunction;
1158
1222
  /** ----------------------------------------------------
1159
- * * ***Type guard: `isInteger`.***
1160
- * ----------------------------------------------------------
1161
- * @description Checks if a value is an integer.
1162
- *
1163
- * **Note:** This method is based on
1164
- * [`Number.isInteger`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger).
1165
- *
1166
- * @param {*} value The value to check.
1167
- * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
1168
- * @example
1169
- * isInteger(3);
1170
- * // true
1171
- * isInteger(Number.MIN_VALUE);
1172
- * // ➔ false
1173
- * isInteger(NaN);
1174
- * // ➔ false
1175
- * isInteger(Infinity);
1176
- * // ➔ false
1177
- * isInteger(-Infinity);
1178
- * // ➔ false
1179
- * isInteger('3');
1180
- * // ➔ false
1181
- */
1223
+ * * ***Type guard: `isInfinityNumber`.***
1224
+ * ----------------------------------------------------
1225
+ * **Checks if a value is positive or negative
1226
+ * [`Infinity`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity).**
1227
+ *
1228
+ * - **ℹ️ Note:**
1229
+ * - This is stricter than the global `isFinite`,
1230
+ * because it only returns `true` for `Infinity` or `-Infinity`,
1231
+ * not other non-finite values.
1232
+ *
1233
+ * @param {*} value The value to check.
1234
+ * @returns {boolean} Returns `true` if `value` is `Infinity` or `-Infinity`, else `false`.
1235
+ *
1236
+ * @example
1237
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1238
+ *
1239
+ * RzlUtilsJs.isInfinityNumber(Infinity);
1240
+ * // ➔ true
1241
+ *
1242
+ * RzlUtilsJs.isInfinityNumber(-Infinity);
1243
+ * // ➔ true
1244
+ *
1245
+ * RzlUtilsJs.isInfinityNumber(new Number(Infinity));
1246
+ * // ➔ true
1247
+ *
1248
+ * RzlUtilsJs.isInfinityNumber(NaN);
1249
+ * // ➔ false
1250
+ *
1251
+ * RzlUtilsJs.isInfinityNumber(123);
1252
+ * // ➔ false
1253
+ */
1254
+ declare function isInfinityNumber(value:unknown):boolean;
1255
+ /** ---------------------------------------------------------
1256
+ * * ***Type guard: `isInteger`.***
1257
+ * ----------------------------------------------------------
1258
+ * **Checks if a value is an integer.**
1259
+ * - **ℹ️ Note:**
1260
+ * - This method is based on
1261
+ * [`Number.isInteger`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger).
1262
+ * @param {*} value The value to check.
1263
+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
1264
+ * @example
1265
+ * isInteger(3);
1266
+ * // ➔ true
1267
+ * isInteger(Number.MIN_VALUE);
1268
+ * // ➔ false
1269
+ * isInteger(NaN);
1270
+ * // ➔ false
1271
+ * isInteger(Infinity);
1272
+ * // ➔ false
1273
+ * isInteger(-Infinity);
1274
+ * // ➔ false
1275
+ * isInteger('3');
1276
+ * // ➔ false
1277
+ */
1182
1278
  declare function isInteger(value:unknown):value is number;
1183
1279
  /** ----------------------------------------
1184
- * * ***Type guard: `isLength`.***
1185
- * ----------------------------------------------------------
1186
- * @description Checks whether the given value is a **valid array-like length**.
1187
- *
1188
- * - ✅ Ensures the value is a **non-negative integer**.
1189
- * - ✅ Ensures the value is **not greater than `Number.MAX_SAFE_INTEGER`**.
1190
- * - ❌ Excludes non-numeric values, `Infinity`, and fractional numbers.
1191
- *
1192
- * **Note:** This method is loosely based on
1193
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1194
- *
1195
- * A valid length must be a non-negative integer
1196
- * and **not greater than `Number.MAX_SAFE_INTEGER`**.
1197
- *
1198
- * @param {*} value The value to check.
1199
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1200
- * @example
1201
- * isLength(3);
1202
- * // ➔ true
1203
- * isLength(Number.MAX_SAFE_INTEGER);
1204
- * // ➔ true
1205
- * isLength(Number.MAX_SAFE_INTEGER + 1);
1206
- * // ➔ false
1207
- * isLength("3");
1208
- * // ➔ false
1209
- * isLength(-1);
1210
- * // ➔ false
1211
- * isLength(3.14);
1212
- * // ➔ false
1213
- * isLength(Infinity);
1214
- * // ➔ false
1215
- * isLength(-Infinity);
1216
- * // ➔ false
1217
- * isLength(Number.MIN_VALUE);
1218
- * // ➔ false
1219
- */
1280
+ * * ***Type guard: `isLength`.***
1281
+ * ----------------------------------------------------------
1282
+ * **Checks whether the given value is a **valid array-like length**.**
1283
+ * - **Behavior:**
1284
+ * - ✅ Ensures the value is a **non-negative integer**.
1285
+ * - ✅ Ensures the value is **not greater than `Number.MAX_SAFE_INTEGER`**.
1286
+ * - ❌ Excludes non-numeric values, `Infinity`, and fractional numbers.
1287
+ * - **ℹ️ Note:**
1288
+ * - This method is loosely based on
1289
+ * - A valid length must be a non-negative integer and **not greater
1290
+ * than `Number.MAX_SAFE_INTEGER`**.
1291
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1292
+ * @param {*} value The value to check.
1293
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1294
+ * @example
1295
+ * isLength(3);
1296
+ * // ➔ true
1297
+ * isLength(Number.MAX_SAFE_INTEGER);
1298
+ * // ➔ true
1299
+ * isLength(Number.MAX_SAFE_INTEGER + 1);
1300
+ * // ➔ false
1301
+ * isLength("3");
1302
+ * // ➔ false
1303
+ * isLength(-1);
1304
+ * // ➔ false
1305
+ * isLength(3.14);
1306
+ * // ➔ false
1307
+ * isLength(Infinity);
1308
+ * // ➔ false
1309
+ * isLength(-Infinity);
1310
+ * // ➔ false
1311
+ * isLength(Number.MIN_VALUE);
1312
+ * // ➔ false
1313
+ */
1220
1314
  declare function isLength(value:unknown):boolean;
1221
1315
  /** --------------------------------------------------
1222
- * * ***Type guard: `isMap`.***
1223
- * ----------------------------------------------------------
1224
- * @description Checks whether the given value is a **`Map` object**.
1225
- *
1226
- * - Ensures that the provided value is an instance of **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)**.
1227
- * - Useful in TypeScript for narrowing types when working with collections.
1228
- *
1229
- * @param {*} value The value to check.
1230
- * @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`.
1231
- * @example
1232
- * isMap(new Map());
1233
- * // ➔ true
1234
- * isMap(new WeakMap());
1235
- * // ➔ false
1236
- * isMap({});
1237
- * // ➔ false
1238
- */
1316
+ * * ***Type guard: `isMap`.***
1317
+ * ----------------------------------------------------------
1318
+ * **Checks whether the given value is a **`Map` object**.**
1319
+ * - **Behavior:**
1320
+ * - Ensures that the provided value is an instance of **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)**.
1321
+ * - Useful in TypeScript for narrowing types when working with collections.
1322
+ * @param {*} value The value to check.
1323
+ * @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`.
1324
+ * @example
1325
+ * isMap(new Map());
1326
+ * // ➔ true
1327
+ * isMap(new WeakMap());
1328
+ * // ➔ false
1329
+ * isMap({});
1330
+ * // ➔ false
1331
+ */
1239
1332
  declare function isMap<K=unknown,V=unknown>(value:Map<K,V>):value is Map<K,V>;declare function isMap(value:unknown):value is Map<unknown,unknown>;
1240
1333
  /** ----------------------------------------------------
1241
- * * ***Performs a partial deep comparison between `object` and `source`.***
1242
- * ----------------------------------------------------
1243
- * @description Determines whether `object` contains equivalent property values from `source`.
1244
- *
1245
- * - Returns `true` if **all properties** in `source` exist in `object` and are deeply equal.
1246
- * - ❌ Does **not** require `object` and `source` to be the same shape—`object` may have extra properties.
1247
- * - ⚠️ Arrays are treated as objects: only matching indexed keys are compared.
1248
- *
1249
- * @remarks
1250
- * - This is functionally equivalent to a partially applied `matches(source)` predicate.
1251
- * - Special cases:
1252
- * - An empty array (`[]`) in `source` matches any array in `object`.
1253
- * - An empty object (`{}`) in `source` matches any object in `object`.
1254
- * @param {object} object - The object to inspect.
1255
- * @param {object} source - The object containing property values to match.
1256
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
1257
- * @example
1258
- * const object = { a: 1, b: 2 };
1259
- *
1260
- * isMatch(object, { b: 2 });
1261
- * // true
1262
- * isMatch(object, { b: 1 });
1263
- * // false
1264
- * isMatch([1, 2, 3], [1, 2]);
1265
- * // ➔ true (treats arrays as objects with index keys)
1266
- */
1334
+ * * ***Predicate: `isMatch`.***
1335
+ * ----------------------------------------------------
1336
+ * **Performs a partial deep comparison between `object` and `source`.**
1337
+ * @description
1338
+ * Determines whether `object` contains equivalent property values from `source`.
1339
+ * - **Behavior:**
1340
+ * - Returns `true` if **all properties** in `source` exist in `object` and are deeply equal.
1341
+ * - ❌ Does **not** require `object` and `source` to be the same shape—`object` may have extra properties.
1342
+ * - ⚠️ Arrays are treated as objects: only matching indexed keys are compared.
1343
+ * - **Remarks:**
1344
+ * - This is functionally equivalent to a partially applied `matches(source)` predicate.
1345
+ * - Special cases:
1346
+ * - An empty array (`[]`) in `source` matches any array in `object`.
1347
+ * - An empty object (`{}`) in `source` matches any object in `object`.
1348
+ * @param {object} object - The object to inspect.
1349
+ * @param {object} source - The object containing property values to match.
1350
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
1351
+ * @example
1352
+ * const object = { a: 1, b: 2 };
1353
+ *
1354
+ * isMatch(object, { b: 2 });
1355
+ * // true
1356
+ * isMatch(object, { b: 1 });
1357
+ * // false
1358
+ * isMatch([1, 2, 3], [1, 2]);
1359
+ * // ➔ true (treats arrays as objects with index keys)
1360
+ */
1267
1361
  declare function isMatch(object:object,source:object):boolean;
1268
1362
  /** ----------------------------------------------------
1269
- * * ***Performs a partial deep comparison between `object` and `source`,
1270
- * like `isMatch`, but with a `customizer` function to control comparisons.***
1271
- * ----------------------------------------------------
1272
- * If `customizer` returns a value other than `undefined`, that value is used
1273
- * as the result of the comparison for the current property. Otherwise,
1274
- * the comparison falls back to the default deep equality logic.
1275
- *
1276
- * @remarks
1277
- * - The `customizer` function is invoked with up to **five** arguments:
1278
- * `(objValue, srcValue, keyOrIndex, object, source)`.
1279
- * - Returning `true` from `customizer` will short-circuit further comparison
1280
- * for that key.
1281
- * - Returning `false` will cause `isMatchWith` to return `false` immediately.
1282
- * - Returning `undefined` allows default comparison to proceed.
1283
- * @param {*} value - The object to inspect.
1284
- * @param {*} other - The object of property values to match.
1285
- * @param {isMatchWithCustomizer} customizer - The function to customize comparisons.
1286
- * @returns Returns `true` if `object` is a match, else `false`.
1287
- *
1288
- * @example
1289
- * function isGreeting(value: unknown) {
1290
- * return typeof value === 'string' && /^h(?:i|ello)$/.test(value);
1291
- * }
1292
- *
1293
- * function customizer(objValue: unknown, srcValue: unknown) {
1294
- * if (isGreeting(objValue) && isGreeting(srcValue)) {
1295
- * return true;
1296
- * }
1297
- * }
1298
- *
1299
- * const object = { greeting: 'hello' };
1300
- * const source = { greeting: 'hi' };
1301
- *
1302
- * isMatchWith(object, source, customizer);
1303
- * // ➔ true
1304
- */
1305
- declare function isMatchWith(value:object,other:object,customizer?:isMatchWithCustomizer):boolean;
1363
+ * * ***Predicate: `isMatchWith`.***
1364
+ * ----------------------------------------------------
1365
+ * **Performs a partial deep comparison between `object` and `source`, like `isMatch`, but with a `customizer` function to control comparisons.**
1366
+ * @description
1367
+ * If `customizer` returns a value other than `undefined`, that value is used
1368
+ * as the result of the comparison for the current property. Otherwise,
1369
+ * the comparison falls back to the default deep equality logic.
1370
+ * - **Behavior:**
1371
+ * - The `customizer` function is invoked with up to **five** arguments:
1372
+ * - `(objValue, srcValue, keyOrIndex, object, source)`,
1373
+ * see **{@link CustomizerIsMatchWith | `CustomizerIsMatchWith`}**.
1374
+ * - Returning `true` from `customizer` will short-circuit further comparison
1375
+ * for that key.
1376
+ * - Returning `false` will cause `isMatchWith` to return `false` immediately.
1377
+ * - Returning `undefined` allows default comparison to proceed.
1378
+ * @param {object} value - The object to inspect.
1379
+ * @param {object} other - The object of property values to match.
1380
+ * @param {CustomizerIsMatchWith} [customizer] - The function to customize comparisons.
1381
+ * @returns Returns `true` if `object` is a match, else `false`.
1382
+ * @example
1383
+ * function isGreeting(value: unknown) {
1384
+ * return typeof value === 'string' && /^h(?:i|ello)$/.test(value);
1385
+ * }
1386
+ *
1387
+ * function customizer(objValue: unknown, srcValue: unknown) {
1388
+ * if (isGreeting(objValue) && isGreeting(srcValue)) {
1389
+ * return true;
1390
+ * }
1391
+ * }
1392
+ *
1393
+ * const object = { greeting: 'hello' };
1394
+ * const source = { greeting: 'hi' };
1395
+ *
1396
+ * isMatchWith(object, source, customizer);
1397
+ * // ➔ true
1398
+ */
1399
+ declare function isMatchWith(value:object,other:object,customizer?:CustomizerIsMatchWith):boolean;
1306
1400
  /** ----------------------------------------------------
1307
- * * ***Type guard: `isNaN`.***
1308
- * ----------------------------------------------------
1309
- * @description Checks if a value is [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).
1310
- *
1311
- * **Note:** This method is based on [`Number.isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN)
1312
- * and is **not** the same as the global [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN),
1313
- * which returns `true` for `undefined` and other non-number values.
1314
- *
1315
- * @param {*} value The value to check.
1316
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1317
- * @example
1318
- * import * as RzlUtilsJs from "@rzl-zone/utils-js";
1319
- *
1320
- * RzlUtilsJs.isNaN(NaN);
1321
- * // ➔ true
1322
- * RzlUtilsJs.isNaN(new Number(NaN));
1323
- * // ➔ true
1324
- * RzlUtilsJs.isNaN(undefined);
1325
- * // ➔ false
1326
- *
1327
- * // This global isNaN:
1328
- * isNaN(undefined);
1329
- * // ➔ true
1330
- */
1401
+ * * ***Type guard: `isNaN`.***
1402
+ * ----------------------------------------------------
1403
+ * **Checks if a value is [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).**
1404
+ * - **ℹ️ Note:**
1405
+ * - This method is based on
1406
+ * [`Number.isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN)
1407
+ * and is **not** the same as the global
1408
+ * [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN),
1409
+ * which returns `true` for `undefined` and other non-number values.
1410
+ * @param {*} value The value to check.
1411
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1412
+ * @example
1413
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1414
+ *
1415
+ * RzlUtilsJs.isNaN(NaN);
1416
+ * // ➔ true
1417
+ * RzlUtilsJs.isNaN(new Number(NaN));
1418
+ * // ➔ true
1419
+ * RzlUtilsJs.isNaN(undefined);
1420
+ * // ➔ false
1421
+ *
1422
+ * // This global isNaN:
1423
+ * isNaN(undefined);
1424
+ * // ➔ true
1425
+ */
1331
1426
  declare function isNaN(value:unknown):boolean;
1332
1427
  /** ----------------------------------------------------
1333
- * * ***Type guard: `isNative`.***
1334
- * ----------------------------------------------------------
1335
- * @description Checks if a value is a **pristine native function**.
1336
- *
1337
- * **Note:**
1338
- * - This method may not reliably detect native functions when using packages
1339
- * like `core-js`, as they override native behavior.
1340
- * - Attempts to detect native functions
1341
- * in such environments may fail or throw errors.
1342
- * - This also affects packages like
1343
- * [babel-polyfill](https://www.npmjs.com/package/babel-polyfill).
1344
- *
1345
- * @param {*} value The value to check.
1346
- * @returns {boolean} Returns `true` if `value` is a native function,
1347
- * else `false`.
1348
- * @example
1349
- * isNative(Array.prototype.push);
1350
- * // ➔ true
1351
- *
1352
- * import * as RzlUtilsJs from "@rzl-zone/utils-js";
1353
- * isNative(RzlUtilsJs);
1354
- * // ➔ false
1355
- */
1356
- declare function isNative(value?:unknown):value is AnyFunction;
1428
+ * * ***Type guard: `isNative`.***
1429
+ * ----------------------------------------------------------
1430
+ * **Checks if a value is a **pristine native function**.**
1431
+ * - **ℹ️ Note:**
1432
+ * - This method may not reliably detect native functions when using packages
1433
+ * like `core-js`, as they override native behavior.
1434
+ * - Attempts to detect native functions in such environments may fail or
1435
+ * throw errors.
1436
+ * - This also affects packages like
1437
+ * **[`babel-polyfill`](https://www.npmjs.com/package/babel-polyfill).**
1438
+ * @param {*} value The value to check.
1439
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
1440
+ * @example
1441
+ * isNative(Array.prototype.push);
1442
+ * // ➔ true
1443
+ *
1444
+ * import * as RzlUtilsJs from "@rzl-zone/utils-js/predicates";
1445
+ * isNative(RzlUtilsJs);
1446
+ * // ➔ false
1447
+ */
1448
+ declare function isNative(value:unknown):value is AnyFunction;
1357
1449
  /** ----------------------------------------------------
1358
- * * ***Type guard: `isNil`.***
1359
- * ----------------------------------------------------------
1360
- * @description Checks if a value is `null` or `undefined`.
1361
- *
1362
- * @param {*} value - The value to check.
1363
- * @returns {boolean} Returns `true` if the value is `null` or `undefined`, otherwise `false`.
1364
- * @example
1365
- * isNil(null);
1366
- * // ➔ true
1367
- * isNil(undefined);
1368
- * // ➔ true
1369
- * isNil(void 0);
1370
- * // ➔ true
1371
- * isNil(NaN);
1372
- * // ➔ false
1373
- */
1374
- declare function isNil(value?:unknown):value is null|undefined;
1450
+ * * ***Type guard: `isNil`.***
1451
+ * ----------------------------------------------------------
1452
+ * **Checks if a value is `null` or `undefined`.**
1453
+ * - **Behavior:**
1454
+ * - Narrows type to `null` or `undefined` when true.
1455
+ * @param {*} value - The value to check.
1456
+ * @returns {boolean} Returns `true` if the value is `null` or `undefined`, otherwise `false`.
1457
+ * @example
1458
+ * isNil(null);
1459
+ * // ➔ true
1460
+ * isNil(undefined);
1461
+ * // ➔ true
1462
+ * isNil(void 0);
1463
+ * // ➔ true
1464
+ * isNil(NaN);
1465
+ * // ➔ false
1466
+ */
1467
+ declare function isNil(value:unknown):value is null|undefined;
1375
1468
  /** ----------------------------------------------------------
1376
- * * ***Type guard: `isNonEmptyArray`.***
1377
- * ----------------------------------------------------------
1378
- * @description Checks if a value is a **non-empty array**.
1379
- *
1380
- * - Ensures the value is an actual array using **[`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)**.
1381
- * - Ensures the array contains at least one item.
1382
- * - Narrows type to `T[]` (non-empty array) when true.
1383
- *
1384
- * @template T - The type of the value being checked.
1385
- * @param {*} value - The value to check.
1386
- * @returns {boolean} Return `true` if value is a non-empty array.
1387
- *
1388
- * @example
1389
- * isNonEmptyArray([1, 2, 3]); // ➔ true
1390
- * isNonEmptyArray([]); // ➔ false
1391
- * isNonEmptyArray(null); // ➔ false
1392
- * isNonEmptyArray("test"); // ➔ false
1393
- */
1469
+ * * ***Type guard: `isNonEmptyArray`.***
1470
+ * ----------------------------------------------------------
1471
+ * **Checks if a value is a **non-empty array**.**
1472
+ * - **Behavior:**
1473
+ * - Ensures the value is an actual array using **[`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)**.
1474
+ * - Ensures the array contains at least one item.
1475
+ * - Narrows type to `T[]` (non-empty array) when true.
1476
+ * @template T - The type of the value being checked.
1477
+ * @param {*} value - The value to check.
1478
+ * @returns {boolean} Return `true` if value is a non-empty array.
1479
+ * @example
1480
+ * isNonEmptyArray([1, 2, 3]); // ➔ true
1481
+ * isNonEmptyArray([]); // ➔ false
1482
+ * isNonEmptyArray(null); // ➔ false
1483
+ * isNonEmptyArray("test"); // ➔ false
1484
+ */
1394
1485
  declare function isNonEmptyArray(value:[]):value is [];declare function isNonEmptyArray<T extends unknown[]>(value:T):value is NonNullable<Extract<T,unknown[]>>;declare function isNonEmptyArray(value:unknown):value is unknown[];type IsNonEmptyStringOptions={
1395
1486
  /**
1396
- * Whether to trim the string before checking.
1397
- *
1398
- * @default `true` */
1487
+ * Whether to trim the string before checking.
1488
+ *
1489
+ * @default `true` */
1399
1490
  trim?:boolean;};
1400
1491
  /** ----------------------------------------------------------
1401
- * * ***Type guard: `isNonEmptyString`.***
1402
- * ----------------------------------------------------------
1403
- * @description Checks if a value is a **non-empty string**.
1404
- *
1405
- * Determines whether the given `value` is a string containing at least one non-whitespace character, with optional trimming behavior.
1406
- *
1407
- * - Ensures the value is a string using **{@link isString}**.
1408
- * - Optionally trims whitespace before checking (`trim` defaults to `true`).
1409
- * - Narrows type to `string` when true.
1410
- *
1411
- * @param {*} value - The value to test.
1412
- * @param {IsNonEmptyStringOptions} options - Optional settings.
1413
- * @param {boolean} options.trim - If `true`, trims the string before checking. Defaults to `true`.
1414
- *
1415
- * @returns {boolean} `true` if `value` is a non-empty string, otherwise `false`.
1416
- *
1417
- * @example
1418
- * isNonEmptyString("hello");
1419
- * // true
1420
- * isNonEmptyString(" ", { trim: true });
1421
- * // ➔ false
1422
- * isNonEmptyString(" ", { trim: false });
1423
- * // ➔ true
1424
- * isNonEmptyString("");
1425
- * // ➔ false
1426
- * isNonEmptyString(123);
1427
- * // ➔ false
1428
- * isNonEmptyString(undefined);
1429
- * // ➔ false
1430
- * isNonEmptyString(null);
1431
- * // ➔ false
1432
- * isNonEmptyString({});
1433
- * // ➔ false
1434
- * isNonEmptyString([]);
1435
- * // ➔ false
1436
- */
1492
+ * * ***Type guard: `isNonEmptyString`.***
1493
+ * ----------------------------------------------------------
1494
+ * **Checks if a value is a **non-empty string**.**
1495
+ * @description
1496
+ * Determines whether the given `value` is a string containing at least one non-whitespace character, with optional trimming behavior.
1497
+ * - **Behavior:**
1498
+ * - Ensures the value is a string using **{@link isString | `isString`}**.
1499
+ * - Optionally trims whitespace before checking (`trim` defaults to `true`).
1500
+ * - Narrows type to `string` when true.
1501
+ * @param {*} value - The value to test.
1502
+ * @param {IsNonEmptyStringOptions} [options] - Optional settings.
1503
+ * @param {boolean} options.trim - If `true`, trims the string before checking, defaults: `true`.
1504
+ * @returns {boolean} Return `true` if `value` is a non-empty string, otherwise `false`.
1505
+ * @example
1506
+ * isNonEmptyString("hello");
1507
+ * // ➔ true
1508
+ * isNonEmptyString(" ", { trim: true });
1509
+ * // ➔ false
1510
+ * isNonEmptyString(" ", { trim: false });
1511
+ * // true
1512
+ * isNonEmptyString("");
1513
+ * // false
1514
+ * isNonEmptyString(123);
1515
+ * // ➔ false
1516
+ * isNonEmptyString(undefined);
1517
+ * // ➔ false
1518
+ * isNonEmptyString(null);
1519
+ * // ➔ false
1520
+ * isNonEmptyString({});
1521
+ * // ➔ false
1522
+ * isNonEmptyString([]);
1523
+ * // ➔ false
1524
+ */
1437
1525
  declare const isNonEmptyString:(value:unknown,options?:IsNonEmptyStringOptions)=>value is string;type IsNonEmptyValueOptions={
1438
- /**
1439
- * Whether to check symbol properties when checking empty objects.
1440
- * @default false
1441
- */
1526
+ /** Whether to check symbol properties when checking empty objects, default: `false`.
1527
+ *
1528
+ * @default false
1529
+ */
1442
1530
  checkSymbols?:boolean;};
1443
1531
  /** ----------------------------------------------------------
1444
- * * ***Determines if a value is a **non-empty** object (`{}` with props), **non-empty** array (`[]` with items)
1445
- * or generally truthy.***
1446
- * ----------------------------------------------------------
1447
- *
1448
- * - Returns `true` for objects with properties, non-empty arrays, numbers (except NaN), functions, `true`, and other truthy values.
1449
- * - Returns `false` for `{}`, `[]`, `null`, `undefined`, `""`, `" "`, `false`, and `NaN`.
1450
- * - Safely handles `null`, `undefined`, and non-object types without throwing.
1451
- *
1452
- * - Returns `true` for `{}`, `[]`, `null`, `undefined`, `""`, `" "`, `false`, and `NaN`.
1453
- * - Returns `false` for objects with properties, non-empty arrays, numbers, functions, `true` (Truthy) and other non-empty values.
1454
- * - Safely handles `null`, `undefined`, and non-object types without throwing.
1455
- *
1456
- * @param {*} value - The value to evaluate.
1457
- * @param {IsNonEmptyValueOptions} options - Optional settings.
1458
- * @returns `true` if the value is considered non-empty/truthy, otherwise `false`.
1459
- *
1460
- * @example
1461
- * isNonEmptyValue({});
1462
- * // false
1463
- * isNonEmptyValue([]);
1464
- * // false
1465
- * isNonEmptyValue({ key: "value" });
1466
- * // ➔ true
1467
- * isNonEmptyValue({ [Symbol("foo")]: 123 });
1468
- * // ➔ false (default `checkSymbols` is `false`)
1469
- * isNonEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: false });
1470
- * // ➔ false (default `checkSymbols` is `false`)
1471
- * isNonEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: true });
1472
- * // ➔ true
1473
- * isNonEmptyValue([1, 2, 3]);
1474
- * // ➔ true
1475
- * isNonEmptyValue(NaN);
1476
- * // ➔ false
1477
- * isNonEmptyValue(true);
1478
- * // ➔ true
1479
- * isNonEmptyValue(false);
1480
- * // ➔ false
1481
- * isNonEmptyValue(null);
1482
- * // ➔ false
1483
- * isNonEmptyValue(undefined);
1484
- * // ➔ false
1485
- * isNonEmptyValue("");
1486
- * // ➔ false
1487
- * isNonEmptyValue(" ");
1488
- * // ➔ false
1489
- * isNonEmptyValue(0);
1490
- * // ➔ true
1491
- * isNonEmptyValue(-1);
1492
- * // ➔ true
1493
- * isNonEmptyValue(2);
1494
- * // ➔ true
1495
- * isNonEmptyValue(() => {});
1496
- * // ➔ true
1497
- */
1532
+ * * ***Predicated: `isNonEmptyValue`.***
1533
+ * ----------------------------------------------------------
1534
+ * **Determines if a value is a **non-empty** object (`{}` with props), **non-empty** array (`[]` with items) or generally truthy.**
1535
+ * - **Behavior:**
1536
+ * - Returns `true` for:
1537
+ * - Objects **with properties**
1538
+ * - Arrays **with items**
1539
+ * - Non-empty, non-whitespace strings
1540
+ * - Numbers (except `NaN`, includes `0`)
1541
+ * - Functions
1542
+ * - `true`
1543
+ * - Returns `false` for:
1544
+ * - Empty objects (`{}`)
1545
+ * - Empty arrays (`[]`)
1546
+ * - `null` or `undefined`
1547
+ * - Empty strings (`""`) or whitespace-only strings (`" "`)
1548
+ * - `false`
1549
+ * - `NaN`
1550
+ * - Safely handles `null`, `undefined`, and non-object types without throwing.
1551
+ * @param {*} value - The value to evaluate.
1552
+ * @param {IsNonEmptyValueOptions} [options] - Optional settings.
1553
+ * @returns {boolean} Return `true` if the value is considered non-empty/truthy, otherwise `false`.
1554
+ * @example
1555
+ * isNonEmptyValue({});
1556
+ * // ➔ false
1557
+ * isNonEmptyValue([]);
1558
+ * // ➔ false
1559
+ * isNonEmptyValue({ key: "value" });
1560
+ * // ➔ true
1561
+ * isNonEmptyValue({ [Symbol("foo")]: 123 });
1562
+ * // ➔ false (default `checkSymbols` is `false`)
1563
+ * isNonEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: false });
1564
+ * // ➔ false (default `checkSymbols` is `false`)
1565
+ * isNonEmptyValue({ [Symbol("foo")]: 123 }, { checkSymbols: true });
1566
+ * // ➔ true
1567
+ * isNonEmptyValue([1, 2, 3]);
1568
+ * // ➔ true
1569
+ * isNonEmptyValue(NaN);
1570
+ * // ➔ false
1571
+ * isNonEmptyValue(true);
1572
+ * // ➔ true
1573
+ * isNonEmptyValue(false);
1574
+ * // ➔ false
1575
+ * isNonEmptyValue(null);
1576
+ * // ➔ false
1577
+ * isNonEmptyValue(undefined);
1578
+ * // ➔ false
1579
+ * isNonEmptyValue("");
1580
+ * // ➔ false
1581
+ * isNonEmptyValue(" ");
1582
+ * // ➔ false
1583
+ * isNonEmptyValue(0);
1584
+ * // ➔ true
1585
+ * isNonEmptyValue(-1);
1586
+ * // ➔ true
1587
+ * isNonEmptyValue(2);
1588
+ * // ➔ true
1589
+ * isNonEmptyValue(() => {});
1590
+ * // ➔ true
1591
+ */
1498
1592
  declare const isNonEmptyValue:(value:unknown,options?:IsNonEmptyValueOptions)=>boolean;
1499
1593
  /** ---------------------------------------------------------
1500
- * * ***Type guard: `isNull`.***
1501
- * ----------------------------------------------------------
1502
- * @description Checks if a value is **[`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null)**.
1503
- *
1504
- * - Strictly compares the value against `null`.
1505
- * - Narrows type to `null` when true.
1506
- *
1507
- * @param {*} val - The value to check.
1508
- * @returns {val is null} Returns `true` if the value is `null`, otherwise `false`.
1509
- *
1510
- * @example
1511
- * isNull(null); // ➔ true
1512
- * isNull(0); // ➔ false
1513
- * isNull(undefined); // ➔ false
1514
- */
1515
- declare const isNull:(val:unknown)=>val is null;type HasKeys$1<T>=keyof T extends never?false:true;type IsObject<T>=unknown extends T?T & Record<PropertyKey,unknown>:T extends object?T extends AnObjectNonArray?T:HasKeys$1<T>extends false?T & Record<PropertyKey,unknown>:IsArray<T>extends true?Exclude<T,unknown[]>:T:never;
1594
+ * * ***Type guard: `isNull`.***
1595
+ * ----------------------------------------------------------
1596
+ * **Checks if a value is **[`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null)**.**
1597
+ * - **Behavior:**
1598
+ * - Narrows type to `null` when true.
1599
+ * - Strictly compares the value against `null`.
1600
+ * @param {*} val - The value to check.
1601
+ * @returns {boolean} Returns `true` if the value is `null`, otherwise `false`.
1602
+ * @example
1603
+ * isNull(null); // ➔ true
1604
+ * isNull(0); // ➔ false
1605
+ * isNull(undefined); // ➔ false
1606
+ */
1607
+ declare const isNull:(val:unknown)=>val is null;
1608
+ /** ----------------------------------------------------
1609
+ * * ***Type guard: `isNumberObject`.***
1610
+ * ----------------------------------------------------
1611
+ * **Checks if a value is a **`Number` object wrapper**
1612
+ * (`new Number(...)`), not a primitive number.**
1613
+ * @param {*} value The value to check.
1614
+ * @returns {boolean} Returns `true` if `value` is a `Number` object.
1615
+ * @example
1616
+ * isNumberObject(new Number(42));
1617
+ * // ➔ true
1618
+ * isNumberObject(42);
1619
+ * // ➔ false
1620
+ */
1621
+ declare function isNumberObject(value:unknown):value is Number;type HasKeys$1<T>=keyof T extends never?false:true;type IsObject<T>=unknown extends T?T & Record<PropertyKey,unknown>:T extends object?T extends AnObjectNonArray?T:HasKeys$1<T>extends false?T & Record<PropertyKey,unknown>:IsArray<T>extends true?Exclude<T,unknown[]>:T:never;
1516
1622
  /** ---------------------------------------------------------
1517
- * * ***Type guard: `isObject`.***
1518
- * ----------------------------------------------------------
1519
- * @description
1520
- * Checks if a value is an **object** (excluding `null` and arrays).
1521
- *
1522
- * - Returns `true` for any non-null object (arrays excluded), including:
1523
- * - Plain objects (`{}`, `Object.create(null)`)
1524
- * - Custom class instances
1525
- * - Built-ins: `Date`, `RegExp`, `Error`, `URL`, `URLSearchParams`
1526
- * - Collections: `Map`, `Set`, `WeakMap`, `WeakSet`
1527
- * - Binary/typed data: `ArrayBuffer`, `DataView`, typed arrays (`Uint8Array`, `Int32Array`, etc.)
1528
- * - DOM/Node objects: `HTMLElement`, `DocumentFragment`, etc.
1529
- * - Proxies (wrapping any object type)
1530
- * ---------------------------------------------------------
1531
- * - Returns `false` for:
1532
- * - `null`
1533
- * - Arrays (`[]`, `new Array()`)
1534
- * - Functions (regular functions, arrow functions, class constructors)
1535
- * - Primitives: `string`, `number`, `boolean`, `symbol`, `bigint`
1536
- * - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`
1537
- * - `undefined` (including `NaN`, which is a primitive number)
1538
- *
1539
- * Note: If you specifically need to check for ***plain objects***, use **{@link isPlainObject}** instead.
1540
- *
1541
- * @template T - The type of the value being checked.
1542
- * @param {*} value - The value to check.
1543
- * @returns {boolean} Returns `true` if the value is a plain object, otherwise `false`.
1544
- *
1545
- * @example
1546
- * isObject({}); // ➔ true
1547
- * isObject(Object.create(null)); // ➔ true
1548
- * isObject(new Date()); // ➔ true
1549
- * isObject(new Map()); // ➔ true
1550
- * isObject(new Uint8Array()); // ➔ true
1551
- * isObject(new String("x")); // ➔ true
1552
- * isObject([]); // ➔ false
1553
- * isObject(null); // ➔ false
1554
- * isObject(undefined); // ➔ false
1555
- * isObject(123); // ➔ false
1556
- * isObject(() => {}); // ➔ false
1557
- */
1623
+ * * ***Type guard: `isObject`.***
1624
+ * ----------------------------------------------------------
1625
+ * **Checks if a value is an **object** (excluding `null` and `arrays`).**
1626
+ * - **✅ Returns `true` for any non-null object (arrays excluded), including:**
1627
+ * - Plain-objects (`{}`, `Object.create(null)`)
1628
+ * - Custom class instances
1629
+ * - Built-ins: `Date`, `RegExp`, `Error`, `URL`, `URLSearchParams`
1630
+ * - Collections: `Map`, `Set`, `WeakMap`, `WeakSet`
1631
+ * - Binary/typed data: `ArrayBuffer`, `DataView`, typed arrays (`Uint8Array`, `Int32Array`, etc.)
1632
+ * - DOM/Node objects: `HTMLElement`, `DocumentFragment`, etc.
1633
+ * - Proxies (wrapping any object type)
1634
+ * - **❌ Returns `false` for:**
1635
+ * - `null`
1636
+ * - Arrays (`[]`, `new Array()`)
1637
+ * - Functions (regular functions, arrow functions, class constructors)
1638
+ * - Primitives: `string`, `number`, `boolean`, `symbol`, `bigint`
1639
+ * - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`
1640
+ * - `undefined` (including `NaN`, which is a primitive number)
1641
+ * - **ℹ️ Note:**
1642
+ * - If you specifically need to check for ***plain-objects*** only, use **{@link isPlainObject}** instead.
1643
+ * - If you specifically need to check for ***object***, ***plain-objects***, and include ***array***, use **{@link isObjectOrArray}** instead.
1644
+ * @template T - The type of the value being checked.
1645
+ * @param {*} value - The value to check.
1646
+ * @returns {boolean} Returns `true` if the value is a ***plain-objects***, otherwise `false`.
1647
+ * @example
1648
+ * isObject({}); // true
1649
+ * isObject(Object.create(null)); // true
1650
+ * isObject(new Date()); // ➔ true
1651
+ * isObject(new Map()); // ➔ true
1652
+ * isObject(new Uint8Array()); // ➔ true
1653
+ * isObject(new String("x")); // ➔ true
1654
+ * isObject([]); // ➔ false
1655
+ * isObject(null); // ➔ false
1656
+ * isObject(undefined); // ➔ false
1657
+ * isObject(123); // ➔ false
1658
+ * isObject(() => {}); // ➔ false
1659
+ */
1558
1660
  declare function isObject<T extends object>(value:T):value is IsObject<T>;declare function isObject(value:unknown):value is Record<PropertyKey,unknown>;
1559
1661
  /** ----------------------------------------------------------
1560
- * * ***Type guard: `isObjectLoose`.***
1561
- * ----------------------------------------------------------
1562
- * @description
1563
- * Checks if a value is the
1564
- * [ECMAScript language type **Object**](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types).
1565
- *
1566
- * - Returns `true` for:
1567
- * - Plain objects (`{}`)
1568
- * - Arrays (`[]`)
1569
- * - Functions
1570
- * - Regexes (`/abc/`)
1571
- * - Boxed primitives:
1572
- * - `new Number(0)`
1573
- * - `new String("")`
1574
- * - `new Boolean(false)`
1575
- * ----------------------------
1576
- * - ❌ Returns `false` for:
1577
- * - `null`
1578
- * - `undefined`
1579
- * - Primitives:
1580
- * - `string`
1581
- * - `number`
1582
- * - `boolean`
1583
- * - `symbol`
1584
- * - `bigint`
1585
- *
1586
- * @note ⚠️ **For More Strict Object Use {@link isObject} or {@link isPlainObject} instead.**
1587
- *
1588
- * @template T - The type of the value being checked.
1589
- * @param {*} value The value to check.
1590
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1591
- * @example
1592
- * isObjectLoose({});
1593
- * // ➔ true
1594
- * isObjectLoose([1, 2, 3]);
1595
- * // ➔ true
1596
- * isObjectLoose(()=> {});
1597
- * // ➔ true
1598
- * isObjectLoose(null);
1599
- * // ➔ false
1600
- * isObjectLoose(undefined);
1601
- * // ➔ false
1602
- */
1662
+ * * ***Type guard: `isObjectLoose`.***
1663
+ * ----------------------------------------------------------
1664
+ * **Checks if a value is the
1665
+ * [ECMAScript language type **Object**](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types).**
1666
+ * - **✅ Returns `true` for:**
1667
+ * - Plain objects (`{}`)
1668
+ * - Arrays (`[]`)
1669
+ * - Functions
1670
+ * - Regexes (`/abc/`)
1671
+ * - Boxed primitives:
1672
+ * - `new Number(0)`
1673
+ * - `new String("")`
1674
+ * - `new Boolean(false)`
1675
+ * - **❌ Returns `false` for:**
1676
+ * - `null`
1677
+ * - `undefined`
1678
+ * - Primitives:
1679
+ * - `string`
1680
+ * - `number`
1681
+ * - `boolean`
1682
+ * - `symbol`
1683
+ * - `bigint`
1684
+ * - **ℹ️ Note:**
1685
+ * - **For More Strict Object Use {@link isObject} or {@link isPlainObject} instead.**
1686
+ * @template T - The type of the value being checked.
1687
+ * @param {*} value The value to check.
1688
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1689
+ * @example
1690
+ * isObjectLoose({});
1691
+ * // true
1692
+ * isObjectLoose([1, 2, 3]);
1693
+ * // ➔ true
1694
+ * isObjectLoose(()=> {});
1695
+ * // ➔ true
1696
+ * isObjectLoose(null);
1697
+ * // ➔ false
1698
+ * isObjectLoose(undefined);
1699
+ * // ➔ false
1700
+ */
1603
1701
  declare function isObjectLoose<T=object>(value:unknown):value is T;type HasKeys<T>=keyof T extends never?false:true;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:HasKeys<T>extends false?T & Record<PropertyKey,unknown>:T:Extract<T,Record<PropertyKey,unknown>& unknown[]>;
1604
1702
  /** ---------------------------------------------------------
1605
- * * ***Type guard: `isObjectOrArray`.***
1606
- * ----------------------------------------------------------
1607
- * @description
1608
- * Checks if a value is an **object** or an **array**.
1609
- *
1610
- * - Returns `true` for:
1611
- * - Plain objects (`{}`, `Object.create(null)`)
1612
- * - Custom objects
1613
- * - Arrays (`[]`, `[1,2,3]`)
1614
- * ----------------------------
1615
- * - ❌ Returns `false` for:
1616
- * - `null`
1617
- * - `undefined`
1618
- * - Primitives:
1619
- * - `string`
1620
- * - `number`
1621
- * - `boolean`
1622
- * - `symbol`
1623
- * - `bigint`
1624
- * - Functions
1625
- *
1626
- * @template T - The type of the value being checked.
1627
- * @param {*} value - The value to check.
1628
- * @returns {boolean} Returns `true` if the value is an `object` or `array`.
1629
- *
1630
- * @example
1631
- * isObjectOrArray({ name: "Alice" }); // ➔ true
1632
- * isObjectOrArray([1,2,3]); // ➔ true
1633
- * isObjectOrArray(null); // ➔ false
1634
- * isObjectOrArray(undefined); // ➔ false
1635
- * isObjectOrArray("hello"); // ➔ false
1636
- */
1703
+ * * ***Type guard: `isObjectOrArray`.***
1704
+ * ----------------------------------------------------------
1705
+ * **Checks if a value is an **object** or an **array**.**
1706
+ * - **✅ Returns `true` for:**
1707
+ * - Plain objects (`{}`, `Object.create(null)`)
1708
+ * - Custom objects
1709
+ * - Arrays (`[]`, `[1,2,3]`)
1710
+ * - **❌ Returns `false` for:**
1711
+ * - `null`
1712
+ * - `undefined`
1713
+ * - Primitives:
1714
+ * - `string`
1715
+ * - `number`
1716
+ * - `boolean`
1717
+ * - `symbol`
1718
+ * - `bigint`
1719
+ * - Functions
1720
+ * @template T - The type of the value being checked.
1721
+ * @param {*} value - The value to check.
1722
+ * @returns {boolean} Returns `true` if the value is an `object` or `array`.
1723
+ * @example
1724
+ * isObjectOrArray({ name: "Alice" }); // true
1725
+ * isObjectOrArray([1,2,3]); // true
1726
+ * isObjectOrArray(null); // false
1727
+ * isObjectOrArray(undefined); // ➔ false
1728
+ * isObjectOrArray("hello"); // ➔ false
1729
+ */
1637
1730
  declare function isObjectOrArray(value:[]):value is [];declare function isObjectOrArray<T>(value:T):value is IsObjectOrArray<T>;
1638
1731
  /** ----------------------------------------------------------
1639
- * * ***Type guard: `isRegExp`.***
1640
- * ----------------------------------------------------------
1641
- * @description Checks if a value is a RegExp instance.
1642
- *
1643
- * @param {*} value - The value to check.
1644
- * @returns {boolean} Return `true` if value is an instance of **[RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)**.
1645
- *
1646
- * @example
1647
- * isRegExp(/abc/); // true
1648
- * isRegExp(new RegExp("abc")); // true
1649
- * isRegExp("abc"); // false
1650
- */
1732
+ * * ***Type guard: `PropertyKey`.***
1733
+ * ----------------------------------------------------------
1734
+ * **Checks if a value is a valid `PropertyKey`.**
1735
+ * - **In JavaScript/TypeScript, a **`PropertyKey`** is any of:**
1736
+ * - **`string`**
1737
+ * - **`number`**
1738
+ * - **`symbol`**
1739
+ * - **This function ensures the given `value` is one of these types.**
1740
+ * - Narrows type to {@link PropertyKey | ***`PropertyKey`***} when true.
1741
+ * - Useful for working with dynamic object keys.
1742
+ * - Strictly rejects `null`, `undefined`, `boolean`, `object`, `function`, etc.
1743
+ * @param {*} value - The value to check.
1744
+ * @returns {boolean} Return `true` if `value` is a valid property key, otherwise `false`.
1745
+ * @example
1746
+ * isPropertyKey("foo");
1747
+ * // ➔ true
1748
+ * isPropertyKey(123);
1749
+ * // ➔ true
1750
+ * isPropertyKey(Symbol("id"));
1751
+ * // ➔ true
1752
+ * isPropertyKey({});
1753
+ * // ➔ false
1754
+ * isPropertyKey(null);
1755
+ * // ➔ false
1756
+ */
1757
+ declare function isPropertyKey(value:unknown):value is PropertyKey;
1758
+ /** ----------------------------------------------------------
1759
+ * * ***Type guard: `isRegExp`.***
1760
+ * ----------------------------------------------------------
1761
+ * **Checks if a value is a RegExp instance.**
1762
+ * @param {*} value - The value to check.
1763
+ * @returns {boolean} Return `true` if value is an instance of **[RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)**.
1764
+ * @example
1765
+ * isRegExp(/abc/); // ➔ true
1766
+ * isRegExp(new RegExp("abc")); // ➔ true
1767
+ * isRegExp("abc"); // ➔ false
1768
+ */
1651
1769
  declare const isRegExp:(value:unknown)=>value is RegExp;
1652
1770
  /** --------------------------------------------------
1653
- * * ***Checks if `value` is a **[`Safe-Integer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger)**.***
1654
- * --------------------------------------------------
1655
- * An integer is considered *safe* if:
1656
- * - It is an IEEE-754 **double precision number**.
1657
- * - It can be exactly represented without rounding errors.
1658
- * - It lies within the range **-(2^53 - 1) to 2^53 - 1**.
1659
- *
1660
- * **Note:** This method is based on **{@link Number.isSafeInteger}**.
1661
- *
1662
- * @param {*} value - The value to check.
1663
- * @returns {boolean} Return `true` if `value` is a safe integer, otherwise `false`.
1664
- * @example
1665
- * isSafeInteger(3);
1666
- * // ➔ true
1667
- * isSafeInteger(Number.MIN_VALUE);
1668
- * // ➔ false
1669
- * isSafeInteger(Infinity);
1670
- * // ➔ false
1671
- * isSafeInteger('3');
1672
- * // ➔ false
1673
- */
1771
+ * * ***Type guard: `isSafeInteger`.***
1772
+ * --------------------------------------------------
1773
+ * **Checks if `value` is a **[`Safe-Integer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger)**.**
1774
+ * - **Behavior:**
1775
+ * - Narrows type to `number` when true.
1776
+ * - **An integer is considered *safe* if:**
1777
+ * - It is an `IEEE-754` **double precision number**.
1778
+ * - It can be exactly represented without rounding errors.
1779
+ * - It lies within the range **-(2^53 - 1) to 2^53 - 1**.
1780
+ * - **Note:**
1781
+ * - This method is based on **{@link Number.isSafeInteger}**.
1782
+ * @param {*} value - The value to check.
1783
+ * @returns {boolean} Return `true` if `value` is a safe integer, otherwise `false`.
1784
+ * @example
1785
+ * isSafeInteger(3);
1786
+ * // ➔ true
1787
+ * isSafeInteger(Number.MIN_VALUE);
1788
+ * // ➔ false
1789
+ * isSafeInteger(Infinity);
1790
+ * // ➔ false
1791
+ * isSafeInteger('3');
1792
+ * // ➔ false
1793
+ */
1674
1794
  declare function isSafeInteger(value:unknown):value is number;
1675
1795
  /** ---------------------------------------------------------
1676
- * * ***Type guard: `isSet`.***
1677
- * ----------------------------------------------------------
1678
- * @description Checks if a value is a **[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set)** object.
1679
- *
1680
- * - Narrows type to `Set<T>` when true.
1681
- * - Excludes `WeakSet`, arrays, plain objects, and other non-Set values.
1682
- *
1683
- * @template T - The type of the value being checked.
1684
- * @param {*} value - The value to check.
1685
- * @returns {boolean} Returns `true` if the value is a `Set`, otherwise `false`.
1686
- * @example
1687
- * isSet(new Set);
1688
- * // ➔ true
1689
- * isSet(new WeakSet);
1690
- * // ➔ false
1691
- */
1796
+ * * ***Type guard: `isSet`.***
1797
+ * ----------------------------------------------------------
1798
+ * **Checks if a value is a **[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set)** object.**
1799
+ * - **Behavior:**
1800
+ * - Narrows type to `Set<T>` when true.
1801
+ * - Excludes `WeakSet`, arrays, plain objects, and other non-Set values.
1802
+ * @template T - The type of the value being checked.
1803
+ * @param {*} value - The value to check.
1804
+ * @returns {boolean} Returns `true` if the value is a `Set`, otherwise `false`.
1805
+ * @example
1806
+ * isSet(new Set);
1807
+ * // ➔ true
1808
+ * isSet(new WeakSet);
1809
+ * // ➔ false
1810
+ */
1692
1811
  declare function isSet<T=unknown>(value:Set<T>):value is Set<T>;declare function isSet(value:unknown):value is Set<unknown>;
1693
1812
  /** ---------------------------------------------------------
1694
- * * ***Type guard: `isString`.***
1695
- * ----------------------------------------------------------
1696
- * @description Checks if a value is of type
1697
- * **[`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**.
1698
- *
1699
- * - Uses the `typeof` operator for strict checking.
1700
- * - Narrows type to `string` when true.
1701
- *
1702
- * @param {*} value - The value to check.
1703
- * @returns {boolean} Returns `true` if the value is a string, otherwise `false`.
1704
- *
1705
- * @example
1706
- * isString("hello"); // ➔ true
1707
- * isString(123); // false
1708
- *
1709
- * // Usage in type narrowing
1710
- * const value: unknown = getValue();
1711
- * if (isString(value)) {
1712
- * // TypeScript now knows `value` is a string
1713
- * console.log(value.toUpperCase());
1714
- * }
1715
- */
1813
+ * * ***Type guard: `isString`.***
1814
+ * ----------------------------------------------------------
1815
+ * **Checks if a value is of type
1816
+ * **[`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**.**
1817
+ * - **Behavior:**
1818
+ * - Narrows type to `string` when true.
1819
+ * - Uses the `typeof` operator for strict checking.
1820
+ * @param {*} value - The value to check.
1821
+ * @returns {boolean} Returns `true` if the value is a string, otherwise `false`.
1822
+ * @example
1823
+ * isString("hello"); // ➔ true
1824
+ * isString(123); // ➔ false
1825
+ *
1826
+ * // Usage in type narrowing
1827
+ * const value: unknown = getValue();
1828
+ * if (isString(value)) {
1829
+ * // TypeScript now knows `value` is a string
1830
+ * console.log(value.toUpperCase());
1831
+ * }
1832
+ */
1716
1833
  declare const isString:(value:unknown)=>value is string;
1834
+ /** ----------------------------------------------------
1835
+ * * ***Type guard: `isStringObject`.***
1836
+ * ----------------------------------------------------
1837
+ * **Checks if a value is a **`String` object wrapper**
1838
+ * (`new String(...)`), not a primitive string.**
1839
+ * @param {*} value The value to check.
1840
+ * @returns {boolean} Returns `true` if `value` is a `String` object.
1841
+ * @example
1842
+ * isStringObject(new String("hello"));
1843
+ * // ➔ true
1844
+ * isStringObject("hello");
1845
+ * // ➔ false
1846
+ */
1847
+ declare function isStringObject(value:unknown):value is String;
1717
1848
  /** ----------------------------------------------------------
1718
- * * ***Type guard: `isSymbol`.***
1719
- * ----------------------------------------------------------
1720
- * @description Checks if a value is of type
1721
- * **[`symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol)**.
1722
- *
1723
- * - Uses the `typeof` operator for strict checking.
1724
- * - Narrows type to `symbol` when true.
1725
- *
1726
- * @param {*} value - The value to check.
1727
- * @returns {boolean} Returns `true` if the value is a symbol, otherwise `false`.
1728
- *
1729
- * @example
1730
- * isSymbol(Symbol("id")); // ➔ true
1731
- * isSymbol("not a symbol"); // ➔ false
1732
- * isSymbol(123); // ➔ false
1733
- * isSymbol(undefined); // ➔ false
1734
- */
1849
+ * * ***Type guard: `isSymbol`.***
1850
+ * ----------------------------------------------------------
1851
+ * **Checks if a value is of type
1852
+ * **[`symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol)**.**
1853
+ * - **Behavior:**
1854
+ * - Narrows type to `symbol` when true.
1855
+ * - Uses the `typeof` operator for strict checking.
1856
+ * @param {*} value - The value to check.
1857
+ * @returns {boolean} Returns `true` if the value is a symbol, otherwise `false`.
1858
+ * @example
1859
+ * isSymbol(Symbol("id")); // ➔ true
1860
+ * isSymbol("not a symbol"); // ➔ false
1861
+ * isSymbol(123); // ➔ false
1862
+ * isSymbol(undefined); // ➔ false
1863
+ */
1735
1864
  declare const isSymbol:(value:unknown)=>value is symbol;
1736
1865
  /** --------------------------------------------------
1737
- * * ***Type guard: `isTypedArray`.***
1738
- * ----------------------------------------------------------
1739
- * @description Checks if `value` is classified as a
1740
- * **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**.
1741
- *
1742
- * - Validates that `value` is a non-null object.
1743
- * - Uses `Object.prototype.toString` tag matching against known typed array tags.
1744
- * - Narrows type to **{@link TypedArray}** when true.
1745
- *
1746
- * @param {*} value - The value to check.
1747
- * @returns {boolean} Returns `true` if the value is a typed array, otherwise `false`.
1748
- * @example
1749
- * isTypedArray(new Uint8Array); // ➔ true
1750
- * isTypedArray(new Uint8Array()); // ➔ true
1751
- * isTypedArray(new Float32Array()); // ➔ true
1752
- * isTypedArray(new Uint8ClampedArray()); // ➔ true
1753
- * isTypedArray([]); // ➔ false
1754
- * isTypedArray(Buffer.from("hi")); // ➔ false
1755
- */
1866
+ * * ***Type guard: `isTypedArray`.***
1867
+ * ----------------------------------------------------------
1868
+ * **Checks if `value` is classified as a
1869
+ * **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**.**
1870
+ * - **Behavior:**
1871
+ * - Validates that `value` is a non-null object.
1872
+ * - Uses `Object.prototype.toString` tag matching against known typed array tags.
1873
+ * - Narrows type to **{@link TypedArray}** when true.
1874
+ * @param {*} value - The value to check.
1875
+ * @returns {boolean} Returns `true` if the value is a typed array, otherwise `false`.
1876
+ * @example
1877
+ * isTypedArray(new Uint8Array); // ➔ true
1878
+ * isTypedArray(new Uint8Array()); // ➔ true
1879
+ * isTypedArray(new Float32Array()); // ➔ true
1880
+ * isTypedArray(new Uint8ClampedArray()); // ➔ true
1881
+ * isTypedArray([]); // ➔ false
1882
+ * isTypedArray(Buffer.from("hi")); // ➔ false
1883
+ */
1756
1884
  declare function isTypedArray(value:unknown):value is TypedArray;
1757
1885
  /** ---------------------------------------------------------
1758
- * * ***Type guard: `isURL`.***
1759
- * ----------------------------------------------------------
1760
- * @description Checks if a value is an instance of the
1761
- * **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** class.
1762
- *
1763
- * - Narrows type to `URL` when true.
1764
- * - Excludes strings, plain objects, and other non-URL values.
1765
- *
1766
- * @param {*} value - The value to check.
1767
- * @returns {boolean} Returns `true` if the value is an instance of `URL`, otherwise `false`.
1768
- *
1769
- * @example
1770
- * isURL(new URL("https://example.com"));
1771
- * // ➔ true
1772
- * isURL("https://example.com");
1773
- * // ➔ false
1774
- */
1886
+ * * ***Type guard: `isURL`.***
1887
+ * ----------------------------------------------------------
1888
+ * **Checks if a value is an instance of the
1889
+ * **[`URL`](https://developer.mozilla.org/docs/Web/API/URL)** class.**
1890
+ * - **Behavior:**
1891
+ * - Narrows type to `URL` when true.
1892
+ * - Excludes `strings`, `plain-objects`, and `other non-URL values`.
1893
+ * @param {*} value - The value to check.
1894
+ * @returns {boolean} Returns `true` if the value is an instance of `URL`, otherwise `false`.
1895
+ * @example
1896
+ * isURL(new URL("https://example.com"));
1897
+ * // ➔ true
1898
+ * isURL("https://example.com");
1899
+ * // ➔ false
1900
+ */
1775
1901
  declare const isURL:(value:unknown)=>value is URL;
1776
1902
  /** ---------------------------------------------------------
1777
- * * ***Type guard: `isUndefined`.***
1778
- * ----------------------------------------------------------
1779
- * @description Checks if a value is
1780
- * **[`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)**.
1781
- *
1782
- * - Narrows type to `undefined` when true.
1783
- * - Excludes `null`, objects, arrays, strings, numbers, and all other values.
1784
- *
1785
- * @param {*} value - The value to check.
1786
- * @returns {value is undefined} Returns `true` if the value is `undefined`, otherwise `false`.
1787
- * @example
1788
- * isUndefined(undefined); // ➔ true
1789
- * isUndefined([]); // ➔ false
1790
- * isUndefined(123); // ➔ false
1791
- * isUndefined(null); // ➔ false
1792
- * isUndefined("abc"); // ➔ false
1793
- */
1903
+ * * ***Type guard: `isUndefined`.***
1904
+ * ----------------------------------------------------------
1905
+ * **Checks if a value is
1906
+ * **[`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)**.**
1907
+ * - **Behavior:**
1908
+ * - Narrows type to `undefined` when true.
1909
+ * - Excludes `null`, `objects`, `arrays`, `strings`, `numbers`, and
1910
+ * `all other values`.
1911
+ * @param {*} value - The value to check.
1912
+ * @returns {boolean} Returns `true` if the value is `undefined`, otherwise `false`.
1913
+ * @example
1914
+ * isUndefined(undefined); // ➔ true
1915
+ * isUndefined([]); // ➔ false
1916
+ * isUndefined(123); // ➔ false
1917
+ * isUndefined(null); // ➔ false
1918
+ * isUndefined("abc"); // ➔ false
1919
+ */
1794
1920
  declare const isUndefined:(value:unknown)=>value is undefined;
1795
- /** ---------------------------------
1796
- * * ***Validates whether a given string is a properly formatted URL.***
1797
- * ---------------------------------------------------------
1798
- *
1799
- * Ensures that the input is:
1800
- * - A non-empty string.
1801
- * - A valid **[URL](https://developer.mozilla.org/docs/Web/API/URL)** with `http://` or `https://` scheme.
1802
- *
1803
- * @description
1804
- * - Includes decoding for percent-encoded URLs (e.g., `https%3A%2F%2F...`).
1805
- * - Rejects invalid strings, unsupported schemes, and malformed domains.
1806
- *
1807
- * @param {*} url - The value to validate.
1808
- * @returns {boolean} Return `true` if the value is a **valid URL string**, otherwise `false`.
1809
- * @example
1810
- * isValidURL("https://example.com");
1811
- * // ➔ true
1812
- *
1813
- * isValidURL("ftp://example.com");
1814
- * // ➔ false
1815
- *
1816
- * isValidURL("not-a-url");
1817
- * // ➔ false
1818
- */
1921
+ /** ---------------------------------------------------------
1922
+ * * ***Predicate: `isValidURL`.***
1923
+ * ---------------------------------------------------------
1924
+ * **Validates whether a given string is a properly formatted URL.**
1925
+ * - **Ensures that the input is:**
1926
+ * - A non-empty string.
1927
+ * - A valid **[URL](https://developer.mozilla.org/docs/Web/API/URL)** with `http://` or `https://` scheme.
1928
+ * - **Behavior:**
1929
+ * - ✅ Includes decoding for percent-encoded URLs (e.g., `https%3A%2F%2F...`).
1930
+ * - Rejects invalid strings, unsupported schemes, and malformed domains.
1931
+ * @param {*} url - The value to validate.
1932
+ * @returns {boolean} Return `true` if the value is a **valid URL string**, otherwise `false`.
1933
+ * @example
1934
+ * isValidURL("https://example.com");
1935
+ * // ➔ true
1936
+ * isValidURL("ftp://example.com");
1937
+ * // ➔ false
1938
+ * isValidURL("not-a-url");
1939
+ * // ➔ false
1940
+ */
1819
1941
  declare const isValidURL:(url:unknown)=>boolean;
1820
1942
  /** --------------------------------------------------
1821
- * * ***Type guard: `isWeakMap`.***
1822
- * ----------------------------------------------------------
1823
- * @description Checks if a value is a **[`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/WeakMap)** object.
1824
- *
1825
- * - Narrows type to `WeakMap<K, V>` when true.
1826
- * - Excludes `Map`, arrays, plain objects, and other non-WeakMap values.
1827
- *
1828
- * @template K - Keys must be objects.
1829
- * @template V - Type of values stored in the WeakMap.
1830
- * @param {*} value - The value to check.
1831
- * @returns {boolean} Returns `true` if the value is a `WeakMap`, otherwise `false`.
1832
- * @example
1833
- *
1834
- * isWeakMap(new WeakMap);
1835
- * // ➔ true
1836
- * isWeakMap(new Map);
1837
- * // false
1838
- */
1839
- declare function isWeakMap<K extends object=object,V=unknown>(value:unknown):value is WeakMap<K,V>;export{type IsArrayResult,IsPlainObjectResult,areArraysEqual,areObjectsEqual,areURLsEqualPath,areURLsIdentical,arrayHasAnyMatch,doesKeyExist,hasOwnProp,isArguments,isArray,isArrayBuffer,isArrayLike,isArrayLikeObject,isBigInt,isBoolean,isBuffer,isCurrencyLike,isDate,isDeepEqual,isElement,isEmpty,isEmptyArray,isEmptyDeep,isEmptyObject,isEmptyString,isEmptyValue,isEqual,isEqualWith,isError,isFinite,isFunction,isInteger,isLength,isMap,isMatch,isMatchWith,isNaN,isNative,isNil,isNonEmptyArray,isNonEmptyString,isNonEmptyValue,isNull,isObject,isObjectLoose,isObjectOrArray,isRegExp,isSafeInteger,isSet,isString,isSymbol,isTypedArray,isURL,isUndefined,isValidURL,isWeakMap,textContainsAll,textContainsAny};
1943
+ * * ***Type guard: `isWeakMap`.***
1944
+ * ----------------------------------------------------------
1945
+ * **Checks if a value is a **[`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/WeakMap)** object.**
1946
+ * - **Behavior:**
1947
+ * - Narrows type to `WeakMap<K, V>` when true.
1948
+ * - Excludes `Map`, `arrays`, `plain-objects,` and `other non-WeakMap values`.
1949
+ * @template K - Keys must be objects.
1950
+ * @template V - Type of values stored in the WeakMap.
1951
+ * @param {*} value - The value to check.
1952
+ * @returns {boolean} Returns `true` if the value is a `WeakMap`, otherwise `false`.
1953
+ * @example
1954
+ * isWeakMap(new WeakMap);
1955
+ * // ➔ true
1956
+ * isWeakMap(new Map);
1957
+ * // ➔ false
1958
+ */
1959
+ declare function isWeakMap<K extends object=object,V=unknown>(value:unknown):value is WeakMap<K,V>;export{type IsArrayResult,IsPlainObjectResult,areArraysEqual,areObjectsEqual,areURLsEqualPath,areURLsIdentical,arrayHasAnyMatch,doesKeyExist,hasOwnProp,isArguments,isArray,isArrayBuffer,isArrayLike,isArrayLikeObject,isBigInt,isBoolean,isBooleanObject,isBuffer,isCurrencyLike,isDate,isDeepEqual,isElement,isEmpty,isEmptyArray,isEmptyDeep,isEmptyObject,isEmptyString,isEmptyValue,isEqual,isEqualWith,isError,isFinite,isFunction,isInfinityNumber,isInteger,isLength,isMap,isMatch,isMatchWith,isNaN,isNative,isNil,isNonEmptyArray,isNonEmptyString,isNonEmptyValue,isNull,isNumberObject,isObject,isObjectLoose,isObjectOrArray,isPropertyKey,isRegExp,isSafeInteger,isSet,isString,isStringObject,isSymbol,isTypedArray,isURL,isUndefined,isValidURL,isWeakMap,textContainsAll,textContainsAny};