@rzl-zone/utils-js 3.9.1 → 3.11.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 (122) hide show
  1. package/README.md +111 -73
  2. package/dist/assertions/index.cjs +11 -11
  3. package/dist/assertions/index.d.ts +487 -215
  4. package/dist/assertions/index.js +5 -5
  5. package/dist/{chunk-SN5HAK3Y.js → chunk-22V4WP3H.js} +4 -4
  6. package/dist/{chunk-EJV5AF4L.js → chunk-2XSZ2ANI.js} +2 -2
  7. package/dist/{chunk-OSSFLQDD.js → chunk-3T6VSWYX.js} +2 -2
  8. package/dist/{chunk-3LE6NX57.js → chunk-5WIEDF2J.js} +4 -4
  9. package/dist/{chunk-WLEZ2KSG.cjs → chunk-6EDFZJZ5.cjs} +126 -126
  10. package/dist/{chunk-GHU356XQ.js → chunk-6LXWT2I5.js} +3 -3
  11. package/dist/{chunk-GKDSBOYE.js → chunk-6YGBRENU.js} +3 -3
  12. package/dist/{chunk-NAOVH4OH.cjs → chunk-7FGNVDEV.cjs} +7 -7
  13. package/dist/{chunk-X6ULJZ3X.js → chunk-AXDYWO67.js} +2 -2
  14. package/dist/{chunk-UV5BKAYW.cjs → chunk-B6PMNZ4M.cjs} +7 -7
  15. package/dist/chunk-BAV5T2E3.cjs +1 -1
  16. package/dist/{chunk-YHFRCVTN.js → chunk-BLF7SD66.js} +3 -3
  17. package/dist/{chunk-QZI5PVCI.cjs → chunk-BMZZXZJ2.cjs} +4 -4
  18. package/dist/{chunk-DXPM4NOU.js → chunk-BOYP3ARU.js} +4 -4
  19. package/dist/{chunk-UXT4XSUK.js → chunk-BPYW5YL7.js} +2 -2
  20. package/dist/{chunk-QGTFQ7RO.cjs → chunk-C2PV3VWC.cjs} +6 -6
  21. package/dist/{chunk-MZ3T6L7Z.js → chunk-CCJ2MSN7.js} +2 -2
  22. package/dist/{chunk-H44QVAZL.cjs → chunk-DAPAK2W3.cjs} +31 -31
  23. package/dist/{chunk-OYFUBKEG.cjs → chunk-DLS3G6WQ.cjs} +4 -4
  24. package/dist/{chunk-MS2KSKD7.js → chunk-DNMCR5JH.js} +9 -9
  25. package/dist/chunk-DVMHRLKP.cjs +1 -1
  26. package/dist/{chunk-IX6PF5ZP.cjs → chunk-EBYFYZW4.cjs} +4 -4
  27. package/dist/{chunk-5Y6JL47L.js → chunk-ENMRZ4BE.js} +3 -3
  28. package/dist/{chunk-7EIFPHV3.js → chunk-FJ4BQFVO.js} +8 -8
  29. package/dist/{chunk-TJ5OY6MC.cjs → chunk-GIKL4PUF.cjs} +10 -10
  30. package/dist/{chunk-M5QB2GM5.js → chunk-GOFINGT6.js} +2 -2
  31. package/dist/{chunk-J6VLFVIL.js → chunk-GXKQ3LHF.js} +3 -3
  32. package/dist/{chunk-5KDVIEVO.js → chunk-HNBRGN4R.js} +2 -2
  33. package/dist/{chunk-OCTHWEZK.cjs → chunk-HYN6FC5A.cjs} +34 -34
  34. package/dist/{chunk-MBFVTGYS.js → chunk-IZGVBYFN.js} +4 -4
  35. package/dist/{chunk-QXTJVDWE.js → chunk-JIE447J5.js} +3 -3
  36. package/dist/{chunk-UFYMRRJH.cjs → chunk-JXEIJM5M.cjs} +61 -61
  37. package/dist/{chunk-WB3FT62A.js → chunk-K47GZDBH.js} +3 -3
  38. package/dist/{chunk-KUVRZ2JW.cjs → chunk-K5536YHG.cjs} +50 -50
  39. package/dist/chunk-KHO2SBNA.cjs +1 -1
  40. package/dist/{chunk-NJ24M6ZH.cjs → chunk-KXJ7X325.cjs} +37 -37
  41. package/dist/chunk-L5RDAVVH.js +1 -1
  42. package/dist/{chunk-SRWL4YCP.js → chunk-LJHPTLWB.js} +7 -7
  43. package/dist/{chunk-6AMDHVS2.cjs → chunk-M7ELWZXM.cjs} +9 -9
  44. package/dist/chunk-MSUW5VHZ.js +1590 -0
  45. package/dist/{chunk-2XGQQZ6A.cjs → chunk-MUHRPRR7.cjs} +3 -3
  46. package/dist/{chunk-XYWC4EQ3.cjs → chunk-MV3TSQSH.cjs} +71 -71
  47. package/dist/{chunk-VCYXNIZ2.cjs → chunk-NLZLXWAU.cjs} +9 -9
  48. package/dist/{chunk-76ATVDCR.cjs → chunk-NVRZPF5M.cjs} +3 -3
  49. package/dist/chunk-ONZFBJVW.js +1 -1
  50. package/dist/{chunk-62FS7WMB.cjs → chunk-PGNL7JXO.cjs} +31 -31
  51. package/dist/{chunk-JI57K7D4.cjs → chunk-Q4GEQS7X.cjs} +161 -161
  52. package/dist/chunk-QNKGP5DY.js +1 -1
  53. package/dist/{chunk-ZTHJQJ5F.cjs → chunk-QYI2VJLS.cjs} +9 -9
  54. package/dist/{chunk-C7GC2PFX.js → chunk-RBWZII5I.js} +3 -3
  55. package/dist/{chunk-MMRHKYT6.cjs → chunk-RMP7VMPB.cjs} +12 -12
  56. package/dist/{chunk-TXOVQZPU.js → chunk-RZOGBYIS.js} +2 -2
  57. package/dist/{chunk-ALRISPTL.cjs → chunk-SU3UELUB.cjs} +3 -3
  58. package/dist/chunk-SYHPSOUU.cjs +1626 -0
  59. package/dist/{chunk-R2DR7SPJ.js → chunk-SZUNAEMR.js} +6 -6
  60. package/dist/{chunk-YVRUY4EW.cjs → chunk-TER22LO4.cjs} +8 -8
  61. package/dist/{chunk-WRGN6UBK.js → chunk-TJHGRQ4P.js} +2 -2
  62. package/dist/{chunk-I33PB44Q.cjs → chunk-U23I7JPB.cjs} +15 -15
  63. package/dist/{chunk-VBSLIIDB.js → chunk-U7HHN47R.js} +10 -10
  64. package/dist/chunk-UDA26MCU.cjs +1 -1
  65. package/dist/{chunk-44X74C26.js → chunk-UIAWUZ4H.js} +4 -4
  66. package/dist/{chunk-5O66AUEC.js → chunk-ULQPCIA2.js} +2 -2
  67. package/dist/chunk-VJDDGRIK.cjs +1 -1
  68. package/dist/{chunk-6WVOUVWD.js → chunk-WETQI6HM.js} +9 -9
  69. package/dist/{chunk-FWWPEL7J.cjs → chunk-WLOQQFDS.cjs} +3 -3
  70. package/dist/chunk-WVSPXFTY.js +1 -1
  71. package/dist/{chunk-WKM6UVMG.cjs → chunk-WXFTVXBF.cjs} +4 -4
  72. package/dist/{chunk-YQHJB7KR.cjs → chunk-XPVTIGU2.cjs} +26 -26
  73. package/dist/{chunk-PWKOFPAH.cjs → chunk-XX6RUGTM.cjs} +3 -3
  74. package/dist/chunk-YWHHVDT4.js +1 -1
  75. package/dist/{chunk-7NXFGJJE.cjs → chunk-ZPDMWDGZ.cjs} +14 -14
  76. package/dist/{chunk-JYOCB6OV.js → chunk-ZVWZEGQP.js} +2 -2
  77. package/dist/conversions/index.cjs +34 -34
  78. package/dist/conversions/index.d.ts +489 -333
  79. package/dist/conversions/index.js +15 -15
  80. package/dist/events/index.cjs +8 -8
  81. package/dist/events/index.d.ts +35 -29
  82. package/dist/events/index.js +4 -4
  83. package/dist/formatters/index.cjs +19 -19
  84. package/dist/formatters/index.d.ts +917 -873
  85. package/dist/formatters/index.js +9 -9
  86. package/dist/generators/index.cjs +9 -9
  87. package/dist/generators/index.d.ts +104 -86
  88. package/dist/generators/index.js +4 -4
  89. package/dist/index.d.ts +1 -1
  90. package/dist/isPlainObject-0p3VveWr.d.ts +534 -0
  91. package/dist/next/index.cjs +37 -37
  92. package/dist/next/index.d.ts +36 -21
  93. package/dist/next/index.js +9 -9
  94. package/dist/next/server/index.cjs +4 -4
  95. package/dist/next/server/index.d.ts +6 -3
  96. package/dist/next/server/index.js +2 -2
  97. package/dist/operations/index.cjs +11 -11
  98. package/dist/operations/index.d.ts +14 -5
  99. package/dist/operations/index.js +8 -8
  100. package/dist/parsers/index.cjs +6 -6
  101. package/dist/parsers/index.d.ts +68 -65
  102. package/dist/parsers/index.js +5 -5
  103. package/dist/predicates/index.cjs +77 -77
  104. package/dist/predicates/index.d.ts +442 -258
  105. package/dist/predicates/index.js +14 -14
  106. package/dist/promises/index.cjs +6 -6
  107. package/dist/promises/index.d.ts +28 -16
  108. package/dist/promises/index.js +4 -4
  109. package/dist/rzl-utils.global.js +2 -2
  110. package/dist/strings/index.cjs +23 -23
  111. package/dist/strings/index.d.ts +82 -54
  112. package/dist/strings/index.js +7 -7
  113. package/dist/tailwind/index.cjs +13 -13
  114. package/dist/tailwind/index.d.ts +186 -169
  115. package/dist/tailwind/index.js +5 -5
  116. package/dist/urls/index.cjs +23 -23
  117. package/dist/urls/index.d.ts +252 -229
  118. package/dist/urls/index.js +16 -16
  119. package/package.json +3 -3
  120. package/dist/chunk-7C7TQC5J.cjs +0 -620
  121. package/dist/chunk-J4TT33ZX.js +0 -584
  122. package/dist/isPlainObject-BTPjv6zB.d.ts +0 -178
