@rzl-zone/utils-js 2.1.0 → 3.0.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 +26 -0
- package/dist/any-BmdI8UbK.d.ts +67 -0
- package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +72 -0
- package/dist/assertions/index.cjs +1 -0
- package/dist/assertions/index.d.ts +408 -0
- package/dist/assertions/index.js +1 -0
- package/dist/chunk-2HSNUPEO.cjs +1 -0
- package/dist/chunk-3YCFMGRB.js +1 -0
- package/dist/chunk-4Z75R3IT.cjs +1 -0
- package/dist/chunk-5C2SMIGX.cjs +1 -0
- package/dist/chunk-5Z2G23WP.js +1 -0
- package/dist/chunk-6C3ATUGM.cjs +1 -0
- package/dist/chunk-AJ25PWXX.cjs +1 -0
- package/dist/chunk-BHIBDDQF.js +1 -0
- package/dist/chunk-CE4JI2YB.js +1 -0
- package/dist/chunk-CMJ6UYWW.cjs +1 -0
- package/dist/chunk-D3VSHABU.cjs +1 -0
- package/dist/chunk-DG2GWBTS.cjs +1 -0
- package/dist/chunk-DVMHRLKP.cjs +1 -0
- package/dist/chunk-ECRNH4FW.js +1 -0
- package/dist/chunk-EKS4IZJR.cjs +1 -0
- package/dist/chunk-EOZKYR5S.cjs +1 -0
- package/dist/chunk-EUANTHVN.js +1 -0
- package/dist/chunk-EW3I4O7X.js +1 -0
- package/dist/chunk-F3E77L46.js +1 -0
- package/dist/chunk-FIAAX3UE.js +1 -0
- package/dist/chunk-FV7SEBKD.cjs +1 -0
- package/dist/chunk-G5LXIEFO.js +0 -0
- package/dist/chunk-GGWPB23G.cjs +1 -0
- package/dist/chunk-GVWGQNLF.js +1 -0
- package/dist/chunk-H3FXL4DU.cjs +1 -0
- package/dist/chunk-HHPDLSX2.cjs +1 -0
- package/dist/chunk-IMCLPT5V.cjs +1 -0
- package/dist/chunk-IRGE5W7L.js +1 -0
- package/dist/chunk-J2RGTPGK.cjs +1 -0
- package/dist/chunk-JARPXKBM.cjs +1 -0
- package/dist/chunk-JFJUPYDT.cjs +1 -0
- package/dist/chunk-JLP56WSM.js +1 -0
- package/dist/chunk-K3MV4AIN.cjs +1 -0
- package/dist/chunk-KHO2SBNA.cjs +1 -0
- package/dist/chunk-KOVO72OM.js +1 -0
- package/dist/chunk-LJ4M3VGE.js +1 -0
- package/dist/chunk-LJVGJLP4.js +1 -0
- package/dist/chunk-M47QIBXI.cjs +1 -0
- package/dist/chunk-MC3LXMCQ.js +1 -0
- package/dist/chunk-MISCBZJC.js +1 -0
- package/dist/chunk-MMSYCIJ2.cjs +1 -0
- package/dist/chunk-MTUBDVJ2.js +1 -0
- package/dist/chunk-O7UT5AN3.cjs +1 -0
- package/dist/chunk-OGPPP2S3.js +1 -0
- package/dist/chunk-OLPKAX7F.cjs +1 -0
- package/dist/chunk-ONZFBJVW.js +1 -0
- package/dist/chunk-ORZFHBEY.js +1 -0
- package/dist/chunk-OWV2P376.js +1 -0
- package/dist/chunk-QNKGP5DY.js +1 -0
- package/dist/chunk-RV2WK5E6.js +1 -0
- package/dist/chunk-SBF43G3B.cjs +1 -0
- package/dist/chunk-T4CIAKEK.js +1 -0
- package/dist/chunk-UDA26MCU.cjs +1 -0
- package/dist/chunk-VCFXNV3Q.cjs +1 -0
- package/dist/chunk-VHAPTHEA.cjs +1 -0
- package/dist/chunk-WVSPXFTY.js +1 -0
- package/dist/chunk-X74TUJSE.cjs +1 -0
- package/dist/chunk-XC3QHAK2.cjs +1 -0
- package/dist/chunk-XLDAIZRK.js +1 -0
- package/dist/chunk-XZJ7C4N6.js +1 -0
- package/dist/chunk-YV3K2EKJ.js +1 -0
- package/dist/chunk-ZHV5ZYVN.cjs +1 -0
- package/dist/chunk-ZL7J6GTP.js +1 -0
- package/dist/chunk-ZTCLKKMB.js +1 -0
- package/dist/conversions/index.cjs +1 -0
- package/dist/conversions/index.d.ts +1436 -0
- package/dist/conversions/index.js +1 -0
- package/dist/env/index.cjs +1 -0
- package/dist/env/index.d.ts +16 -0
- package/dist/env/index.js +1 -0
- package/dist/events/index.cjs +1 -0
- package/dist/events/index.d.ts +122 -0
- package/dist/events/index.js +1 -0
- package/dist/extends-Bk_SBGdT.d.ts +367 -0
- package/dist/formatting/index.cjs +1 -0
- package/dist/formatting/index.d.ts +950 -0
- package/dist/formatting/index.js +1 -0
- package/dist/generator/index.cjs +1 -0
- package/dist/generator/index.d.ts +186 -0
- package/dist/generator/index.js +1 -0
- package/dist/if-CvT4R7Kh.d.ts +18 -0
- package/dist/is-array--YjXV-Wx.d.ts +1207 -0
- package/dist/isPlainObject-BVhBAPHX.d.ts +169 -0
- package/dist/never-BfayMBF9.d.ts +75 -0
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.d.ts +130 -110
- package/dist/next/index.js +1 -1
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +9 -23
- package/dist/next/server/index.js +1 -1
- package/dist/nils-DMz3kU7M.d.ts +177 -0
- package/dist/omit-VvmIsZmX.d.ts +28 -0
- package/dist/operations/index.cjs +1 -0
- package/dist/operations/index.d.ts +127 -0
- package/dist/operations/index.js +1 -0
- package/dist/parsers/index.cjs +1 -0
- package/dist/parsers/index.d.ts +36 -0
- package/dist/parsers/index.js +1 -0
- package/dist/predicates/index.cjs +1 -0
- package/dist/predicates/index.d.ts +1865 -0
- package/dist/predicates/index.js +1 -0
- package/dist/prettify-C4xLcYOP.d.ts +353 -0
- package/dist/promise/index.cjs +1 -0
- package/dist/promise/index.d.ts +31 -0
- package/dist/promise/index.js +1 -0
- package/dist/rzl-utils.global.js +1 -1
- package/dist/string-XA-til3C.d.ts +351 -0
- package/dist/strings/index.cjs +1 -0
- package/dist/strings/index.d.ts +741 -0
- package/dist/strings/index.js +1 -0
- 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 +261 -0
- package/dist/types/index.d.ts +3054 -1555
- package/dist/urls/index.cjs +1 -0
- package/dist/urls/index.d.ts +393 -0
- package/dist/urls/index.js +1 -0
- package/package.json +196 -27
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -4334
- package/dist/index.js +0 -1
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import{G as GetPreciseTypeOptions,I as IsNumberOptions,a as IsPlainObjectResult}from'../isPlainObject-BVhBAPHX.js';import'../type-data-DDs-u2kq.js';
|
|
2
|
+
/** -------------------------------------------------------
|
|
3
|
+
* * ***Shape of the object passed to custom error message functions.***
|
|
4
|
+
* -------------------------------------------------------
|
|
5
|
+
* This type describes the parameters received when `options.message`
|
|
6
|
+
* is defined as a function in `OptionsAssertIs`.
|
|
7
|
+
*
|
|
8
|
+
* - `currentType` ➔ the actual detected runtime type of the value.
|
|
9
|
+
* - `validType` ➔ the required/expected type name that the value must match.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const options: OptionsAssertIs = {
|
|
14
|
+
* message: ({ currentType, validType }) =>
|
|
15
|
+
* `Expected ${validType} but got ${currentType}`
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
type OptionsMessageFunctionAssertIs={
|
|
20
|
+
/** The actual runtime type of the value being checked.
|
|
21
|
+
*
|
|
22
|
+
* - Example: `"number"`, `"big-int"`, `"plain-object"`, (depends `formatCase` options).
|
|
23
|
+
*/
|
|
24
|
+
currentType:string;
|
|
25
|
+
/** The required/expected type that the value must conform to.
|
|
26
|
+
*
|
|
27
|
+
* - Example: `"boolean"`, `"string"`, `"big-int"`, `"plain-object"`, (will force format to `kebab-case`).
|
|
28
|
+
*/
|
|
29
|
+
validType:string;};type OptionsAssertIs={
|
|
30
|
+
/** -------------------------------------------------------
|
|
31
|
+
* * ***Custom error message for assertion failures.***
|
|
32
|
+
* -------------------------------------------------------
|
|
33
|
+
*
|
|
34
|
+
* @description
|
|
35
|
+
* This option allows overriding the **default error message** when a value
|
|
36
|
+
* does not match the required type.
|
|
37
|
+
*
|
|
38
|
+
* - If a **string** is provided:
|
|
39
|
+
* - Must be non-empty after trimming.
|
|
40
|
+
* - Will be used directly as the error message.
|
|
41
|
+
*
|
|
42
|
+
* - If a **function** is provided:
|
|
43
|
+
* - Receives an object containing:
|
|
44
|
+
* - `currentType` ➔ the detected runtime type of the value (depends `formatCase` options, e.g., `"number"`).
|
|
45
|
+
* - `validType` ➔ the expected type name (with format `kebab-case`, e.g., `"boolean"`, `"big-int"`, `"plain-object"`).
|
|
46
|
+
* - Must return a string. If the returned string is empty or whitespace,
|
|
47
|
+
* the default message will be used instead.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Static message
|
|
52
|
+
* { message: "Must be a boolean!" }
|
|
53
|
+
*
|
|
54
|
+
* // Dynamic message
|
|
55
|
+
* {
|
|
56
|
+
* message: ({ currentType, validType }) =>
|
|
57
|
+
* `Expected ${validType} but got ${currentType}`
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
message?:string|(({currentType,validType}:OptionsMessageFunctionAssertIs)=>string);}& GetPreciseTypeOptions;
|
|
62
|
+
/** -------------------------------------------------------
|
|
63
|
+
* * ***Type guard assertion: `assertIsBoolean`.***
|
|
64
|
+
* -------------------------------------------------------
|
|
65
|
+
* **This function is an **assertion function**.**
|
|
66
|
+
* - Validates that the given `value` is a **boolean**.
|
|
67
|
+
* - After it returns successfully, TypeScript narrows the type of `value` to `boolean`.
|
|
68
|
+
* - **Behavior:**
|
|
69
|
+
* - ✅ If `value` is a `boolean` ➔ execution continues normally.
|
|
70
|
+
* - ❌ If `value` is not a `boolean` ➔ throws a `TypeError` with either:
|
|
71
|
+
* - A custom error message (`options.message`), or
|
|
72
|
+
* - A default message including the actual type.
|
|
73
|
+
* @param {*} value - The value to validate.
|
|
74
|
+
* @param {OptionsAssertIs} [options] - Optional configuration:
|
|
75
|
+
* - `message`: A custom error message (`string` or `function`).
|
|
76
|
+
* - `formatCase`: Controls type formatting (from `GetPreciseTypeOptions`).
|
|
77
|
+
* @returns {boolean} Narrows `value` to `boolean` if no error is thrown.
|
|
78
|
+
* @throws {TypeError} If the value is not a boolean.
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* // ✅ Simple usage
|
|
82
|
+
* assertIsBoolean(true);
|
|
83
|
+
* // No error, value is boolean
|
|
84
|
+
*
|
|
85
|
+
* // ❌ Throws TypeError with default message
|
|
86
|
+
* assertIsBoolean(42);
|
|
87
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `boolean`, but received: `number`."
|
|
88
|
+
*
|
|
89
|
+
* // ❌ Throws with custom string message
|
|
90
|
+
* assertIsBoolean(42, { message: "Must be boolean!" });
|
|
91
|
+
* // ➔ TypeError: "Must be boolean!"
|
|
92
|
+
*
|
|
93
|
+
* // ❌ Throws with custom function message + case formatting
|
|
94
|
+
* assertIsBoolean(123n, {
|
|
95
|
+
* message: ({ currentType, validType }) =>
|
|
96
|
+
* `Expected ${validType} but got (${currentType}).`,
|
|
97
|
+
* formatCase: "toKebabCase"
|
|
98
|
+
* });
|
|
99
|
+
* // ➔ TypeError: "Expected boolean but got (big-int)."
|
|
100
|
+
* ```
|
|
101
|
+
* -------------------------------------------------------
|
|
102
|
+
* ✅ ***Real-world usage example***:
|
|
103
|
+
* ```ts
|
|
104
|
+
* type User = { name: string; email: string };
|
|
105
|
+
* const mixedValue: string | User | boolean | number | undefined = getUserInput();
|
|
106
|
+
*
|
|
107
|
+
* // ❌ Throws if not boolean
|
|
108
|
+
* // ⚠️ Code below after this call, will NOT be executed if TypeError is thrown
|
|
109
|
+
* assertIsBoolean(mixedValue, { message: "Must be boolean!" });
|
|
110
|
+
*
|
|
111
|
+
* // ✅ After this call, TypeScript knows `mixedValue` is boolean
|
|
112
|
+
* const result: boolean = mixedValue; // ➔ Safe to use
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare const assertIsBoolean:(value:unknown,options?:OptionsAssertIs)=>asserts value is boolean;
|
|
116
|
+
/** -------------------------------------------------------
|
|
117
|
+
* * ***Type guard assertion: `assertIsBigInt`.***
|
|
118
|
+
* -------------------------------------------------------
|
|
119
|
+
* **This function is an **assertion function**.**
|
|
120
|
+
* - Validates that the given `value` is a **bigint**.
|
|
121
|
+
* - After it returns successfully, TypeScript narrows the type of `value` to `bigint`.
|
|
122
|
+
* - **Behavior:**
|
|
123
|
+
* - ✅ If `value` is a `bigint` ➔ execution continues normally.
|
|
124
|
+
* - ❌ If `value` is not a `bigint` ➔ throws a `TypeError` with either:
|
|
125
|
+
* - A custom error message (`options.message`), or
|
|
126
|
+
* - A default message including the actual type.
|
|
127
|
+
* - **ℹ️ Note:**
|
|
128
|
+
* - A `bigint` refers strictly to the JavaScript `bigint` primitive type (e.g., `123n`, `0n`, `-999999999999999999999n`).
|
|
129
|
+
* - This excludes `BigInt` objects created with `Object(BigInt(123))`.
|
|
130
|
+
* @param {*} value - The value to validate.
|
|
131
|
+
* @param {OptionsAssertIs} [options] - Optional configuration:
|
|
132
|
+
* - `message`: A custom error message (`string` or `function`).
|
|
133
|
+
* - `formatCase`: Controls type formatting (from `GetPreciseTypeOptions`).
|
|
134
|
+
* @returns {boolean} Narrows `value` to `bigint` if no error is thrown.
|
|
135
|
+
* @throws {TypeError} If the value is not a bigint.
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* // ✅ Simple usage
|
|
139
|
+
* assertIsBigInt(123n);
|
|
140
|
+
* // No error, value is bigint
|
|
141
|
+
*
|
|
142
|
+
* // ❌ Throws TypeError with default message
|
|
143
|
+
* assertIsBigInt(42);
|
|
144
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `bigint`, but received: `number`."
|
|
145
|
+
*
|
|
146
|
+
* // ❌ Throws with custom string message
|
|
147
|
+
* assertIsBigInt("123", { message: "Must be a bigint!" });
|
|
148
|
+
* // ➔ TypeError: "Must be a bigint!"
|
|
149
|
+
*
|
|
150
|
+
* // ❌ Throws with custom function message + case formatting
|
|
151
|
+
* assertIsBigInt(42, {
|
|
152
|
+
* message: ({ currentType, validType }) =>
|
|
153
|
+
* `Expected ${validType} but got (${currentType}).`,
|
|
154
|
+
* formatCase: "toKebabCase"
|
|
155
|
+
* });
|
|
156
|
+
* // ➔ TypeError: "Expected bigint but got (number)."
|
|
157
|
+
* ```
|
|
158
|
+
* -------------------------------------------------------
|
|
159
|
+
* ✅ ***Real-world usage example***:
|
|
160
|
+
* ```ts
|
|
161
|
+
* const mixedValue: string | bigint | undefined = getUserInput();
|
|
162
|
+
*
|
|
163
|
+
* // ❌ Throws if not bigint
|
|
164
|
+
* // ⚠️ Code below after this call, will NOT be executed if TypeError is thrown
|
|
165
|
+
* assertIsBigInt(mixedValue, { message: "Must be a bigint!" });
|
|
166
|
+
*
|
|
167
|
+
* // ✅ After this call, TypeScript knows `mixedValue` is bigint
|
|
168
|
+
* const result: bigint = mixedValue; // ➔ Safe to use
|
|
169
|
+
* console.log(result + 100n);
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
declare const assertIsBigInt:(value:unknown,options?:OptionsAssertIs)=>asserts value is bigint;type OptionsAssertIsNumber=OptionsAssertIs & IsNumberOptions;
|
|
173
|
+
/** -------------------------------------------------------
|
|
174
|
+
* * ***Type guard assertion: `assertIsNumber`.***
|
|
175
|
+
* -------------------------------------------------------
|
|
176
|
+
* **This function is an **assertion function**.**
|
|
177
|
+
* - Validates that the given `value` is a **number**.
|
|
178
|
+
* - After it returns successfully, TypeScript narrows the type of `value` to `number`.
|
|
179
|
+
* - **Behavior:**
|
|
180
|
+
* - ✅ If `value` is a `number` ➔ execution continues normally.
|
|
181
|
+
* - ❌ If `value` is not a `number` ➔ throws a `TypeError` with either:
|
|
182
|
+
* - A custom error message (`options.message`), or
|
|
183
|
+
* - A default message including the actual type.
|
|
184
|
+
* - **ℹ️ Note:**
|
|
185
|
+
* - A `number` refers strictly to the JavaScript `number` primitive type (e.g., `42`, `3.14`, `-1`, `0`).
|
|
186
|
+
* - This excludes `Number` objects created with `new Number(123)`.
|
|
187
|
+
* - By default, `NaN` is **not considered** valid, you can allow it with `{ includeNaN: true }`.
|
|
188
|
+
* @param {*} value - The value to validate.
|
|
189
|
+
* @param {OptionsAssertIsNumber} [options] - Optional configuration:
|
|
190
|
+
* - `message`: A custom error message (`string` or `function`).
|
|
191
|
+
* - `formatCase`: Controls type formatting (from `GetPreciseTypeOptions`).
|
|
192
|
+
* - `includeNaN`: Whether to treat `NaN` as valid.
|
|
193
|
+
* @returns {boolean} Narrows `value` to `number` if no error is thrown.
|
|
194
|
+
* @throws {TypeError} If the value is not a number (or is `NaN` when `includeNaN` is `false`).
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts
|
|
197
|
+
* // ✅ Simple usage
|
|
198
|
+
* assertIsNumber(123);
|
|
199
|
+
* // No error, value is number
|
|
200
|
+
*
|
|
201
|
+
* // ❌ Throws TypeError with default message
|
|
202
|
+
* assertIsNumber("42");
|
|
203
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `number`, but received: `string`."
|
|
204
|
+
*
|
|
205
|
+
* // ❌ Throws with custom string message
|
|
206
|
+
* assertIsNumber(true, { message: "Must be a number!" });
|
|
207
|
+
* // ➔ TypeError: "Must be a number!"
|
|
208
|
+
*
|
|
209
|
+
* // ❌ Throws with custom function message + case formatting
|
|
210
|
+
* assertIsNumber("hello", {
|
|
211
|
+
* message: ({ currentType, validType }) =>
|
|
212
|
+
* `Expected ${validType} but got (${currentType}).`,
|
|
213
|
+
* formatCase: "toKebabCase"
|
|
214
|
+
* });
|
|
215
|
+
* // ➔ TypeError: "Expected number but got (string)."
|
|
216
|
+
*
|
|
217
|
+
* // ⚠️ NaN is invalid by default
|
|
218
|
+
* assertIsNumber(NaN);
|
|
219
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `number`, but received: `NaN`."
|
|
220
|
+
*
|
|
221
|
+
* // ✅ Allow NaN explicitly
|
|
222
|
+
* assertIsNumber(NaN, { includeNaN: true });
|
|
223
|
+
* // No error
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* -------------------------------------------------------
|
|
227
|
+
* ✅ ***Real-world usage example***:
|
|
228
|
+
* ```ts
|
|
229
|
+
* const mixedValue: string | number | undefined = getUserInput();
|
|
230
|
+
*
|
|
231
|
+
* // ❌ Throws if not number
|
|
232
|
+
* // ⚠️ Code below after this call, will NOT be executed if TypeError is thrown
|
|
233
|
+
* assertIsNumber(mixedValue, { message: "Must be a number!" });
|
|
234
|
+
*
|
|
235
|
+
* // ✅ After this call, TypeScript knows `mixedValue` is number
|
|
236
|
+
* const result: number = mixedValue; // ➔ Safe to use
|
|
237
|
+
* console.log(result + 100);
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
declare const assertIsNumber:(value:unknown,options?:OptionsAssertIsNumber)=>asserts value is number;
|
|
241
|
+
/** -------------------------------------------------------
|
|
242
|
+
* * ***Type guard assertion: `assertIsArray`.***
|
|
243
|
+
* -------------------------------------------------------
|
|
244
|
+
* **This function is an **assertion function**.**
|
|
245
|
+
* - Validates that the given `value` is a **array**.
|
|
246
|
+
* - After it returns successfully, TypeScript narrows the type of `value` to `array` **(generic support)**.
|
|
247
|
+
* - **Behavior:**
|
|
248
|
+
* - ✅ If `value` is an `array` ➔ execution continues normally.
|
|
249
|
+
* - ❌ If `value` is not an `array` ➔ throws a `TypeError` with either:
|
|
250
|
+
* - A custom error message (`options.message`), or
|
|
251
|
+
* - A default message including the actual type.
|
|
252
|
+
* @template T - The input type being asserted.
|
|
253
|
+
* @param {*} value - The value to validate.
|
|
254
|
+
* @param {OptionsAssertIs} [options] - Optional configuration:
|
|
255
|
+
* - `message`: A custom error message (`string` or `function`).
|
|
256
|
+
* - `formatCase`: Controls type formatting (from `GetPreciseTypeOptions`).
|
|
257
|
+
* @returns {boolean} Narrows `value` to an `array` **(generic support)** if no error is thrown.
|
|
258
|
+
* @throws {TypeError} If the value is not an array.
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts
|
|
261
|
+
* // ✅ Simple usage
|
|
262
|
+
* assertIsArray([1, 2, 3]);
|
|
263
|
+
* // No error, value is array
|
|
264
|
+
*
|
|
265
|
+
* // ❌ Throws TypeError with default message
|
|
266
|
+
* assertIsArray({ a: 1 });
|
|
267
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `array`, but received: `plain-object`."
|
|
268
|
+
*
|
|
269
|
+
* // ❌ Throws with custom string message
|
|
270
|
+
* assertIsArray(42, { message: "Must be an array!" });
|
|
271
|
+
* // ➔ TypeError: "Must be an array!"
|
|
272
|
+
*
|
|
273
|
+
* // ❌ Throws with custom function message + case formatting
|
|
274
|
+
* assertIsArray(42n, {
|
|
275
|
+
* message: ({ currentType, validType }) =>
|
|
276
|
+
* `Expected ${validType} but got (${currentType}).`,
|
|
277
|
+
* formatCase: "toKebabCase"
|
|
278
|
+
* });
|
|
279
|
+
* // ➔ TypeError: "Expected array but got (big-int)."
|
|
280
|
+
* ```
|
|
281
|
+
*
|
|
282
|
+
* -------------------------------------------------------
|
|
283
|
+
* ✅ ***Real-world usage with generic narrowing***:
|
|
284
|
+
* ```ts
|
|
285
|
+
* const mixedValue: string | number[] | undefined = getUserInput();
|
|
286
|
+
*
|
|
287
|
+
* // ❌ Throws if not array
|
|
288
|
+
* // ⚠️ Code below after this call, will NOT be executed if TypeError is thrown
|
|
289
|
+
* assertIsArray(mixedValue, { message: "Must be an array!" });
|
|
290
|
+
*
|
|
291
|
+
* // ✅ After this call, TypeScript knows `mixedValue` is narrowed to number[]
|
|
292
|
+
* const result: number[] = mixedValue; // ➔ Safe to use
|
|
293
|
+
* console.log(result.length);
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
declare function assertIsArray<T extends unknown[]>(value:T,options?:OptionsAssertIs):value is Extract<T,unknown[]>;declare function assertIsArray<T extends readonly unknown[]>(value:T,options?:OptionsAssertIs):value is Extract<T,readonly unknown[]>;declare function assertIsArray(value:unknown,options?:OptionsAssertIs):value is unknown[];
|
|
297
|
+
/** -------------------------------------------------------
|
|
298
|
+
* * ***Type guard assertion: `assertIsPlainObject`.***
|
|
299
|
+
* -------------------------------------------------------
|
|
300
|
+
* **This function is an **assertion function**.**
|
|
301
|
+
* - Validates that the given `value` is a **plain-object**.
|
|
302
|
+
* - After it returns successfully, TypeScript narrows the type of `value` to `plain-object` **(generic support)**.
|
|
303
|
+
* - **Behavior:**
|
|
304
|
+
* - ✅ If `value` is a `plain-object` ➔ execution continues normally.
|
|
305
|
+
* - ❌ If `value` is not a `plain-object` ➔ throws a `TypeError` with either:
|
|
306
|
+
* - A custom error message (`options.message`), or
|
|
307
|
+
* - A default message including the actual type.
|
|
308
|
+
* @template T - The input type being asserted.
|
|
309
|
+
* @param {*} value - The value to validate.
|
|
310
|
+
* @param {OptionsAssertIs} [options] - Optional configuration:
|
|
311
|
+
* - `message`: A custom error message (`string` or `function`).
|
|
312
|
+
* - `formatCase`: Controls type formatting (from `GetPreciseTypeOptions`).
|
|
313
|
+
* @returns {boolean} Narrows `value` to a `plain-object` **(generic support)** if no error is thrown.
|
|
314
|
+
* @throws {TypeError} If `value` is not a `plain-object`.
|
|
315
|
+
* @example
|
|
316
|
+
* ```ts
|
|
317
|
+
* // ✅ Simple usage
|
|
318
|
+
* assertIsPlainObject({ a: 1, b: 2 });
|
|
319
|
+
* // ➔ ok, value is plain object
|
|
320
|
+
*
|
|
321
|
+
* // ❌ Throws TypeError with default message
|
|
322
|
+
* assertIsPlainObject([1, 2, 3]);
|
|
323
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `plain-object`, but received: `array`."
|
|
324
|
+
*
|
|
325
|
+
* // ❌ Throws with custom string message
|
|
326
|
+
* assertIsPlainObject("hello", { message: "Must be plain object!" });
|
|
327
|
+
* // ➔ TypeError: "Must be plain object!"
|
|
328
|
+
*
|
|
329
|
+
* // ❌ Throws with custom message function and formatCase
|
|
330
|
+
* assertIsPlainObject(42n, {
|
|
331
|
+
* message: ({ currentType, validType }) =>
|
|
332
|
+
* `Expected ${validType} but got (${currentType}).`,
|
|
333
|
+
* formatCase: "toKebabCase"
|
|
334
|
+
* });
|
|
335
|
+
* // ➔ TypeError: "Expected plain-object but got (big-int)."
|
|
336
|
+
* ```
|
|
337
|
+
* -------------------------------------------------------
|
|
338
|
+
* ✅ ***Real-world usage with generic narrowing***:
|
|
339
|
+
* ```ts
|
|
340
|
+
* type User = { name: string; email: string };
|
|
341
|
+
* const mixedValue: string | User | boolean | number | undefined = getUserInput();
|
|
342
|
+
*
|
|
343
|
+
* // Throws TypeError if not plain object
|
|
344
|
+
* assertIsPlainObject(mixedValue, { message: "Must be plain object!" });
|
|
345
|
+
*
|
|
346
|
+
* // After this call, TypeScript knows `mixedValue` is narrowed to User
|
|
347
|
+
* const user: User = mixedValue; // ➔ safe
|
|
348
|
+
* console.log(user.email); // ➔ type-safe
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
declare function assertIsPlainObject<T>(value:T,options?:OptionsAssertIs):asserts value is IsPlainObjectResult<T>;
|
|
352
|
+
/** -------------------------------------------------------
|
|
353
|
+
* * ***Type guard assertion: `assertIsString`.***
|
|
354
|
+
* -------------------------------------------------------
|
|
355
|
+
* **This function is an **assertion function**.**
|
|
356
|
+
* - Validates that the given `value` is a **primitive-string**.
|
|
357
|
+
* - After it returns successfully, TypeScript narrows the type of `value` to `primitive-string`.
|
|
358
|
+
* - **Behavior:**
|
|
359
|
+
* - ✅ If `value` is a `primitive-string` ➔ execution continues normally.
|
|
360
|
+
* - ❌ If `value` is not a `primitive-string` ➔ throws a `TypeError` with either:
|
|
361
|
+
* - A custom error message (`options.message`), or
|
|
362
|
+
* - A default message including the actual type.
|
|
363
|
+
* - **ℹ️ Note:**
|
|
364
|
+
* - A "string" refers strictly to a JavaScript `primitive-string` type (e.g., `"hello"`, `""`, `"123"`).
|
|
365
|
+
* - This function excludes `String` objects created with `new String()`.
|
|
366
|
+
* @param {*} value - The value to validate.
|
|
367
|
+
* @param {OptionsAssertIs} [options] - Optional configuration:
|
|
368
|
+
* - `message`: A custom error message (`string` or `function`).
|
|
369
|
+
* - `formatCase`: Controls type formatting (from `GetPreciseTypeOptions`).
|
|
370
|
+
* @returns {boolean} Narrows `value` to `string` if no error is thrown.
|
|
371
|
+
* @throws {TypeError} If the value is not a string.
|
|
372
|
+
* @example
|
|
373
|
+
* ```ts
|
|
374
|
+
* // ✅ Simple usage
|
|
375
|
+
* assertIsString("hello");
|
|
376
|
+
* // ➔ ✅ ok value is string, no error
|
|
377
|
+
*
|
|
378
|
+
* // ❌ Throws TypeError with default message
|
|
379
|
+
* assertIsString(42);
|
|
380
|
+
* // ➔ TypeError: "Parameter input (`value`) must be of type `string`, but received: `number`."
|
|
381
|
+
*
|
|
382
|
+
* // ❌ Throws with custom string message
|
|
383
|
+
* assertIsString(42, { message: "Must be a string!" });
|
|
384
|
+
* // ➔ TypeError: "Must be a string!"
|
|
385
|
+
*
|
|
386
|
+
* // ❌ Throws with custom message function and formatCase
|
|
387
|
+
* assertIsString(42n, {
|
|
388
|
+
* message: ({ currentType, validType }) => `Expected ${currentType} but got (${currentType}).`,
|
|
389
|
+
* formatCase: "toKebabCase"
|
|
390
|
+
* });
|
|
391
|
+
* // ➔ TypeError: "Expected string but got (big-int)."
|
|
392
|
+
* ```
|
|
393
|
+
* -------------------------------------------------------
|
|
394
|
+
* ✅ ***Real-world usage with generic narrowing***:
|
|
395
|
+
* ```ts
|
|
396
|
+
* type User = { name: string; email: string };
|
|
397
|
+
* const mixedValue: string | User | undefined = getUserInput();
|
|
398
|
+
*
|
|
399
|
+
* // Throws TypeError if the value is not string
|
|
400
|
+
* // ⚠️ Code below after this call, will NOT be executed if TypeError is thrown
|
|
401
|
+
* assertIsString(mixedValue, { message: "Must be a string!" });
|
|
402
|
+
*
|
|
403
|
+
* // After this call, TypeScript knows `mixedValue` is string
|
|
404
|
+
* const result: string = mixedValue; // ➔ ✅ safe to use
|
|
405
|
+
* console.log(result.toUpperCase()); // ➔ ✅ type-safe
|
|
406
|
+
* ```
|
|
407
|
+
*/
|
|
408
|
+
declare const assertIsString:(value:unknown,options?:OptionsAssertIs)=>asserts value is string;export{assertIsArray,assertIsBigInt,assertIsBoolean,assertIsNumber,assertIsPlainObject,assertIsString};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{assertIsBigInt,assertIsNumber}from"../chunk-OGPPP2S3.js";export{assertIsArray}from"../chunk-ECRNH4FW.js";export{assertIsString}from"../chunk-T4CIAKEK.js";import"../chunk-QNKGP5DY.js";export{assertIsBoolean,assertIsPlainObject}from"../chunk-EW3I4O7X.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("./chunk-4Z75R3IT.cjs"),t=require("./chunk-D3VSHABU.cjs");exports.normalizeSpaces=(r,i={withTrim:!0,trimOnly:!1})=>{if(!t.isNonEmptyString(r))return"";t.isPlainObject(i)||(i={});const{trimOnly:e=!1,withTrim:n=!0}=i;return e?r.trim():(n&&(r=r.trim()),r.replace(/\s+/g," "))},exports.normalizeString=r=>t.isNonEmptyString(r)?r.trim():"",exports.removeSpaces=(r,i={trimOnly:!1})=>{if(!t.isNonEmptyString(r))return"";t.isPlainObject(i)||(i={});const{trimOnly:e=!1}=i;return e?r.trim():r.replace(/\s+/g,"")},exports.stripHtmlTags=function(i){if(!t.isString(i))return;return r.isEmptyString(i)?"":i.replace(/<\/?[a-zA-Z][^<>]*\/?>/g," ").trim().replace(/\s+/g," ").trim()};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isInteger as e}from"./chunk-WVSPXFTY.js";import{safeStableStringify as r}from"./chunk-BHIBDDQF.js";import{isNonEmptyArray as t,getPreciseType as n,isNumber as a,isPlainObject as m,assertIsBoolean as i,isNaN as h}from"./chunk-EW3I4O7X.js";function o(e){if(!t(e))return;return e[Math.floor(Math.random()*(e.length||0))]}var u=(t,a)=>{if(!e(t)||!e(a))throw new TypeError(`First parameter (\`min\`) and second parameter (\`max\`) must be of type \`integer-number\`${c(t,a)}value, but received: ['min': \`${n(t)}\` - (with value: \`${r(t)})\`, 'max': \`${n(a)}\` - (with value: \`${r(a)}\`)].`);if(t>a)throw new RangeError(`First parameter (\`min\`) must be less than or equal to second parameter (\`max\`), but received: ['min': ${s(t)}, 'max': ${s(a)}].`);return t=Math.max(1,t),a=Math.min(Number.MAX_SAFE_INTEGER,a),Math.floor(Math.random()*(a-t+1))+t},s=e=>a(e,{includeNaN:!0})?e===Number.MIN_VALUE?"`Number.MIN_VALUE`":`${e}`:`\`${n(e)}\``,c=(...e)=>e.some(e=>a(e,{includeNaN:!0})&&e===Number.MIN_VALUE)?" and can't be `Number.MIN_VALUE` ":" ",g=t=>{m(t)||(t={});const{minLength:a=1,maxLength:h=16,avoidZero:o=!1}=t;if(i(o,{message:({currentType:e,validType:r})=>`Parameters \`avoidZero\` must be of type \`${r}\`, but received: \`${e}\`.`}),!e(a)||!e(h))throw new TypeError(`Parameters \`minLength\` and \`maxLength\` must be of type \`integer-number\`, but received: ['minLength': \`${n(a)}\` - (with value: ${r(a)}), 'maxLength': \`${n(h)}\` - (with value: ${r(h)})].`);if(a<1||h>16||a>h)throw new RangeError(`Invalid range at parameters \`minLength\` must be ≥ 1, \`maxLength\` must be ≤ 16, and \`minLength\` ≤ \`maxLength\`, but received: ['minLength': \`${a}\`, 'maxLength': \`${h}\`].`);const s=a===h?a:u(a,h),c=10**(s-1);let g=u(c,10**s-1);return o&&0===g&&(g=c),g},p=t=>{m(t)||(t={});const{minLength:a=40,maxLength:o=40,type:s="string",avoidWhiteSpace:c=!0}=t;if(i(c,{message:({currentType:e,validType:r})=>`Parameters \`avoidWhiteSpace\` property of the \`options\` (first-parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),!e(a)||!e(o))throw new TypeError(`Parameters \`minLength\` and \`maxLength\` must be of type \`integer-number\`, but received: ['minLength': \`${n(a)}\` - (with value: ${r(a)}), 'maxLength': \`${n(o)}\` - (with value: ${r(o)})].`);if(a<1||o>5e3||a>o)throw new RangeError(`Invalid range at parameters \`minLength\` must be ≥ 1, \`maxLength\` must be ≤ 5000, and \`minLength\` ≤ \`maxLength\`, but received: ['minLength': \`${a}\`, 'maxLength': \`${o}\`].`);if("string"!==s&&"number"!==s)throw new TypeError(`Parameter \`type\` must be of type \`string\` with value one of "string" | "number", but received: \`${n(s)}\`, with value: ${r(s)}.`);const g=u(a,o),p="number"===s?(h(Number(t.replaceGenInt))?void 0:t.replaceGenInt)??"0123456789":(t.replaceGenStr?t.replaceGenStr:void 0)??"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",d=(l=p,(c?l.replace(/\s|\n|\t/g,""):l)+(t.addChar||""));var l;if(!d.length){throw new Error(`Character set is empty. ${(()=>"number"===s?c?"If `avoidWhiteSpace` is true, and `replaceGenInt` cant be empty-string value, ensure `replaceGenInt` has valid characters and non-nan string number.":"Ensure `replaceGenInt` has valid characters and not a NaN number string while convert to number.":"Ensure `replaceGenStr` has valid characters and non empty string.")()}`)}let b="";for(let e=0;e<g;e++)b+=d.charAt(Math.floor(Math.random()*d.length));return b};export{o as getRandomItem,u as randomInt,g as randomIntByLength,p as randomStr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("./chunk-D3VSHABU.cjs");exports.isEmptyString=(t,i={})=>!r.isNonEmptyString(t,i);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.noop=()=>{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isServer as e}from"./chunk-MC3LXMCQ.js";import{assertIsString as t}from"./chunk-T4CIAKEK.js";import{isPlainObject as o,hasOwnProp as s,isNonEmptyString as r,isNumber as i}from"./chunk-EW3I4O7X.js";var n=(o="on_processing")=>{if(e())return;t(o,{message:({validType:e,currentType:t})=>`First parameter \`className\` must be of type \`${e}\`, but received: \`${t}\`.`});const{documentElement:s}=document;s&&!s.classList.contains(o)&&s.classList.add(o)},m=(o="on_processing")=>{if(e())return;t(o,{message:({validType:e,currentType:t})=>`First parameter \`className\` must be of type \`${e}\`, but received: \`${t}\`.`});const{documentElement:s}=document;s&&s.classList.contains(o)&&s.classList.remove(o)},c=()=>{if(e())return;const t=document.activeElement;t instanceof HTMLElement&&t.blur()},a=t=>{if(e())return;o(t)||(t={});const n=s(t,"behavior")&&r(t.behavior)&&["auto","instant","smooth"].includes(t.behavior.trim())?t.behavior:"smooth";let m=s(t,"timeout")&&i(t.timeout)&&t.timeout>=1?t.timeout:1;m=m>2147483647?2147483647:m,setTimeout(()=>window.scrollTo({top:0,left:0,behavior:n}),m)};export{n as disableUserInteraction,m as enableUserInteraction,c as removeElementFocus,a as scrollToTop};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=require("./chunk-M47QIBXI.cjs"),r=new Set(["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object BigInt64Array]","[object BigUint64Array]"]);exports.isNonEmptyValue=(r,e={})=>!t.isEmptyValue(r,e),exports.isTypedArray=function(t){return null!=t&&"object"==typeof t&&r.has(Object.prototype.toString.call(t))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-D3VSHABU.cjs");exports.getInitialsName=r=>{if(!e.isNonEmptyString(r))return"";const t=(r=r.replace(/\s+/g," ").trim()).split(" ");return t.length>1?t[0][0]+t[1][0].toUpperCase():r.length>1?r.substring(0,2).toUpperCase():r[0].toUpperCase()},exports.replaceAt=(r,t,i)=>{if(!e.isNumber(r)||!e.isString(i)||!e.isString(t))throw new TypeError(`First parameter (\`index\`) must be of type \`number\`, second parameter (\`originalString\`) and third parameter (\`replaceTo\`) must be of type \`string\`, but received: "['index': \`${e.getPreciseType(r)}\`, 'originalString': \`${e.getPreciseType(t)}\`, 'replaceTo': \`${e.getPreciseType(i)}\`]".`);if(r<0||r>=t.length)throw new RangeError("First parameter (`index`) is out of range from second parameter (`originalString`).");return t.slice(0,r)+i+t.slice(r+1)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isBigInt as r}from"./chunk-QNKGP5DY.js";import{isNaN as t,assertIsPlainObject as e,hasOwnProp as o,isBoolean as n,getPreciseType as s,isFunction as a,isSymbol as i,isUndefined as f,isObjectOrArray as u,isSet as c,isArray as p,isNull as y,isNumber as m,isObject as l}from"./chunk-EW3I4O7X.js";function b(r){return"[object Map]"===Object.prototype.toString.call(r)||r instanceof Map}var S=r=>r instanceof Date&&!t(r.getTime()),g=(g,d={})=>{e(d,{message:({currentType:r,validType:t})=>`Second parameter (\`options\`) must be of type \`${t}\`, but received: \`${r}\`.`});const h=!!o(d,"pretty")&&d.pretty,A=!o(d,"sortKeys")||d.sortKeys,N=!!o(d,"sortArray")&&d.sortArray;if(!n(A)||!n(N)||!n(h))throw new TypeError(`Parameters \`sortKeys\`, \`sortArray\` and \`pretty\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: "['sortKeys': \`${s(A)}\`, 'sortArray': \`${s(N)}\`, 'pretty': \`${s(h)}\`]".`);const j=new WeakSet,v=r=>y(r)||!u(r)&&!a(r),K=e=>{if(e instanceof Number)return Number(e);if(e instanceof String)return String(e);if(e instanceof Boolean)return Boolean(e);if(!a(e)&&!i(e)){if(r(e))return e.toString();if(f(e)||t(e)||e===1/0||e===-1/0)return null;if(u(e)){if(j.has(e))return"[Circular]";if(j.add(e),S(e))return e.toISOString();if(b(e))return{map:Array.from(e.entries()).map(([r,t])=>[r,K(t)])};if(c(e))return{set:Array.from(e.values()).map(K)};if(p(e)){const r=e.map(K);if(N){const t=[],e=[];for(const o of r)v(o)?t.push(o):e.push(o);return t.sort((r,t)=>m(r)&&m(t)?r-t:String(r).localeCompare(String(t))),[...t,...e]}return r}const r=Object.keys(e);A&&r.sort((r,e)=>{const o=Number(r),n=Number(e);return t(o)||t(n)?r.localeCompare(e):o-n});const o={};if(l(e))for(const t of r){const r=K(e[t]);f(r)||(o[t]=r)}return o}return e}};try{return JSON.stringify(K(g),null,h?2:0)}catch(r){return console.warn("Error in safeStableStringify:",r),"{}"}};export{S as isDate,b as isMap,g as safeStableStringify};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{safeJsonParse as e}from"./chunk-XLDAIZRK.js";import{isEqual as r,isEmptyArray as t}from"./chunk-ZTCLKKMB.js";import{assertIsArray as n}from"./chunk-ECRNH4FW.js";import{safeStableStringify as s}from"./chunk-BHIBDDQF.js";import{isPlainObject as i,isNonEmptyArray as o,isObjectOrArray as c,isArray as a,isNaN as u,isUndefined as m}from"./chunk-EW3I4O7X.js";var f=e=>{n(e,{message:({currentType:e,validType:r})=>`First parameter (\`values\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`});const t=[];return e.forEach((n,s)=>{for(let i=s+1;i<e.length;i++)if(r(n,e[i])){t.some(e=>r(e,n))||t.push(n);break}}),t},p=(e,r)=>{if(!i(e))return{};n(r,{message:({currentType:e,validType:r})=>`Second parameter (\`keysToOmit\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`});const t=f(r);if(t.length>0)throw new Error(`Function "omitKeys" Error: Duplicate keys detected - \`${t}\``);return Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e)))},l=(r,p)=>{if(!i(r))return{};n(p,{message:({currentType:e,validType:r})=>`Second parameter (\`keysToOmit\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`});const l=f(p);if(o(l))throw new Error(`Function "omitKeysDeep" Error: Duplicate keys detected - \`${s(l)}\`.`);const y=(e,r)=>{if(!c(e))return e;const[n,...s]=r;if(t(s))if(a(e)){const r=parseInt(n);!u(r)&&r in e&&e.splice(r,1)}else delete e[n];else{const r=e[n];c(r)&&(e[n]=y(r,s))}return e},d=e=>{if(a(e))return e.map(d).filter(e=>!(c(e)&&0===Object.keys(e).length));if(c(e)){return Object.fromEntries(Object.entries(e).map(([e,r])=>[e,d(r)]).filter(([,e])=>!(m(e)||c(e)&&0===Object.keys(e).length)))}return e},b=e(s(r));for(const e of p){const r=e.split(".");y(b,r)}return d(b)};export{f as findDuplicates,p as omitKeys,l as omitKeysDeep};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=require("./chunk-D3VSHABU.cjs");exports.isFinite=function(e){return i.isNumber(e)&&Number.isFinite(e)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=e=>"boolean"==typeof e,r=e=>"function"==typeof e;function t(e){return null==e}function o(e){return Array.isArray(e)}function a(e){return"object"==typeof e&&!t(e)&&!o(e)}function n(e){if(!a(e))return!1;const r=Object.getPrototypeOf(e);return r===Object.prototype||null===r}var s=e=>"string"==typeof e;function i(e){return"number"==typeof e?Number.isNaN(e):"[object Number]"===Object.prototype.toString.call(e)&&Number.isNaN(Number(e).valueOf())}var l=e=>null===e,c=(r,t={})=>{if(e(r))return;const o=U({value:r,options:t,requiredValidType:"boolean"});throw new TypeError(o)},u=(r,t={})=>{$(t,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const o=!(!n(t)||!e(t.includeNaN))&&t.includeNaN;c(o,{message:({currentType:e,validType:r})=>`Parameter \`includeNaN\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const a="number"==typeof r;return o?a:a&&!Number.isNaN(r)},p=e=>"symbol"==typeof e,f=e=>void 0===e;function m(e){return o(e)||a(e)}function y(e,t,o={}){if(!s(e)&&!m(e)&&!r(e))return!1;$(o,{message:({currentType:e,validType:r})=>`Third parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const a=void 0===o.discardUndefined||o.discardUndefined,n=void 0!==o.discardNull&&o.discardNull;c(a,{message:({currentType:e,validType:r})=>`Parameter \`discardUndefined\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),c(n,{message:({currentType:e,validType:r})=>`Parameter \`discardNull\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const y=[];if(s(t)&&t.trim().length>0||u(t,{includeNaN:!0})){(u(t,{includeNaN:!0})?String(t):t).split(".").forEach(e=>{const r=e.match(/^\[(\d+)\]$/),t=e.match(/^Symbol\((.+)\)$/);r?y.push(Number(r[1])):t?y.push(Symbol.for(t[1])):i(Number(e))?y.push(e):y.push(Number(e))})}else{if(!p(t))return!1;y.push(t)}let b=s(e)&&e.trim().length>0?Object(e):e;for(const e of y)if(s(e)&&e.trim().length>0||u(e,{includeNaN:!0})){if(l(b)||!Object.prototype.hasOwnProperty.call(b,e))return!1;b=b[e]}else{if(!p(e))return!1;{if(l(b)||"object"!=typeof b&&!r(b))return!1;const t=Object.getOwnPropertySymbols(b).find(r=>r===e||r.description===e.description);if(!t)return!1;b=b[t]}}return(!a||!f(b))&&(!n||!l(b))}var b=(e,r={})=>{if(!s(e))return!1;$(r,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const t=!y(r,"trim")||r.trim;c(t,{message:({currentType:e,validType:r})=>`Parameter \`trim\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`});return(t?e.trim():e).length>0};function d(e){return"[object Set]"===Object.prototype.toString.call(e)||e instanceof Set}function g(e){return Array.isArray(e)&&e.length>0}var v=e=>{let r="";return o(e)?r=e.map(e=>b(e)?e.trim():"").filter(e=>e.length).join("-"):b(e)&&(r=e.trim()),r.split(/[^\p{L}\p{N}]+/u).filter(Boolean)},h=e=>{const r=new Set([]),t=e=>e.trim().split(/[^\p{L}\p{N}]+/u).filter(Boolean).join("");if(b(e)){const o=t(e);o&&r.add(o)}return g(e)&&e.forEach(e=>{if(b(e)){const o=t(e);o&&r.add(o)}}),d(e)&&e.forEach(e=>{if(b(e)){const o=t(e);o&&r.add(o)}}),r},S=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map((e,r)=>o.has(e)?e:0===r?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")},j=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")},C=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")},N=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join(" ")},x=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join("-")},w=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join("_")},A=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join(".")},T=(e,r)=>{if(!g(e)&&!b(e))return"";const t=v(e),o=h(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join("-").replace(/^-+|-+$/g,"")},P=e=>"[object Error]"===Object.prototype.toString.call(e)||e instanceof Error,O=e=>"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e),E=Object.freeze(["URI","URL","HTTP","HTTPS","HTML","XML","CSS","JS","JSON","SVG","DOM","UTC","XHR","RTC","ICE","TLS","TCP","UDP","IDB","ID"]),I=e=>e.replace(/[\s_\-]+/g,"").toLowerCase(),R=Object.entries({string:"String",number:"Number",boolean:"Boolean",bigint:"Big Int",symbol:"Symbol",undefined:"Undefined",null:"Null",regexp:"Reg Exp",reflect:"Reflect",proxy:"Proxy",atomics:"Atomics",object:"Object",array:"Array",arguments:"Arguments",function:"Function",asyncfunction:"Async Function",generatorfunction:"Generator Function",asyncgeneratorfunction:"Async Generator Function",generator:"Generator",promise:"Promise",evalerror:"Eval Error",rangeerror:"Range Error",referenceerror:"Reference Error",syntaxerror:"Syntax Error",typeerror:"Type Error",urierror:"URI Error",aggregateerror:"Aggregate Error",error:"Error",int8array:"Int 8 Array",uint8array:"Uint 8 Array",uint8clampedarray:"Uint 8 Clamped Array",int16array:"Int 16 Array",uint16array:"Uint 16 Array",int32array:"Int 32 Array",uint32array:"Uint 32 Array",float32array:"Float 32 Array",float64array:"Float 64 Array",bigint64array:"Big Int 64 Array",biguint64array:"Big Uint 64 Array",arraybuffer:"Array Buffer",sharedarraybuffer:"Shared Array Buffer",dataview:"Data View",arraybufferview:"Array Buffer View",map:"Map",set:"Set",weakmap:"Weak Map",weakset:"Weak Set",mapiterator:"Map Iterator",setiterator:"Set Iterator",arrayiterator:"Array Iterator",stringiterator:"String Iterator",readablestream:"Readable Stream",writablestream:"Writable Stream",transformstream:"Transform Stream",readablestreamdefaultreader:"Readable Stream Default Reader",writablestreamdefaultwriter:"Writable Stream Default Writer",readablestreamdefaultcontroller:"Readable Stream Default Controller",transformstreamdefaultcontroller:"Transform Stream Default Controller",abortcontroller:"Abort Controller",abortsignal:"Abort Signal",fetch:"fetch",request:"Request",response:"Response",headers:"Headers",formdata:"FormData",blob:"Blob",file:"File",filelist:"FileList",filereader:"FileReader",intl:"Intl",collator:"Intl. Collator",datetimeformat:"Intl. Date Time Format",listformat:"Intl. List Format",numberformat:"Intl. Number Format",pluralrules:"Intl. Plural Rules",relativetimeformat:"Intl. Relative Time Format",segmenter:"Intl. Segmenter",locale:"Intl. Locale",displaynames:"Intl. Display Names",finalizationregistry:"Finalization Registry",weakref:"Weak Ref",structuredclone:"structured Clone",urlpattern:"URL Pattern",performance:"Performance",performanceobserver:"Performance Observer",performanceentry:"Performance Entry",performancemark:"Performance Mark",performancemeasure:"Performance Measure",webassembly:"Web Assembly",wasmmodule:"WebAssembly .Module",wasminstance:"WebAssembly. Instance",wasmmemory:"WebAssembly. Memory",wasmtable:"WebAssembly. Table",buffer:"Buffer",process:"Process",eventemitter:"Event Emitter",stream:"Stream",fs:"fs",path:"path",url:"URL",urlsearchparams:"URL Search Params",node:"Node",element:"Element",htmlelement:"HTML Element",svgelement:"SVG Element",document:"Document",documentfragment:"Document Fragment",shadowroot:"Shadow Root",nodelist:"Node List",htmlcollection:"HTML Collection",mutationobserver:"Mutation Observer",intersectionobserver:"Intersection Observer",resizeobserver:"Resize Observer"}).reduce((e,[r,t])=>(e[I(r)]=t,e),{});var L=(e,r)=>"toPascalCaseSpace"===r?j(e,E):"slugify"===r?T(e,E):"toCamelCase"===r?S(e,E):"toDotCase"===r?A(e,E):"toKebabCase"===r?x(e,E):"toPascalCase"===r?C(e,E):"toSnakeCase"===r?w(e,E):N(e,E),B=(e,t={formatCase:"toLowerCase"})=>{var o,s;n(t)||(t={});const c=t.formatCase;if(l(e))return L(R[I("null")]??"Null",c);if(i(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(e instanceof Number)return L("Number Constructor",c);if(e instanceof String)return L("String Constructor",c);if(e instanceof Boolean)return L("Boolean Constructor",c);const u=typeof e;if(!m(e)&&!r(e))return L(R[I(u)]??u,c);if(O(e))return L(R[I("buffer")]??"Buffer",c);if(function(e){if("object"!=typeof e||null===e)return!1;const r=Object.prototype.toString.call(e);if(["[object Array]","[object Date]","[object RegExp]","[object Map]","[object Set]","[object WeakMap]","[object WeakSet]","[object Function]","[object Error]","[object Promise]","[object Generator]","[object GeneratorFunction]","[object AsyncFunction]"].includes(r))return!1;try{return Reflect.defineProperty(e,"__proxy_detect__",{configurable:!0,value:1}),Reflect.deleteProperty(e,"__proxy_detect__"),!1}catch{return!0}}(e))return L(R[I("proxy")]??"Proxy",c);if(a(e)&&r(null==e?void 0:e.next)&&r(null==e?void 0:e.throw))return L(R[I("generator")]??"Generator",c);if(P(e)){const r=(null==(o=e.constructor)?void 0:o.name)??"Error";return L(R[I(r)]??R[I(r.replace(/\s+/g,""))]??r,c)}if(l(Object.getPrototypeOf(e)))return L(R[I("object")]??"Object",c);const p=Object.prototype.toString.call(e).slice(8,-1)||"Object",f=R[I(p)];if(f)return L(f,c);const y=null==(s=null==e?void 0:e.constructor)?void 0:s.name;return L(y&&"Object"!==y?R[I(y)]??y:p,c)};function U(e){const{requiredValidType:t,value:o,options:a}=e||{},{message:s,formatCase:i}=n(a)?a:{},l=x(t),c=B(o,{formatCase:i}),u={currentType:c,validType:l},p=`Parameter input (\`value\`) must be of type \`${l}\`, but received: \`${c}\`.`;return r(s)?b(s(u))?s(u).trim():p:b(s)?s.trim():p}function $(e,r={}){if(n(e))return;const t=U({value:e,options:r,requiredValidType:"plain object"});throw new TypeError(t)}exports.assertIsBoolean=c,exports.assertIsPlainObject=$,exports.capitalizeFirst=(e,r={lowerCaseNextRest:!0,trim:!1})=>{if(!b(e))return"";n(r)||(r={});const t=!1!==r.lowerCaseNextRest;return!0===r.trim&&(e=e.trim()),e[0].toUpperCase()+(t?e.slice(1).toLowerCase():e.slice(1))},exports.capitalizeWords=(e,r={collapseSpaces:!1,trim:!1})=>{var t,o;if(!b(e))return"";let a=e;n(r)||(r={});const s=!0===r.collapseSpaces;if(!0===r.trim&&(a=a.trim()),s){const e=(null==(t=a.match(/^\s*/))?void 0:t[0])??"",r=(null==(o=a.match(/\s*$/))?void 0:o[0])??"";a=a.trim().replace(/\s+/g," "),a=`${e}${a}${r}`}return a.toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},exports.getPreciseType=B,exports.hasOwnProp=y,exports.isArray=o,exports.isBoolean=e,exports.isBuffer=O,exports.isError=P,exports.isFunction=r,exports.isNaN=i,exports.isNil=t,exports.isNonEmptyArray=g,exports.isNonEmptyString=b,exports.isNull=l,exports.isNumber=u,exports.isObject=a,exports.isObjectOrArray=m,exports.isPlainObject=n,exports.isSet=d,exports.isString=s,exports.isSymbol=p,exports.isUndefined=f,exports.resolveErrorMessageAssertions=U,exports.slugify=T,exports.toCamelCase=S,exports.toDotCase=A,exports.toKebabCase=x,exports.toLowerCase=N,exports.toPascalCase=C,exports.toPascalCaseSpace=j,exports.toSnakeCase=w;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-6C3ATUGM.cjs"),r=require("./chunk-H3FXL4DU.cjs"),t=require("./chunk-JARPXKBM.cjs"),i=require("./chunk-VHAPTHEA.cjs"),s=require("./chunk-CMJ6UYWW.cjs"),n=require("./chunk-4Z75R3IT.cjs"),o=require("./chunk-VCFXNV3Q.cjs"),a=require("./chunk-ZHV5ZYVN.cjs"),m=require("./chunk-UDA26MCU.cjs"),y=require("./chunk-D3VSHABU.cjs");var p=e=>!y.isNil(e)&&(y.isString(e)?y.isNonEmptyString(e):y.isBoolean(e)?e:y.isNumber(e,{includeNaN:!0})?0!==e:y.isArray(e)?e.some(p):!!y.isObject(e)&&Object.values(e).some(p)),c=(e,r)=>{if(!y.isObjectOrArray(e))return e;const[i,...s]=r;if(y.isArray(e))for(const t of e)y.isObjectOrArray(t)&&c(t,r);else t.isEmptyArray(s)?y.isPlainObject(e)&&delete e[i]:y.isPlainObject(e)&&y.isObjectOrArray(e[i])&&c(e[i],s);return e},u=(e,r)=>{if(!y.isPlainObject(e))return e;const[t,...i]=r;return 0===i.length?y.isPlainObject(e)&&delete e[t]:y.isPlainObject(e[t])&&u(e[t],i),e};exports.convertType=e=>{const r={undefined:void 0,null:null,nan:NaN,true:!0,false:!1,yes:!0,no:!1};if(y.isString(e)){const t=e.trim().toLowerCase();if(Object.prototype.hasOwnProperty.call(r,t))return r[t];const i=t.replace(/,/g,""),s=Number(i);return!y.isNaN(s)&&y.isNonEmptyString(i)?s:e.trim()}return e},exports.removeObjectPaths=function(e,r,s=!0){if(t.isEmptyObject(e,{checkSymbols:!0}))return{};if(i.assertIsArray(r,{message:({currentType:e,validType:t})=>`Second parameter (\`keysToDelete\`) must be of type \`${t}\` with value of { key: string, deep?: boolean } plain-object, but received: \`${e}\`, with value: \`${a.safeStableStringify(r)}\`.`}),!r.every(e=>y.isPlainObject(e)&&"key"in e))throw new TypeError(`Each element in Second Parameter (\`keysToDelete\`) must be of type \`plain-object\` with at least a "key" property (optionally "deep"), but received: \`${a.safeStableStringify(r)}\`.`);let n=s?(e=>{try{if(y.isFunction(structuredClone))return structuredClone(e)}catch{}return JSON.parse(JSON.stringify(e))})(e):e;for(const{key:e,deep:t}of r){if(o.assertIsString(e,{message:({currentType:e,validType:r})=>`Parameter \`key\` at Second Parameter (\`keysToDelete\`) must be of type \`${r}\`, but received: \`${e}\`.`}),!y.isUndefined(t)&&!y.isBoolean(t))throw new TypeError(`Parameter \`deep\` at Second Parameter (\`keysToDelete\`) ➔ (key: "${e}", deep: ${t}) must be of type \`boolean\` or \`undefined\`, but received: \`${y.getPreciseType(t)}\`.`);const r=e.split(".");n=t?c(n,r):u(n,r)}return n},exports.toBooleanContent=r=>!y.isNil(r)&&(y.isString(r)?y.isNonEmptyString(r):y.isBoolean(r)?r:y.isNumber(r,{includeNaN:!0})?0!==r:y.isArray(r)||y.isObject(r)?e.isNonEmptyValue(r):Boolean(r)),exports.toBooleanContentDeep=p,exports.toBooleanExplicit=(e,r={})=>{if(y.isNil(e))return!1;y.isPlainObject(r)||(r={});const t=!!y.hasOwnProp(r,"caseInsensitive")&&r.caseInsensitive,i=!y.hasOwnProp(r,"trimString")||r.trimString,s=!!y.hasOwnProp(r,"includeIndeterminate")&&r.includeIndeterminate;if(!y.isBoolean(t)||!y.isBoolean(i)||!y.isBoolean(s))throw new TypeError(`Parameters \`caseInsensitive\`, \`trimString\` and \`includeIndeterminate\` property of the \`options\` (second parameter) expected to be a \`boolean\` type, but received: ['caseInsensitive': \`${y.getPreciseType(t)}\`, 'trimString': \`${y.getPreciseType(i)}\`, 'includeIndeterminate': \`${y.getPreciseType(s)}\`].`);if(y.isString(e)){let r=e;i&&(r=r.trim()),t&&(r=r.toLowerCase());const n=["true","on","yes","1"];return s&&n.push("indeterminate"),n.includes(r)}return y.isNumber(e)?1===e:!!y.isBoolean(e)&&e},exports.toBooleanLoose=e=>!y.isNil(e)&&(y.isString(e)?!n.isEmptyString(e):y.isBoolean(e)?e:y.isNumber(e,{includeNaN:!0})?0!==e:y.isArray(e)?e.length>0:Boolean(e)),exports.toNumberArrayUnRecursive=function(e,t={}){y.assertIsPlainObject(t,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const i=!y.hasOwnProp(t,"removeInvalidValueNumber")||t.removeInvalidValueNumber;if(y.assertIsBoolean(i,{message:({currentType:e,validType:r})=>`Parameter \`removeInvalidValueNumber\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),y.isArray(e)){const t=Array.from(e,e=>{if(m.isBigInt(e))return Number(e);const r=String(e).trim().match(/-?\d+(\.\d+)?/);return r?Number(r[0]):y.isNull(e)?null:void 0});return i?r.filterNilArray(t):t}},exports.toNumberDeep=function(r,i={}){return y.assertIsPlainObject(i,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`}),function r(i,n){if(y.isNil(i))return;const{removeEmptyArrays:o,removeEmptyObjects:m,isRoot:p}=n;if(!y.isBoolean(m)||!y.isBoolean(o))throw new TypeError(`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${y.getPreciseType(m)}\`, 'removeEmptyArrays': \`${y.getPreciseType(o)}\`].`);if(y.isNumber(i)||y.isNonEmptyString(i)&&!y.isNaN(Number(i))){const e=Number(i);return s.isFinite(e)?e:void 0}if(y.isArray(i)){const e=i.map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!y.isUndefined(e));if(o&&t.isEmptyArray(e))return;return e}if(y.isSet(i)){const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!y.isUndefined(e));if(o&&t.isEmptyArray(e))return;return e}if(a.isMap(i)){let e=Array.from(i.entries()).map(([e,t])=>{const i=r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1}),s=r(t,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1});return y.isUndefined(i)||y.isUndefined(s)?void 0:[i,s]}).filter(e=>!y.isUndefined(e));if(o&&(e=e.filter(e=>!(y.isArray(e)&&0===e.length))),o&&t.isEmptyArray(e))return;return e}if(y.isBuffer(i)){const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!y.isUndefined(e));if(o&&t.isEmptyArray(e))return;return e}if(e.isTypedArray(i)){if(i instanceof BigInt64Array||i instanceof BigUint64Array){const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!y.isUndefined(e));if(o&&t.isEmptyArray(e))return;return e}{const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1})).filter(e=>!y.isUndefined(e));if(o&&t.isEmptyArray(e))return;return e}}if(a.isDate(i))return y.isNaN(i.getTime())?0:i.getTime();if(y.isObject(i)){const e={};for(const[t,s]of Object.entries(i)){const i=r(s,{removeEmptyObjects:m,removeEmptyArrays:o,isRoot:!1});y.isUndefined(i)||(e[t]=i)}return m&&t.isEmptyObject(e)?p?{}:void 0:e}}(r,{removeEmptyObjects:!!y.hasOwnProp(i,"removeEmptyObjects")&&i.removeEmptyObjects,removeEmptyArrays:!!y.hasOwnProp(i,"removeEmptyArrays")&&i.removeEmptyArrays,isRoot:!0})},exports.toStringDeep=function(r,i={}){return y.assertIsPlainObject(i,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`}),function r(i,s){if(y.isNil(i))return;const{removeEmptyArrays:n,removeEmptyObjects:o,isRoot:m}=s;if(!y.isBoolean(o)||!y.isBoolean(n))throw new TypeError(`Parameters \`removeEmptyObjects\` and \`removeEmptyArrays\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['removeEmptyObjects': \`${y.getPreciseType(o)}\`, 'removeEmptyArrays': \`${y.getPreciseType(n)}\`].`);if(y.isNumber(i)||y.isString(i))return String(i);if(a.isDate(i))return i.toISOString();if(t.isRegExp(i))return i.toString();if(y.isBuffer(i))return Array.from(i).map(e=>String(e)).filter(e=>!y.isUndefined(e));if(e.isTypedArray(i)){if(i instanceof BigInt64Array||i instanceof BigUint64Array){const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1})).map(e=>String(e)).filter(e=>!y.isUndefined(e));if(n&&t.isEmptyArray(e))return;return e}{const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1})).map(e=>String(e)).filter(e=>!y.isUndefined(e));if(n&&t.isEmptyArray(e))return;return e}}if(y.isSet(i)){const e=Array.from(i).map(e=>r(e,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1})).filter(e=>!y.isUndefined(e));if(n&&t.isEmptyArray(e))return;return e}if(a.isMap(i)){const e=Array.from(i.entries()).map(([e,t])=>[r(e,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1}),r(t,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1})]).filter(([e,r])=>!y.isUndefined(e)&&!y.isUndefined(r));if(n&&t.isEmptyArray(e))return;return e}if(y.isArray(i)){let e=i.map(e=>r(e,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1})).filter(e=>!y.isUndefined(e));if(n&&(e=e.filter(e=>!(y.isArray(e)&&0===e.length))),n&&t.isEmptyArray(e))return;return e}if(y.isObject(i)){const e={};for(const[t,s]of Object.entries(i)){const i=r(s,{removeEmptyObjects:o,removeEmptyArrays:n,isRoot:!1});y.isUndefined(i)?y.isArray(s)&&!n&&(e[t]=[]):e[t]=i}return o&&0===Object.keys(e).length?m?{}:void 0:e}}(r,{removeEmptyObjects:!!y.hasOwnProp(i,"removeEmptyObjects")&&i.removeEmptyObjects,removeEmptyArrays:!!y.hasOwnProp(i,"removeEmptyArrays")&&i.removeEmptyArrays,isRoot:!0})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.isInteger=function(e){return"number"==typeof e&&Number.isInteger(e)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isArray as r,resolveErrorMessageAssertions as o}from"./chunk-EW3I4O7X.js";function e(e,n){if(r(e))return;const t=o({value:e,options:n,requiredValidType:"array"});throw new TypeError(t)}export{e as assertIsArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-EOZKYR5S.cjs"),r=require("./chunk-JARPXKBM.cjs"),t=require("./chunk-VHAPTHEA.cjs"),s=require("./chunk-ZHV5ZYVN.cjs"),i=require("./chunk-D3VSHABU.cjs"),n=e=>{t.assertIsArray(e,{message:({currentType:e,validType:r})=>`First parameter (\`values\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`});const s=[];return e.forEach((t,i)=>{for(let n=i+1;n<e.length;n++)if(r.isEqual(t,e[n])){s.some(e=>r.isEqual(e,t))||s.push(t);break}}),s};exports.findDuplicates=n,exports.omitKeys=(e,r)=>{if(!i.isPlainObject(e))return{};t.assertIsArray(r,{message:({currentType:e,validType:r})=>`Second parameter (\`keysToOmit\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`});const s=n(r);if(s.length>0)throw new Error(`Function "omitKeys" Error: Duplicate keys detected - \`${s}\``);return Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e)))},exports.omitKeysDeep=(a,c)=>{if(!i.isPlainObject(a))return{};t.assertIsArray(c,{message:({currentType:e,validType:r})=>`Second parameter (\`keysToOmit\`) must be of type \`${r}\` (array literal or instance), but received: \`${e}\`.`});const o=n(c);if(i.isNonEmptyArray(o))throw new Error(`Function "omitKeysDeep" Error: Duplicate keys detected - \`${s.safeStableStringify(o)}\`.`);const u=(e,t)=>{if(!i.isObjectOrArray(e))return e;const[s,...n]=t;if(r.isEmptyArray(n))if(i.isArray(e)){const r=parseInt(s);!i.isNaN(r)&&r in e&&e.splice(r,1)}else delete e[s];else{const r=e[s];i.isObjectOrArray(r)&&(e[s]=u(r,n))}return e},y=e=>{if(i.isArray(e))return e.map(y).filter(e=>!(i.isObjectOrArray(e)&&0===Object.keys(e).length));if(i.isObjectOrArray(e)){return Object.fromEntries(Object.entries(e).map(([e,r])=>[e,y(r)]).filter(([,e])=>!(i.isUndefined(e)||i.isObjectOrArray(e)&&0===Object.keys(e).length)))}return e},l=e.safeJsonParse(s.safeStableStringify(a));for(const e of c){const r=e.split(".");u(l,r)}return y(l)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-JARPXKBM.cjs"),r=require("./chunk-5C2SMIGX.cjs"),t=require("./chunk-ZHV5ZYVN.cjs"),o=require("./chunk-D3VSHABU.cjs"),n=e=>{if(!o.isString(e)&&!o.isNumber(e))return 0;const r=String(e).trim().replace(/[^0-9]/g,"");return Number(r)||0},s=(e={})=>{o.assertIsPlainObject(e,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const t=!!o.hasOwnProp(e,"convertBooleans")&&e.convertBooleans,n=!!o.hasOwnProp(e,"convertDates")&&e.convertDates,s=!!o.hasOwnProp(e,"convertNumbers")&&e.convertNumbers,i=!!o.hasOwnProp(e,"loggingOnFail")&&e.loggingOnFail,a=!!o.hasOwnProp(e,"removeEmptyArrays")&&e.removeEmptyArrays,c=!!o.hasOwnProp(e,"removeEmptyObjects")&&e.removeEmptyObjects,l=!!o.hasOwnProp(e,"removeNulls")&&e.removeNulls,u=!!o.hasOwnProp(e,"removeUndefined")&&e.removeUndefined,m=!!o.hasOwnProp(e,"strictMode")&&e.strictMode,p=!!o.hasOwnProp(e,"checkSymbols")&&e.checkSymbols,N=!!o.hasOwnProp(e,"convertNaN")&&e.convertNaN,v=o.hasOwnProp(e,"customDateFormats")?e.customDateFormats:[],d=o.hasOwnProp(e,"onError")?e.onError:r.noop;if(!(o.isBoolean(t)&&o.isBoolean(n)&&o.isBoolean(s)&&o.isBoolean(N)&&o.isBoolean(p)&&o.isBoolean(i)&&o.isBoolean(a)&&o.isBoolean(c)&&o.isBoolean(l)&&o.isBoolean(u)&&o.isBoolean(m)&&o.isArray(v)&&o.isFunction(d)))throw new TypeError(`Invalid \`options\` parameter (second argument): \`convertBooleans\`, \`convertDates\`, \`convertNumbers\`, \`loggingOnFail\`, \`removeEmptyArrays\`, \`removeEmptyObjects\`, \`removeNulls\`, \`removeUndefined\`, \`strictMode\` expected to be a \`boolean\` type, \`customDateFormats\` expected to be a \`array\` type and \`onError\` expected to be a \`void function\` type. But received: ['convertBooleans': \`${o.getPreciseType(t)}\`, 'convertDates': \`${o.getPreciseType(n)}\`, 'convertNumbers': \`${o.getPreciseType(s)}\`, 'loggingOnFail': \`${o.getPreciseType(i)}\`, 'removeEmptyArrays': \`${o.getPreciseType(a)}\`, 'removeEmptyObjects': \`${o.getPreciseType(c)}\`, 'removeNulls': \`${o.getPreciseType(l)}\`, 'removeUndefined': \`${o.getPreciseType(u)}\`, 'strictMode': \`${o.getPreciseType(m)}\`, 'customDateFormats': \`${o.getPreciseType(v)}\`, 'onError': \`${o.getPreciseType(d)}\`].`);return{convertBooleans:t,convertDates:n,convertNumbers:s,convertNaN:N,loggingOnFail:i,removeEmptyArrays:a,removeEmptyObjects:c,removeNulls:l,removeUndefined:u,strictMode:m,customDateFormats:v,onError:d,checkSymbols:p}},i=(r,t={})=>{var n;const c=s(t);if(o.isNull(r))return c.removeNulls?void 0:null;if(!o.isUndefined(r)){if(o.isString(r)){const e=r.trim();if(c.convertNaN&&"NaN"===e)return NaN;if(c.convertNumbers&&!o.isNaN(Number(e)))return Number(e);if(c.convertBooleans){if("true"===e)return!0;if("false"===e)return!1}if(c.convertDates){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e))return new Date(e);if(null==(n=c.customDateFormats)?void 0:n.length)for(const r of c.customDateFormats){const t=a(e,r);if(t)return t}}return c.strictMode?void 0:e}if(o.isArray(r)){const t=r.map(e=>i(e,c)).filter(e=>!o.isUndefined(e));return c.removeEmptyArrays&&e.isEmptyArray(t)?void 0:t}if(o.isObject(r)){const t={};for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const n=i(r[e],c);o.isUndefined(n)||(t[e]=n)}return c.removeEmptyObjects&&e.isEmptyObject(t,{checkSymbols:c.checkSymbols})?void 0:t}return c.strictMode?void 0:r}c.removeUndefined},a=(e,r)=>{if(!o.isNonEmptyString(e)||!o.isNonEmptyString(r))throw new TypeError(`Parameter \`dateString\` and \`format\` must be of type \`string\` and not empty-string, but received: "['dateString': \`${o.getPreciseType(e)}\` - (current value: \`${t.safeStableStringify(e)}\`), 'format': \`${o.getPreciseType(r)}\` - (current value: \`${t.safeStableStringify(r)}\`)]".`);const n=e.split(/[-/]/).map(Number);if(3!==n.length||n.some(o.isNaN))return null;let s,i,a;if("DD/MM/YYYY"===r)[s,i,a]=n;else{if("MM/DD/YYYY"!==r)return null;[i,s,a]=n}i-=1;const c=new Date(a,i,s);return c.getFullYear()!==a||c.getMonth()!==i||c.getDate()!==s?null:c};exports.cleanParsedData=i,exports.extractDigits=n,exports.parseCustomDate=a,exports.safeJsonParse=function(e,r={}){if(o.isNull(e))return null;const t=s(r);if(t.convertNaN&&(o.isNaN(e)||o.isNonEmptyString(e)&&"NaN"===e))return NaN;if(t.convertNumbers&&!o.isNaN(Number(e))&&o.isNumber(n(e)))return Number(e);if(o.isString(e))try{let r=function(e){const r=new Set(["\\",'"',"/","b","f","n","r","t","u"]);let t="",o=!1,n=!1,s=!1;for(let i=0;i<e.length;i++){const a=e[i];if(s)o?"'"===a?t+="'":r.has(a)?t+="\\"===a?"\\\\":'"'===a?'\\"':"\\"+a:t+="\\\\"+a:n?'"'===a?t+='\\"':r.has(a)?t+="\\"+a:t+="\\\\"+a:t+="\\"+a,s=!1;else if("\\"!==a){if(o||n){if(o){if("'"===a){t+='"',o=!1;continue}}else if(n&&'"'===a){t+='"',n=!1;continue}}else{if("'"===a){t+='"',o=!0;continue}if('"'===a){t+='"',n=!0;continue}}t+=a}else s=!0}return t}(e);r=t.removeUndefined?r.replace(/,\s*"[^"]*"\s*:\s*undefined(?=\s*[},])/g,"").replace(/"[^"]*"\s*:\s*undefined\s*(,)?/g,""):r.replace(/:\s*undefined(?=\s*[,}])/g,":null"),r=t.convertNaN?r.replace(/:\s*NaN(?=\s*[,}])/g,':"NaN"'):r.replace(/:\s*NaN(?=\s*[,}])/g,':"NaN"').replace(/,\s*"[^"]*"\s*:\s*NaN(?=\s*[},])/g,"").replace(/"[^"]*"\s*:\s*NaN\s*(,)?/g,""),r=r.replace(/,(\s*[}\]])/g,"$1");const o=JSON.parse(r);return i(o,t)}catch(e){return t.loggingOnFail&&console.error("Failed to parsing at `safeJsonParse`:",e),void t.onError(o.isError(e)?new Error(e.message.replace(/^JSON\.parse:/,"Failed to parsing")):new Error(String(e)))}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNonEmptyString as e}from"./chunk-EW3I4O7X.js";var l=l=>{if(!e(l))return 0;let c=l.trim().replace(/\u00A0/g,"").replace(/\u202F/g,""),s=!1;/^\(.*\)$/.test(c)&&(s=!0,c=c.slice(1,-1).trim()),c=c.replace(/^[-\s]+/,e=>e.includes("-")?"-":"").replace(/[\s.,-]+$/,""),s=s||/^-/.test(c)||/^[^\d]*-/.test(c);let r=c.replace(/[^0-9.,'\s]/g,"").replace(/[\s']/g,"");const t=r.match(/,\d{2}/g);if(t&&t.length>1)r=r.replace(/,/g,"");else{const e=(r.match(/\./g)||[]).length,l=(r.match(/,/g)||[]).length;if(e>1&&0===l)r=r.replace(/\./g,"");else if(l>1&&0===e)r=r.replace(/,/g,"");else{const e=r.lastIndexOf(","),l=r.lastIndexOf(".");if(e>l)r=r.replace(/\./g,"").replace(",",".");else if(l>e)r=r.replace(/,/g,"");else if(e>l){const l=r.slice(0,e).replace(/,/g,"").replace(/\./g,""),c=r.slice(e+1);r=l+"."+c}else if(l>e){const e=r.slice(0,l).replace(/\./g,"").replace(/,/g,""),c=r.slice(l+1);r=e+"."+c}else-1!==e?r=r.replace(/,/g,""):-1!==l&&(r=r.replace(/\./g,""))}}const a=parseFloat(r)||0;return s?-a:a};export{l as parseCurrencyString};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=e=>"boolean"==typeof e,r=e=>"function"==typeof e;function t(e){return null==e}function o(e){return Array.isArray(e)}function a(e){return"object"==typeof e&&!t(e)&&!o(e)}function n(e){if(!a(e))return!1;const r=Object.getPrototypeOf(e);return r===Object.prototype||null===r}var i=e=>"string"==typeof e;function s(e){return"number"==typeof e?Number.isNaN(e):"[object Number]"===Object.prototype.toString.call(e)&&Number.isNaN(Number(e).valueOf())}var l=e=>null===e,c=(r,t={})=>{if(e(r))return;const o=D({value:r,options:t,requiredValidType:"boolean"});throw new TypeError(o)},u=(r,t={})=>{x(t,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const o=!(!n(t)||!e(t.includeNaN))&&t.includeNaN;c(o,{message:({currentType:e,validType:r})=>`Parameter \`includeNaN\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const a="number"==typeof r;return o?a:a&&!Number.isNaN(r)},f=e=>"symbol"==typeof e,m=e=>void 0===e;function p(e){return o(e)||a(e)}function y(e,t,o={}){if(!i(e)&&!p(e)&&!r(e))return!1;x(o,{message:({currentType:e,validType:r})=>`Third parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const a=void 0===o.discardUndefined||o.discardUndefined,n=void 0!==o.discardNull&&o.discardNull;c(a,{message:({currentType:e,validType:r})=>`Parameter \`discardUndefined\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`}),c(n,{message:({currentType:e,validType:r})=>`Parameter \`discardNull\` property of the \`options\` (third parameter) must be of type \`${r}\`, but received: \`${e}\`.`});const y=[];if(i(t)&&t.trim().length>0||u(t,{includeNaN:!0})){(u(t,{includeNaN:!0})?String(t):t).split(".").forEach(e=>{const r=e.match(/^\[(\d+)\]$/),t=e.match(/^Symbol\((.+)\)$/);r?y.push(Number(r[1])):t?y.push(Symbol.for(t[1])):s(Number(e))?y.push(e):y.push(Number(e))})}else{if(!f(t))return!1;y.push(t)}let b=i(e)&&e.trim().length>0?Object(e):e;for(const e of y)if(i(e)&&e.trim().length>0||u(e,{includeNaN:!0})){if(l(b)||!Object.prototype.hasOwnProperty.call(b,e))return!1;b=b[e]}else{if(!f(e))return!1;{if(l(b)||"object"!=typeof b&&!r(b))return!1;const t=Object.getOwnPropertySymbols(b).find(r=>r===e||r.description===e.description);if(!t)return!1;b=b[t]}}return(!a||!m(b))&&(!n||!l(b))}var b=(e,r={})=>{if(!i(e))return!1;x(r,{message:({currentType:e,validType:r})=>`Second parameter (\`options\`) must be of type \`${r}\`, but received: \`${e}\`.`});const t=!y(r,"trim")||r.trim;c(t,{message:({currentType:e,validType:r})=>`Parameter \`trim\` property of the \`options\` (second parameter) must be of type \`${r}\`, but received: \`${e}\`.`});return(t?e.trim():e).length>0};function d(e){return"[object Set]"===Object.prototype.toString.call(e)||e instanceof Set}function g(e){return Array.isArray(e)&&e.length>0}var v=(e,r={lowerCaseNextRest:!0,trim:!1})=>{if(!b(e))return"";n(r)||(r={});const t=!1!==r.lowerCaseNextRest;return!0===r.trim&&(e=e.trim()),e[0].toUpperCase()+(t?e.slice(1).toLowerCase():e.slice(1))},h=(e,r={collapseSpaces:!1,trim:!1})=>{var t,o;if(!b(e))return"";let a=e;n(r)||(r={});const i=!0===r.collapseSpaces;if(!0===r.trim&&(a=a.trim()),i){const e=(null==(t=a.match(/^\s*/))?void 0:t[0])??"",r=(null==(o=a.match(/\s*$/))?void 0:o[0])??"";a=a.trim().replace(/\s+/g," "),a=`${e}${a}${r}`}return a.toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},j=e=>{let r="";return o(e)?r=e.map(e=>b(e)?e.trim():"").filter(e=>e.length).join("-"):b(e)&&(r=e.trim()),r.split(/[^\p{L}\p{N}]+/u).filter(Boolean)},S=e=>{const r=new Set([]),t=e=>e.trim().split(/[^\p{L}\p{N}]+/u).filter(Boolean).join("");if(b(e)){const o=t(e);o&&r.add(o)}return g(e)&&e.forEach(e=>{if(b(e)){const o=t(e);o&&r.add(o)}}),d(e)&&e.forEach(e=>{if(b(e)){const o=t(e);o&&r.add(o)}}),r},C=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map((e,r)=>o.has(e)?e:0===r?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")},N=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")},w=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")},T=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join(" ")},A=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join("-")},P=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join("_")},R=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join(".")},I=(e,r)=>{if(!g(e)&&!b(e))return"";const t=j(e),o=S(r);return t.map(e=>o.has(e)?e:e.toLowerCase()).join("-").replace(/^-+|-+$/g,"")},L=e=>"[object Error]"===Object.prototype.toString.call(e)||e instanceof Error,O=e=>"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e),E=Object.freeze(["URI","URL","HTTP","HTTPS","HTML","XML","CSS","JS","JSON","SVG","DOM","UTC","XHR","RTC","ICE","TLS","TCP","UDP","IDB","ID"]),$=e=>e.replace(/[\s_\-]+/g,"").toLowerCase(),U=Object.entries({string:"String",number:"Number",boolean:"Boolean",bigint:"Big Int",symbol:"Symbol",undefined:"Undefined",null:"Null",regexp:"Reg Exp",reflect:"Reflect",proxy:"Proxy",atomics:"Atomics",object:"Object",array:"Array",arguments:"Arguments",function:"Function",asyncfunction:"Async Function",generatorfunction:"Generator Function",asyncgeneratorfunction:"Async Generator Function",generator:"Generator",promise:"Promise",evalerror:"Eval Error",rangeerror:"Range Error",referenceerror:"Reference Error",syntaxerror:"Syntax Error",typeerror:"Type Error",urierror:"URI Error",aggregateerror:"Aggregate Error",error:"Error",int8array:"Int 8 Array",uint8array:"Uint 8 Array",uint8clampedarray:"Uint 8 Clamped Array",int16array:"Int 16 Array",uint16array:"Uint 16 Array",int32array:"Int 32 Array",uint32array:"Uint 32 Array",float32array:"Float 32 Array",float64array:"Float 64 Array",bigint64array:"Big Int 64 Array",biguint64array:"Big Uint 64 Array",arraybuffer:"Array Buffer",sharedarraybuffer:"Shared Array Buffer",dataview:"Data View",arraybufferview:"Array Buffer View",map:"Map",set:"Set",weakmap:"Weak Map",weakset:"Weak Set",mapiterator:"Map Iterator",setiterator:"Set Iterator",arrayiterator:"Array Iterator",stringiterator:"String Iterator",readablestream:"Readable Stream",writablestream:"Writable Stream",transformstream:"Transform Stream",readablestreamdefaultreader:"Readable Stream Default Reader",writablestreamdefaultwriter:"Writable Stream Default Writer",readablestreamdefaultcontroller:"Readable Stream Default Controller",transformstreamdefaultcontroller:"Transform Stream Default Controller",abortcontroller:"Abort Controller",abortsignal:"Abort Signal",fetch:"fetch",request:"Request",response:"Response",headers:"Headers",formdata:"FormData",blob:"Blob",file:"File",filelist:"FileList",filereader:"FileReader",intl:"Intl",collator:"Intl. Collator",datetimeformat:"Intl. Date Time Format",listformat:"Intl. List Format",numberformat:"Intl. Number Format",pluralrules:"Intl. Plural Rules",relativetimeformat:"Intl. Relative Time Format",segmenter:"Intl. Segmenter",locale:"Intl. Locale",displaynames:"Intl. Display Names",finalizationregistry:"Finalization Registry",weakref:"Weak Ref",structuredclone:"structured Clone",urlpattern:"URL Pattern",performance:"Performance",performanceobserver:"Performance Observer",performanceentry:"Performance Entry",performancemark:"Performance Mark",performancemeasure:"Performance Measure",webassembly:"Web Assembly",wasmmodule:"WebAssembly .Module",wasminstance:"WebAssembly. Instance",wasmmemory:"WebAssembly. Memory",wasmtable:"WebAssembly. Table",buffer:"Buffer",process:"Process",eventemitter:"Event Emitter",stream:"Stream",fs:"fs",path:"path",url:"URL",urlsearchparams:"URL Search Params",node:"Node",element:"Element",htmlelement:"HTML Element",svgelement:"SVG Element",document:"Document",documentfragment:"Document Fragment",shadowroot:"Shadow Root",nodelist:"Node List",htmlcollection:"HTML Collection",mutationobserver:"Mutation Observer",intersectionobserver:"Intersection Observer",resizeobserver:"Resize Observer"}).reduce((e,[r,t])=>(e[$(r)]=t,e),{});var B=(e,r)=>"toPascalCaseSpace"===r?N(e,E):"slugify"===r?I(e,E):"toCamelCase"===r?C(e,E):"toDotCase"===r?R(e,E):"toKebabCase"===r?A(e,E):"toPascalCase"===r?w(e,E):"toSnakeCase"===r?P(e,E):T(e,E),F=(e,t={formatCase:"toLowerCase"})=>{var o,i;n(t)||(t={});const c=t.formatCase;if(l(e))return B(U[$("null")]??"Null",c);if(s(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(e instanceof Number)return B("Number Constructor",c);if(e instanceof String)return B("String Constructor",c);if(e instanceof Boolean)return B("Boolean Constructor",c);const u=typeof e;if(!p(e)&&!r(e))return B(U[$(u)]??u,c);if(O(e))return B(U[$("buffer")]??"Buffer",c);if(function(e){if("object"!=typeof e||null===e)return!1;const r=Object.prototype.toString.call(e);if(["[object Array]","[object Date]","[object RegExp]","[object Map]","[object Set]","[object WeakMap]","[object WeakSet]","[object Function]","[object Error]","[object Promise]","[object Generator]","[object GeneratorFunction]","[object AsyncFunction]"].includes(r))return!1;try{return Reflect.defineProperty(e,"__proxy_detect__",{configurable:!0,value:1}),Reflect.deleteProperty(e,"__proxy_detect__"),!1}catch{return!0}}(e))return B(U[$("proxy")]??"Proxy",c);if(a(e)&&r(null==e?void 0:e.next)&&r(null==e?void 0:e.throw))return B(U[$("generator")]??"Generator",c);if(L(e)){const r=(null==(o=e.constructor)?void 0:o.name)??"Error";return B(U[$(r)]??U[$(r.replace(/\s+/g,""))]??r,c)}if(l(Object.getPrototypeOf(e)))return B(U[$("object")]??"Object",c);const f=Object.prototype.toString.call(e).slice(8,-1)||"Object",m=U[$(f)];if(m)return B(m,c);const y=null==(i=null==e?void 0:e.constructor)?void 0:i.name;return B(y&&"Object"!==y?U[$(y)]??y:f,c)};function D(e){const{requiredValidType:t,value:o,options:a}=e||{},{message:i,formatCase:s}=n(a)?a:{},l=A(t),c=F(o,{formatCase:s}),u={currentType:c,validType:l},f=`Parameter input (\`value\`) must be of type \`${l}\`, but received: \`${c}\`.`;return r(i)?b(i(u))?i(u).trim():f:b(i)?i.trim():f}function x(e,r={}){if(n(e))return;const t=D({value:e,options:r,requiredValidType:"plain object"});throw new TypeError(t)}export{c as assertIsBoolean,x as assertIsPlainObject,v as capitalizeFirst,h as capitalizeWords,F as getPreciseType,y as hasOwnProp,o as isArray,e as isBoolean,O as isBuffer,L as isError,r as isFunction,s as isNaN,t as isNil,g as isNonEmptyArray,b as isNonEmptyString,l as isNull,u as isNumber,a as isObject,p as isObjectOrArray,n as isPlainObject,d as isSet,i as isString,f as isSymbol,m as isUndefined,D as resolveErrorMessageAssertions,I as slugify,C as toCamelCase,R as toDotCase,A as toKebabCase,T as toLowerCase,w as toPascalCase,N as toPascalCaseSpace,P as toSnakeCase};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{assertIsArray as e}from"./chunk-ECRNH4FW.js";import{isPlainObject as i,isNumber as r,isNonEmptyString as s,isFunction as o,hasOwnProp as t,isNonEmptyArray as n,getPreciseType as a}from"./chunk-EW3I4O7X.js";import{getDefaultConfig as l,extendTailwindMerge as c}from"tailwind-merge-v3";import{getDefaultConfig as f,extendTailwindMerge as p}from"tailwind-merge-v4";function d(e){var i,r,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(i=0;i<o;i++)e[i]&&(r=d(e[i]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}var u=function(){for(var e,i,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(i=d(e))&&(s&&(s+=" "),s+=i);return s},m=e=>{i(e)||(e={});let{config:a,prefix:l,extend:c,override:f,cacheSize:p,experimentalParseClassName:d}=e;i(a)||(a={}),i(c)||(c={}),i(f)||(f={}),r(p)||(p=void 0),s(l)||(l=void 0),o(d)||(d=void 0);return{config:a,override:f,cacheSize:p,prefix:l,experimentalParseClassName:d,theme:t(c,"theme")?c.theme:{},classGroups:t(c,"classGroups")?c.classGroups:{},conflictingClassGroupModifiers:t(c,"conflictingClassGroupModifiers")?c.conflictingClassGroupModifiers:{},conflictingClassGroups:t(c,"conflictingClassGroups")?c.conflictingClassGroups:{},orderSensitiveModifiers:t(c,"orderSensitiveModifiers")&&n(c.orderSensitiveModifiers)?c.orderSensitiveModifiers:[]}},g=l(),v=(e={})=>{var r,s,o;i(e)||(e={});const{cacheSize:t,classGroups:n,config:a,conflictingClassGroupModifiers:l,conflictingClassGroups:f,override:p,prefix:d,theme:u,experimentalParseClassName:v}=m(e);return c({prefix:d??a.prefix,cacheSize:t||g.cacheSize,experimentalParseClassName:v,override:p,extend:{conflictingClassGroupModifiers:{...g.conflictingClassGroupModifiers,...l},theme:{...g.theme,...u},conflictingClassGroups:{...g.conflictingClassGroups,...f},classGroups:{...g.classGroups,...n,"text-shadow":["","-sm","-md","-lg","-xl","-xxl","-none","-default"].map(e=>`text-shadow${e}`),"font-size":Object.keys({...(null==(r=a.theme)?void 0:r.fontSize)||{},...(null==(o=null==(s=a.theme)?void 0:s.extend)?void 0:o.fontSize)||{}}).map(e=>`text-${e}`)}}})},x=f(),h=(e={})=>{var r,s,o;i(e)||(e={});const{cacheSize:t,classGroups:n,config:a,conflictingClassGroupModifiers:l,conflictingClassGroups:c,orderSensitiveModifiers:f,override:d,prefix:u,theme:g,experimentalParseClassName:v}=m(e);return p({prefix:u||a.prefix,cacheSize:t||x.cacheSize,experimentalParseClassName:v,override:d,extend:{conflictingClassGroupModifiers:{...x.conflictingClassGroupModifiers,...l},theme:{...x.theme,...g},conflictingClassGroups:{...x.conflictingClassGroups,...c},orderSensitiveModifiers:[...x.orderSensitiveModifiers,...f],classGroups:{...x.classGroups,...n,"text-shadow":["","-sm","-md","-lg","-xl","-xxl","-none","-default"].map(e=>`text-shadow${e}`),"font-size":Object.keys({...(null==(r=a.theme)?void 0:r.fontSize)||{},...(null==(o=null==(s=a.theme)?void 0:s.extend)?void 0:o.fontSize)||{}}).map(e=>`text-${e}`)}}})},G=v(),C=h(),S=(...e)=>G(u(...e)),M=(...e)=>C(u(...e)),y=(e,...i)=>{if(!o(e))throw new TypeError(`first Parameter (\`customTwMergeV3\`) must be of type \`function\`, but received: \`${a(e)}\`.`);return e(u(...i))},z=(e,...i)=>{if(!o(e))throw new TypeError(`first Parameter (\`customTwMergeV4\`) must be of type \`function\`, but received: \`${a(e)}\`.`);return e(u(...i))},w=i=>(e(i,{message:({currentType:e,validType:i})=>`First parameter (\`props\`) must be of type \`${i}\`, but received: \`${e}\`.`}),e=>!i.map(e=>e.toString()).includes(e.toString()));export{S as cnV3,M as cnV4,y as customCnV3,z as customCnV4,w as shouldForwardProp,v as twMergeDefaultV3,h as twMergeDefaultV4};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=()=>{};export{r as noop};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-DVMHRLKP.cjs"),t=require("./chunk-ZHV5ZYVN.cjs"),r=require("./chunk-D3VSHABU.cjs");var n=(n,s)=>{if(!e.isInteger(n)||!e.isInteger(s))throw new TypeError(`First parameter (\`min\`) and second parameter (\`max\`) must be of type \`integer-number\`${i(n,s)}value, but received: ['min': \`${r.getPreciseType(n)}\` - (with value: \`${t.safeStableStringify(n)})\`, 'max': \`${r.getPreciseType(s)}\` - (with value: \`${t.safeStableStringify(s)}\`)].`);if(n>s)throw new RangeError(`First parameter (\`min\`) must be less than or equal to second parameter (\`max\`), but received: ['min': ${a(n)}, 'max': ${a(s)}].`);return n=Math.max(1,n),s=Math.min(Number.MAX_SAFE_INTEGER,s),Math.floor(Math.random()*(s-n+1))+n},a=e=>r.isNumber(e,{includeNaN:!0})?e===Number.MIN_VALUE?"`Number.MIN_VALUE`":`${e}`:`\`${r.getPreciseType(e)}\``,i=(...e)=>e.some(e=>r.isNumber(e,{includeNaN:!0})&&e===Number.MIN_VALUE)?" and can't be `Number.MIN_VALUE` ":" ";exports.getRandomItem=function(e){if(!r.isNonEmptyArray(e))return;return e[Math.floor(Math.random()*(e.length||0))]},exports.randomInt=n,exports.randomIntByLength=a=>{r.isPlainObject(a)||(a={});const{minLength:i=1,maxLength:s=16,avoidZero:m=!1}=a;if(r.assertIsBoolean(m,{message:({currentType:e,validType:t})=>`Parameters \`avoidZero\` must be of type \`${t}\`, but received: \`${e}\`.`}),!e.isInteger(i)||!e.isInteger(s))throw new TypeError(`Parameters \`minLength\` and \`maxLength\` must be of type \`integer-number\`, but received: ['minLength': \`${r.getPreciseType(i)}\` - (with value: ${t.safeStableStringify(i)}), 'maxLength': \`${r.getPreciseType(s)}\` - (with value: ${t.safeStableStringify(s)})].`);if(i<1||s>16||i>s)throw new RangeError(`Invalid range at parameters \`minLength\` must be ≥ 1, \`maxLength\` must be ≤ 16, and \`minLength\` ≤ \`maxLength\`, but received: ['minLength': \`${i}\`, 'maxLength': \`${s}\`].`);const o=i===s?i:n(i,s),h=10**(o-1);let u=n(h,10**o-1);return m&&0===u&&(u=h),u},exports.randomStr=a=>{r.isPlainObject(a)||(a={});const{minLength:i=40,maxLength:s=40,type:m="string",avoidWhiteSpace:o=!0}=a;if(r.assertIsBoolean(o,{message:({currentType:e,validType:t})=>`Parameters \`avoidWhiteSpace\` property of the \`options\` (first-parameter) must be of type \`${t}\`, but received: \`${e}\`.`}),!e.isInteger(i)||!e.isInteger(s))throw new TypeError(`Parameters \`minLength\` and \`maxLength\` must be of type \`integer-number\`, but received: ['minLength': \`${r.getPreciseType(i)}\` - (with value: ${t.safeStableStringify(i)}), 'maxLength': \`${r.getPreciseType(s)}\` - (with value: ${t.safeStableStringify(s)})].`);if(i<1||s>5e3||i>s)throw new RangeError(`Invalid range at parameters \`minLength\` must be ≥ 1, \`maxLength\` must be ≤ 5000, and \`minLength\` ≤ \`maxLength\`, but received: ['minLength': \`${i}\`, 'maxLength': \`${s}\`].`);if("string"!==m&&"number"!==m)throw new TypeError(`Parameter \`type\` must be of type \`string\` with value one of "string" | "number", but received: \`${r.getPreciseType(m)}\`, with value: ${t.safeStableStringify(m)}.`);const h=n(i,s),u="number"===m?(r.isNaN(Number(a.replaceGenInt))?void 0:a.replaceGenInt)??"0123456789":(a.replaceGenStr?a.replaceGenStr:void 0)??"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",g=(c=u,(o?c.replace(/\s|\n|\t/g,""):c)+(a.addChar||""));var c;if(!g.length){throw new Error(`Character set is empty. ${(()=>"number"===m?o?"If `avoidWhiteSpace` is true, and `replaceGenInt` cant be empty-string value, ensure `replaceGenInt` has valid characters and non-nan string number.":"Ensure `replaceGenInt` has valid characters and not a NaN number string while convert to number.":"Ensure `replaceGenStr` has valid characters and non empty string.")()}`)}let p="";for(let e=0;e<h;e++)p+=g.charAt(Math.floor(Math.random()*g.length));return p};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("./chunk-UDA26MCU.cjs"),e=require("./chunk-D3VSHABU.cjs");exports.assertIsBigInt=(s,i={})=>{if(r.isBigInt(s))return;const n=e.resolveErrorMessageAssertions({value:s,options:i,requiredValidType:"big int"});throw new TypeError(n)},exports.assertIsNumber=(r,s={})=>{const i=e.hasOwnProp(s,"includeNaN")?s.includeNaN:void 0;if(e.isNumber(r,{includeNaN:i}))return;const n=e.resolveErrorMessageAssertions({value:r,options:s,requiredValidType:"number"});throw new TypeError(n)};
|