@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -27
- package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +23 -23
- package/dist/any-BmdI8UbK.d.ts +56 -56
- package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +66 -66
- package/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +398 -418
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-26XIKDJI.cjs +1 -0
- package/dist/chunk-2NWHDDM5.js +1 -0
- package/dist/chunk-2UIRWYE3.js +1 -0
- package/dist/chunk-3KBHD3BS.cjs +1 -0
- package/dist/chunk-4HD2O5A4.js +1 -0
- package/dist/chunk-5C2SMIGX.cjs +1 -0
- package/dist/chunk-5I2B5DOG.js +1 -0
- package/dist/chunk-6HQDHIOD.js +1 -0
- package/dist/chunk-735HJXBT.cjs +1 -0
- package/dist/chunk-7BXIZM57.cjs +1 -0
- package/dist/chunk-7KJBDGEP.js +1 -0
- package/dist/chunk-7U44T63D.cjs +1 -0
- package/dist/chunk-AJ65QFV2.js +1 -0
- package/dist/chunk-APHDUCVQ.js +1 -0
- package/dist/chunk-BSVZRN7C.js +1 -0
- package/dist/chunk-C6JFHUR2.cjs +1 -0
- package/dist/chunk-CPLBRGST.js +1 -0
- package/dist/chunk-CTBRLEOG.js +1 -0
- package/dist/chunk-DUK2K4FB.js +1 -0
- package/dist/chunk-DVMHRLKP.cjs +1 -0
- package/dist/chunk-E63WVPZE.cjs +1 -0
- package/dist/chunk-EBMHQW7X.cjs +1 -0
- package/dist/chunk-EGNZCW4K.js +1 -0
- package/dist/chunk-FEKDB32T.js +1 -0
- package/dist/chunk-FIAAX3UE.js +1 -0
- package/dist/chunk-FUS3DVLB.cjs +1 -0
- package/dist/chunk-GGRMHIFJ.cjs +1 -0
- package/dist/chunk-HQ5GQTEE.js +1 -0
- package/dist/chunk-I5X5IN4H.js +1 -0
- package/dist/chunk-I7YGXQPI.cjs +1 -0
- package/dist/chunk-INUFZJLX.cjs +1 -0
- package/dist/chunk-IREHUBF7.js +1 -0
- package/dist/chunk-J2RGTPGK.cjs +1 -0
- package/dist/chunk-KHO2SBNA.cjs +1 -0
- package/dist/chunk-KXIXXSWX.cjs +1 -0
- package/dist/chunk-LBMEEJWA.js +1 -0
- package/dist/chunk-MC3LXMCQ.js +1 -0
- package/dist/chunk-MMSYCIJ2.cjs +1 -1
- package/dist/chunk-NU3N4WHD.cjs +1 -0
- package/dist/chunk-ODZQXH7E.cjs +1 -0
- package/dist/chunk-ONZFBJVW.js +1 -0
- package/dist/chunk-PXDRHFIE.js +1 -0
- package/dist/chunk-Q6NHYWVX.js +1 -0
- package/dist/chunk-QNKGP5DY.js +1 -0
- package/dist/chunk-S6Z6I2EG.cjs +1 -0
- package/dist/chunk-SMADKXZE.js +1 -0
- package/dist/chunk-TSLYDPBJ.js +1 -0
- package/dist/chunk-TVXADXCC.cjs +1 -0
- package/dist/chunk-UDA26MCU.cjs +1 -0
- package/dist/chunk-UET567YM.cjs +1 -0
- package/dist/chunk-VEYMQ3UA.js +1 -0
- package/dist/chunk-W2W3L2M5.js +1 -0
- package/dist/chunk-WBWTXKMC.cjs +1 -0
- package/dist/chunk-WVSPXFTY.js +1 -0
- package/dist/chunk-XC2PYCT4.cjs +1 -0
- package/dist/chunk-XIXA5KDF.cjs +1 -0
- package/dist/chunk-Y4O5KZF6.cjs +1 -0
- package/dist/chunk-YRM7IJLX.js +1 -0
- package/dist/chunk-YT3MSZKK.cjs +1 -0
- package/dist/chunk-YXHCULSO.cjs +1 -0
- package/dist/chunk-YZR5OGJA.cjs +1 -0
- package/dist/chunk-Z4DXK7A6.cjs +1 -0
- package/dist/chunk-ZXIWDFEQ.js +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +1368 -1515
- package/dist/conversions/index.js +1 -1
- package/dist/env/index.cjs +1 -1
- package/dist/env/index.d.ts +14 -17
- package/dist/env/index.js +1 -1
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +111 -108
- package/dist/events/index.js +1 -1
- package/dist/extends-Bk_SBGdT.d.ts +367 -0
- package/dist/formatting/index.cjs +1 -1
- package/dist/formatting/index.d.ts +878 -840
- package/dist/formatting/index.js +1 -1
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.ts +173 -150
- package/dist/generator/index.js +1 -1
- package/dist/if-CvT4R7Kh.d.ts +16 -16
- package/dist/is-array-Cymwrsmm.d.ts +1119 -0
- package/dist/isPlainObject-BVhBAPHX.d.ts +169 -0
- package/dist/never-BfayMBF9.d.ts +64 -64
- package/dist/next/index.cjs +1 -8
- package/dist/next/index.d.ts +196 -176
- package/dist/next/index.js +1 -8
- package/dist/next/server/index.cjs +1 -2
- package/dist/next/server/index.d.ts +26 -40
- package/dist/next/server/index.js +1 -2
- package/dist/nils-DMz3kU7M.d.ts +155 -155
- package/dist/omit-VvmIsZmX.d.ts +25 -25
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +121 -176
- package/dist/operations/index.js +1 -1
- package/dist/or-DyZCRvaU.d.ts +89 -0
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +35 -36
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +1797 -1677
- package/dist/predicates/index.js +1 -1
- package/dist/prettify-C4xLcYOP.d.ts +328 -328
- package/dist/promise/index.cjs +1 -1
- package/dist/promise/index.d.ts +29 -38
- package/dist/promise/index.js +1 -1
- package/dist/rzl-utils.global.js +1 -4
- package/dist/string-XA-til3C.d.ts +351 -0
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +712 -787
- package/dist/strings/index.js +1 -1
- package/dist/tailwind/index.cjs +1 -0
- package/dist/tailwind/index.d.ts +565 -0
- package/dist/tailwind/index.js +1 -0
- package/dist/type-data-DDs-u2kq.d.ts +241 -241
- package/dist/types/index.d.ts +3266 -3266
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +384 -409
- package/dist/urls/index.js +1 -1
- package/package.json +61 -18
- package/dist/array-CIZRbqTF.d.ts +0 -223
- package/dist/chunk-2TRAPBZ7.cjs +0 -1
- package/dist/chunk-3D74QO5D.cjs +0 -1
- package/dist/chunk-4DK3RCC4.js +0 -2
- package/dist/chunk-4JOQ45HL.js +0 -1
- package/dist/chunk-55CZALRS.js +0 -1
- package/dist/chunk-56QBKKRE.js +0 -1
- package/dist/chunk-5JFV3GDE.cjs +0 -4
- package/dist/chunk-5SZUSNGZ.js +0 -1
- package/dist/chunk-62HX5Z45.cjs +0 -1
- package/dist/chunk-7NA6DUHR.cjs +0 -2
- package/dist/chunk-7YWAQOA4.cjs +0 -1
- package/dist/chunk-BVPMMWDL.cjs +0 -1
- package/dist/chunk-BYZAD3XN.cjs +0 -1
- package/dist/chunk-CEFYHEM4.cjs +0 -1
- package/dist/chunk-CN53M4QZ.cjs +0 -1
- package/dist/chunk-D47MHBSD.cjs +0 -1
- package/dist/chunk-DGH75GJD.js +0 -1
- package/dist/chunk-E5NUI7PN.js +0 -1
- package/dist/chunk-ELDDNERR.js +0 -1
- package/dist/chunk-EXZ47NOW.js +0 -1
- package/dist/chunk-FDITZ5C6.cjs +0 -1
- package/dist/chunk-FF76ISQ2.js +0 -1
- package/dist/chunk-FIEZKTAZ.cjs +0 -1
- package/dist/chunk-FSSV24W7.cjs +0 -1
- package/dist/chunk-GCGU2WB7.js +0 -1
- package/dist/chunk-GECI2YBP.js +0 -1
- package/dist/chunk-GQE4OVHC.cjs +0 -1
- package/dist/chunk-GRVZXQXL.cjs +0 -1
- package/dist/chunk-I4AVNHPA.cjs +0 -1
- package/dist/chunk-JFRL7NKU.js +0 -4
- package/dist/chunk-JWHM3WZQ.cjs +0 -1
- package/dist/chunk-KCQDDZJE.cjs +0 -1
- package/dist/chunk-L54ZPSYJ.js +0 -1
- package/dist/chunk-LVKAYEZ4.js +0 -1
- package/dist/chunk-MBDWTK54.cjs +0 -1
- package/dist/chunk-MNGGDB2G.js +0 -1
- package/dist/chunk-MY7BA4GI.cjs +0 -1
- package/dist/chunk-N2IJPIND.cjs +0 -1
- package/dist/chunk-NIMNTEGV.js +0 -1
- package/dist/chunk-NNM7QCNB.js +0 -1
- package/dist/chunk-PUQXRLZH.cjs +0 -1
- package/dist/chunk-PVJF2JHM.js +0 -1
- package/dist/chunk-QCFXEUKL.js +0 -1
- package/dist/chunk-QFCGBBSY.js +0 -1
- package/dist/chunk-QQYAUPSK.cjs +0 -1
- package/dist/chunk-RN3TP3S3.js +0 -1
- package/dist/chunk-RV2VULM7.cjs +0 -1
- package/dist/chunk-SW6HYEW7.cjs +0 -1
- package/dist/chunk-SYJC7UAW.js +0 -1
- package/dist/chunk-TC4VBE4Y.cjs +0 -1
- package/dist/chunk-TUXDINHF.cjs +0 -1
- package/dist/chunk-U5Y2FXMN.cjs +0 -1
- package/dist/chunk-UUPQI6ND.cjs +0 -1
- package/dist/chunk-VYCGZ2S6.js +0 -1
- package/dist/chunk-W5EDKJK3.js +0 -1
- package/dist/chunk-WHAVUFEU.js +0 -1
- package/dist/chunk-XCFIOTCV.js +0 -1
- package/dist/chunk-XE27XPJR.js +0 -1
- package/dist/chunk-XH6MCRLP.js +0 -1
- package/dist/chunk-XVB3ZZEB.js +0 -1
- package/dist/chunk-ZBSIGJFO.cjs +0 -1
- package/dist/chunk-ZYAML74V.js +0 -1
- package/dist/extends-Mp81Hq9-.d.ts +0 -145
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/is-array-Ckm_47hw.d.ts +0 -1557
- package/dist/isPlainObject-BKYaI6a8.d.ts +0 -182
- package/dist/stylings/index.cjs +0 -1
- package/dist/stylings/index.d.ts +0 -49
- package/dist/stylings/index.js +0 -1
|
@@ -1,261 +1,261 @@
|
|
|
1
1
|
/** --------------------------------------------------
|
|
2
|
-
* * ***AnyFunction.***
|
|
3
|
-
* --------------------------------------------------
|
|
4
|
-
* A generic type representing **any function**
|
|
5
|
-
* with any arguments and any return type.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const fn: AnyFunction = (a, b) => a + b;
|
|
9
|
-
* fn(1, 2);
|
|
10
|
-
* // ➔ 3
|
|
11
|
-
*/
|
|
2
|
+
* * ***AnyFunction.***
|
|
3
|
+
* --------------------------------------------------
|
|
4
|
+
* A generic type representing **any function**
|
|
5
|
+
* with any arguments and any return type.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const fn: AnyFunction = (a, b) => a + b;
|
|
9
|
+
* fn(1, 2);
|
|
10
|
+
* // ➔ 3
|
|
11
|
+
*/
|
|
12
12
|
type AnyFunction=(...args:any[])=>any;
|
|
13
13
|
/** --------------------------------------------------
|
|
14
|
-
* * ***Represents Node.js built-in core objects.***
|
|
15
|
-
* --------------------------------------------------
|
|
16
|
-
*
|
|
17
|
-
* Includes commonly used Node.js core classes/objects
|
|
18
|
-
* that are not plain objects.
|
|
19
|
-
*
|
|
20
|
-
* Examples:
|
|
21
|
-
* - `Buffer`
|
|
22
|
-
* - `EventEmitter`
|
|
23
|
-
* - `Stream`
|
|
24
|
-
* - `URL`
|
|
25
|
-
* - `process`
|
|
26
|
-
*
|
|
27
|
-
* ❌ Excludes plain objects (`{}`) and primitives.
|
|
28
|
-
*
|
|
29
|
-
* ⚠️ Note:
|
|
30
|
-
* This is **not exhaustive** because Node.js has
|
|
31
|
-
* many built-in modules, but it covers the main
|
|
32
|
-
* runtime objects often encountered.
|
|
33
|
-
*/
|
|
14
|
+
* * ***Represents Node.js built-in core objects.***
|
|
15
|
+
* --------------------------------------------------
|
|
16
|
+
*
|
|
17
|
+
* Includes commonly used Node.js core classes/objects
|
|
18
|
+
* that are not plain objects.
|
|
19
|
+
*
|
|
20
|
+
* Examples:
|
|
21
|
+
* - `Buffer`
|
|
22
|
+
* - `EventEmitter`
|
|
23
|
+
* - `Stream`
|
|
24
|
+
* - `URL`
|
|
25
|
+
* - `process`
|
|
26
|
+
*
|
|
27
|
+
* ❌ Excludes plain objects (`{}`) and primitives.
|
|
28
|
+
*
|
|
29
|
+
* ⚠️ Note:
|
|
30
|
+
* This is **not exhaustive** because Node.js has
|
|
31
|
+
* many built-in modules, but it covers the main
|
|
32
|
+
* runtime objects often encountered.
|
|
33
|
+
*/
|
|
34
34
|
type NodeBuiltins=Buffer|NodeJS.EventEmitter|NodeJS.ReadableStream|NodeJS.WritableStream|NodeJS.Process|URL;
|
|
35
35
|
/** --------------------------------------------------
|
|
36
|
-
* * ***DataTypes.***
|
|
37
|
-
* --------------------------------------------------
|
|
38
|
-
* Represents a broad union of commonly used JavaScript data types.
|
|
39
|
-
*
|
|
40
|
-
* ✅ Includes:
|
|
41
|
-
* - Primitive types
|
|
42
|
-
* - `object`
|
|
43
|
-
* - `null`
|
|
44
|
-
* - `undefined`
|
|
45
|
-
* - `symbol`
|
|
46
|
-
* - Any function signature
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* function isValidType(value: DataTypes): boolean {
|
|
51
|
-
* return value !== undefined && value !== null;
|
|
52
|
-
* }
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
36
|
+
* * ***DataTypes.***
|
|
37
|
+
* --------------------------------------------------
|
|
38
|
+
* Represents a broad union of commonly used JavaScript data types.
|
|
39
|
+
*
|
|
40
|
+
* ✅ Includes:
|
|
41
|
+
* - Primitive types
|
|
42
|
+
* - `object`
|
|
43
|
+
* - `null`
|
|
44
|
+
* - `undefined`
|
|
45
|
+
* - `symbol`
|
|
46
|
+
* - Any function signature
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* function isValidType(value: DataTypes): boolean {
|
|
51
|
+
* return value !== undefined && value !== null;
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
55
|
type DataTypes=bigint|boolean|AnyFunction|null|number|object|string|symbol|undefined;
|
|
56
56
|
/** --------------------------------------------------
|
|
57
|
-
* * ***DeepReplaceType.***
|
|
58
|
-
* --------------------------------------------------
|
|
59
|
-
* Recursively traverses an array, tuple, or object (including nested structures)
|
|
60
|
-
* and replaces all values of type `Target` with `NewType`.
|
|
61
|
-
*
|
|
62
|
-
* ✅ Useful for remapping deeply nested arrays, tuples, or records.
|
|
63
|
-
*
|
|
64
|
-
* @template Arr - The input array, tuple, or object.
|
|
65
|
-
* @template Target - The type to match and replace.
|
|
66
|
-
* @template NewType - The new type to assign to matched values.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* // Simple tuple
|
|
71
|
-
* type A = [number, string, [number]];
|
|
72
|
-
* type B = DeepReplaceType<A, number, boolean>;
|
|
73
|
-
* // ➔ [boolean, string, [boolean]]
|
|
74
|
-
*
|
|
75
|
-
* // Nested object
|
|
76
|
-
* type Obj = { a: number; b: { c: number; d: string } };
|
|
77
|
-
* type ObjReplaced = DeepReplaceType<Obj, number, boolean>;
|
|
78
|
-
* // ➔ { a: boolean; b: { c: boolean; d: string } }
|
|
79
|
-
*
|
|
80
|
-
* // Mixed array and object
|
|
81
|
-
* type Mixed = [{ x: number }, { y: string, z: number[] }];
|
|
82
|
-
* type MixedReplaced = DeepReplaceType<Mixed, number, boolean>;
|
|
83
|
-
* // ➔ [{ x: boolean }, { y: string, z: boolean[] }]
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
57
|
+
* * ***DeepReplaceType.***
|
|
58
|
+
* --------------------------------------------------
|
|
59
|
+
* Recursively traverses an array, tuple, or object (including nested structures)
|
|
60
|
+
* and replaces all values of type `Target` with `NewType`.
|
|
61
|
+
*
|
|
62
|
+
* ✅ Useful for remapping deeply nested arrays, tuples, or records.
|
|
63
|
+
*
|
|
64
|
+
* @template Arr - The input array, tuple, or object.
|
|
65
|
+
* @template Target - The type to match and replace.
|
|
66
|
+
* @template NewType - The new type to assign to matched values.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* // Simple tuple
|
|
71
|
+
* type A = [number, string, [number]];
|
|
72
|
+
* type B = DeepReplaceType<A, number, boolean>;
|
|
73
|
+
* // ➔ [boolean, string, [boolean]]
|
|
74
|
+
*
|
|
75
|
+
* // Nested object
|
|
76
|
+
* type Obj = { a: number; b: { c: number; d: string } };
|
|
77
|
+
* type ObjReplaced = DeepReplaceType<Obj, number, boolean>;
|
|
78
|
+
* // ➔ { a: boolean; b: { c: boolean; d: string } }
|
|
79
|
+
*
|
|
80
|
+
* // Mixed array and object
|
|
81
|
+
* type Mixed = [{ x: number }, { y: string, z: number[] }];
|
|
82
|
+
* type MixedReplaced = DeepReplaceType<Mixed, number, boolean>;
|
|
83
|
+
* // ➔ [{ x: boolean }, { y: string, z: boolean[] }]
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
86
|
type DeepReplaceType<Arr,Target,NewType>=Arr extends Target?NewType:Arr extends object?{[K in keyof Arr]:DeepReplaceType<Arr[K],Target,NewType>;}:Arr;
|
|
87
87
|
/** --------------------------------------------------
|
|
88
|
-
* * ***TypedArray.***
|
|
89
|
-
* --------------------------------------------------
|
|
90
|
-
* Represents all JavaScript **TypedArray** types used for binary data manipulation.
|
|
91
|
-
*
|
|
92
|
-
* Includes:
|
|
93
|
-
* - `Int8Array`
|
|
94
|
-
* - `Uint8Array`
|
|
95
|
-
* - `Uint8ClampedArray`
|
|
96
|
-
* - `Int16Array`
|
|
97
|
-
* - `Uint16Array`
|
|
98
|
-
* - `Int32Array`
|
|
99
|
-
* - `Uint32Array`
|
|
100
|
-
* - `Float32Array`
|
|
101
|
-
* - `Float64Array`
|
|
102
|
-
* - `BigInt64Array`
|
|
103
|
-
* - `BigUint64Array`
|
|
104
|
-
*/
|
|
88
|
+
* * ***TypedArray.***
|
|
89
|
+
* --------------------------------------------------
|
|
90
|
+
* Represents all JavaScript **TypedArray** types used for binary data manipulation.
|
|
91
|
+
*
|
|
92
|
+
* Includes:
|
|
93
|
+
* - `Int8Array`
|
|
94
|
+
* - `Uint8Array`
|
|
95
|
+
* - `Uint8ClampedArray`
|
|
96
|
+
* - `Int16Array`
|
|
97
|
+
* - `Uint16Array`
|
|
98
|
+
* - `Int32Array`
|
|
99
|
+
* - `Uint32Array`
|
|
100
|
+
* - `Float32Array`
|
|
101
|
+
* - `Float64Array`
|
|
102
|
+
* - `BigInt64Array`
|
|
103
|
+
* - `BigUint64Array`
|
|
104
|
+
*/
|
|
105
105
|
type TypedArray=Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|BigInt64Array|BigUint64Array;
|
|
106
106
|
/** --------------------------------------------------
|
|
107
|
-
* * ***WebApiObjects.***
|
|
108
|
-
* --------------------------------------------------
|
|
109
|
-
* Represents common **Web API objects** available in the browser.
|
|
110
|
-
*
|
|
111
|
-
* Includes:
|
|
112
|
-
* - URL: `URL`, `URLSearchParams`
|
|
113
|
-
* - Networking: `Request`, `Response`, `Headers`, `WebSocket`
|
|
114
|
-
* - Streams: `ReadableStream`, `WritableStream`, `TransformStream`
|
|
115
|
-
* - Events: `Event`, `CustomEvent`, `MessageChannel`, `MessagePort`, `MessageEvent`
|
|
116
|
-
* - DOM: `HTMLElement`, `Node`, `Document`, `Window`, `CanvasRenderingContext2D`
|
|
117
|
-
* - Encoding: `TextEncoder`, `TextDecoder`
|
|
118
|
-
* - File: `File`, `FileList`, `ImageBitmap`, `FormData`
|
|
119
|
-
* - Abort: `AbortController`, `AbortSignal`
|
|
120
|
-
* - Crypto: `CryptoKey`
|
|
121
|
-
*/
|
|
107
|
+
* * ***WebApiObjects.***
|
|
108
|
+
* --------------------------------------------------
|
|
109
|
+
* Represents common **Web API objects** available in the browser.
|
|
110
|
+
*
|
|
111
|
+
* Includes:
|
|
112
|
+
* - URL: `URL`, `URLSearchParams`
|
|
113
|
+
* - Networking: `Request`, `Response`, `Headers`, `WebSocket`
|
|
114
|
+
* - Streams: `ReadableStream`, `WritableStream`, `TransformStream`
|
|
115
|
+
* - Events: `Event`, `CustomEvent`, `MessageChannel`, `MessagePort`, `MessageEvent`
|
|
116
|
+
* - DOM: `HTMLElement`, `Node`, `Document`, `Window`, `CanvasRenderingContext2D`
|
|
117
|
+
* - Encoding: `TextEncoder`, `TextDecoder`
|
|
118
|
+
* - File: `File`, `FileList`, `ImageBitmap`, `FormData`
|
|
119
|
+
* - Abort: `AbortController`, `AbortSignal`
|
|
120
|
+
* - Crypto: `CryptoKey`
|
|
121
|
+
*/
|
|
122
122
|
type WebApiObjects=URL|URLSearchParams|FormData|Headers|Response|Request|ReadableStream<any>|WritableStream<any>|TransformStream<any,any>|MessageChannel|MessagePort|MessageEvent|Event|CustomEvent|HTMLElement|Node|Document|Window|AbortController|AbortSignal|TextEncoder|TextDecoder|CryptoKey|File|FileList|ImageBitmap|CanvasRenderingContext2D|WebSocket;
|
|
123
123
|
/** --------------------------------------------------
|
|
124
|
-
* * ***IntlObjects.***
|
|
125
|
-
* --------------------------------------------------
|
|
126
|
-
* Represents all **ECMAScript Internationalization API** objects from `Intl`.
|
|
127
|
-
*
|
|
128
|
-
* Includes:
|
|
129
|
-
* - `Intl.Collator`
|
|
130
|
-
* - `Intl.DateTimeFormat`
|
|
131
|
-
* - `Intl.NumberFormat`
|
|
132
|
-
* - `Intl.RelativeTimeFormat`
|
|
133
|
-
* - `Intl.PluralRules`
|
|
134
|
-
* - `Intl.ListFormat`
|
|
135
|
-
* - `Intl.Locale`
|
|
136
|
-
*/
|
|
124
|
+
* * ***IntlObjects.***
|
|
125
|
+
* --------------------------------------------------
|
|
126
|
+
* Represents all **ECMAScript Internationalization API** objects from `Intl`.
|
|
127
|
+
*
|
|
128
|
+
* Includes:
|
|
129
|
+
* - `Intl.Collator`
|
|
130
|
+
* - `Intl.DateTimeFormat`
|
|
131
|
+
* - `Intl.NumberFormat`
|
|
132
|
+
* - `Intl.RelativeTimeFormat`
|
|
133
|
+
* - `Intl.PluralRules`
|
|
134
|
+
* - `Intl.ListFormat`
|
|
135
|
+
* - `Intl.Locale`
|
|
136
|
+
*/
|
|
137
137
|
type IntlObjects=Intl.Collator|Intl.DateTimeFormat|Intl.NumberFormat|Intl.RelativeTimeFormat|Intl.PluralRules|Intl.ListFormat|Intl.Locale;
|
|
138
138
|
/** --------------------------------------------------
|
|
139
|
-
* * ***BoxedPrimitivesTypes.***
|
|
140
|
-
* --------------------------------------------------
|
|
141
|
-
* Represents JavaScript **boxed primitive objects** (object wrappers for primitive values).
|
|
142
|
-
*
|
|
143
|
-
* Boxed primitives are created using the `new` keyword on primitive wrapper constructors.
|
|
144
|
-
*
|
|
145
|
-
* ✅ **Includes (object wrappers):**
|
|
146
|
-
* - `new Number(123)` → `Number`
|
|
147
|
-
* - `new String("hello")` → `String`
|
|
148
|
-
* - `new Boolean(true)` → `Boolean`
|
|
149
|
-
*
|
|
150
|
-
* ❌ **Excludes (primitive values):**
|
|
151
|
-
* - `123` → `number`
|
|
152
|
-
* - `"hello"` → `string`
|
|
153
|
-
* - `true` → `boolean`
|
|
154
|
-
*
|
|
155
|
-
* ℹ️ **Note:**
|
|
156
|
-
* - These are **rarely used directly** in modern JavaScript/TypeScript.
|
|
157
|
-
* - However, they exist for completeness and are sometimes relevant
|
|
158
|
-
* when distinguishing between **primitive values** and **object wrappers**.
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
* ```ts
|
|
162
|
-
* const a: BoxedPrimitivesTypes = new Number(123); // ✅ valid
|
|
163
|
-
* const b: BoxedPrimitivesTypes = new String("abc"); // ✅ valid
|
|
164
|
-
* const c: BoxedPrimitivesTypes = new Boolean(false); // ✅ valid
|
|
165
|
-
*
|
|
166
|
-
* // ❌ Not allowed (primitive values):
|
|
167
|
-
* // const x: BoxedPrimitivesTypes = 123;
|
|
168
|
-
* // const y: BoxedPrimitivesTypes = "abc";
|
|
169
|
-
* // const z: BoxedPrimitivesTypes = true;
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
139
|
+
* * ***BoxedPrimitivesTypes.***
|
|
140
|
+
* --------------------------------------------------
|
|
141
|
+
* Represents JavaScript **boxed primitive objects** (object wrappers for primitive values).
|
|
142
|
+
*
|
|
143
|
+
* Boxed primitives are created using the `new` keyword on primitive wrapper constructors.
|
|
144
|
+
*
|
|
145
|
+
* ✅ **Includes (object wrappers):**
|
|
146
|
+
* - `new Number(123)` → `Number`
|
|
147
|
+
* - `new String("hello")` → `String`
|
|
148
|
+
* - `new Boolean(true)` → `Boolean`
|
|
149
|
+
*
|
|
150
|
+
* ❌ **Excludes (primitive values):**
|
|
151
|
+
* - `123` → `number`
|
|
152
|
+
* - `"hello"` → `string`
|
|
153
|
+
* - `true` → `boolean`
|
|
154
|
+
*
|
|
155
|
+
* ℹ️ **Note:**
|
|
156
|
+
* - These are **rarely used directly** in modern JavaScript/TypeScript.
|
|
157
|
+
* - However, they exist for completeness and are sometimes relevant
|
|
158
|
+
* when distinguishing between **primitive values** and **object wrappers**.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* const a: BoxedPrimitivesTypes = new Number(123); // ✅ valid
|
|
163
|
+
* const b: BoxedPrimitivesTypes = new String("abc"); // ✅ valid
|
|
164
|
+
* const c: BoxedPrimitivesTypes = new Boolean(false); // ✅ valid
|
|
165
|
+
*
|
|
166
|
+
* // ❌ Not allowed (primitive values):
|
|
167
|
+
* // const x: BoxedPrimitivesTypes = 123;
|
|
168
|
+
* // const y: BoxedPrimitivesTypes = "abc";
|
|
169
|
+
* // const z: BoxedPrimitivesTypes = true;
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
172
|
type BoxedPrimitivesTypes=Number|String|Boolean;
|
|
173
173
|
/** --------------------------------------------------
|
|
174
|
-
* * ***NonPlainObject.***
|
|
175
|
-
* --------------------------------------------------
|
|
176
|
-
* Represents all known **non-plain object types**,
|
|
177
|
-
* i.e., values that are **not** considered a "plain object" (`{ [key: string]: any }`).
|
|
178
|
-
*
|
|
179
|
-
* ✅ **Includes:**
|
|
180
|
-
* - **Functions**
|
|
181
|
-
* - **Arrays**
|
|
182
|
-
* - **Native objects:** `Date`, `RegExp`, `Map`, `Set`, `WeakMap`, `WeakSet`
|
|
183
|
-
* - **Built-in classes & APIs:** `Promise`, `Error`, `ArrayBuffer`, `DataView`
|
|
184
|
-
* - **Typed arrays:** `TypedArray`
|
|
185
|
-
* - **Browser & Node APIs:** `WebApiObjects`, `IntlObjects`, `NodeBuiltins`
|
|
186
|
-
* - **Symbols**
|
|
187
|
-
* - **Proxies** (wrapping any object)
|
|
188
|
-
* - The global **`Reflect`** object
|
|
189
|
-
*
|
|
190
|
-
* ❌ **Excludes:**
|
|
191
|
-
* - Plain objects (`{ foo: string }`, `Record<string, any>`)
|
|
192
|
-
* - `null` and `undefined`
|
|
193
|
-
*
|
|
194
|
-
* ℹ️ **Note:**
|
|
195
|
-
* Use this type when you need to differentiate **plain objects**
|
|
196
|
-
* from **all other object-like values**.
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* ```ts
|
|
200
|
-
* type A = NonPlainObject;
|
|
201
|
-
*
|
|
202
|
-
* const x: A = new Date(); // ✅ Allowed
|
|
203
|
-
* const y: A = [1, 2, 3]; // ✅ Allowed
|
|
204
|
-
* const z: A = Promise.resolve(123); // ✅ Allowed
|
|
205
|
-
*
|
|
206
|
-
* // ❌ Not allowed (plain object):
|
|
207
|
-
* // const bad: A = { foo: "bar" };
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
174
|
+
* * ***NonPlainObject.***
|
|
175
|
+
* --------------------------------------------------
|
|
176
|
+
* Represents all known **non-plain object types**,
|
|
177
|
+
* i.e., values that are **not** considered a "plain object" (`{ [key: string]: any }`).
|
|
178
|
+
*
|
|
179
|
+
* ✅ **Includes:**
|
|
180
|
+
* - **Functions**
|
|
181
|
+
* - **Arrays**
|
|
182
|
+
* - **Native objects:** `Date`, `RegExp`, `Map`, `Set`, `WeakMap`, `WeakSet`
|
|
183
|
+
* - **Built-in classes & APIs:** `Promise`, `Error`, `ArrayBuffer`, `DataView`
|
|
184
|
+
* - **Typed arrays:** `TypedArray`
|
|
185
|
+
* - **Browser & Node APIs:** `WebApiObjects`, `IntlObjects`, `NodeBuiltins`
|
|
186
|
+
* - **Symbols**
|
|
187
|
+
* - **Proxies** (wrapping any object)
|
|
188
|
+
* - The global **`Reflect`** object
|
|
189
|
+
*
|
|
190
|
+
* ❌ **Excludes:**
|
|
191
|
+
* - Plain objects (`{ foo: string }`, `Record<string, any>`)
|
|
192
|
+
* - `null` and `undefined`
|
|
193
|
+
*
|
|
194
|
+
* ℹ️ **Note:**
|
|
195
|
+
* Use this type when you need to differentiate **plain objects**
|
|
196
|
+
* from **all other object-like values**.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```ts
|
|
200
|
+
* type A = NonPlainObject;
|
|
201
|
+
*
|
|
202
|
+
* const x: A = new Date(); // ✅ Allowed
|
|
203
|
+
* const y: A = [1, 2, 3]; // ✅ Allowed
|
|
204
|
+
* const z: A = Promise.resolve(123); // ✅ Allowed
|
|
205
|
+
*
|
|
206
|
+
* // ❌ Not allowed (plain object):
|
|
207
|
+
* // const bad: A = { foo: "bar" };
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
210
|
type NonPlainObject=BoxedPrimitivesTypes|AnyFunction|Promise<any>|Array<any>|AnObjectNonArray;
|
|
211
211
|
/** --------------------------------------------------
|
|
212
|
-
* * ***AnObjectNonArray.***
|
|
213
|
-
* --------------------------------------------------
|
|
214
|
-
* Represents all **non-null, non-array, object-like values** in JavaScript/Node.js.
|
|
215
|
-
*
|
|
216
|
-
* ✅ **Includes:**
|
|
217
|
-
* - **Built-in objects:** `Date`, `RegExp`, `Error`, `ArrayBuffer`, `DataView`
|
|
218
|
-
* - **Collections:** `Map`, `Set`, `WeakMap`, `WeakSet`
|
|
219
|
-
* - **Typed arrays:**
|
|
220
|
-
* `Int8Array`, `Uint8Array`, `Uint8ClampedArray`,
|
|
221
|
-
* `Int16Array`, `Uint16Array`,
|
|
222
|
-
* `Int32Array`, `Uint32Array`,
|
|
223
|
-
* `Float32Array`, `Float64Array`,
|
|
224
|
-
* `BigInt64Array`, `BigUint64Array`
|
|
225
|
-
* - **Browser Web APIs:**
|
|
226
|
-
* `URL`, `URLSearchParams`, `FormData`, `Headers`, `Response`, `Request`,
|
|
227
|
-
* `ReadableStream`, `WritableStream`, `TransformStream`,
|
|
228
|
-
* `MessageChannel`, `MessagePort`, `MessageEvent`,
|
|
229
|
-
* `Event`, `CustomEvent`, `HTMLElement`, `Node`, `Document`, `Window`,
|
|
230
|
-
* `CanvasRenderingContext2D`,
|
|
231
|
-
* `AbortController`, `AbortSignal`,
|
|
232
|
-
* `TextEncoder`, `TextDecoder`,
|
|
233
|
-
* `CryptoKey`, `File`, `FileList`, `ImageBitmap`, `WebSocket`
|
|
234
|
-
* - **ECMAScript Internationalization API objects:**
|
|
235
|
-
* `Intl.Collator`, `Intl.DateTimeFormat`, `Intl.NumberFormat`,
|
|
236
|
-
* `Intl.RelativeTimeFormat`, `Intl.PluralRules`,
|
|
237
|
-
* `Intl.ListFormat`, `Intl.Locale`
|
|
238
|
-
* - **Node.js built-ins:** `Buffer`
|
|
239
|
-
* - **Symbols**
|
|
240
|
-
* - **Proxies** (wrapping any object)
|
|
241
|
-
* - The global **`Reflect`** object
|
|
242
|
-
*
|
|
243
|
-
* ❌ **Excludes:**
|
|
244
|
-
* - `null`
|
|
245
|
-
* - Arrays (`[]`, `new Array()`)
|
|
246
|
-
*
|
|
247
|
-
* ℹ️ **Note:**
|
|
248
|
-
* Use this type when you need to represent **any object-like value except arrays and `null`**.
|
|
249
|
-
*
|
|
250
|
-
* @example
|
|
251
|
-
* ```ts
|
|
252
|
-
* const a: AnObjectNonArray = new Date();
|
|
253
|
-
* const b: AnObjectNonArray = new Map();
|
|
254
|
-
* const c: AnObjectNonArray = Symbol("id");
|
|
255
|
-
*
|
|
256
|
-
* // ❌ These are NOT allowed:
|
|
257
|
-
* // const x: AnObjectNonArray = null;
|
|
258
|
-
* // const y: AnObjectNonArray = [];
|
|
259
|
-
* ```
|
|
260
|
-
*/
|
|
212
|
+
* * ***AnObjectNonArray.***
|
|
213
|
+
* --------------------------------------------------
|
|
214
|
+
* Represents all **non-null, non-array, object-like values** in JavaScript/Node.js.
|
|
215
|
+
*
|
|
216
|
+
* ✅ **Includes:**
|
|
217
|
+
* - **Built-in objects:** `Date`, `RegExp`, `Error`, `ArrayBuffer`, `DataView`
|
|
218
|
+
* - **Collections:** `Map`, `Set`, `WeakMap`, `WeakSet`
|
|
219
|
+
* - **Typed arrays:**
|
|
220
|
+
* `Int8Array`, `Uint8Array`, `Uint8ClampedArray`,
|
|
221
|
+
* `Int16Array`, `Uint16Array`,
|
|
222
|
+
* `Int32Array`, `Uint32Array`,
|
|
223
|
+
* `Float32Array`, `Float64Array`,
|
|
224
|
+
* `BigInt64Array`, `BigUint64Array`
|
|
225
|
+
* - **Browser Web APIs:**
|
|
226
|
+
* `URL`, `URLSearchParams`, `FormData`, `Headers`, `Response`, `Request`,
|
|
227
|
+
* `ReadableStream`, `WritableStream`, `TransformStream`,
|
|
228
|
+
* `MessageChannel`, `MessagePort`, `MessageEvent`,
|
|
229
|
+
* `Event`, `CustomEvent`, `HTMLElement`, `Node`, `Document`, `Window`,
|
|
230
|
+
* `CanvasRenderingContext2D`,
|
|
231
|
+
* `AbortController`, `AbortSignal`,
|
|
232
|
+
* `TextEncoder`, `TextDecoder`,
|
|
233
|
+
* `CryptoKey`, `File`, `FileList`, `ImageBitmap`, `WebSocket`
|
|
234
|
+
* - **ECMAScript Internationalization API objects:**
|
|
235
|
+
* `Intl.Collator`, `Intl.DateTimeFormat`, `Intl.NumberFormat`,
|
|
236
|
+
* `Intl.RelativeTimeFormat`, `Intl.PluralRules`,
|
|
237
|
+
* `Intl.ListFormat`, `Intl.Locale`
|
|
238
|
+
* - **Node.js built-ins:** `Buffer`
|
|
239
|
+
* - **Symbols**
|
|
240
|
+
* - **Proxies** (wrapping any object)
|
|
241
|
+
* - The global **`Reflect`** object
|
|
242
|
+
*
|
|
243
|
+
* ❌ **Excludes:**
|
|
244
|
+
* - `null`
|
|
245
|
+
* - Arrays (`[]`, `new Array()`)
|
|
246
|
+
*
|
|
247
|
+
* ℹ️ **Note:**
|
|
248
|
+
* Use this type when you need to represent **any object-like value except arrays and `null`**.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* const a: AnObjectNonArray = new Date();
|
|
253
|
+
* const b: AnObjectNonArray = new Map();
|
|
254
|
+
* const c: AnObjectNonArray = Symbol("id");
|
|
255
|
+
*
|
|
256
|
+
* // ❌ These are NOT allowed:
|
|
257
|
+
* // const x: AnObjectNonArray = null;
|
|
258
|
+
* // const y: AnObjectNonArray = [];
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
261
|
type AnObjectNonArray=Date|RegExp|Map<any,any>|Set<any>|WeakMap<any,any>|WeakSet<any>|Error|ArrayBuffer|DataView|TypedArray|WebApiObjects|IntlObjects|NodeBuiltins|symbol|{[Symbol.toStringTag]:"Proxy";}|typeof Reflect;export type{AnyFunction as A,BoxedPrimitivesTypes as B,DataTypes as D,IntlObjects as I,NonPlainObject as N,TypedArray as T,WebApiObjects as W,AnObjectNonArray as a,DeepReplaceType as b};
|