@@ -2,12 +2,15 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.9.1.
5
+ * Version: 3.11.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
9
9
  */
10
- import{NumberRangeUnion,Prettify,IsPositive,ParseNumber,Extends,IsStringLiteral,CharAt,AnyString,AnyFunction,IsEmptyString,Trim,IsAny,AnObjectNonArray,IsArray,OrArr,IsNever,TypedArray}from'@rzl-zone/ts-types-plus';import{a as IsPlainObjectResult,c as IsHasKeysObject}from'../isPlainObject-BTPjv6zB.js';export{G as GetPreciseTypeOptions,I as IsNumberOptions,g as getPreciseType,i as isNumber,b as isPlainObject}from'../isPlainObject-BTPjv6zB.js';
10
+ import { NumberRangeUnion, Prettify, IsPositive, ParseNumber, Extends, IsStringLiteral, CharAt, AnyString, AnyFunction, IsEmptyString, Trim, IsAny, AnObjectNonArray, IsArray, OrArr, IsNever, TypedArray } from '@rzl-zone/ts-types-plus';
11
+ import { a as IsPlainObjectResult, c as IsHasKeysObject } from '../isPlainObject-0p3VveWr.js';
12
+ export { A as AcronymsList, G as GetPreciseTypeOptions, I as IsNumberOptions, g as getPreciseType, i as isNumber, b as isPlainObject } from '../isPlainObject-0p3VveWr.js';
13
+
11
14
  /** ----------------------------------------------------------
12
15
  * * ***Predicate: `areArraysEqual`.***
13
16
  * ----------------------------------------------------------
@@ -36,7 +39,8 @@ import{NumberRangeUnion,Prettify,IsPositive,ParseNumber,Extends,IsStringLiteral,
36
39
  * // ➔ true
37
40
  * ```
38
41
  */
39
- declare const areArraysEqual:(array1:unknown[],array2:unknown[],ignoreOrder?:boolean)=>boolean;
42
+ declare const areArraysEqual: (array1: unknown[], array2: unknown[], ignoreOrder?: boolean) => boolean;
43
+
40
44
  /** ---------------------------------
41
45
  * * ***Predicate: `areObjectsEqual`.***
42
46
  * ---------------------------------
@@ -54,7 +58,8 @@ declare const areArraysEqual:(array1:unknown[],array2:unknown[],ignoreOrder?:boo
54
58
  * areObjectsEqual([1, 2, 3], [1, 2, 3]);
55
59
  * // ➔ true
56
60
  */
57
- declare const areObjectsEqual:(object1:unknown,object2:unknown)=>boolean;
61
+ declare const areObjectsEqual: (object1: unknown, object2: unknown) => boolean;
62
+
58
63
  /** ---------------------------------
59
64
  * * ***Predicate: `areURLsEqualPath`.***
60
65
  * ---------------------------------
@@ -91,7 +96,8 @@ declare const areObjectsEqual:(object1:unknown,object2:unknown)=>boolean;
91
96
  * );
92
97
  * // ➔ true
93
98
  */
94
- declare const areURLsEqualPath:(urlA:URL,urlB:URL)=>boolean;
99
+ declare const areURLsEqualPath: (urlA: URL, urlB: URL) => boolean;
100
+
95
101
  /** ---------------------------------
96
102
  * * ***Predicate: `areURLsIdentical`.***
97
103
  * ---------------------------------
@@ -128,17 +134,20 @@ declare const areURLsEqualPath:(urlA:URL,urlB:URL)=>boolean;
128
134
  * );
129
135
  * // ➔ false
130
136
  */
131
- declare const areURLsIdentical:(urlA:URL,urlB:URL)=>boolean;type OptionsTextContainsAll={
132
- /** If `true`, matches whole words only, defaultValue is `false`.
133
- *
134
- * @default false
135
- */
136
- exactMatch?:boolean;
137
- /** Optional regex flags (default: `"i"` for case-insensitive).
138
- *
139
- * @default "i"
140
- */
141
- flags?:string;};
137
+ declare const areURLsIdentical: (urlA: URL, urlB: URL) => boolean;
138
+
139
+ type OptionsTextContainsAll = {
140
+ /** If `true`, matches whole words only, defaultValue is `false`.
141
+ *
142
+ * @default false
143
+ */
144
+ exactMatch?: boolean;
145
+ /** Optional regex flags (default: `"i"` for case-insensitive).
146
+ *
147
+ * @default "i"
148
+ */
149
+ flags?: string;
150
+ };
142
151
  /** ----------------------------------------------------------
143
152
  * * ***Predicate: `textContainsAll`.***
144
153
  * ----------------------------------------------------------
@@ -169,17 +178,20 @@ flags?:string;};
169
178
  * textContainsAll("Hello", null);
170
179
  * // ➔ false (invalid searchWords)
171
180
  */
172
- declare const textContainsAll:<T extends string>(text?:T|null,searchWords?:T[]|string[]|null,options?:OptionsTextContainsAll)=>boolean;type OptionsTextContainsAny={
173
- /** If `true`, matches whole words only, defaultValue is `false`.
174
- *
175
- * @default false
176
- */
177
- exactMatch?:boolean;
178
- /** Optional regex flags (default: `"i"` for case-insensitive).
179
- *
180
- * @default "i"
181
- */
182
- flags?:string;};
181
+ declare const textContainsAll: <T extends string>(text?: T | null, searchWords?: T[] | string[] | null, options?: OptionsTextContainsAll) => boolean;
182
+
183
+ type OptionsTextContainsAny = {
184
+ /** If `true`, matches whole words only, defaultValue is `false`.
185
+ *
186
+ * @default false
187
+ */
188
+ exactMatch?: boolean;
189
+ /** Optional regex flags (default: `"i"` for case-insensitive).
190
+ *
191
+ * @default "i"
192
+ */
193
+ flags?: string;
194
+ };
183
195
  /** ----------------------------------------------------------
184
196
  * * ***Predicate: `textContainsAny`.***
185
197
  * ----------------------------------------------------------
@@ -210,7 +222,8 @@ flags?:string;};
210
222
  * textContainsAny("Hello", null);
211
223
  * // ➔ false (invalid searchWords)
212
224
  */
213
- declare const textContainsAny:<T extends string>(text?:T|null,searchWords?:T[]|string[]|null,options?:OptionsTextContainsAny)=>boolean;
225
+ declare const textContainsAny: <T extends string>(text?: T | null, searchWords?: T[] | string[] | null, options?: OptionsTextContainsAny) => boolean;
226
+
214
227
  /** ----------------------------------------------------------
215
228
  * * ***Predicate: `doesKeyExist`.***
216
229
  * ----------------------------------------------------------
@@ -256,7 +269,8 @@ declare const textContainsAny:<T extends string>(text?:T|null,searchWords?:T[]|s
256
269
  * doesKeyExist({ a: 1 }, ["not", "valid"]);
257
270
  * // ➔ ❌ Throws TypeError
258
271
  */
259
- declare const doesKeyExist:(object:Record<string,unknown>|unknown[],key:PropertyKey)=>boolean;
272
+ declare const doesKeyExist: (object: Record<string, unknown> | unknown[], key: PropertyKey) => boolean;
273
+
260
274
  /** ----------------------------------------------------------
261
275
  * * ***Predicate: `arrayHasAnyMatch`.***
262
276
  * ----------------------------------------------------------
@@ -309,26 +323,27 @@ declare const doesKeyExist:(object:Record<string,unknown>|unknown[],key:Property
309
323
  * arrayHasAnyMatch([[1, 2]], [[1, 2]]);
310
324
  * // ➔ false (different array object)
311
325
  */
312
- declare const arrayHasAnyMatch:<T>(sourceArray:T[]|null|undefined,targetArray:T[]|null|undefined)=>boolean;
326
+ declare const arrayHasAnyMatch: <T>(sourceArray: T[] | null | undefined, targetArray: T[] | null | undefined) => boolean;
327
+
313
328
  /** Restrict array indices to a fixed numeric range (1–25). */
314
- type ArrayIndex=NumberRangeUnion<1,25>;
329
+ type ArrayIndex = NumberRangeUnion<1, 25>;
315
330
  /** Remove `undefined` from a type. */
316
- type NonUndef<T>=T extends undefined?never:T;
331
+ type NonUndef<T> = T extends undefined ? never : T;
317
332
  /** Remove `null` from a type. */
318
- type NonNull<T>=T extends null?never:T;
333
+ type NonNull<T> = T extends null ? never : T;
319
334
  /** Convert optional boolean for "discard undefined" to actual boolean. */
320
- type EffectiveDiscardUndefined<O extends boolean|undefined>=O extends boolean?O:true;
335
+ type EffectiveDiscardUndefined<O extends boolean | undefined> = O extends boolean ? O : true;
321
336
  /** Convert optional boolean for "discard null" to actual boolean. */
322
- type EffectiveDiscardNull<O extends boolean|undefined>=O extends boolean?O:false;
337
+ type EffectiveDiscardNull<O extends boolean | undefined> = O extends boolean ? O : false;
323
338
  /** Unwrap array type. */
324
- type UnwrapArray<T>=T extends(infer U)[]?U:T extends readonly(infer U)[]?U:T;
339
+ type UnwrapArray<T> = T extends (infer U)[] ? U : T extends readonly (infer U)[] ? U : T;
325
340
  /** Force symbol key to be deep required. */
326
- type IsOptionalKey<T,K extends keyof T>=Record<never,never>extends Pick<T,K>?true:false;
341
+ type IsOptionalKey<T, K extends keyof T> = Record<never, never> extends Pick<T, K> ? true : false;
327
342
  /** * ***Returns numeric keys of an object.***
328
343
  *
329
344
  * @private ***types for {@link hasOwnProp}.***
330
345
  */
331
- type NumericKeyOfHasOwnProp<Obj>=Extract<keyof Obj,number>;
346
+ type NumericKeyOfHasOwnProp<Obj> = Extract<keyof Obj, number>;
332
347
  /** * ***Generate all nested keys of an object or array in dot/bracket notation.***
333
348
  *
334
349
  * @private ***types for {@link hasOwnProp}.***
@@ -339,7 +354,9 @@ type NumericKeyOfHasOwnProp<Obj>=Extract<keyof Obj,number>;
339
354
  * // Keys = "users" | "users.[number]" | "users.[number].name"
340
355
  * ```
341
356
  */
