@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.1-beta.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 (164) hide show
  1. package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +23 -23
  2. package/dist/any-BmdI8UbK.d.ts +56 -56
  3. package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +66 -66
  4. package/dist/assertions/index.cjs +1 -1
  5. package/dist/assertions/index.d.ts +398 -418
  6. package/dist/assertions/index.js +1 -1
  7. package/dist/chunk-26W3VZIK.cjs +1 -0
  8. package/dist/chunk-2KRCHXFG.cjs +2 -0
  9. package/dist/chunk-33ZLH266.js +1 -0
  10. package/dist/{chunk-EXZ47NOW.js → chunk-4L4EJTNZ.js} +1 -1
  11. package/dist/chunk-5Q37AP7P.js +1 -0
  12. package/dist/chunk-7CHFAMS2.js +1 -0
  13. package/dist/chunk-7MMJZ6HS.js +1 -0
  14. package/dist/chunk-7TC6DE3J.cjs +1 -0
  15. package/dist/{chunk-XH6MCRLP.js → chunk-7VX33E3V.js} +1 -1
  16. package/dist/chunk-BEZPD44N.cjs +1 -0
  17. package/dist/chunk-BI263OHW.js +1 -0
  18. package/dist/chunk-CII6WWLO.cjs +1 -0
  19. package/dist/chunk-D5TYPCWU.cjs +1 -0
  20. package/dist/chunk-EEQY5QUG.js +1 -0
  21. package/dist/chunk-ESJYBIYH.js +1 -0
  22. package/dist/chunk-EWYPSKKM.js +1 -0
  23. package/dist/chunk-EXCOQLWX.cjs +1 -0
  24. package/dist/chunk-FWQVTMYA.cjs +1 -0
  25. package/dist/chunk-G4EWCRKS.js +1 -0
  26. package/dist/chunk-G7R5XZRM.cjs +1 -0
  27. package/dist/chunk-GGEV7LXX.cjs +1 -0
  28. package/dist/chunk-HJOZOENU.cjs +1 -0
  29. package/dist/{chunk-BYZAD3XN.cjs → chunk-IRDZVLNZ.cjs} +1 -1
  30. package/dist/chunk-IW73G523.cjs +1 -0
  31. package/dist/chunk-IY5OZAB3.cjs +1 -0
  32. package/dist/chunk-J4NCYYGS.js +1 -0
  33. package/dist/chunk-J7JAZAJD.js +1 -0
  34. package/dist/{chunk-FF76ISQ2.js → chunk-JYNSO7ZY.js} +1 -1
  35. package/dist/chunk-K3UVKYEU.js +1 -0
  36. package/dist/chunk-LQ76EDZG.js +1 -0
  37. package/dist/chunk-MROH35V3.cjs +1 -0
  38. package/dist/chunk-NJSAV73S.js +1 -0
  39. package/dist/chunk-NR44SNYE.js +1 -0
  40. package/dist/chunk-NXMTWY77.js +1 -0
  41. package/dist/chunk-OZCQZO2V.cjs +4 -0
  42. package/dist/chunk-Q3NTKN5I.cjs +1 -0
  43. package/dist/chunk-QDNSC57Z.js +4 -0
  44. package/dist/chunk-QGXTL5ZH.js +2 -0
  45. package/dist/{chunk-JWHM3WZQ.cjs → chunk-QSQDP7L2.cjs} +1 -1
  46. package/dist/{chunk-RN3TP3S3.js → chunk-S5M33A4O.js} +1 -1
  47. package/dist/chunk-SGTHOQQ2.js +1 -0
  48. package/dist/chunk-SL3RQOWA.js +1 -0
  49. package/dist/chunk-SZPWZZYG.cjs +1 -0
  50. package/dist/chunk-UA4B7JBO.cjs +1 -0
  51. package/dist/chunk-UQDJF5RR.cjs +1 -0
  52. package/dist/chunk-UTQUYABU.cjs +1 -0
  53. package/dist/chunk-VPW3DRV5.js +1 -0
  54. package/dist/chunk-W32WALNU.js +1 -0
  55. package/dist/chunk-XGZ6K753.cjs +1 -0
  56. package/dist/chunk-YFTR64N5.cjs +1 -0
  57. package/dist/chunk-ZFDS7W6B.cjs +1 -0
  58. package/dist/chunk-ZQOLZE6Z.cjs +1 -0
  59. package/dist/conversions/index.cjs +1 -1
  60. package/dist/conversions/index.d.ts +1307 -1504
  61. package/dist/conversions/index.js +1 -1
  62. package/dist/env/index.d.ts +14 -17
  63. package/dist/events/index.cjs +1 -1
  64. package/dist/events/index.d.ts +111 -108
  65. package/dist/events/index.js +1 -1
  66. package/dist/extends-Bk_SBGdT.d.ts +367 -0
  67. package/dist/formatting/index.cjs +1 -1
  68. package/dist/formatting/index.d.ts +878 -840
  69. package/dist/formatting/index.js +1 -1
  70. package/dist/generator/index.cjs +1 -1
  71. package/dist/generator/index.d.ts +173 -150
  72. package/dist/generator/index.js +1 -1
  73. package/dist/if-CvT4R7Kh.d.ts +16 -16
  74. package/dist/index.cjs +1 -1
  75. package/dist/index.d.ts +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/is-array--YjXV-Wx.d.ts +1207 -0
  78. package/dist/isPlainObject-BVhBAPHX.d.ts +169 -0
  79. package/dist/never-BfayMBF9.d.ts +64 -64
  80. package/dist/next/index.cjs +6 -6
  81. package/dist/next/index.d.ts +196 -176
  82. package/dist/next/index.js +5 -5
  83. package/dist/next/server/index.cjs +1 -1
  84. package/dist/next/server/index.d.ts +26 -40
  85. package/dist/next/server/index.js +1 -1
  86. package/dist/nils-DMz3kU7M.d.ts +155 -155
  87. package/dist/omit-VvmIsZmX.d.ts +25 -25
  88. package/dist/operations/index.cjs +1 -1
  89. package/dist/operations/index.d.ts +121 -176
  90. package/dist/operations/index.js +1 -1
  91. package/dist/parsers/index.cjs +1 -1
  92. package/dist/parsers/index.d.ts +35 -36
  93. package/dist/parsers/index.js +1 -1
  94. package/dist/predicates/index.cjs +1 -1
  95. package/dist/predicates/index.d.ts +1701 -1675
  96. package/dist/predicates/index.js +1 -1
  97. package/dist/prettify-C4xLcYOP.d.ts +328 -328
  98. package/dist/promise/index.cjs +1 -1
  99. package/dist/promise/index.d.ts +29 -38
  100. package/dist/promise/index.js +1 -1
  101. package/dist/rzl-utils.global.js +3 -3
  102. package/dist/string-XA-til3C.d.ts +351 -0
  103. package/dist/strings/index.cjs +1 -1
  104. package/dist/strings/index.d.ts +712 -787
  105. package/dist/strings/index.js +1 -1
  106. package/dist/stylings/index.cjs +1 -1
  107. package/dist/stylings/index.d.ts +37 -45
  108. package/dist/stylings/index.js +1 -1
  109. package/dist/type-data-DDs-u2kq.d.ts +241 -241
  110. package/dist/types/index.d.ts +3266 -3266
  111. package/dist/urls/index.cjs +1 -1
  112. package/dist/urls/index.d.ts +384 -409
  113. package/dist/urls/index.js +1 -1
  114. package/package.json +53 -11
  115. package/dist/array-CIZRbqTF.d.ts +0 -223
  116. package/dist/chunk-2TRAPBZ7.cjs +0 -1
  117. package/dist/chunk-3D74QO5D.cjs +0 -1
  118. package/dist/chunk-4DK3RCC4.js +0 -2
  119. package/dist/chunk-4JOQ45HL.js +0 -1
  120. package/dist/chunk-55CZALRS.js +0 -1
  121. package/dist/chunk-5JFV3GDE.cjs +0 -4
  122. package/dist/chunk-62HX5Z45.cjs +0 -1
  123. package/dist/chunk-7NA6DUHR.cjs +0 -2
  124. package/dist/chunk-BVPMMWDL.cjs +0 -1
  125. package/dist/chunk-CEFYHEM4.cjs +0 -1
  126. package/dist/chunk-CN53M4QZ.cjs +0 -1
  127. package/dist/chunk-D47MHBSD.cjs +0 -1
  128. package/dist/chunk-DGH75GJD.js +0 -1
  129. package/dist/chunk-E5NUI7PN.js +0 -1
  130. package/dist/chunk-FDITZ5C6.cjs +0 -1
  131. package/dist/chunk-FSSV24W7.cjs +0 -1
  132. package/dist/chunk-GCGU2WB7.js +0 -1
  133. package/dist/chunk-GECI2YBP.js +0 -1
  134. package/dist/chunk-GQE4OVHC.cjs +0 -1
  135. package/dist/chunk-GRVZXQXL.cjs +0 -1
  136. package/dist/chunk-I4AVNHPA.cjs +0 -1
  137. package/dist/chunk-JFRL7NKU.js +0 -4
  138. package/dist/chunk-KCQDDZJE.cjs +0 -1
  139. package/dist/chunk-L54ZPSYJ.js +0 -1
  140. package/dist/chunk-LVKAYEZ4.js +0 -1
  141. package/dist/chunk-MBDWTK54.cjs +0 -1
  142. package/dist/chunk-MNGGDB2G.js +0 -1
  143. package/dist/chunk-MY7BA4GI.cjs +0 -1
  144. package/dist/chunk-N2IJPIND.cjs +0 -1
  145. package/dist/chunk-NIMNTEGV.js +0 -1
  146. package/dist/chunk-PVJF2JHM.js +0 -1
  147. package/dist/chunk-QCFXEUKL.js +0 -1
  148. package/dist/chunk-QFCGBBSY.js +0 -1
  149. package/dist/chunk-QQYAUPSK.cjs +0 -1
  150. package/dist/chunk-TC4VBE4Y.cjs +0 -1
  151. package/dist/chunk-TUXDINHF.cjs +0 -1
  152. package/dist/chunk-U5Y2FXMN.cjs +0 -1
  153. package/dist/chunk-UUPQI6ND.cjs +0 -1
  154. package/dist/chunk-VYCGZ2S6.js +0 -1
  155. package/dist/chunk-W5EDKJK3.js +0 -1
  156. package/dist/chunk-WHAVUFEU.js +0 -1
  157. package/dist/chunk-XCFIOTCV.js +0 -1
  158. package/dist/chunk-XE27XPJR.js +0 -1
  159. package/dist/chunk-XVB3ZZEB.js +0 -1
  160. package/dist/chunk-ZBSIGJFO.cjs +0 -1
  161. package/dist/chunk-ZYAML74V.js +0 -1
  162. package/dist/extends-Mp81Hq9-.d.ts +0 -145
  163. package/dist/is-array-Ckm_47hw.d.ts +0 -1557
  164. package/dist/isPlainObject-BKYaI6a8.d.ts +0 -182
