@rzl-zone/utils-js 3.1.2-beta.0 → 3.2.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 +59 -32
- package/dist/NumberRangeUnion-B6bhM2s7.d.ts +33 -0
- package/dist/{any-BmdI8UbK.d.ts → any-v4TsK9ES.d.ts} +25 -26
- package/dist/{arrays-normalize-recursive-CnjYJ9xg.d.ts → arrays-normalize-recursive-BqmVuFlD.d.ts} +20 -20
- package/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +96 -70
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-2CQX5CBG.js +1 -0
- package/dist/chunk-2IOOEY45.cjs +1 -0
- package/dist/chunk-3IBQ5MOM.js +1 -0
- package/dist/chunk-3VA554KW.js +1 -0
- package/dist/chunk-5757UBXJ.cjs +1 -0
- package/dist/chunk-5IGC6PBH.js +1 -0
- package/dist/chunk-5KJFVIQT.cjs +1 -0
- package/dist/chunk-6JFCSH7J.js +1 -0
- package/dist/chunk-6JFZL7YE.cjs +1 -0
- package/dist/chunk-7ODAAXX5.cjs +1 -0
- package/dist/chunk-BAV5T2E3.cjs +1 -0
- package/dist/chunk-CAH33WOQ.cjs +1 -0
- package/dist/chunk-CKTLUNWX.js +1 -0
- package/dist/chunk-CMW2TBOQ.js +1 -0
- package/dist/chunk-D3ENH7H6.cjs +1 -0
- package/dist/chunk-DEZZUYE2.js +1 -0
- package/dist/chunk-DVMHRLKP.cjs +1 -0
- package/dist/chunk-DWF2R5GD.cjs +1 -0
- package/dist/chunk-E55EQK2U.cjs +1 -0
- package/dist/chunk-E74U6CYP.cjs +1 -0
- package/dist/chunk-EL6A35UR.cjs +1 -0
- package/dist/chunk-F6IPNNSJ.cjs +1 -0
- package/dist/chunk-FJZGG54N.cjs +1 -0
- package/dist/chunk-FWCKOJZM.js +1 -0
- package/dist/chunk-FWHNWL2P.cjs +1 -0
- package/dist/chunk-GGEADHZO.js +1 -0
- package/dist/chunk-GQR4R5WY.js +1 -0
- package/dist/chunk-H66AC7GK.cjs +1 -0
- package/dist/chunk-HQWOFR56.cjs +1 -0
- package/dist/chunk-HYRQMTRH.cjs +1 -0
- package/dist/chunk-IRFL4MAX.js +1 -0
- package/dist/chunk-IVL7CKVH.cjs +1 -0
- package/dist/chunk-IZPBKKPO.js +1 -0
- package/dist/chunk-JBQMXC5I.cjs +1 -0
- package/dist/chunk-JEQEF5WD.js +1 -0
- package/dist/chunk-JMJQCN74.js +1 -0
- package/dist/chunk-JYQTCICM.js +1 -0
- package/dist/chunk-KHO2SBNA.cjs +1 -0
- package/dist/chunk-KVAL5PAG.cjs +1 -0
- package/dist/chunk-L5RDAVVH.js +1 -0
- package/dist/chunk-LS6U7FAY.cjs +1 -0
- package/dist/chunk-NBZWMBO6.js +1 -0
- package/dist/chunk-NRF6LWBC.cjs +1 -0
- package/dist/chunk-OI5XKNZO.js +1 -0
- package/dist/chunk-ONZFBJVW.js +1 -0
- package/dist/chunk-OYTYSY7G.js +1 -0
- package/dist/chunk-PET42Z7W.js +1 -0
- package/dist/chunk-PZQ6I4JJ.cjs +1 -0
- package/dist/chunk-QBKAEVYG.js +1 -0
- package/dist/chunk-QNKGP5DY.js +1 -0
- package/dist/chunk-RIPKY4RU.js +1 -0
- package/dist/chunk-RZW35UN5.cjs +1 -0
- package/dist/chunk-SBFNXGTJ.js +1 -0
- package/dist/chunk-SBKGWRS5.js +1 -0
- package/dist/chunk-SIM77PU4.js +1 -0
- package/dist/chunk-T2T7K3KR.js +1 -0
- package/dist/chunk-T7PU2V7X.cjs +1 -0
- package/dist/chunk-UDA26MCU.cjs +1 -0
- package/dist/chunk-V45XJKHW.cjs +1 -0
- package/dist/chunk-VJDDGRIK.cjs +1 -0
- package/dist/chunk-W2WNBUDE.js +1 -0
- package/dist/chunk-WVSPXFTY.js +1 -0
- package/dist/chunk-XABCB3Y7.cjs +1 -0
- package/dist/chunk-XEDXFSGI.js +1 -0
- package/dist/chunk-YKPSRP5G.js +1 -0
- package/dist/chunk-YLA3DURS.cjs +1 -0
- package/dist/chunk-YWHHVDT4.js +1 -0
- package/dist/chunk-ZETAZZLD.cjs +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +515 -321
- package/dist/conversions/index.js +1 -1
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +25 -20
- package/dist/events/index.js +1 -1
- package/dist/{extends-Bk_SBGdT.d.ts → extends-DtdRjDyU.d.ts} +63 -87
- package/dist/formatters/index.cjs +1 -0
- package/dist/formatters/index.d.ts +2106 -0
- package/dist/formatters/index.js +1 -0
- package/dist/generators/index.cjs +1 -0
- package/dist/{generator → generators}/index.d.ts +57 -59
- package/dist/generators/index.js +1 -0
- package/dist/{if-CvT4R7Kh.d.ts → if-ChM35c_q.d.ts} +6 -5
- package/dist/{is-array--YjXV-Wx.d.ts → is-array-BJeHxPM3.d.ts} +287 -542
- package/dist/{isPlainObject-BVhBAPHX.d.ts → isPlainObject-DGJkcFYw.d.ts} +6 -6
- package/dist/{never-BfayMBF9.d.ts → never-D89PbPh5.d.ts} +10 -19
- package/dist/next/index.cjs +1 -8
- package/dist/next/index.d.ts +15 -12
- package/dist/next/index.js +1 -8
- package/dist/next/server/index.cjs +1 -2
- package/dist/next/server/index.d.ts +1 -1
- package/dist/next/server/index.js +1 -2
- package/dist/{nils-DMz3kU7M.d.ts → nils-CO8zLHSB.d.ts} +39 -65
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +4 -4
- package/dist/operations/index.js +1 -1
- package/dist/or-C6qzKt2I.d.ts +82 -0
- package/dist/override-CL2olHE5.d.ts +59 -0
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.js +1 -1
- package/dist/pick-BSMX6Xe2.d.ts +15 -0
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +425 -106
- package/dist/predicates/index.js +1 -1
- package/dist/prettify-3o8_Kw6b.d.ts +564 -0
- package/dist/promises/index.cjs +1 -0
- package/dist/promises/index.d.ts +107 -0
- package/dist/promises/index.js +1 -0
- package/dist/promises-LU7K00H0.d.ts +72 -0
- package/dist/rzl-utils.global.js +1 -4
- package/dist/{string-XA-til3C.d.ts → string-B1jlOnws.d.ts} +82 -121
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +209 -210
- package/dist/strings/index.js +1 -1
- package/dist/tailwind/index.cjs +1 -0
- package/dist/tailwind/index.d.ts +571 -0
- package/dist/tailwind/index.js +1 -0
- package/dist/types/index.d.ts +899 -1181
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +113 -108
- package/dist/urls/index.js +1 -1
- package/package.json +45 -47
- package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +0 -26
- package/dist/chunk-26W3VZIK.cjs +0 -1
- package/dist/chunk-2KRCHXFG.cjs +0 -2
- package/dist/chunk-33ZLH266.js +0 -1
- package/dist/chunk-4L4EJTNZ.js +0 -1
- package/dist/chunk-56QBKKRE.js +0 -1
- package/dist/chunk-5Q37AP7P.js +0 -1
- package/dist/chunk-5SZUSNGZ.js +0 -1
- package/dist/chunk-7CHFAMS2.js +0 -1
- package/dist/chunk-7MMJZ6HS.js +0 -1
- package/dist/chunk-7TC6DE3J.cjs +0 -1
- package/dist/chunk-7VX33E3V.js +0 -1
- package/dist/chunk-7YWAQOA4.cjs +0 -1
- package/dist/chunk-BEZPD44N.cjs +0 -1
- package/dist/chunk-BI263OHW.js +0 -1
- package/dist/chunk-CII6WWLO.cjs +0 -1
- package/dist/chunk-D5TYPCWU.cjs +0 -1
- package/dist/chunk-EEQY5QUG.js +0 -1
- package/dist/chunk-ELDDNERR.js +0 -1
- package/dist/chunk-ESJYBIYH.js +0 -1
- package/dist/chunk-EWYPSKKM.js +0 -1
- package/dist/chunk-EXCOQLWX.cjs +0 -1
- package/dist/chunk-FIEZKTAZ.cjs +0 -1
- package/dist/chunk-FWQVTMYA.cjs +0 -1
- package/dist/chunk-G4EWCRKS.js +0 -1
- package/dist/chunk-G5LXIEFO.js +0 -0
- package/dist/chunk-G7R5XZRM.cjs +0 -1
- package/dist/chunk-GGEV7LXX.cjs +0 -1
- package/dist/chunk-HJOZOENU.cjs +0 -1
- package/dist/chunk-IRDZVLNZ.cjs +0 -1
- package/dist/chunk-IW73G523.cjs +0 -1
- package/dist/chunk-IY5OZAB3.cjs +0 -1
- package/dist/chunk-J4NCYYGS.js +0 -1
- package/dist/chunk-J7JAZAJD.js +0 -1
- package/dist/chunk-JYNSO7ZY.js +0 -1
- package/dist/chunk-K3UVKYEU.js +0 -1
- package/dist/chunk-LQ76EDZG.js +0 -1
- package/dist/chunk-MMSYCIJ2.cjs +0 -1
- package/dist/chunk-MROH35V3.cjs +0 -1
- package/dist/chunk-NJSAV73S.js +0 -1
- package/dist/chunk-NNM7QCNB.js +0 -1
- package/dist/chunk-NR44SNYE.js +0 -1
- package/dist/chunk-NXMTWY77.js +0 -1
- package/dist/chunk-OZCQZO2V.cjs +0 -4
- package/dist/chunk-PUQXRLZH.cjs +0 -1
- package/dist/chunk-Q3NTKN5I.cjs +0 -1
- package/dist/chunk-QDNSC57Z.js +0 -4
- package/dist/chunk-QGXTL5ZH.js +0 -2
- package/dist/chunk-QSQDP7L2.cjs +0 -1
- package/dist/chunk-RV2VULM7.cjs +0 -1
- package/dist/chunk-S5M33A4O.js +0 -1
- package/dist/chunk-SGTHOQQ2.js +0 -1
- package/dist/chunk-SL3RQOWA.js +0 -1
- package/dist/chunk-SW6HYEW7.cjs +0 -1
- package/dist/chunk-SYJC7UAW.js +0 -1
- package/dist/chunk-SZPWZZYG.cjs +0 -1
- package/dist/chunk-UA4B7JBO.cjs +0 -1
- package/dist/chunk-UQDJF5RR.cjs +0 -1
- package/dist/chunk-UTQUYABU.cjs +0 -1
- package/dist/chunk-VPW3DRV5.js +0 -1
- package/dist/chunk-W32WALNU.js +0 -1
- package/dist/chunk-XGZ6K753.cjs +0 -1
- package/dist/chunk-YFTR64N5.cjs +0 -1
- package/dist/chunk-ZFDS7W6B.cjs +0 -1
- package/dist/chunk-ZQOLZE6Z.cjs +0 -1
- package/dist/env/index.cjs +0 -1
- package/dist/env/index.d.ts +0 -16
- package/dist/env/index.js +0 -1
- package/dist/formatting/index.cjs +0 -1
- package/dist/formatting/index.d.ts +0 -950
- package/dist/formatting/index.js +0 -1
- package/dist/generator/index.cjs +0 -1
- package/dist/generator/index.js +0 -1
- package/dist/omit-VvmIsZmX.d.ts +0 -28
- package/dist/prettify-C4xLcYOP.d.ts +0 -353
- package/dist/promise/index.cjs +0 -1
- package/dist/promise/index.d.ts +0 -31
- package/dist/promise/index.js +0 -1
- package/dist/stylings/index.cjs +0 -1
- package/dist/stylings/index.d.ts +0 -41
- package/dist/stylings/index.js +0 -1
- package/dist/type-data-DDs-u2kq.d.ts +0 -261
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{censorEmail,chunkString,formatCurrency,formatDateFns,formatDateIntl,formatDateTime,formatNumber,formatPhoneNumber,getGMTOffset,truncateString}from"../chunk-YKPSRP5G.js";import"../chunk-T2T7K3KR.js";import"../chunk-IRFL4MAX.js";import"../chunk-3IBQ5MOM.js";import"../chunk-WVSPXFTY.js";import"../chunk-W2WNBUDE.js";import"../chunk-SBKGWRS5.js";import"../chunk-PET42Z7W.js";import"../chunk-QNKGP5DY.js";import"../chunk-CMW2TBOQ.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../chunk-5757UBXJ.cjs");require("../chunk-DVMHRLKP.cjs");var r=require("../chunk-BAV5T2E3.cjs");require("../chunk-T7PU2V7X.cjs"),require("../chunk-UDA26MCU.cjs"),require("../chunk-PZQ6I4JJ.cjs"),Object.defineProperty(exports,"getRandomItem",{enumerable:!0,get:function(){return e.getRandomItem}}),Object.defineProperty(exports,"randomInt",{enumerable:!0,get:function(){return e.randomInt}}),Object.defineProperty(exports,"randomIntByLength",{enumerable:!0,get:function(){return e.randomIntByLength}}),Object.defineProperty(exports,"randomStr",{enumerable:!0,get:function(){return e.randomStr}}),Object.defineProperty(exports,"noop",{enumerable:!0,get:function(){return r.noop}});
|
|
@@ -1,44 +1,10 @@
|
|
|
1
|
-
import{f as IfNonEmptyArray,E as Extends}from'../extends-
|
|
2
|
-
/** Ensures no whitespace characters in the generated string, defaultValue: `true`.
|
|
3
|
-
*
|
|
4
|
-
* @default true
|
|
5
|
-
*/
|
|
6
|
-
avoidWhiteSpace?:boolean;
|
|
7
|
-
/** Custom characters to replace the default number set if `type` is `"number"`, defaultValue: `undefined`.
|
|
8
|
-
*
|
|
9
|
-
* @default undefined
|
|
10
|
-
*/
|
|
11
|
-
replaceGenInt?:string;
|
|
12
|
-
/** Custom characters to replace the default string set if `type` is `"string"`, defaultValue: `undefined`.
|
|
13
|
-
*
|
|
14
|
-
* @default undefined
|
|
15
|
-
*/
|
|
16
|
-
replaceGenStr?:string;
|
|
17
|
-
/** Additional characters to include in the generated string, defaultValue: `undefined`.
|
|
18
|
-
*
|
|
19
|
-
* @default undefined
|
|
20
|
-
*/
|
|
21
|
-
addChar?:string;
|
|
22
|
-
/** Minimum length of the generated string (1 to 5000), defaultValue: `40`.
|
|
23
|
-
*
|
|
24
|
-
* @default 40
|
|
25
|
-
*/
|
|
26
|
-
minLength?:number;
|
|
27
|
-
/** Maximum length of the generated string (1 to 5000), defaultValue: `40`.
|
|
28
|
-
*
|
|
29
|
-
* @default 40
|
|
30
|
-
*/
|
|
31
|
-
maxLength?:number;
|
|
32
|
-
/** Type of output: `"string"` or `"number"`, defaultValue: `"string"`.
|
|
33
|
-
*
|
|
34
|
-
* @default "string"
|
|
35
|
-
*/
|
|
36
|
-
type?:"string"|"number";};
|
|
1
|
+
import{f as IfNonEmptyArray,E as Extends}from'../extends-DtdRjDyU.js';import{F as FixNeverArrayRecursive}from'../arrays-normalize-recursive-BqmVuFlD.js';import{g as NullToUndefined}from'../nils-CO8zLHSB.js';import'../if-ChM35c_q.js';import'../never-D89PbPh5.js';
|
|
37
2
|
/** ---------------------------------
|
|
38
|
-
* * ***
|
|
3
|
+
* * ***Utility: `getRandomItem`.***
|
|
39
4
|
* ---------------------------------
|
|
5
|
+
* **Function to get a random element from a given array.**
|
|
40
6
|
* @template T - The type of the input array.
|
|
41
|
-
* @param {*} array - The input array
|
|
7
|
+
* @param {*} array - The input array, can be `null`, `undefined`, or an empty array.
|
|
42
8
|
* @returns
|
|
43
9
|
* - If `array` is a non-empty tuple, returns one of its elements.
|
|
44
10
|
* - If `array` is empty, `null`, or `undefined`, returns `undefined`.
|
|
@@ -66,13 +32,12 @@ type?:"string"|"number";};
|
|
|
66
32
|
*/
|
|
67
33
|
declare function getRandomItem(array:undefined):undefined;declare function getRandomItem(array:null):undefined;declare function getRandomItem(array:[]):undefined;declare function getRandomItem<T extends readonly unknown[]>(array:T):T extends never[][]?[]:number extends T["length"]?NullToUndefined<FixNeverArrayRecursive<T[number]>>:IfNonEmptyArray<T,NullToUndefined<FixNeverArrayRecursive<T[number]>>,undefined>;declare function getRandomItem<T extends readonly unknown[]|undefined|null>(array:T):T extends readonly unknown[]?NullToUndefined<FixNeverArrayRecursive<T[number]>>|undefined:undefined;declare function getRandomItem<T>(array:T):unknown extends T?unknown:Extends<any[]|readonly any[],T>extends true?Extract<T,unknown[]|readonly unknown[]>[number]|undefined:Extends<any[],T>extends true?Extract<T,unknown[]|readonly unknown[]>[number]|undefined:Extends<readonly any[],T>extends true?Extract<T,unknown[]|readonly unknown[]>[number]|undefined:undefined;
|
|
68
34
|
/** -----------------------------------------------------------------------
|
|
69
|
-
* * ***
|
|
35
|
+
* * ***Utility: `randomInt`.***
|
|
70
36
|
* ------------------------------------------------------------------------
|
|
71
|
-
* Generates a random integer
|
|
72
|
-
* - `min`
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* Validates input parameters to ensure robust behavior.
|
|
37
|
+
* **Generates a random integer within a specified range (inclusive).**
|
|
38
|
+
* - **Generates a random integer between `min` and `max` (inclusive), with safety constraints:**
|
|
39
|
+
* - `min` will be forced to be at least `1`.
|
|
40
|
+
* - `max` will be capped at `Number.MAX_SAFE_INTEGER`.
|
|
76
41
|
* @param {number} min - The minimum value (inclusive), must be an integer.
|
|
77
42
|
* @param {number} max - The maximum value (inclusive), must be an integer.
|
|
78
43
|
* @returns {number} A random integer N where `min ≤ N ≤ max`.
|
|
@@ -106,18 +71,20 @@ maxLength?:number;
|
|
|
106
71
|
*/
|
|
107
72
|
avoidZero?:boolean;};
|
|
108
73
|
/** ----------------------------------------------------------------------------
|
|
109
|
-
* * ***
|
|
74
|
+
* * ***Utility: `randomIntByLength`.***
|
|
110
75
|
* -----------------------------------------------------------------------------
|
|
111
|
-
* **
|
|
76
|
+
* **Generates a random integer within a specified range of digit lengths.**
|
|
77
|
+
* @description
|
|
78
|
+
* This function allows generating random integers that strictly conform to a specified minimum and
|
|
112
79
|
* maximum digit length, it is useful for scenarios such as generating realistic-looking IDs, codes,
|
|
113
|
-
* or random test data
|
|
80
|
+
* or random test data.
|
|
114
81
|
* - **The function ensures:**
|
|
115
82
|
* - `minLength` is at least 1 and not greater than `maxLength`.
|
|
116
|
-
* - `maxLength` is no more than 16 (due to JavaScript's Number.MAX_SAFE_INTEGER).
|
|
83
|
+
* - `maxLength` is no more than 16 (due to JavaScript's `Number.MAX_SAFE_INTEGER`).
|
|
117
84
|
* - If `avoidZero` is `true`, ensures that `0` is never returned.
|
|
118
85
|
* @param {OptionsRandomIntByLength} [options] - Configuration options.
|
|
119
|
-
* @param {OptionsRandomIntByLength["minLength"]} [options.minLength=1] - Minimum number of digits (must be ≥1 and ≤ `maxLength`).
|
|
120
|
-
* @param {OptionsRandomIntByLength["maxLength"]} [options.maxLength=16] - Maximum number of digits (must be ≤16).
|
|
86
|
+
* @param {OptionsRandomIntByLength["minLength"]} [options.minLength=1] - Minimum number of digits (must be ≥ `1` and ≤ `maxLength`).
|
|
87
|
+
* @param {OptionsRandomIntByLength["maxLength"]} [options.maxLength=16] - Maximum number of digits (must be ≤ `16`).
|
|
121
88
|
* @param {OptionsRandomIntByLength["avoidZero"]} [options.avoidZero=false] - If true, will ensure the result is never zero.
|
|
122
89
|
* @returns {number} A randomly generated integer within the specified constraints.
|
|
123
90
|
* @throws {TypeError} If parameters are invalid, such as:
|
|
@@ -133,13 +100,43 @@ avoidZero?:boolean;};
|
|
|
133
100
|
* randomIntByLength({ avoidZero: true });
|
|
134
101
|
* // ➔ never 0
|
|
135
102
|
*/
|
|
136
|
-
declare const randomIntByLength:(options?:OptionsRandomIntByLength)=>number;
|
|
103
|
+
declare const randomIntByLength:(options?:OptionsRandomIntByLength)=>number;type OptionsRandomStr={
|
|
104
|
+
/** ***Ensures no whitespace characters in the generated string, defaultValue: `true`.***
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
avoidWhiteSpace?:boolean;
|
|
108
|
+
/** ***Custom characters to replace the default number set if `type` is `"number"`, defaultValue: `undefined`.***
|
|
109
|
+
* @default undefined
|
|
110
|
+
*/
|
|
111
|
+
replaceGenInt?:string;
|
|
112
|
+
/** ***Custom characters to replace the default string set if `type` is `"string"`, defaultValue: `undefined`.***
|
|
113
|
+
* @default undefined
|
|
114
|
+
*/
|
|
115
|
+
replaceGenStr?:string;
|
|
116
|
+
/** ***Additional characters to include in the generated string, defaultValue: `undefined`.***
|
|
117
|
+
* @default undefined
|
|
118
|
+
*/
|
|
119
|
+
addChar?:string;
|
|
120
|
+
/** ***Minimum length of the generated string (1 to 5000), defaultValue: `40`.***
|
|
121
|
+
* @default 40
|
|
122
|
+
*/
|
|
123
|
+
minLength?:number;
|
|
124
|
+
/** ***Maximum length of the generated string (1 to 5000), defaultValue: `40`.***
|
|
125
|
+
* @default 40
|
|
126
|
+
*/
|
|
127
|
+
maxLength?:number;
|
|
128
|
+
/** ***Type of output: `"string"` or `"number"`, defaultValue: `"string"`.***
|
|
129
|
+
* @default "string"
|
|
130
|
+
*/
|
|
131
|
+
type?:"string"|"number";};
|
|
137
132
|
/** ---------------------------------------------------------------------------------
|
|
138
|
-
* * ***
|
|
133
|
+
* * ***Utility: `randomStr`.***
|
|
139
134
|
* ---------------------------------------------------------------------------------
|
|
140
|
-
* **
|
|
135
|
+
* **Generates a random alphanumeric string or number with a specified length range.**
|
|
136
|
+
* @description
|
|
137
|
+
* This function allows you to generate random strings or numbers with fully
|
|
141
138
|
* customizable options, such as length range, character sets, inclusion of
|
|
142
|
-
* additional characters, and whether to avoid whitespace
|
|
139
|
+
* additional characters, and whether to avoid whitespace.
|
|
143
140
|
* @param {OptionsRandomStr} [options] - Configuration options for generating the string.
|
|
144
141
|
* @param {OptionsRandomStr["minLength"]} [options.minLength=40] - Minimum length of the generated string (must be `≥` `1`).
|
|
145
142
|
* @param {OptionsRandomStr["maxLength"]} [options.maxLength=40] - Maximum length of the generated string (must be `≤` `5000`).
|
|
@@ -164,9 +161,10 @@ declare const randomIntByLength:(options?:OptionsRandomIntByLength)=>number;
|
|
|
164
161
|
*/
|
|
165
162
|
declare const randomStr:(options?:OptionsRandomStr)=>string;
|
|
166
163
|
/** --------------------------------------------------
|
|
167
|
-
* * ***
|
|
164
|
+
* * ***Utility: `noop`.***
|
|
168
165
|
* --------------------------------------------------
|
|
169
|
-
* **
|
|
166
|
+
* **A no-operation function that always returns `undefined`.**
|
|
167
|
+
* - *Useful as a default callback, placeholder, or stub function.*
|
|
170
168
|
* @returns {undefined} Always returns `undefined`.
|
|
171
169
|
* @example
|
|
172
170
|
* // Direct call returns undefined
|
|
@@ -174,9 +172,9 @@ declare const randomStr:(options?:OptionsRandomStr)=>string;
|
|
|
174
172
|
* // ➔ undefined
|
|
175
173
|
*
|
|
176
174
|
* // Can be used with type-checking helpers
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* isFunction(noop());
|
|
175
|
+
* isFunction(noop); // ➔ true
|
|
176
|
+
* isUndefined(noop()); // ➔ true
|
|
177
|
+
* isFunction(noop()); // ➔ false
|
|
180
178
|
*
|
|
181
179
|
* // Often used as a default function
|
|
182
180
|
* const callback = noop;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{getRandomItem,randomInt,randomIntByLength,randomStr}from"../chunk-DEZZUYE2.js";import"../chunk-WVSPXFTY.js";export{noop}from"../chunk-YWHHVDT4.js";import"../chunk-PET42Z7W.js";import"../chunk-QNKGP5DY.js";import"../chunk-CMW2TBOQ.js";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/** -------------------------------------------------------
|
|
2
|
-
* * ***If
|
|
2
|
+
* * ***Utility Type: `If`.***
|
|
3
3
|
* -------------------------------------------------------
|
|
4
|
-
* Conditional
|
|
4
|
+
* - **Conditional:**
|
|
5
|
+
* - Returns the second argument if the first argument is `true`, otherwise
|
|
6
|
+
* returns the third argument.
|
|
5
7
|
* - Defaults: `IfTrue = true`, `IfFalse = false`.
|
|
6
|
-
*
|
|
7
8
|
* @template Condition - The boolean condition to check.
|
|
8
|
-
* @template IfTrue - The branch type if condition is `true`. (default: `true`)
|
|
9
|
-
* @template IfFalse - The branch type if condition is `false`. (default: `false`)
|
|
9
|
+
* @template IfTrue - The branch type if condition is `true`. (default: `true`).
|
|
10
|
+
* @template IfFalse - The branch type if condition is `false`. (default: `false`).
|
|
10
11
|
* @example
|
|
11
12
|
* ```ts
|
|
12
13
|
* type A = If<true, "valid">;
|