342
- 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;
357
+ type NestedKeyOfHasOwnProp<T> = T extends readonly (infer U)[] ? `[${number}]` | `[${number}].${NestedKeyOfHasOwnProp<U>}` : T extends object ? {
358
+ [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;
359
+ }[keyof T & (string | number)] : never;
343
360
  /** Apply discard rules to the last key of a path.
344
361
  *
345
362
  * Rules:
@@ -348,9 +365,11 @@ type NestedKeyOfHasOwnProp<T>=T extends readonly(infer U)[]?`[${number}]`|`[${nu
348
365
  *
349
366
  * Order: first strip undefined (if requested), then strip null (if requested)
350
367
  */
351
- 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>;
368
+ 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>;
352
369
  /** Force an array index N to type U. */
353
- type RefineArrayAtIndex<T extends readonly unknown[],N extends number,U>=T &{[K in N]:U;};
370
+ type RefineArrayAtIndex<T extends readonly unknown[], N extends number, U> = T & {
371
+ [K in N]: U;
372
+ };
354
373
  /** Narrow object/array type based on a path string.
355
374
  *
356
375
  * @template T - object type to narrow
@@ -358,33 +377,67 @@ type RefineArrayAtIndex<T extends readonly unknown[],N extends number,U>=T &{[K
358
377
  * @template DU - discard undefined
359
378
  * @template DN - discard null
360
379
  */
361
- 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;
380
+ 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 ? {
381
+ [K in keyof T]-?: NarrowByPathHasOwnProp<EffectiveDiscardUndefined<DU> extends true ? NonUndef<T[K]> : EffectiveDiscardNull<DN> extends true ? NonNull<T[K]> : T[K], Rest, DU, DN>;
382
+ } : EffectiveDiscardUndefined<DU> extends true ? {
383
+ [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];
384
+ } : {
385
+ [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];
386
+ } : {
387
+ [K in keyof T]: K extends Head ? NarrowByPathHasOwnProp<NonNullable<T[K]>, Rest, DU, DN> : T[K];
388
+ } & {
389
+ [K in Head]-?: NarrowByPathHasOwnProp<NonNullable<T[K]>, Rest, DU, DN>;
390
+ } : 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 ? {
391
+ [K in keyof T]: K extends P ? ApplyLastRulesHasOwnProp<T[K], DU, DN> : T[K];
392
+ } & {
393
+ [K in P]-?: ApplyLastRulesHasOwnProp<T[P], DU, DN>;
394
+ } : {
395
+ [K in keyof T]: K extends P ? ApplyLastRulesHasOwnProp<T[K], DU, DN> : T[K];
396
+ } : T;
362
397
  /** * ***Expand an array/string/function into a nested type according
363
398
  * to a dot/bracket path.***
364
399
  * @private ***types for {@link hasOwnProp}.***
365
400
  */
366
- 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;
401
+ 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;
367
402
  /** @private ***types for {@link hasOwnProp}.*** */
368
- type SmartDetectArrayFuncHasOwnProp<Obj extends unknown[]|AnyFunction,Key extends PropertyKey>=Prettify<Obj & DotToNestedSpecialSmartDetect<Key>&{length:number;},{recursive:false;}>;
403
+ type SmartDetectArrayFuncHasOwnProp<Obj extends unknown[] | AnyFunction, Key extends PropertyKey> = Prettify<Obj & DotToNestedSpecialSmartDetect<Key> & {
404
+ length: number;
405
+ }, {
406
+ recursive: false;
407
+ }>;
369
408
  /** * ***Smartly detect nested path keys of an unknown object or function,
370
409
  * falls-back to inferred nested structure when path is not valid.***
371
410
  *
372
411
  * @private ***types for {@link hasOwnProp}.***
373
412
  */
374
- 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;}>;
413
+ 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>), {
414
+ recursive: true;
415
+ }>;
375
416
  /** Convert dot/bracket path string to nested object type with leaf value.
376
417
  * Path not found in object key ➔ return unknown.
377
418
  */
378
- 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;};
419
+ 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>[] : {
420
+ [Key in Head]: DotToNestedSpecialSmartDetect<Rest, Value>;
421
+ } : Path extends `[${number}]` ? Value[] : {
422
+ [Key in Path]: Value;
423
+ };
379
424
  /** * ***Guarded wrapper for `NarrowByPathHasOwnProp` with `Prettify`.***
380
425
  * @private ***types for {@link hasOwnProp}.***
381
426
  */
382
- 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;}>;
427
+ 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>>, {
428
+ recursive: true;
429
+ }>;
383
430
  /** * ***Make a specific symbol key deeply required in an object symbols.***
384
431
  * **Used internally to enforce stronger type narrowing.**
385
432
  * @private ***types for {@link hasOwnProp}.***
386
433
  */
387
- 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;}>;
434
+ type DeepRequiredSymbolHasOwnProp<Obj, Sym extends symbol, DU extends boolean = true, DN extends boolean = false> = Prettify<Obj & ({
435
+ [K in keyof Obj & Sym as DU extends true ? K : never]-?: DN extends true ? NonNull<NonUndef<Obj[K]>> : NonUndef<Obj[K]>;
436
+ } & {
437
+ [K in keyof Obj & Sym as DU extends true ? never : K]?: DN extends true ? NonNull<Obj[K]> : Obj[K];
438
+ }), {
439
+ recursive: true;
440
+ }>;
388
441
  /** * ***Apply discard rules to numeric keys in an object type.***
389
442
  *
390
443
  * - If `discardUndefined = true` ➔ undefined removed, key required
@@ -392,37 +445,49 @@ type DeepRequiredSymbolHasOwnProp<Obj,Sym extends symbol,DU extends boolean=true
392
445
  *
393
446
  * @private ***types for {@link hasOwnProp}.***
394
447
  */
395
- 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;}>;
448
+ type NumericKeyHasOwnPropMapped<Obj extends object, K extends NumericKeyOfHasOwnProp<Obj>, DU extends boolean, DN extends boolean> = Prettify<Obj & (IsOptionalKey<Obj, K> extends true ? {
449
+ [P in K]?: DN extends true ? NonNull<Obj[K]> : Obj[K];
450
+ } & (DU extends true ? {
451
+ [P in K]-?: NonUndef<Obj[K]>;
452
+ } : Record<never, never>) : {
453
+ [P in K]-?: DN extends true ? NonNull<Obj[K]> : Obj[K];
454
+ } & (DU extends true ? {
455
+ [P in K]-?: NonUndef<Obj[K]>;
456
+ } : Record<never, never>)), {
457
+ recursive: true;
458
+ }>;
396
459
  /** * ***Options to control `hasOwnProp` behavior.***
397
460
  * @private ***types options for {@link hasOwnProp}.***
398
461
  */
399
- type HasOwnPropOptions<DiscardUndefined extends boolean=true,DiscardNull extends boolean=false>={
400
- /** If `true` ***(default)***, properties with `undefined` values are treated as non-existent.
401
- *
402
- * - **Effects:**
403
- * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `undefined`.
404
- * - **TypeScript narrowing:** The property's type is narrowed to exclude `undefined`.
405
- * - **Example:**
406
- * ```ts
407
- * const obj = { a: undefined, b: 123 };
408
- * hasOwnProp(obj, "a"); // ➔ false
409
- * hasOwnProp(obj, "a", { discardUndefined: false }); // ➔ true
410
- * ```
411
- */
412
- discardUndefined?:DiscardUndefined;
413
- /** If `true` ***(default: `false`)***, properties with `null` values are treated as non-existent.
414
- *
415
- * - **Effects:**
416
- * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `null`.
417
- * - **TypeScript narrowing:** The property's type is narrowed to exclude `null`.
418
- * - **Example:**
419
- * ```ts
420
- * const obj = { a: null, b: 123 };
421
- * hasOwnProp(obj, "a"); // ➔ true (default discardNull = false)
422
- * hasOwnProp(obj, "a", { discardNull: true }); // ➔ false
423
- * ```
424
- */
425
- discardNull?:DiscardNull;};
462
+ type HasOwnPropOptions<DiscardUndefined extends boolean = true, DiscardNull extends boolean = false> = {
463
+ /** If `true` ***(default)***, properties with `undefined` values are treated as non-existent.
464
+ *
465
+ * - **Effects:**
466
+ * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `undefined`.
467
+ * - **TypeScript narrowing:** The property's type is narrowed to exclude `undefined`.
468
+ * - **Example:**
469
+ * ```ts
470
+ * const obj = { a: undefined, b: 123 };
471
+ * hasOwnProp(obj, "a"); // ➔ false
472
+ * hasOwnProp(obj, "a", { discardUndefined: false }); // ➔ true
473
+ * ```
474
+ */
475
+ discardUndefined?: DiscardUndefined;
476
+ /** If `true` ***(default: `false`)***, properties with `null` values are treated as non-existent.
477
+ *
478
+ * - **Effects:**
479
+ * - **Runtime:** `hasOwnProp(obj, key)` returns `false` if the property exists but its value is `null`.
480
+ * - **TypeScript narrowing:** The property's type is narrowed to exclude `null`.
481
+ * - **Example:**
482
+ * ```ts
483
+ * const obj = { a: null, b: 123 };
484
+ * hasOwnProp(obj, "a"); // ➔ true (default discardNull = false)
485
+ * hasOwnProp(obj, "a", { discardNull: true }); // ➔ false
486
+ * ```
487
+ */
488
+ discardNull?: DiscardNull;
489
+ };
490
+
426
491
  /** -------------------------------------------------------
427
492
  * * ***Predicate: `hasOwnProp`.***
428
493
  * -------------------------------------------------------
@@ -551,19 +616,27 @@ discardNull?:DiscardNull;};
551
616
  * hasOwnProp(obj, " "); // ➔ false (trimmed to empty)
552
617
  * ```
553
618
  */
554
- declare function hasOwnProp<Obj>(obj:IsAny<Obj>extends true?Obj:never,key:PropertyKey,options?:HasOwnPropOptions<boolean,boolean>
619
+ declare function hasOwnProp<Obj>(obj: IsAny<Obj> extends true ? Obj : never, key: PropertyKey, options?: HasOwnPropOptions<boolean, boolean>
555
620
  /** @ts-expect-error we force `any` to `unknown` at result */
556
- ):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>
621
+ ): obj is unknown;
622
+ declare function hasOwnProp<Obj extends null | undefined>(obj: Obj, key: PropertyKey, options?: HasOwnPropOptions<boolean, boolean>): false;
623
+ 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>
557
624
  /** @ts-expect-error we force to override recursive type result */