@@ -1,182 +0,0 @@
1
- import{N as NonPlainObject}from'./type-data-DDs-u2kq.js';type GetPreciseTypeOptions={
2
- /** -------------------------------------------------------
3
- * * ***Specifies the format in which the returned string type should be transformed.***
4
- * -------------------------------------------------------
5
- *
6
- * ℹ️ For special string literals in `SPECIAL_CASES` (`"-Infinity" | "Infinity" | "NaN"`), which will remain unchanged.
7
- * @default "toLowerCase"
8
- *
9
- * @description
10
- * Supported formats:
11
- * - `"toLowerCase"` (default) — converts all letters to lowercase.
12
- * - ➔ `"result example type"`
13
- * - `"toDotCase"` — words separated by dots.
14
- * - ➔ `"result.example.type"`
15
- * - `"toCamelCase"` — first word lowercase, subsequent words capitalized.
16
- * - ➔ `"resultExampleType"`
17
- * - `"toKebabCase"` — words separated by hyphens.
18
- * - ➔ `"result-example-type"`
19
- * - `"toSnakeCase"` — words separated by underscores.
20
- * - ➔ `"result_example_type"`
21
- * - `"toPascalCase"` — all words capitalized, no spaces.
22
- * - ➔ `"ResultExampleType"`
23
- * - `"toPascalCaseSpace"` — all words capitalized with spaces between words.
24
- * - ➔ `"Result Example Type"`
25
- * - `"slugify"` — URL-friendly slug (lowercase with hyphens).
26
- * - ➔ `"result-example-type"`
27
- *
28
- * @note
29
- * ⚠️ If an invalid value is provided, the function will automatically fallback to the default `"toLowerCase"`.
30
- */
31
- formatCase?:"toPascalCaseSpace"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSnakeCase"|"toDotCase"|"slugify"|"toLowerCase";};
32
- /** ----------------------------------------------------------
33
- * * ***Returns a detailed and normalized type string for the given value.***
34
- * ----------------------------------------------------------
35
- *
36
- * The returned string is human-readable _**toLowerCase**_ with spaces _***(by default)***_ or
37
- * formatted according to the `options.formatCase` setting.
38
- *
39
- * Handles:
40
- * - Primitives (`string`, `number`, `boolean`, `null`, `undefined`, `symbol`, `bigint`)
41
- * - Built-in objects (`Array`, `Map`, `Set`, `Error subclasses`, `Typed Arrays`, etc)
42
- * - Objects created with `Object.create(null)`
43
- * - Generator instances
44
- * - Node.js `Buffer` instances
45
- * - Proxy detection (returns `"Proxy"` if detected; detection is not 100% accurate)
46
- * - Uses cached mapping table (`FIXES`) for known types to provide consistent naming
47
- * - Falls back to constructor name or `Object.prototype.toString` tag
48
- *
49
- * @param {*} value - The value to detect the precise type of
50
- * @param {Object} [options] - Optional configuration
51
- * @param {"toPascalCaseSpace"|"toLowerCase"|"toPascalCase"|"toCamelCase"|"toKebabCase"|"toSnakeCase"|"toDotCase"|"slugify"} [options.formatCase="toLowerCase"]
52
- * - Specifies how the returned type string should be formatted.
53
- * - ⚠️ Special string literals in `SPECIAL_CASES` (`"-Infinity" | "Infinity" | "NaN"`)
54
- * will remain unchanged even if a different `formatCase` is applied.
55
- *
56
- * @returns {string} The normalized and formatted type string
57
- *
58
- * @example
59
- * getPreciseType(123); // ➔ "number"
60
- * getPreciseType(null); // ➔ "null"
61
- * getPreciseType(/regex/,{ formatCase: "toKebabCase" });
62
- * // ➔ "reg-exp"
63
- * getPreciseType(function* () {}, { formatCase: "toCamelCase" });
64
- * // ➔ "generatorFunction"
65
- * getPreciseType(async function () {}, { formatCase: "toPascalCaseSpace" });
66
- * // ➔ "Async Function"
67
- * getPreciseType("NaN", { formatCase: "toKebabCase" });
68
- * // ➔ "NaN" (SPECIAL_CASES remain)
69
- */
70
- declare const getPreciseType:(value:unknown,options?:GetPreciseTypeOptions)=>string;type IsNumberOptions={
71
- /**
72
- * If set to `true`, `NaN` will be considered a valid number.
73
- * @default false
74
- */
75
- includeNaN?:boolean;};
76
- /** ---------------------------------------------------------
77
- * * ***Type guard: `isNumber`.***
78
- * ----------------------------------------------------------
79
- * @description Checks if a value is of type **`number`**.
80
- *
81
- * - Uses `typeof value === "number"`.
82
- * - By default, excludes **`NaN`**.
83
- * - If `options.includeNaN` is `true`, then **`NaN`** is also considered valid.
84
- * - Still considers `Infinity` and `-Infinity` as numbers (consistent with JavaScript).
85
- *
86
- * ℹ️ To exclude `Infinity` and `-Infinity`, use **{@link isFinite}** instead.
87
- *
88
- * @param {*} value - The value to check.
89
- * @param {IsNumberOptions} options - Optional settings.
90
- * @param {boolean} options.includeNaN If `true`, `NaN` will be considered a valid number, dsefaults to `false`, which excludes `NaN`.
91
- * @returns {boolean} Returns `true` if the value is a number (and depending on `includeNaN`, `NaN` is included or excluded).
92
- *
93
- * @example
94
- * isNumber(42);
95
- * // ➔ true
96
- * isNumber(Infinity);
97
- * // ➔ true
98
- * isNumber(-Infinity);
99
- * // ➔ true
100
- * isNumber(NaN);
101
- * // ➔ false (default)
102
- * isNumber(NaN, { includeNaN: true });
103
- * // ➔ true
104
- * isNumber("42");
105
- * // ➔ false
106
- */
107
- declare const isNumber:(value:unknown,options?:IsNumberOptions)=>value is number;type HasKeys<T>=keyof T extends never?false:true;
108
- /** ----------------------------------------------------------
109
- * * ***Utility type: `IsPlainObjectResult`.***
110
- * ----------------------------------------------------------
111
- * @description
112
- * Represents the inferred type after asserting a value is a **plain object**.
113
- *
114
-
115
- *
116
- * - If `T` is `unknown`, the resulting type is `Record<PropertyKey, unknown> & T`.
117
- * - If `T` is an object:
118
- * - If it is a non-plain object (class instance, built-in object, etc.), the result is `never`.
119
- * - If it has no keys (`HasKeys<T>` checked by **{@link HasKeys}** is false), the result is `Record<PropertyKey, unknown> & T`.
120
- * - Otherwise, the result is `T` itself.
121
- * - For any other types, the result is `never`.
122
- *
123
- * @template T - The input type to be asserted as a plain object.
124
- * @example
125
- * ```ts
126
- * type A = IsPlainObjectResult<unknown>;
127
- * // ➔ Record<PropertyKey, unknown> & unknown
128
- * type B = IsPlainObjectResult<{}>;
129
- * // ➔ Record<PropertyKey, unknown> & {}
130
- * type C = IsPlainObjectResult<{ foo: string }>;
131
- * // ➔ { foo: string }
132
- * type D = IsPlainObjectResult<Date>;
133
- * // ➔ never
134
- * ```
135
- */
136
- type IsPlainObjectResult<T>=unknown extends T?Record<PropertyKey,unknown>& T:T extends object?T extends NonPlainObject?never:HasKeys<T>extends false?Record<PropertyKey,unknown>& T:T:Extract<T,Record<PropertyKey,unknown>>;
137
- /** ----------------------------------------------------------
138
- * * ***Type guard: `isPlainObject`.***
139
- * ----------------------------------------------------------
140
- * @description
141
- * Checks if a value is a **plain-object**.
142
- *
143
- * A plain object is:
144
- * - Created by the `Object` constructor, or
145
- * - Has a `[[Prototype]]` of `null` (e.g. `Object.create(null)`).
146
- * ----------------------------------------------------------
147
- * - ✅ Returns `true` for:
148
- * - Empty object literals: `{}`
149
- * - Objects with null prototype: `Object.create(null)`
150
- * ----------------------------------------------------------
151
- * - ❌ Returns `false` for:
152
- * - Arrays (`[]`, `new Array()`)
153
- * - Functions (regular, arrow, or class constructors)
154
- * - Built-in objects: `Date`, `RegExp`, `Error`, `Map`, `Set`, `WeakMap`, `WeakSet`
155
- * - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`
156
- * - `null` or `undefined`
157
- * - Symbols
158
- * - Class instances
159
- *
160
- * @template T - The type of the value being checked.
161
- * @param {*} value - The value to check.
162
- * @returns {boolean} Return `true` if `value` is a `plain-object`, otherwise `false`.
163
- *
164
- * @example
165
- * isPlainObject({});
166
- * // ➔ true
167
- * isPlainObject(Object.create(null));
168
- * // ➔ true
169
- * isPlainObject(null);
170
- * // ➔ false
171
- * isPlainObject(() => {});
172
- * // ➔ false
173
- * isPlainObject([1, 2, 3]);
174
- * // ➔ false
175
- * isPlainObject(new Date());
176
- * // ➔ false
177
- * isPlainObject(new MyClass());
178
- * // ➔ false
179
- * isPlainObject(new String("x"));
180
- * // ➔ false
181
- */
182
- declare function isPlainObject<T>(value:T):value is IsPlainObjectResult<T>;declare function isPlainObject<T>(value:T):value is NonNullable<Extract<T,Record<PropertyKey,unknown>>>;export{type GetPreciseTypeOptions as G,type IsNumberOptions as I,type IsPlainObjectResult as a,isPlainObject as b,getPreciseType as g,isNumber as i};