@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.0-beta.2
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/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +96 -116
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-25G6B35W.js +1 -0
- package/dist/chunk-2AUUPGMN.js +1 -0
- package/dist/chunk-2JQQQ625.js +1 -0
- package/dist/chunk-445TAVT4.cjs +1 -0
- package/dist/chunk-467VEMJH.js +1 -0
- package/dist/chunk-6Q4I2RPC.cjs +1 -0
- package/dist/chunk-6SMJMZ7G.cjs +1 -0
- package/dist/chunk-BLCANGFS.js +1 -0
- package/dist/chunk-CK3BZGEU.js +1 -0
- package/dist/{chunk-JWHM3WZQ.cjs → chunk-D43GV6EF.cjs} +1 -1
- package/dist/chunk-DFSTVQFI.cjs +1 -0
- package/dist/chunk-DYRDBYPF.cjs +1 -0
- package/dist/chunk-EXXLUO7L.cjs +1 -0
- package/dist/chunk-G72VSVGO.js +1 -0
- package/dist/chunk-GAJTFCUA.js +1 -0
- package/dist/chunk-GOJNH55O.cjs +1 -0
- package/dist/chunk-HXST7RJB.js +1 -0
- package/dist/{chunk-BYZAD3XN.cjs → chunk-HXTACM3O.cjs} +1 -1
- package/dist/chunk-IJTZWWRJ.cjs +1 -0
- package/dist/chunk-ISJ33O2J.cjs +1 -0
- package/dist/chunk-JISH2VGG.js +1 -0
- package/dist/{chunk-FF76ISQ2.js → chunk-JQZUWBIX.js} +1 -1
- package/dist/{chunk-XH6MCRLP.js → chunk-K4PLGD7C.js} +1 -1
- package/dist/chunk-KZQB7H4E.cjs +1 -0
- package/dist/chunk-LUVV5KSD.cjs +2 -0
- package/dist/chunk-LVUSFXQS.cjs +1 -0
- package/dist/chunk-ME5OV5HN.js +1 -0
- package/dist/chunk-MF5Y5K4N.cjs +1 -0
- package/dist/chunk-MJAW5RAK.js +1 -0
- package/dist/chunk-MWLEM7ED.js +1 -0
- package/dist/chunk-NSVLG7NY.js +4 -0
- package/dist/chunk-NUHOOAUN.cjs +1 -0
- package/dist/chunk-NUVGETPD.js +2 -0
- package/dist/chunk-O5VXBNUQ.cjs +4 -0
- package/dist/chunk-O7SJR4CY.cjs +1 -0
- package/dist/chunk-OX6RLS2F.cjs +1 -0
- package/dist/chunk-PFLNHD4B.cjs +1 -0
- package/dist/chunk-PSWITZK5.js +1 -0
- package/dist/chunk-PYUVKHUF.cjs +1 -0
- package/dist/chunk-REFMEB4A.js +1 -0
- package/dist/chunk-RHE3M2NJ.cjs +1 -0
- package/dist/chunk-RHIBYOFQ.js +1 -0
- package/dist/chunk-S7GMG4TB.js +1 -0
- package/dist/chunk-TQMZ2LPI.js +1 -0
- package/dist/{chunk-RN3TP3S3.js → chunk-U4TZO7WV.js} +1 -1
- package/dist/chunk-UUMKL74S.js +1 -0
- package/dist/{chunk-EXZ47NOW.js → chunk-VQLAPEL3.js} +1 -1
- package/dist/chunk-VTR75UID.cjs +1 -0
- package/dist/chunk-XFCJDSB2.cjs +1 -0
- package/dist/chunk-XOYX4PLZ.cjs +1 -0
- package/dist/chunk-Z6FLCEN6.js +1 -0
- package/dist/chunk-ZO5364A6.cjs +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +396 -593
- package/dist/conversions/index.js +1 -1
- package/dist/env/index.d.ts +5 -8
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +80 -77
- package/dist/events/index.js +1 -1
- package/dist/{array-CIZRbqTF.d.ts → extends-Bk_SBGdT.d.ts} +145 -1
- package/dist/formatting/index.cjs +1 -1
- package/dist/formatting/index.d.ts +478 -440
- package/dist/formatting/index.js +1 -1
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.ts +135 -112
- package/dist/generator/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{is-array-Ckm_47hw.d.ts → is-array--YjXV-Wx.d.ts} +2 -352
- package/dist/{isPlainObject-BKYaI6a8.d.ts → isPlainObject-BVhBAPHX.d.ts} +49 -62
- package/dist/next/index.cjs +6 -6
- package/dist/next/index.d.ts +125 -105
- package/dist/next/index.js +5 -5
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +8 -22
- package/dist/next/server/index.js +1 -1
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +72 -127
- package/dist/operations/index.js +1 -1
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +26 -27
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +686 -660
- package/dist/predicates/index.js +1 -1
- package/dist/promise/index.cjs +1 -1
- package/dist/promise/index.d.ts +14 -23
- package/dist/promise/index.js +1 -1
- package/dist/rzl-utils.global.js +3 -3
- package/dist/string-XA-til3C.d.ts +351 -0
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +301 -376
- package/dist/strings/index.js +1 -1
- package/dist/stylings/index.cjs +1 -1
- package/dist/stylings/index.d.ts +15 -23
- package/dist/stylings/index.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +276 -301
- package/dist/urls/index.js +1 -1
- package/package.json +53 -11
- 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-5JFV3GDE.cjs +0 -4
- package/dist/chunk-62HX5Z45.cjs +0 -1
- package/dist/chunk-7NA6DUHR.cjs +0 -2
- package/dist/chunk-BVPMMWDL.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-FDITZ5C6.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-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-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-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-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
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f as convertType,g as removeObjectPaths,b as toBooleanContent,c as toBooleanContentDeep,d as toBooleanExplicit,e as toBooleanLoose,a as toNumberArrayUnRecursive,h as toNumberDeep,i as toStringDeep}from'../chunk-
|
|
1
|
+
export{f as convertType,g as removeObjectPaths,b as toBooleanContent,c as toBooleanContentDeep,d as toBooleanExplicit,e as toBooleanLoose,a as toNumberArrayUnRecursive,h as toNumberDeep,i as toStringDeep}from'../chunk-G72VSVGO.js';export{b as cleanParsedData,a as extractDigits,c as parseCustomDate,d as safeJsonParse}from'../chunk-MWLEM7ED.js';import'../chunk-RHIBYOFQ.js';export{c as dedupeArray,b as filterNilArray,d as toStringArrayUnRecursive,a as toStringDeepForce}from'../chunk-PSWITZK5.js';import'../chunk-REFMEB4A.js';import'../chunk-ME5OV5HN.js';import'../chunk-2JQQQ625.js';export{a as parseCurrencyString}from'../chunk-K4PLGD7C.js';import'../chunk-GAJTFCUA.js';import'../chunk-SYJC7UAW.js';import'../chunk-Z6FLCEN6.js';import'../chunk-JISH2VGG.js';export{c as safeStableStringify}from'../chunk-467VEMJH.js';import'../chunk-5SZUSNGZ.js';import'../chunk-MJAW5RAK.js';
|
package/dist/env/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/** ----------------------------------------
|
|
2
|
-
* * ***
|
|
2
|
+
* * ***Utility: `isServer`.***
|
|
3
3
|
* ----------------------------------------
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* or in a browser environment (client).
|
|
7
|
-
*
|
|
4
|
+
* **Checks if the current execution environment is at **server-side** (Node.js)
|
|
5
|
+
* or **client-side** (browser).**
|
|
8
6
|
* @returns {boolean}
|
|
9
|
-
* - `true`
|
|
10
|
-
* - `false`
|
|
11
|
-
*
|
|
7
|
+
* - `true` ➔ running on the **server-side** (Node.js).
|
|
8
|
+
* - `false` ➔ running on the **client-side** (browser).
|
|
12
9
|
* @example
|
|
13
10
|
* if (isServer()) {
|
|
14
11
|
* console.log("Running on Node.js");
|
package/dist/events/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkEXXLUO7L_cjs=require('../chunk-EXXLUO7L.cjs');require('../chunk-SW6HYEW7.cjs'),require('../chunk-DYRDBYPF.cjs'),require('../chunk-LVUSFXQS.cjs');Object.defineProperty(exports,"disableUserInteraction",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.a}});Object.defineProperty(exports,"enableUserInteraction",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.b}});Object.defineProperty(exports,"removeElementFocus",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.c}});Object.defineProperty(exports,"scrollToTop",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.d}});
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,119 +1,122 @@
|
|
|
1
1
|
type ScrollToTopOptions={
|
|
2
|
-
/**
|
|
2
|
+
/** Scroll animation type.
|
|
3
|
+
*
|
|
4
|
+
* - Valid values: `"auto"`, `"instant"`, `"smooth"`.
|
|
5
|
+
* - Default force to `"smooth"` if missing or invalid.
|
|
6
|
+
*
|
|
7
|
+
* @default "smooth"
|
|
8
|
+
*/
|
|
3
9
|
behavior?:ScrollBehavior|undefined;
|
|
4
|
-
/**
|
|
10
|
+
/** Delay before scrolling (in milliseconds).
|
|
11
|
+
*
|
|
12
|
+
* - Default value is `1`.
|
|
13
|
+
* - Valid values: any number `≥` `1`.
|
|
14
|
+
* - Non-integer number are truncated to an integer.
|
|
15
|
+
* - Force to `2147483647` if number is larger than `2147483647`.
|
|
16
|
+
* - Default force to `1` if `missing`, `NaN`, `invalid-type`, or `less-than` `1`.
|
|
17
|
+
*
|
|
18
|
+
* @default 1
|
|
19
|
+
*/
|
|
5
20
|
timeout?:number|undefined;};
|
|
6
21
|
/** ----------------------------------------------------------
|
|
7
|
-
* * ***
|
|
22
|
+
* * ***Utility: `disableUserInteraction`.***
|
|
8
23
|
* ----------------------------------------------------------
|
|
9
|
-
*
|
|
10
|
-
* Key points
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
24
|
+
* **Disables user interaction by adding a CSS class to the `<html>` element.**
|
|
25
|
+
* - **Key points**:
|
|
26
|
+
* - Works **only in browser environments**.
|
|
27
|
+
* - Safely adds the specified CSS class to `<html>`.
|
|
28
|
+
* - Prevents multiple additions of the same class.
|
|
29
|
+
* - Useful to indicate that a process is ongoing
|
|
15
30
|
* (e.g., loading or processing state).
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - Example: if you have `.loading` in your styles, passing `"loading"`
|
|
31
|
+
* - **Using custom CSS classes:**
|
|
32
|
+
* - You can pass any class name that exists in your CSS.
|
|
33
|
+
* - Example: if you have `.loading` in your styles, passing `"loading"`
|
|
20
34
|
* will add it and disable interactions accordingly.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param {string} [className="on_processing"] - The CSS class to add. Defaults to `"on_processing"`.
|
|
26
|
-
*
|
|
35
|
+
* - **Validation:**
|
|
36
|
+
* - Throws `TypeError` if the `className` parameter is not a string.
|
|
37
|
+
* @param {string} [className="on_processing"] - The CSS class to add, defaults to `"on_processing"`.
|
|
27
38
|
* @returns {void} Does not return anything.
|
|
28
|
-
*
|
|
29
39
|
* @throws {TypeError} If `className` is not a string.
|
|
30
|
-
*
|
|
31
40
|
* @example
|
|
32
|
-
* disableUserInteraction();
|
|
33
|
-
* disableUserInteraction("loading");
|
|
41
|
+
* disableUserInteraction(); // ➔ Adds "on_processing" class
|
|
42
|
+
* disableUserInteraction("loading"); // ➔ Adds "loading" class
|
|
34
43
|
* // ❌ Invalid value:
|
|
35
|
-
* disableUserInteraction(123);
|
|
44
|
+
* disableUserInteraction(123); // ➔ Throws TypeError
|
|
36
45
|
*/
|
|
37
46
|
declare const disableUserInteraction:(className?:string)=>void;
|
|
38
47
|
/** ----------------------------------------------------------
|
|
39
|
-
* * ***
|
|
48
|
+
* * ***Utility: `enableUserInteraction`.***
|
|
40
49
|
* ----------------------------------------------------------
|
|
41
|
-
*
|
|
42
|
-
* Key points
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
50
|
+
* **Enables user interaction by removing a CSS class from the `<html>` element.**
|
|
51
|
+
* - **Key points**:
|
|
52
|
+
* - Works **only in browser environments**.
|
|
53
|
+
* - Safely removes the specified CSS class from `<html>`.
|
|
54
|
+
* - Does nothing if the class is not present.
|
|
55
|
+
* - Useful to re-enable user interactions after a process
|
|
47
56
|
* (e.g., loading or processing) completes.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* - Example: if you have `.loading` in your styles, passing `"loading"`
|
|
57
|
+
* - **Using custom CSS classes:**
|
|
58
|
+
* - You can pass any class name that exists in your CSS.
|
|
59
|
+
* - Example: if you have `.loading` in your styles, passing `"loading"`
|
|
52
60
|
* will remove it and re-enable interactions.
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* @param {string} [className="on_processing"] - The CSS class to remove. Defaults to `"on_processing"`.
|
|
58
|
-
*
|
|
61
|
+
* - **Validation:**
|
|
62
|
+
* - Throws `TypeError` if the `className` parameter is not a string.
|
|
63
|
+
* @param {string} [className="on_processing"] - The CSS class to remove, defaults to `"on_processing"`.
|
|
59
64
|
* @returns {void} Does not return anything.
|
|
60
|
-
*
|
|
61
65
|
* @throws {TypeError} If `className` is not a string.
|
|
62
|
-
*
|
|
63
66
|
* @example
|
|
64
|
-
* enableUserInteraction();
|
|
65
|
-
* enableUserInteraction("loading");
|
|
66
|
-
* //
|
|
67
|
-
* enableUserInteraction(123);
|
|
67
|
+
* enableUserInteraction(); // ➔ Removes "on_processing" class
|
|
68
|
+
* enableUserInteraction("loading"); // ➔ Removes "loading" class
|
|
69
|
+
* // ❌ Invalid value:
|
|
70
|
+
* enableUserInteraction(123); // ➔ Throws TypeError
|
|
68
71
|
*/
|
|
69
72
|
declare const enableUserInteraction:(className?:string)=>void;
|
|
70
73
|
/** ----------------------------------------------------------
|
|
71
|
-
* * ***
|
|
74
|
+
* * ***Utility: `removeElementFocus`.***
|
|
72
75
|
* ----------------------------------------------------------
|
|
73
|
-
*
|
|
74
|
-
* -
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
76
|
+
* **Removes focus from the currently active element in the document.**
|
|
77
|
+
* - **Features**:
|
|
78
|
+
* - This function works **only in browser environments**.
|
|
79
|
+
* - If an element is focused, it will lose focus by calling `blur()`.
|
|
80
|
+
* - If no element is focused or the active element is not an `HTMLElement`, nothing happens.
|
|
78
81
|
* @returns {void} Does not return anything.
|
|
79
|
-
*
|
|
80
82
|
* @example
|
|
81
|
-
* removeElementFocus(); // Removes focus from the currently active element
|
|
83
|
+
* removeElementFocus(); // ➔ Removes focus from the currently active element
|
|
82
84
|
*/
|
|
83
85
|
declare const removeElementFocus:()=>void;
|
|
84
86
|
/** ----------------------------------------------------------
|
|
85
|
-
* * ***
|
|
87
|
+
* * ***Utility: `scrollToTop`.***
|
|
86
88
|
* ----------------------------------------------------------
|
|
87
|
-
*
|
|
88
|
-
* -
|
|
89
|
-
*
|
|
89
|
+
* **Scrolls the page to the top with optional smooth animation and delay.**
|
|
90
|
+
* - **Features**:
|
|
91
|
+
* - This function works **only in browser environments** (no effect on server-side).
|
|
92
|
+
* - It leverages the native `window.scrollTo()` API with support for smooth scrolling
|
|
90
93
|
* and an optional timeout delay before executing the scroll.
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* **automatically falls back to its default**.
|
|
94
|
-
*
|
|
94
|
+
* - Each option has strict valid values.
|
|
95
|
+
* - If an invalid value is provided, the function **automatically falls back to its default**.
|
|
95
96
|
* @param {ScrollToTopOptions} [options] - Optional settings for scroll behavior.
|
|
96
|
-
* @param {
|
|
97
|
+
* @param {ScrollToTopOptions["behavior"]} [options.behavior="smooth"] - Scroll animation type.
|
|
97
98
|
* - Valid values: `"auto"`, `"instant"`, `"smooth"`.
|
|
98
|
-
* - Default
|
|
99
|
-
* @param {
|
|
100
|
-
* -
|
|
101
|
-
* -
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
99
|
+
* - Default force to `"smooth"` if missing or invalid.
|
|
100
|
+
* @param {ScrollToTopOptions["timeout"]} [options.timeout=1] - Delay before scrolling (in milliseconds).
|
|
101
|
+
* - Default value is `1`.
|
|
102
|
+
* - Valid values: any number `≥` `1`.
|
|
103
|
+
* - Non-integer number are truncated to an integer.
|
|
104
|
+
* - Force to `2147483647` if number is larger than `2147483647`.
|
|
105
|
+
* - Default force to `1` if `missing`, `NaN`, `invalid`, or `less-than` `1`.
|
|
106
|
+
* @returns {void} Does not return anything, only scrolling to top.
|
|
105
107
|
* @example
|
|
106
|
-
* //
|
|
108
|
+
* // ✅ Valid options value:
|
|
107
109
|
* scrollToTop();
|
|
108
|
-
*
|
|
109
|
-
* // Jump instantly to the top
|
|
110
|
+
* // ➔ Scroll smoothly to the top after 1ms delay
|
|
110
111
|
* scrollToTop({ behavior: "instant" });
|
|
111
|
-
*
|
|
112
|
-
* // Scroll smoothly to the top after 500ms
|
|
112
|
+
* // ➔ Jump instantly to the top
|
|
113
113
|
* scrollToTop({ timeout: 500 });
|
|
114
|
+
* // ➔ Scroll smoothly to the top after 500ms
|
|
114
115
|
*
|
|
115
116
|
* // ❌ Invalid options value:
|
|
116
117
|
* scrollToTop({ behavior: "fly", timeout: -100 });
|
|
117
|
-
* // Fallback: behavior="smooth", timeout=1
|
|
118
|
+
* // ➔ Fallback: behavior="smooth", timeout=1
|
|
119
|
+
* scrollToTop({ behavior: "fly", timeout: 123.55 });
|
|
120
|
+
* // ➔ Fallback: behavior="smooth", timeout=123
|
|
118
121
|
*/
|
|
119
122
|
declare const scrollToTop:(options?:ScrollToTopOptions)=>void;export{disableUserInteraction,enableUserInteraction,removeElementFocus,scrollToTop};
|
package/dist/events/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as disableUserInteraction,b as enableUserInteraction,c as removeElementFocus,d as scrollToTop}from'../chunk-
|
|
1
|
+
export{a as disableUserInteraction,b as enableUserInteraction,c as removeElementFocus,d as scrollToTop}from'../chunk-U4TZO7WV.js';import'../chunk-56QBKKRE.js';import'../chunk-JISH2VGG.js';import'../chunk-MJAW5RAK.js';
|
|
@@ -220,4 +220,148 @@ type IfEmptyArray<T extends readonly unknown[],IfTrue=true,IfFalse=false>=If<IsE
|
|
|
220
220
|
* // ➔ "no"
|
|
221
221
|
* ```
|
|
222
222
|
*/
|
|
223
|
-
type IfNonEmptyArray<T extends readonly unknown[],IfTrue=true,IfFalse=false>=If<IsNonEmptyArray<T>,IfTrue,IfFalse>;
|
|
223
|
+
type IfNonEmptyArray<T extends readonly unknown[],IfTrue=true,IfFalse=false>=If<IsNonEmptyArray<T>,IfTrue,IfFalse>;
|
|
224
|
+
/** -------------------------------------------------------
|
|
225
|
+
* * ***Not.***
|
|
226
|
+
* -------------------------------------------------------
|
|
227
|
+
* Accepts a boolean type `T` and returns its negation.
|
|
228
|
+
*
|
|
229
|
+
* @template T - Boolean type to negate.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* type A = Not<true>; // ➔ false
|
|
234
|
+
* type B = Not<false>; // ➔ true
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
type Not<T extends boolean>=T extends true?false:true;
|
|
238
|
+
/** -------------------------------------------------------
|
|
239
|
+
* * ***PopOptions.***
|
|
240
|
+
* -------------------------------------------------------
|
|
241
|
+
*
|
|
242
|
+
* Configuration options for the {@link Pop} type utility.
|
|
243
|
+
*/
|
|
244
|
+
type PopOptions={
|
|
245
|
+
/**
|
|
246
|
+
* If `true`, {@link Pop} will return a tuple `[Rest, Removed]`
|
|
247
|
+
* instead of just the remaining array.
|
|
248
|
+
*
|
|
249
|
+
* Default: `false`.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```ts
|
|
253
|
+
* type Options = { includeRemoved: true };
|
|
254
|
+
* type Result = Pop<[1, 2, 3], Options>; // ➔ [[1, 2], 3]
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
includeRemoved:boolean;};
|
|
258
|
+
/** -------------------------------------------------------
|
|
259
|
+
* * ***Pop.***
|
|
260
|
+
* -------------------------------------------------------
|
|
261
|
+
*
|
|
262
|
+
* Removes the last element from a tuple/array type.
|
|
263
|
+
*
|
|
264
|
+
* If the `includeRemoved` option is `true`, it returns a tuple `[Rest, Removed]`
|
|
265
|
+
* where `Rest` is the array without the last element, and `Removed` is the last element.
|
|
266
|
+
*
|
|
267
|
+
* @template T - The tuple or array to pop from.
|
|
268
|
+
* @template Options - Configuration object. Default `{ includeRemoved: false }`.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```ts
|
|
272
|
+
* // Removes last element
|
|
273
|
+
* type Case1 = Pop<[1, 2, 3]>
|
|
274
|
+
* // ➔ [1, 2]
|
|
275
|
+
*
|
|
276
|
+
* // Removes last element and includes the removed value
|
|
277
|
+
* type Case2 = Pop<[1, 2, 3], { includeRemoved: true }>
|
|
278
|
+
* // ➔ [[1, 2], 3]
|
|
279
|
+
*
|
|
280
|
+
* // Edge case: empty array
|
|
281
|
+
* type Case3 = Pop<[]>
|
|
282
|
+
* // ➔ never
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
type Pop<T extends readonly unknown[],Options extends PopOptions={includeRemoved:false;}>=IsEmptyArray<T>extends true?never:T extends readonly [...infer Rest extends readonly unknown[],infer Removed]?If<Options["includeRemoved"],[Rest,Removed],Rest>:never;
|
|
286
|
+
/** -------------------------------------------------------
|
|
287
|
+
* * ***Extends.***
|
|
288
|
+
* -------------------------------------------------------
|
|
289
|
+
* Returns a boolean indicating whether the first argument ***extends*** the second argument.
|
|
290
|
+
*
|
|
291
|
+
* @template T - The type to check.
|
|
292
|
+
* @template Base - The type to compare against.
|
|
293
|
+
* @example
|
|
294
|
+
* ```ts
|
|
295
|
+
* type A = Extends<1, number>; // ➔ true
|
|
296
|
+
* type B = Extends<number, 1>; // ➔ false
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
type Extends<T,Base>=[T] extends [Base]?true:false;
|
|
300
|
+
/** -------------------------------------------------------
|
|
301
|
+
* * ***NotExtends.***
|
|
302
|
+
* -------------------------------------------------------
|
|
303
|
+
* Returns a boolean indicating whether the first argument does ***not extend*** the second argument.
|
|
304
|
+
*
|
|
305
|
+
* @template T - The type to check.
|
|
306
|
+
* @template Base - The type to compare against.
|
|
307
|
+
* @example
|
|
308
|
+
* ```ts
|
|
309
|
+
* type A = NotExtends<1, number>; // ➔ false
|
|
310
|
+
* type B = NotExtends<number, 1>; // ➔ true
|
|
311
|
+
* ```
|
|
312
|
+
*/
|
|
313
|
+
type NotExtends<T,Base>=Not<Extends<T,Base>>;
|
|
314
|
+
/** -------------------------------------------------------
|
|
315
|
+
* * ***IfExtends.***
|
|
316
|
+
* -------------------------------------------------------
|
|
317
|
+
* Conditional: returns the third argument if the first argument ***extends*** the second argument, otherwise returns the fourth argument.
|
|
318
|
+
* - Defaults: `IfTrue = true`, `IfFalse = false`.
|
|
319
|
+
*
|
|
320
|
+
* @template T - The type to check.
|
|
321
|
+
* @template Base - The type to compare against.
|
|
322
|
+
* @template IfTrue - The branch type if condition is met. (default: `true`)
|
|
323
|
+
* @template IfFalse - The branch type if condition is not met. (default: `false`)
|
|
324
|
+
* @example
|
|
325
|
+
* ```ts
|
|
326
|
+
* type A = IfExtends<1, number, "valid">;
|
|
327
|
+
* // ➔ "valid"
|
|
328
|
+
* type B = IfExtends<1, string, "valid", "invalid">;
|
|
329
|
+
* // ➔ "invalid"
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
type IfExtends<T,Base,IfTrue=true,IfFalse=false>=If<Extends<T,Base>,IfTrue,IfFalse>;
|
|
333
|
+
/** -------------------------------------------------------
|
|
334
|
+
* * ***IfNotExtends.***
|
|
335
|
+
* -------------------------------------------------------
|
|
336
|
+
* Conditional: returns the third argument if the first argument does ***not extend*** the second argument, otherwise returns the fourth argument.
|
|
337
|
+
* - Defaults: `IfTrue = true`, `IfFalse = false`.
|
|
338
|
+
*
|
|
339
|
+
* @template T - The type to check.
|
|
340
|
+
* @template Base - The type to compare against.
|
|
341
|
+
* @template IfTrue - The branch type if condition is met. (default: `true`)
|
|
342
|
+
* @template IfFalse - The branch type if condition is not met. (default: `false`)
|
|
343
|
+
* @example
|
|
344
|
+
* ```ts
|
|
345
|
+
* type A = IfNotExtends<1, string, "valid">;
|
|
346
|
+
* // ➔ "valid"
|
|
347
|
+
* type B = IfNotExtends<1, number, "valid", "invalid">;
|
|
348
|
+
* // ➔ "invalid"
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
type IfNotExtends<T,Base,IfTrue=true,IfFalse=false>=If<NotExtends<T,Base>,IfTrue,IfFalse>;
|
|
352
|
+
/** -------------------------------------------------------
|
|
353
|
+
* * ***ExtendsArr.***
|
|
354
|
+
* -------------------------------------------------------
|
|
355
|
+
* Returns a boolean indicating whether every element of the first array argument ***extends*** the second argument.
|
|
356
|
+
*
|
|
357
|
+
* @template T - The array to check.
|
|
358
|
+
* @template Base - The type to compare each element against.
|
|
359
|
+
* @example
|
|
360
|
+
* ```ts
|
|
361
|
+
* type A = ExtendsArr<[1, 2, 3], number>;
|
|
362
|
+
* // ➔ true
|
|
363
|
+
* type B = ExtendsArr<[1, "2", 3], number>;
|
|
364
|
+
* // ➔ false
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
type ExtendsArr<T extends readonly unknown[],Base>=IsEmptyArray<T>extends true?true:Pop<T,{includeRemoved:true;}>extends readonly [infer Rest extends readonly unknown[],infer Removed]?Extends<Removed,Base>extends true?ExtendsArr<Rest,Base>:false:false;export type{Arrayable as A,Extends as E,GetArrayElementType as G,IfExtends as I,MutableArray as M,Not as N,Pop as P,NotExtends as a,IsEmptyArray as b,ExtendsArr as c,IfEmptyArray as d,EmptyArray as e,IfNonEmptyArray as f,IsNonEmptyArray as g,NonEmptyArray as h,IfNotExtends as i,PopOptions as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkVTR75UID_cjs=require('../chunk-VTR75UID.cjs');require('../chunk-D43GV6EF.cjs'),require('../chunk-MF5Y5K4N.cjs'),require('../chunk-445TAVT4.cjs'),require('../chunk-6Q4I2RPC.cjs'),require('../chunk-DYRDBYPF.cjs'),require('../chunk-PUQXRLZH.cjs'),require('../chunk-O7SJR4CY.cjs'),require('../chunk-7YWAQOA4.cjs'),require('../chunk-LVUSFXQS.cjs');Object.defineProperty(exports,"censorEmail",{enumerable:true,get:function(){return chunkVTR75UID_cjs.h}});Object.defineProperty(exports,"chunkString",{enumerable:true,get:function(){return chunkVTR75UID_cjs.i}});Object.defineProperty(exports,"formatCurrency",{enumerable:true,get:function(){return chunkVTR75UID_cjs.a}});Object.defineProperty(exports,"formatDateFns",{enumerable:true,get:function(){return chunkVTR75UID_cjs.f}});Object.defineProperty(exports,"formatDateIntl",{enumerable:true,get:function(){return chunkVTR75UID_cjs.e}});Object.defineProperty(exports,"formatDateTime",{enumerable:true,get:function(){return chunkVTR75UID_cjs.d}});Object.defineProperty(exports,"formatNumber",{enumerable:true,get:function(){return chunkVTR75UID_cjs.b}});Object.defineProperty(exports,"formatPhoneNumber",{enumerable:true,get:function(){return chunkVTR75UID_cjs.c}});Object.defineProperty(exports,"getGMTOffset",{enumerable:true,get:function(){return chunkVTR75UID_cjs.g}});Object.defineProperty(exports,"truncateString",{enumerable:true,get:function(){return chunkVTR75UID_cjs.j}});
|