558
- ):obj is GuardedHasOwnProp<Obj,Key,DiscardUndefined,DiscardNull>;declare function hasOwnProp<Obj extends object,Num extends NumericKeyOfHasOwnProp<Obj>,DiscardUndefined extends boolean=true,DiscardNull extends boolean=false>(obj:Obj|null|undefined,key:Num,options?:HasOwnPropOptions<DiscardUndefined,DiscardNull>
625
+ ): obj is GuardedHasOwnProp<Obj, Key, DiscardUndefined, DiscardNull>;
626
+ declare function hasOwnProp<Obj extends object, Num extends NumericKeyOfHasOwnProp<Obj>, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj | null | undefined, key: Num, options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>
559
627
  /** @ts-expect-error we force to override recursive type result */
560
- ):obj is NumericKeyHasOwnPropMapped<Obj,Num,DiscardUndefined,DiscardNull>;declare function hasOwnProp<Obj extends object|AnyFunction,Sym extends symbol,DiscardUndefined extends boolean=true,DiscardNull extends boolean=false>(obj:Obj|null|undefined,key:Sym,options?:HasOwnPropOptions<DiscardUndefined,DiscardNull>
628
+ ): obj is NumericKeyHasOwnPropMapped<Obj, Num, DiscardUndefined, DiscardNull>;
629
+ declare function hasOwnProp<Obj extends object | AnyFunction, Sym extends symbol, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj | null | undefined, key: Sym, options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>
561
630
  /** @ts-expect-error we force to override recursive type result */
562
- ):obj is DeepRequiredSymbolHasOwnProp<Obj,Sym,DiscardUndefined,DiscardNull>;declare function hasOwnProp<Obj extends string|null|undefined,Key extends string|number>(obj:Obj|null|undefined,key:Key,options?:HasOwnPropOptions<boolean,boolean>
631
+ ): obj is DeepRequiredSymbolHasOwnProp<Obj, Sym, DiscardUndefined, DiscardNull>;
632
+ declare function hasOwnProp<Obj extends string | null | undefined, Key extends string | number>(obj: Obj | null | undefined, key: Key, options?: HasOwnPropOptions<boolean, boolean>
563
633
  /** @ts-expect-error we force to override recursive type result */
564
- ):obj is IsStringLiteral<SmartDetectStringHasOwnProp<Obj,Key>>extends true?AnyString|SmartDetectStringHasOwnProp<Obj,Key>:SmartDetectStringHasOwnProp<Obj,Key>;declare function hasOwnProp<Obj extends unknown[]|AnyFunction,Key extends PropertyKey>(obj:Obj,key:Key,options?:HasOwnPropOptions<boolean,boolean>):obj is SmartDetectArrayFuncHasOwnProp<Obj,Key>;declare function hasOwnProp<Obj extends unknown|AnyFunction,Key extends PropertyKey,DiscardUndefined extends boolean=true,DiscardNull extends boolean=false>(obj:Obj,key:Key|"length"|(IsPlainObjectResult<Obj>extends never?never:keyof Obj),options?:HasOwnPropOptions<DiscardUndefined,DiscardNull>
634
+ ): obj is IsStringLiteral<SmartDetectStringHasOwnProp<Obj, Key>> extends true ? AnyString | SmartDetectStringHasOwnProp<Obj, Key> : SmartDetectStringHasOwnProp<Obj, Key>;
635
+ declare function hasOwnProp<Obj extends unknown[] | AnyFunction, Key extends PropertyKey>(obj: Obj, key: Key, options?: HasOwnPropOptions<boolean, boolean>): obj is SmartDetectArrayFuncHasOwnProp<Obj, Key>;
636
+ declare function hasOwnProp<Obj extends unknown | AnyFunction, Key extends PropertyKey, DiscardUndefined extends boolean = true, DiscardNull extends boolean = false>(obj: Obj, key: Key | "length" | (IsPlainObjectResult<Obj> extends never ? never : keyof Obj), options?: HasOwnPropOptions<DiscardUndefined, DiscardNull>
565
637
  /** @ts-expect-error we force to override recursive type result */
566
- ):obj is SmartDetectUnknownKeyHasOwnProp<Obj,Key,DiscardUndefined,DiscardNull>;
638
+ ): obj is SmartDetectUnknownKeyHasOwnProp<Obj, Key, DiscardUndefined, DiscardNull>;
639
+
567
640
  /** -------------------
568
641
  * * ***Type guard: `isArguments`.***
569
642
  * -------------------
@@ -576,7 +649,8 @@ declare function hasOwnProp<Obj>(obj:IsAny<Obj>extends true?Obj:never,key:Proper
576
649
  * isArguments([1, 2, 3]);
577
650
  * // ➔ false
578
651
  */
579
- declare const isArguments:(value:unknown)=>value is IArguments;
652
+ declare const isArguments: (value: unknown) => value is IArguments;
653
+
580
654
  /** ----------------------------------------------------------
581
655
  * * ***Type guard: `isArray`.***
582
656
  * ----------------------------------------------------------
@@ -602,7 +676,10 @@ declare const isArguments:(value:unknown)=>value is IArguments;
602
676
  * isArray(undefined);
603
677
  * // ➔ false
604
678
  */
605
- 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[];
679
+ declare function isArray<T extends unknown[]>(value: T): value is Extract<T, unknown[]>;
680
+ declare function isArray<T extends readonly unknown[]>(value: T): value is Extract<T, readonly unknown[]>;
681
+ declare function isArray(value: unknown): value is unknown[];
682
+
606
683
  /** ----------------------------------------------------
607
684
  * * ***Type guard: `isArrayBuffer`.***
608
685
  * ----------------------------------------------------
@@ -615,7 +692,8 @@ declare function isArray<T extends unknown[]>(value:T):value is Extract<T,unknow
615
692
  * isArrayBuffer(new Array(2));
616
693
  * // ➔ false
617
694
  */
618
- declare function isArrayBuffer(value:unknown):value is ArrayBuffer;
695
+ declare function isArrayBuffer(value: unknown): value is ArrayBuffer;
696
+
619
697
  /** ----------------------------------------------------
620
698
  * * ***Type guard: `isArrayLike`.***
621
699
  * ----------------------------------------------------
@@ -635,7 +713,14 @@ declare function isArrayBuffer(value:unknown):value is ArrayBuffer;
635
713
  * isArrayLike('abc');
636
714
  * // ➔ false
637
715
  */
638
- 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;};
716
+ declare function isArrayLike<T extends {
717
+ __anyHack: unknown;
718
+ }>(value: T): boolean;
719
+ declare function isArrayLike(value: AnyFunction | null | undefined): value is never;
720
+ declare function isArrayLike(value: unknown): value is {
721
+ length: number;
722
+ };
723
+
639
724
  /** ----------------------------------------------------
640
725
  * * ***Type guard: `isArrayLikeObject`.***
641
726
  * ----------------------------------------------------
@@ -654,7 +739,14 @@ declare function isArrayLike<T extends{__anyHack:unknown;}>(value:T):boolean;dec
654
739
  * isArrayLikeObject(noop);
655
740
  * // ➔ false
656
741
  */
657
- 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;};
742
+ declare function isArrayLikeObject<T extends {
743
+ __anyHack: unknown;
744
+ }>(value: T): boolean;
745
+ declare function isArrayLikeObject(value: AnyFunction | string | boolean | number | null | undefined): value is never;
746
+ declare function isArrayLikeObject(value: unknown): value is object & {
747
+ length: number;
748
+ };
749
+
658
750
  /** ----------------------------------------------------------
659
751
  * * ***Type guard: `isBigInt`.***
660
752
  * ----------------------------------------------------------
@@ -676,7 +768,8 @@ declare function isArrayLikeObject<T extends{__anyHack:unknown;}>(value:T):boole
676
768
  * isBigInt(Object(BigInt(1)));
677
769
  * // ➔ false
678
770
  */
679
- declare const isBigInt:(value:unknown)=>value is bigint;
771
+ declare const isBigInt: (value: unknown) => value is bigint;
772
+
680
773
  /** ----------------------------------------------------------
681
774
  * * ***Type guard: `isBoolean`.***
682
775
  * ----------------------------------------------------------
@@ -688,7 +781,8 @@ declare const isBigInt:(value:unknown)=>value is bigint;
688
781
  * isBoolean(false); // ➔ true
689
782
  * isBoolean("true"); // ➔ false
690
783
  */
691
- declare const isBoolean:(value:unknown)=>value is boolean;
784
+ declare const isBoolean: (value: unknown) => value is boolean;
785
+
692
786
  /** ----------------------------------------------------
693
787
  * * ***Type guard: `isBooleanObject`.***
694
788
  * ----------------------------------------------------
@@ -702,7 +796,8 @@ declare const isBoolean:(value:unknown)=>value is boolean;
702
796
  * isBooleanObject(true);
703
797
  * // ➔ false
704
798
  */
705
- declare function isBooleanObject(value:unknown):value is Boolean;
799
+ declare function isBooleanObject(value: unknown): value is Boolean;
800
+
706
801
  /** ----------------------------------------------------
707
802
  * * ***Type guard: `isBuffer`.***
708
803
  * ----------------------------------------------------------
@@ -723,7 +818,8 @@ declare function isBooleanObject(value:unknown):value is Boolean;
723
818
  * isBuffer(new Uint8Array(1024));
724
819
  * // ➔ false
725
820
  */
726
- declare const isBuffer:(value:unknown)=>value is Buffer;
821
+ declare const isBuffer: (value: unknown) => value is Buffer;
822
+
727
823
  /** -----------------------------------------------------------
728
824
  * * ***Predicate: `isCurrencyLike`.***
729
825
  * -----------------------------------------------------------
@@ -757,16 +853,19 @@ declare const isBuffer:(value:unknown)=>value is Buffer;
757
853
  * isCurrencyLike("abc");
758
854
  * // ➔ false
759
855
  */
760
- declare const isCurrencyLike:(input:unknown)=>boolean;type isDateOptions={
761
- /** * ***Skip the validity check (`!isNaN(date.getTime())`).***
762
- *
763
- * When `true`, the function only checks that the value is an
764
- * instance of `Date` without verifying that it represents a valid
765
- * date value, default: `false`.
766
- *
767
- * @default false
768
- */
769
- skipInvalidDate?:boolean;};
856
+ declare const isCurrencyLike: (input: unknown) => boolean;
857
+
858
+ type isDateOptions = {
859
+ /** * ***Skip the validity check (`!isNaN(date.getTime())`).***
860
+ *
861
+ * When `true`, the function only checks that the value is an
862
+ * instance of `Date` without verifying that it represents a valid
863
+ * date value, default: `false`.
864
+ *
865
+ * @default false
866
+ */
867
+ skipInvalidDate?: boolean;
868
+ };
770
869
  /** ----------------------------------------------------------
771
870
  * * ***Type guard: `isDate`.***
772
871
  * ----------------------------------------------------------
@@ -796,7 +895,8 @@ skipInvalidDate?:boolean;};
796
895
  * isDate(new Date("invalid"), { skipInvalidDate: true });
797
896
  * // ➜ true
798
897
  */
799
- declare const isDate:(value:unknown,options?:isDateOptions)=>value is Date;
898
+ declare const isDate: (value: unknown, options?: isDateOptions) => value is Date;
899
+
800
900
  /** ----------------------------------------------------------
801
901
  * * ***Predicate: `isDeepEqual`.***
802
902
  * ----------------------------------------------------------
@@ -853,7 +953,8 @@ declare const isDate:(value:unknown,options?:isDateOptions)=>value is Date;
853
953
  * isDeepEqual(1, "1");
854
954
  * // ➔ false
855
955
  */
856
- declare const isDeepEqual:(a:unknown,b:unknown)=>boolean;
956
+ declare const isDeepEqual: (a: unknown, b: unknown) => boolean;
957
+
857
958
  /** ----------------------------------------------------
858
959
  * * ***Type guard: `isElement`.***
859
960
  * ----------------------------------------------------------
@@ -874,7 +975,10 @@ declare const isDeepEqual:(a:unknown,b:unknown)=>boolean;
874
975
  * isElement({ tagName: "DIV" });
875
976
  * // ➔ false
876
977
  */
877
- 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;
978
+ declare function isElement(value: []): value is [];
979
+ declare function isElement<T extends Element>(value: T): value is T;
980
+ declare function isElement(value: unknown): value is Element;
981
+
878
982
  /**
879
983
  * -------------------------------------------------------------------
880
984
  * * ***Array-like structure interface.***
@@ -894,11 +998,13 @@ declare function isElement(value:[]):value is [];declare function isElement<T ex
894
998
  * logArrayLike(myNodeList);
895
999
  * ```
896
1000
  */
897
- interface ArrayLike<T>{
898
- /** * ***Number of elements in the array-like object.*** */
899
- readonly length:number;
900
- /** * ***Indexed access to elements.*** */
901
- readonly [n:number]:T;}
1001
+ interface ArrayLike<T> {
1002
+ /** * ***Number of elements in the array-like object.*** */
1003
+ readonly length: number;
1004
+ /** * ***Indexed access to elements.*** */
1005
+ readonly [n: number]: T;
1006
+ }
1007
+
902
1008
  /** -------------------------------------------------------------------
903
1009
  * * ***Represents an object with no allowed properties.***
904
1010
  * -------------------------------------------------------------------
@@ -910,7 +1016,9 @@ readonly [n:number]:T;}
910
1016
  * // ➔ { a?: never }
911
1017
  * ```
912
1018
  */
913
- type EmptyObject<T>={[K in keyof T]?:never;};
1019
+ type EmptyObject<T> = {
1020
+ [K in keyof T]?: never;
1021
+ };
914
1022
  /** -------------------------------------------------------------------
915
1023
  * * ***Conditional empty object type.***
916
1024
  * -------------------------------------------------------------------
@@ -922,7 +1030,7 @@ type EmptyObject<T>={[K in keyof T]?:never;};
922
1030
  * // ➔ { a?: never } | never depending on assignability
923
1031
  * ```
924
1032
  */
925
- type EmptyObjectOf<T>=EmptyObject<T>extends T?EmptyObject<T>:never;
1033
+ type EmptyObjectOf<T> = EmptyObject<T> extends T ? EmptyObject<T> : never;
926
1034
  /** -------------------------------------------------------------------
927
1035
  * * ***List type alias.***
928
1036
  * -------------------------------------------------------------------
@@ -934,7 +1042,8 @@ type EmptyObjectOf<T>=EmptyObject<T>extends T?EmptyObject<T>:never;
934
1042
  * const nodeList: List<Element> = document.querySelectorAll("div");
935
1043
  * ```
936
1044
  */
937
- type List<T>=ArrayLike<T>;
1045
+ type List<T> = ArrayLike<T>;
1046
+
938
1047
  /** ----------------------------------------------------
939
1048
  * * ***Predicate: `isEmpty`.***
940
1049
  * ----------------------------------------------------------
@@ -977,7 +1086,15 @@ type List<T>=ArrayLike<T>;
977
1086
  * isEmpty({ 'a': 1 });
978
1087
  * // ➔ false
979
1088
  */
980
- 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;
1089
+ declare function isEmpty<T extends {
1090
+ __trapAny: any;
1091
+ }>(value?: T): boolean;
1092
+ declare function isEmpty(value: string): value is "";
1093
+ declare function isEmpty(value: Map<any, any> | Set<any> | List<any> | null | undefined): boolean;
1094
+ declare function isEmpty(value: object): boolean;
1095
+ declare function isEmpty<T extends object>(value: T | null | undefined): value is EmptyObjectOf<T> | null | undefined;
1096
+ declare function isEmpty(value: any): boolean;
1097
+
981
1098
  /** ----------------------------------------------------------
982
1099
  * * ***Predicate: `isEmptyArray`.***
983
1100
  * ----------------------------------------------------------
@@ -997,7 +1114,8 @@ declare function isEmpty<T extends{__trapAny:any;}>(value?:T):boolean;declare fu
997
1114
  * console.log("No items to display.");
998
1115
  * }
999
1116
  */
1000
- declare const isEmptyArray:(value:unknown)=>boolean;
1117
+ declare const isEmptyArray: (value: unknown) => boolean;
1118
+
1001
1119
  /** ----------------------------------------------------------
1002
1120
  * * ***Predicate: `isEmptyDeep`.***
1003
1121
  * ----------------------------------------------------------
@@ -1035,12 +1153,15 @@ declare const isEmptyArray:(value:unknown)=>boolean;
1035
1153
  * isEmptyDeep(NaN);
1036
1154
  * // ➔ true
1037
1155
  */
1038
- declare const isEmptyDeep:(value:unknown)=>boolean;type IsEmptyObjectOptions={
1039
- /** Whether to check for symbol properties in addition to string keys, defaultValue: `false`.
1040
- *
1041
- * @default false
1042
- */
1043
- checkSymbols?:boolean;};
1156
+ declare const isEmptyDeep: (value: unknown) => boolean;
1157
+
1158
+ type IsEmptyObjectOptions = {
1159
+ /** Whether to check for symbol properties in addition to string keys, defaultValue: `false`.
1160
+ *
1161
+ * @default false
1162
+ */
1163
+ checkSymbols?: boolean;
1164
+ };
1044
1165
  /** ----------------------------------------------------------
1045
1166
  * * ***Predicate: `isEmptyObject`.***
1046
1167
  * ----------------------------------------------------------
@@ -1071,11 +1192,14 @@ checkSymbols?:boolean;};
1071
1192
  * isEmptyObject(123);
1072
1193
  * // ➔ true (not object)
1073
1194
  */
1074
- declare function isEmptyObject(value:unknown,options?:IsEmptyObjectOptions):boolean;type IsEmptyStringOptions={
1075
- /** Whether to trim the string before checking, defaultValue: `true`.
1076
- *
1077
- * @default true */
1078
- trim?:boolean;};
1195
+ declare function isEmptyObject(value: unknown, options?: IsEmptyObjectOptions): boolean;
1196
+
1197
+ type IsEmptyStringOptions = {
1198
+ /** Whether to trim the string before checking, defaultValue: `true`.
1199
+ *
1200
+ * @default true */
1201
+ trim?: boolean;
1202
+ };
1079
1203
  /** ----------------------------------------------------------
1080
1204
  * * ***Predicate: `isEmptyString`.***
1081
1205
  * ----------------------------------------------------------
@@ -1109,13 +1233,16 @@ trim?:boolean;};
1109
1233
  * throw new Error("Name cannot be empty.");
1110
1234
  * }
1111
1235
  */
1112
- declare const isEmptyString:(value:unknown,options?:IsEmptyStringOptions)=>boolean;type IsEmptyValueOptions={
1113
- /** **Whether to check symbol properties when checking empty objects.**
1114
- * - **DefaultValue:** `false`.
1115
- *
1116
- * @default false
1117
- */
1118
- checkSymbols?:boolean;};
1236
+ declare const isEmptyString: (value: unknown, options?: IsEmptyStringOptions) => boolean;
1237
+
1238
+ type IsEmptyValueOptions = {
1239
+ /** **Whether to check symbol properties when checking empty objects.**
1240
+ * - **DefaultValue:** `false`.
1241
+ *
1242
+ * @default false
1243
+ */
1244
+ checkSymbols?: boolean;
1245
+ };
1119
1246
  /** ----------------------------------------------------------
1120
1247
  * * ***Predicate: `isEmptyValue`.***
1121
1248
  * ----------------------------------------------------------
@@ -1171,7 +1298,8 @@ checkSymbols?:boolean;};
1171
1298
  * isEmptyValue(() => {});
1172
1299
  * // ➔ false
1173
1300
  */
1174
- declare const isEmptyValue:(value:unknown,options?:IsEmptyValueOptions)=>boolean;
1301
+ declare const isEmptyValue: (value: unknown, options?: IsEmptyValueOptions) => boolean;
1302
+
1175
1303
  /** ----------------------------------------------------
1176
1304
  * * ***Predicate: `isEqual`.***
1177
1305
  * ----------------------------------------------------------
@@ -1211,7 +1339,8 @@ declare const isEmptyValue:(value:unknown,options?:IsEmptyValueOptions)=>boolean
1211
1339
  * isEqual({ a: 1 }, { a: 1, b: undefined });
1212
1340
  * // ➔ false
1213
1341
  */
1214
- declare function isEqual(value:unknown,other:unknown):boolean;
1342
+ declare function isEqual(value: unknown, other: unknown): boolean;
1343
+
1215
1344
  /** -------------------------------------------------------------------
1216
1345
  * * ***Customizer function for `isEqualWith`.***
1217
1346
  * -------------------------------------------------------------------
@@ -1245,19 +1374,20 @@ declare function isEqual(value:unknown,other:unknown):boolean;
1245
1374
  * // returns true
1246
1375
  * ```
1247
1376
  */
1248
- type CustomizerIsEqualWith=(
1377
+ type CustomizerIsEqualWith = (
1249
1378
  /** * ***The current value being compared.*** */
1250
- value:unknown,
1379
+ value: unknown,
1251
1380
  /** * ***The corresponding value from the other object.*** */
1252
- other:unknown,
1381
+ other: unknown,
1253
1382
  /** * ***Property key (for objects) or index (for arrays) of the current value.*** */
1254
- indexOrKey:PropertyKey,
1383
+ indexOrKey: PropertyKey,
1255
1384
  /** * ***Parent object or array containing `value`.*** */
1256
- parent:unknown,
1385
+ parent: unknown,
1257
1386
  /** * ***Parent object or array containing `other`.*** */
1258
- otherParent:unknown,
1387
+ otherParent: unknown,
1259
1388
  /** * ***WeakMap or tracking structure for visited objects to handle circular references.*** */
1260
- stack:unknown)=>boolean|undefined;
1389
+ stack: unknown) => boolean | undefined;
1390
+
1261
1391
  /** ----------------------------------------------------
1262
1392
  * * ***Predicate: `isEqualWith`.***
1263
1393
  * ----------------------------------------------------
@@ -1296,7 +1426,8 @@ stack:unknown)=>boolean|undefined;
1296
1426
  * isEqualWith(array, other, customizer);
1297
1427
  * // ➔ true
1298
1428
  */
1299
- declare function isEqualWith(value:unknown,other:unknown,customizer?:CustomizerIsEqualWith):boolean;
1429
+ declare function isEqualWith(value: unknown, other: unknown, customizer?: CustomizerIsEqualWith): boolean;
1430
+
1300
1431
  /** ----------------------------------------------------------
1301
1432
  * * ***Type guard: `isError`.***
1302
1433
  * ----------------------------------------------------------
@@ -1314,7 +1445,8 @@ declare function isEqualWith(value:unknown,other:unknown,customizer?:CustomizerI
1314
1445
  * isError(null);
1315
1446
  * // ➔ false
1316
1447
  */
1317
- declare const isError:(error:unknown)=>error is Error;
1448
+ declare const isError: (error: unknown) => error is Error;
1449
+
1318
1450
  /** ----------------------------------------------------------
1319
1451
  * * ***Type guard: `isFinite`.***
1320
1452
  * -----------------------------------------------------------
@@ -1351,7 +1483,8 @@ declare const isError:(error:unknown)=>error is Error;
1351
1483
  * isFinite(new Number(3));
1352
1484
  * // ➔ true (object coerced to primitive number)
1353
1485
  */
1354
- declare function isFinite(value:unknown):value is number;
1486
+ declare function isFinite(value: unknown): value is number;
1487
+
1355
1488
  /** ----------------------------------------------------------
1356
1489
  * * ***Type guard: `isFunction`.***
1357
1490
  * -----------------------------------------------------------
@@ -1372,7 +1505,8 @@ declare function isFinite(value:unknown):value is number;
1372
1505
  * isFunction({});
1373
1506
  * // ➔ false
1374
1507
  */
1375
- declare const isFunction:(value:unknown)=>value is AnyFunction;
1508
+ declare const isFunction: (value: unknown) => value is AnyFunction;
1509
+
1376
1510
  /** ----------------------------------------------------
1377
1511
  * * ***Type guard: `isInfinityNumber`.***
1378
1512
  * ----------------------------------------------------
@@ -1398,7 +1532,8 @@ declare const isFunction:(value:unknown)=>value is AnyFunction;
1398
1532
  * RzlUtilsJs.isInfinityNumber(123);
1399
1533
  * // ➔ false
1400
1534
  */
1401
- declare function isInfinityNumber(value:unknown):boolean;
1535
+ declare function isInfinityNumber(value: unknown): boolean;
1536
+
1402
1537
  /** ---------------------------------------------------------
1403
1538
  * * ***Type guard: `isInteger`.***
1404
1539
  * ----------------------------------------------------------
@@ -1422,7 +1557,8 @@ declare function isInfinityNumber(value:unknown):boolean;
1422
1557
  * isInteger('3');
1423
1558
  * // ➔ false
1424
1559
  */
1425
- declare function isInteger(value:unknown):value is number;
1560
+ declare function isInteger(value: unknown): value is number;
1561
+
1426
1562
  /** ----------------------------------------
1427
1563
  * * ***Predicate: `isLength`.***
1428
1564
  * ----------------------------------------------------------
@@ -1458,7 +1594,8 @@ declare function isInteger(value:unknown):value is number;
1458
1594
  * isLength(Number.MIN_VALUE);
1459
1595
  * // ➔ false
1460
1596
  */
1461
- declare function isLength(value:unknown):boolean;
1597
+ declare function isLength(value: unknown): boolean;
1598
+
1462
1599
  /** --------------------------------------------------
1463
1600
  * * ***Type guard: `isMap`.***
1464
1601
  * ----------------------------------------------------------
@@ -1476,7 +1613,9 @@ declare function isLength(value:unknown):boolean;
1476
1613
  * isMap({});
1477
1614
  * // ➔ false
1478
1615
  */
1479
- 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>;
1616
+ declare function isMap<K = unknown, V = unknown>(value: Map<K, V>): value is Map<K, V>;
1617
+ declare function isMap(value: unknown): value is Map<unknown, unknown>;
1618
+
1480
1619
  /** ----------------------------------------------------
1481
1620
  * * ***Predicate: `isMatch`.***
1482
1621
  * ----------------------------------------------------
@@ -1505,7 +1644,8 @@ declare function isMap<K=unknown,V=unknown>(value:Map<K,V>):value is Map<K,V>;de
1505
1644
  * isMatch([1, 2, 3], [1, 2]);
1506
1645
  * // ➔ true (treats arrays as objects with index keys)
1507
1646
  */
1508
- declare function isMatch(object:object,source:object):boolean;
1647
+ declare function isMatch(object: object, source: object): boolean;
1648
+
1509
1649
  /** -------------------------------------------------------------------
1510
1650
  * * ***Customizer function for `isMatchWith`.***
1511
1651
  * -------------------------------------------------------------------
@@ -1537,17 +1677,18 @@ declare function isMatch(object:object,source:object):boolean;
1537
1677
  * // returns true
1538
1678
  * ```
1539
1679
  */
1540
- type CustomizerIsMatchWith=(
1680
+ type CustomizerIsMatchWith = (
1541
1681
  /** * ***Current value from the object being tested.*** */
1542
- value:unknown,
1682
+ value: unknown,
1543
1683
  /** * ***Corresponding value from the source object.*** */
1544
- other:unknown,
1684
+ other: unknown,
1545
1685
  /** * ***Property key (objects) or index (arrays) of the current value.*** */
1546
- indexOrKey:PropertyKey,
1686
+ indexOrKey: PropertyKey,
1547
1687
  /** * ***Parent object containing `value`.*** */
1548
- object:object,
1688
+ object: object,
1549
1689
  /** * ***Parent source object containing `other`.*** */
1550
- source:object)=>boolean|undefined;
1690
+ source: object) => boolean | undefined;
1691
+
1551
1692
  /** ----------------------------------------------------
1552
1693
  * * ***Predicate: `isMatchWith`.***
1553
1694
  * ----------------------------------------------------
@@ -1585,7 +1726,8 @@ source:object)=>boolean|undefined;
1585
1726
  * isMatchWith(object, source, customizer);
1586
1727
  * // ➔ true
1587
1728
  */
1588
- declare function isMatchWith(value:object,other:object,customizer?:CustomizerIsMatchWith):boolean;
1729
+ declare function isMatchWith(value: object, other: object, customizer?: CustomizerIsMatchWith): boolean;
1730
+
1589
1731
  /** ----------------------------------------------------
1590
1732
  * * ***Type guard: `isNaN`.***
1591
1733
  * ----------------------------------------------------
@@ -1612,7 +1754,8 @@ declare function isMatchWith(value:object,other:object,customizer?:CustomizerIsM
1612
1754
  * isNaN(undefined);
1613
1755
  * // ➔ true
1614
1756
  */
1615
- declare function isNaN(value:unknown):boolean;
1757
+ declare function isNaN(value: unknown): boolean;
1758
+
1616
1759
  /** ----------------------------------------------------
1617
1760
  * * ***Type guard: `isNative`.***
1618
1761
  * ----------------------------------------------------------
@@ -1634,7 +1777,8 @@ declare function isNaN(value:unknown):boolean;
1634
1777
  * isNative(RzlUtilsJs);
1635
1778
  * // ➔ false
1636
1779
  */
1637
- declare function isNative(value:unknown):value is AnyFunction;
1780
+ declare function isNative(value: unknown): value is AnyFunction;
1781
+
1638
1782
  /** ----------------------------------------------------
1639
1783
  * * ***Type guard: `isNil`.***
1640
1784
  * ----------------------------------------------------------
@@ -1653,7 +1797,8 @@ declare function isNative(value:unknown):value is AnyFunction;
1653
1797
  * isNil(NaN);
1654
1798
  * // ➔ false
1655
1799
  */
1656
- declare function isNil(value:unknown):value is null|undefined;
1800
+ declare function isNil(value: unknown): value is null | undefined;
1801
+
1657
1802
  /** ----------------------------------------------------------
1658
1803
  * * ***Type guard: `isNonEmptyArray`.***
1659
1804
  * ----------------------------------------------------------
@@ -1671,11 +1816,16 @@ declare function isNil(value:unknown):value is null|undefined;
1671
1816
  * isNonEmptyArray(null); // ➔ false
1672
1817
  * isNonEmptyArray("test"); // ➔ false
1673
1818
  */
1674
- 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={
1675
- /** Whether to trim the string before checking, defaultValue: `true`.
1676
- *
1677
- * @default true */
1678
- trim?:boolean;};
1819
+ declare function isNonEmptyArray(value: []): value is [];
1820
+ declare function isNonEmptyArray<T extends unknown[]>(value: T): value is NonNullable<Extract<T, unknown[]>>;
1821
+ declare function isNonEmptyArray(value: unknown): value is unknown[];
1822
+
1823
+ type IsNonEmptyStringOptions = {
1824
+ /** Whether to trim the string before checking, defaultValue: `true`.
1825
+ *
1826
+ * @default true */
1827
+ trim?: boolean;
1828
+ };
1679
1829
  /** ----------------------------------------------------------
1680
1830
  * * ***Type guard: `isNonEmptyString`.***
1681
1831
  * ----------------------------------------------------------
@@ -1710,12 +1860,15 @@ trim?:boolean;};
1710
1860
  * isNonEmptyString([]);
1711
1861
  * // ➔ false
1712
1862
  */
1713
- declare const isNonEmptyString:(value:unknown,options?:IsNonEmptyStringOptions)=>value is string;type IsNonEmptyValueOptions={
1714
- /** Whether to check symbol properties when checking empty objects, default: `false`.
1715
- *
1716
- * @default false
1717
- */
1718
- checkSymbols?:boolean;};
1863
+ declare const isNonEmptyString: (value: unknown, options?: IsNonEmptyStringOptions) => value is string;
1864
+
1865
+ type IsNonEmptyValueOptions = {
1866
+ /** Whether to check symbol properties when checking empty objects, default: `false`.
1867
+ *
1868
+ * @default false
1869
+ */
1870
+ checkSymbols?: boolean;
1871
+ };
1719
1872
  /** ----------------------------------------------------------
1720
1873
  * * ***Predicated: `isNonEmptyValue`.***
1721
1874
  * ----------------------------------------------------------
@@ -1777,7 +1930,8 @@ checkSymbols?:boolean;};
1777
1930
  * isNonEmptyValue(() => {});
1778
1931
  * // ➔ true
1779
1932
  */
1780
- declare const isNonEmptyValue:(value:unknown,options?:IsNonEmptyValueOptions)=>boolean;
1933
+ declare const isNonEmptyValue: (value: unknown, options?: IsNonEmptyValueOptions) => boolean;
1934
+
1781
1935
  /** ---------------------------------------------------------
1782
1936
  * * ***Type guard: `isNull`.***
1783
1937
  * ----------------------------------------------------------
@@ -1792,7 +1946,8 @@ declare const isNonEmptyValue:(value:unknown,options?:IsNonEmptyValueOptions)=>b
1792
1946
  * isNull(0); // ➔ false
1793
1947
  * isNull(undefined); // ➔ false
1794
1948
  */
1795
- declare const isNull:(val:unknown)=>val is null;
1949
+ declare const isNull: (val: unknown) => val is null;
1950
+
1796
1951
  /** ----------------------------------------------------
1797
1952
  * * ***Type guard: `isNumberObject`.***
1798
1953
  * ----------------------------------------------------
@@ -1806,7 +1961,9 @@ declare const isNull:(val:unknown)=>val is null;
1806
1961
  * isNumberObject(42);
1807
1962
  * // ➔ false
1808
1963
  */
1809
- declare function isNumberObject(value:unknown):value is Number;type IsObject<T>=unknown extends T?T & Record<PropertyKey,unknown>:T extends object?T extends AnObjectNonArray?T:IsHasKeysObject<T>extends false?T & Record<PropertyKey,unknown>:IsArray<T>extends true?Exclude<T,unknown[]>:T:never;
1964
+ declare function isNumberObject(value: unknown): value is Number;
1965
+
1966
+ type IsObject<T> = unknown extends T ? T & Record<PropertyKey, unknown> : T extends object ? T extends AnObjectNonArray ? T : IsHasKeysObject<T> extends false ? T & Record<PropertyKey, unknown> : IsArray<T> extends true ? Exclude<T, unknown[]> : T : never;
1810
1967
  /** ---------------------------------------------------------
1811
1968
  * * ***Type guard: `isObject`.***
1812
1969
  * ----------------------------------------------------------
@@ -1845,7 +2002,9 @@ declare function isNumberObject(value:unknown):value is Number;type IsObject<T>=
1845
2002
  * isObject(123); // ➔ false
1846
2003
  * isObject(() => {}); // ➔ false
1847
2004
  */
1848
- declare function isObject<T extends object>(value:T):value is IsObject<T>;declare function isObject(value:unknown):value is Record<PropertyKey,unknown>;
2005
+ declare function isObject<T extends object>(value: T): value is IsObject<T>;
2006
+ declare function isObject(value: unknown): value is Record<PropertyKey, unknown>;
2007
+
1849
2008
  /** ----------------------------------------------------------
1850
2009
  * * ***Type guard: `isObjectLoose`.***
1851
2010
  * ----------------------------------------------------------
@@ -1886,7 +2045,13 @@ declare function isObject<T extends object>(value:T):value is IsObject<T>;declar
1886
2045
  * isObjectLoose(undefined);
1887
2046
  * // ➔ false
1888
2047
  */
1889
- declare function isObjectLoose<T=object>(value:unknown):value is T;type IsObjectOrArray<T>=OrArr<[ IsNever<T>,Extends<T,Record<PropertyKey,unknown>>,Extends<unknown,T>]>extends true?T & Record<PropertyKey,unknown>& unknown[]:T extends object?T extends unknown[]?T:T extends AnObjectNonArray?T:IsHasKeysObject<T>extends false?T & Record<PropertyKey,unknown>:T:Extract<T,Record<PropertyKey,unknown>& unknown[]>;
2048
+ declare function isObjectLoose<T = object>(value: unknown): value is T;
2049
+
2050
+ type IsObjectOrArray<T> = OrArr<[
2051
+ IsNever<T>,
2052
+ Extends<T, Record<PropertyKey, unknown>>,
2053
+ Extends<unknown, T>
2054
+ ]> extends true ? T & Record<PropertyKey, unknown> & unknown[] : T extends object ? T extends unknown[] ? T : T extends AnObjectNonArray ? T : IsHasKeysObject<T> extends false ? T & Record<PropertyKey, unknown> : T : Extract<T, Record<PropertyKey, unknown> & unknown[]>;
1890
2055
  /** ---------------------------------------------------------
1891
2056
  * * ***Type guard: `isObjectOrArray`.***
1892
2057
  * ----------------------------------------------------------
@@ -1915,7 +2080,9 @@ declare function isObjectLoose<T=object>(value:unknown):value is T;type IsObject
1915
2080
  * isObjectOrArray(undefined); // ➔ false
1916
2081
  * isObjectOrArray("hello"); // ➔ false
1917
2082
  */
1918
- declare function isObjectOrArray(value:[]):value is [];declare function isObjectOrArray<T>(value:T):value is IsObjectOrArray<T>;
2083
+ declare function isObjectOrArray(value: []): value is [];
2084
+ declare function isObjectOrArray<T>(value: T): value is IsObjectOrArray<T>;
2085
+
1919
2086
  /** ----------------------------------------------------------
1920
2087
  * * ***Type guard: `PropertyKey`.***
1921
2088
  * ----------------------------------------------------------
@@ -1942,7 +2109,8 @@ declare function isObjectOrArray(value:[]):value is [];declare function isObject
1942
2109
  * isPropertyKey(null);
1943
2110
  * // ➔ false
1944
2111
  */
1945
- declare function isPropertyKey(value:unknown):value is PropertyKey;
2112
+ declare function isPropertyKey(value: unknown): value is PropertyKey;
2113
+
1946
2114
  /** ----------------------------------------------------------
1947
2115
  * * ***Type guard: `isRegExp`.***
1948
2116
  * ----------------------------------------------------------
@@ -1954,7 +2122,8 @@ declare function isPropertyKey(value:unknown):value is PropertyKey;
1954
2122
  * isRegExp(new RegExp("abc")); // ➔ true
1955
2123
  * isRegExp("abc"); // ➔ false
1956
2124
  */
1957
- declare const isRegExp:(value:unknown)=>value is RegExp;
2125
+ declare const isRegExp: (value: unknown) => value is RegExp;
2126
+
1958
2127
  /** --------------------------------------------------
1959
2128
  * * ***Type guard: `isSafeInteger`.***
1960
2129
  * --------------------------------------------------
@@ -1979,7 +2148,8 @@ declare const isRegExp:(value:unknown)=>value is RegExp;
1979
2148
  * isSafeInteger('3');
1980
2149
  * // ➔ false
1981
2150
  */
1982
- declare function isSafeInteger(value:unknown):value is number;
2151
+ declare function isSafeInteger(value: unknown): value is number;
2152
+
1983
2153
  /** ---------------------------------------------------------
1984
2154
  * * ***Environment Predicate: `isServer`.***
1985
2155
  * ---------------------------------------------------------
@@ -2001,7 +2171,8 @@ declare function isSafeInteger(value:unknown):value is number;
2001
2171
  * console.log("Running in a browser");
2002
2172
  * }
2003
2173
  */
2004
- declare const isServer:()=>boolean;
2174
+ declare const isServer: () => boolean;
2175
+
2005
2176
  /** ---------------------------------------------------------
2006
2177
  * * ***Type guard: `isSet`.***
2007
2178
  * ----------------------------------------------------------
@@ -2018,7 +2189,9 @@ declare const isServer:()=>boolean;
2018
2189
  * isSet(new WeakSet);
2019
2190
  * // ➔ false
2020
2191
  */
2021
- declare function isSet<T=unknown>(value:Set<T>):value is Set<T>;declare function isSet(value:unknown):value is Set<unknown>;
2192
+ declare function isSet<T = unknown>(value: Set<T>): value is Set<T>;
2193
+ declare function isSet(value: unknown): value is Set<unknown>;
2194
+
2022
2195
  /** ---------------------------------------------------------
2023
2196
  * * ***Type guard: `isString`.***
2024
2197
  * ----------------------------------------------------------
@@ -2040,7 +2213,8 @@ declare function isSet<T=unknown>(value:Set<T>):value is Set<T>;declare function
2040
2213
  * console.log(value.toUpperCase());
2041
2214
  * }
2042
2215
  */
2043
- declare const isString:(value:unknown)=>value is string;
2216
+ declare const isString: (value: unknown) => value is string;
2217
+
2044
2218
  /** ----------------------------------------------------
2045
2219
  * * ***Type guard: `isStringObject`.***
2046
2220
  * ----------------------------------------------------
@@ -2054,7 +2228,8 @@ declare const isString:(value:unknown)=>value is string;
2054
2228
  * isStringObject("hello");
2055
2229
  * // ➔ false
2056
2230
  */
2057
- declare function isStringObject(value:unknown):value is String;
2231
+ declare function isStringObject(value: unknown): value is String;
2232
+
2058
2233
  /** ----------------------------------------------------------
2059
2234
  * * ***Type guard: `isSymbol`.***
2060
2235
  * ----------------------------------------------------------
@@ -2071,7 +2246,8 @@ declare function isStringObject(value:unknown):value is String;
2071
2246
  * isSymbol(123); // ➔ false
2072
2247
  * isSymbol(undefined); // ➔ false
2073
2248
  */
2074
- declare const isSymbol:(value:unknown)=>value is symbol;
2249
+ declare const isSymbol: (value: unknown) => value is symbol;
2250
+
2075
2251
  /** --------------------------------------------------
2076
2252
  * * ***Type guard: `isTypedArray`.***
2077
2253
  * ----------------------------------------------------------
@@ -2091,7 +2267,8 @@ declare const isSymbol:(value:unknown)=>value is symbol;
2091
2267
  * isTypedArray([]); // ➔ false
2092
2268
  * isTypedArray(Buffer.from("hi")); // ➔ false
2093
2269
  */
2094
- declare function isTypedArray(value:unknown):value is TypedArray;
2270
+ declare function isTypedArray(value: unknown): value is TypedArray;
2271
+
2095
2272
  /** ---------------------------------------------------------
2096
2273
  * * ***Type guard: `isURL`.***
2097
2274
  * ----------------------------------------------------------
@@ -2108,7 +2285,8 @@ declare function isTypedArray(value:unknown):value is TypedArray;
2108
2285
  * isURL("https://example.com");
2109
2286
  * // ➔ false
2110
2287
  */
2111
- declare const isURL:(value:unknown)=>value is URL;
2288
+ declare const isURL: (value: unknown) => value is URL;
2289
+
2112
2290
  /** ---------------------------------------------------------
2113
2291
  * * ***Type guard: `isUndefined`.***
2114
2292
  * ----------------------------------------------------------
@@ -2127,78 +2305,80 @@ declare const isURL:(value:unknown)=>value is URL;
2127
2305
  * isUndefined(null); // ➔ false
2128
2306
  * isUndefined("abc"); // ➔ false
2129
2307
  */
2130
- declare const isUndefined:(value:unknown)=>value is undefined;
2308
+ declare const isUndefined: (value: unknown) => value is undefined;
2309
+
2131
2310
  /** ---------------------------------------------------------
2132
2311
  * * ***Options for `isValidDomain` predicate.***
2133
2312
  * ---------------------------------------------------------
2134
2313
  * **Customize the behavior of domain validation.**
2135
2314
  */
2136
- type IsValidDomainOptions={
2137
- /** * ***Enable conversion of Unicode domains (IDN) to ASCII (punycode).***
2138
- *
2139
- * - Example: `"пример.рф"` ➔ `"xn--e1afmkfd.xn--p1ai"`
2140
- * - Allows validating Unicode domains correctly.
2141
- * - Default: `false`
2142
- *
2143
- * @defaultValue `false`.
2144
- */
2145
- allowUnicode?:boolean;
2146
- /** * ***If `true`, validates **only top-level domains (TLDs)** that are not part of any SLD/second-level domain.***
2147
- *
2148
- * - Accepts country-code TLDs like `"ai"` or `"ai."` ✅
2149
- * - Rejects common TLDs that are part of SLDs like `"com"` ❌
2150
- * - Only the final label is checked; subdomains are ignored.
2151
- * - Default: `false`
2152
- *
2153
- * @defaultValue `false`.
2154
- */
2155
- topLevel?:boolean;
2156
- /** * ***Allow or disallow subdomains.***
2157
- *
2158
- * - Example: `"sub.example.com"` ✅ if `subdomain` is `true`, ❌ if `false`
2159
- * - Wildcards and SLDs are considered when evaluating subdomains.
2160
- * - Default: `true`
2161
- *
2162
- * @defaultValue `true`.
2163
- */
2164
- subdomain?:boolean;
2165
- /** * ***Allow a wildcard `*` in the left-most label.***
2166
- *
2167
- * - Example: `"*.example.com"` ✅ if `wildcard` is `true`, ❌ if `false`
2168
- * - Wildcards are only valid in the first label and require at least one additional label.
2169
- * - Default: `false`
2170
- *
2171
- * @defaultValue `false`.
2172
- */
2173
- wildcard?:boolean;
2174
- /** * ***Allow a port after the domain.***
2175
- *
2176
- * - Example: `"localhost:3000"` or `"example.com:8080"` ✅ if `allowPort` is `true`
2177
- * - Validates that the port is a number between `1` and `65535`.
2178
- * - Does not affect domain validation rules otherwise.
2179
- * - Default: `false`
2180
- *
2181
- * @defaultValue `false`.
2182
- */
2183
- allowPort?:boolean;
2184
- /** * ***Allow special domains like `localhost`.***
2185
- *
2186
- * - Example: `"localhost"` ✅ if `allowLocalhost` is `true`
2187
- * - Works with or without a port if `allowPort` is enabled.
2188
- * - Default: `false`
2189
- *
2190
- * @defaultValue `false`.
2191
- */
2192
- allowLocalhost?:boolean;
2193
- /** * ***Allow URLs with protocol (`http`/`https`) and automatically extract the hostname.***
2194
- *
2195
- * - Example: `"https://example.com/foo/bar"` ➔ `"example.com"`
2196
- * - The function will validate only the hostname part and ignore the path, query, and fragment.
2197
- * - Default: `false`
2198
- *
2199
- * @defaultValue `false`.
2200
- */
2201
- allowProtocol?:boolean;};
2315
+ type IsValidDomainOptions = {
2316
+ /** * ***Enable conversion of Unicode domains (IDN) to ASCII (punycode).***
2317
+ *
2318
+ * - Example: `"пример.рф"` ➔ `"xn--e1afmkfd.xn--p1ai"`
2319
+ * - Allows validating Unicode domains correctly.
2320
+ * - Default: `false`
2321
+ *
2322
+ * @defaultValue `false`.
2323
+ */
2324
+ allowUnicode?: boolean;
2325
+ /** * ***If `true`, validates **only top-level domains (TLDs)** that are not part of any SLD/second-level domain.***
2326
+ *
2327
+ * - Accepts country-code TLDs like `"ai"` or `"ai."` ✅
2328
+ * - Rejects common TLDs that are part of SLDs like `"com"` ❌
2329
+ * - Only the final label is checked; subdomains are ignored.
2330
+ * - Default: `false`
2331
+ *
2332
+ * @defaultValue `false`.
2333
+ */
2334
+ topLevel?: boolean;
2335
+ /** * ***Allow or disallow subdomains.***
2336
+ *
2337
+ * - Example: `"sub.example.com"` ✅ if `subdomain` is `true`, ❌ if `false`
2338
+ * - Wildcards and SLDs are considered when evaluating subdomains.
2339
+ * - Default: `true`
2340
+ *
2341
+ * @defaultValue `true`.
2342
+ */
2343
+ subdomain?: boolean;
2344
+ /** * ***Allow a wildcard `*` in the left-most label.***
2345
+ *
2346
+ * - Example: `"*.example.com"` ✅ if `wildcard` is `true`, ❌ if `false`
2347
+ * - Wildcards are only valid in the first label and require at least one additional label.
2348
+ * - Default: `false`
2349
+ *
2350
+ * @defaultValue `false`.
2351
+ */
2352
+ wildcard?: boolean;
2353
+ /** * ***Allow a port after the domain.***
2354
+ *
2355
+ * - Example: `"localhost:3000"` or `"example.com:8080"` ✅ if `allowPort` is `true`
2356
+ * - Validates that the port is a number between `1` and `65535`.
2357
+ * - Does not affect domain validation rules otherwise.
2358
+ * - Default: `false`
2359
+ *
2360
+ * @defaultValue `false`.
2361
+ */
2362
+ allowPort?: boolean;
2363
+ /** * ***Allow special domains like `localhost`.***
2364
+ *
2365
+ * - Example: `"localhost"` ✅ if `allowLocalhost` is `true`
2366
+ * - Works with or without a port if `allowPort` is enabled.
2367
+ * - Default: `false`
2368
+ *
2369
+ * @defaultValue `false`.
2370
+ */
2371
+ allowLocalhost?: boolean;
2372
+ /** * ***Allow URLs with protocol (`http`/`https`) and automatically extract the hostname.***
2373
+ *
2374
+ * - Example: `"https://example.com/foo/bar"` ➔ `"example.com"`
2375
+ * - The function will validate only the hostname part and ignore the path, query, and fragment.
2376
+ * - Default: `false`
2377
+ *
2378
+ * @defaultValue `false`.
2379
+ */
2380
+ allowProtocol?: boolean;
2381
+ };
2202
2382
  /** ---------------------------------------------------------
2203
2383
  * * ***Predicate: `isValidDomain`.***
2204
2384
  * ---------------------------------------------------------
@@ -2257,7 +2437,8 @@ allowProtocol?:boolean;};
2257
2437
  * isValidDomain("invalid_domain.com");
2258
2438
  * // ➔ false
2259
2439
  */
2260
- declare function isValidDomain(value:unknown,options?:IsValidDomainOptions):boolean;
2440
+ declare function isValidDomain(value: unknown, options?: IsValidDomainOptions): boolean;
2441
+
2261
2442
  /** ---------------------------------------------------------
2262
2443
  * * ***Predicate: `isValidURL`.***
2263
2444
  * ---------------------------------------------------------
@@ -2278,7 +2459,8 @@ declare function isValidDomain(value:unknown,options?:IsValidDomainOptions):bool
2278
2459
  * isValidURL("not-a-url");
2279
2460
  * // ➔ false
2280
2461
  */
2281
- declare const isValidURL:(url:unknown)=>boolean;
2462
+ declare const isValidURL: (url: unknown) => boolean;
2463
+
2282
2464
  /** --------------------------------------------------
2283
2465
  * * ***Type guard: `isWeakMap`.***
2284
2466
  * ----------------------------------------------------------
@@ -2296,4 +2478,6 @@ declare const isValidURL:(url:unknown)=>boolean;
2296
2478
  * isWeakMap(new Map);
2297
2479
  * // ➔ false
2298
2480
  */
2299
- declare function isWeakMap<K extends object=object,V=unknown>(value:unknown):value is WeakMap<K,V>;export{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,isServer,isSet,isString,isStringObject,isSymbol,isTypedArray,isURL,isUndefined,isValidDomain,isValidURL,isWeakMap,textContainsAll,textContainsAny};
2481
+ declare function isWeakMap<K extends object = object, V = unknown>(value: unknown): value is WeakMap<K, V>;
2482
+
2483
+ export { 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, isServer, isSet, isString, isStringObject, isSymbol, isTypedArray, isURL, isUndefined, isValidDomain, isValidURL, isWeakMap, textContainsAll, textContainsAny };