@rzl-zone/utils-js 3.4.0 → 3.5.1
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/LICENSE.md +1 -1
- package/README.md +94 -45
- package/dist/assertions/index.cjs +41 -1
- package/dist/assertions/index.d.ts +11 -2
- package/dist/assertions/index.js +14 -1
- package/dist/chunk-2CQX5CBG.js +262 -1
- package/dist/chunk-2IOOEY45.cjs +30 -1
- package/dist/chunk-2WA36TC5.cjs +189 -0
- package/dist/chunk-3IBQ5MOM.js +16 -1
- package/dist/chunk-3VA554KW.js +34 -1
- package/dist/chunk-5757UBXJ.cjs +157 -1
- package/dist/chunk-5IGC6PBH.js +33 -1
- package/dist/chunk-5KJFVIQT.cjs +65 -1
- package/dist/chunk-6JFCSH7J.js +35 -1
- package/dist/chunk-6JFZL7YE.cjs +24 -1
- package/dist/chunk-7ODAAXX5.cjs +397 -1
- package/dist/chunk-BAV5T2E3.cjs +15 -1
- package/dist/chunk-CAH33WOQ.cjs +36 -1
- package/dist/chunk-CDCERIZ2.js +177 -0
- package/dist/chunk-CKTLUNWX.js +22 -1
- package/dist/chunk-CMW2TBOQ.js +567 -1
- package/dist/chunk-D3ENH7H6.cjs +101 -1
- package/dist/chunk-DEZZUYE2.js +152 -1
- package/dist/chunk-DVMHRLKP.cjs +16 -1
- package/dist/chunk-DWF2R5GD.cjs +225 -1
- package/dist/chunk-E55EQK2U.cjs +18 -1
- package/dist/chunk-E74U6CYP.cjs +18 -1
- package/dist/chunk-EL6A35UR.cjs +64 -1
- package/dist/chunk-F6IPNNSJ.cjs +554 -1
- package/dist/chunk-FJZGG54N.cjs +267 -1
- package/dist/chunk-FWCKOJZM.js +542 -1
- package/dist/chunk-FWHNWL2P.cjs +419 -1
- package/dist/chunk-GGEADHZO.js +90 -1
- package/dist/chunk-GQR4R5WY.js +31 -1
- package/dist/chunk-H66AC7GK.cjs +93 -1
- package/dist/chunk-HQWOFR56.cjs +33 -1
- package/dist/chunk-HYRQMTRH.cjs +24 -1
- package/dist/chunk-IRFL4MAX.js +63 -1
- package/dist/chunk-IVL7CKVH.cjs +37 -1
- package/dist/chunk-IZPBKKPO.js +16 -1
- package/dist/chunk-JBQMXC5I.cjs +106 -1
- package/dist/chunk-JEQEF5WD.js +95 -1
- package/dist/chunk-JMJQCN74.js +370 -1
- package/dist/chunk-KHO2SBNA.cjs +16 -1
- package/dist/chunk-KVAL5PAG.cjs +26 -1
- package/dist/chunk-L5RDAVVH.js +14 -1
- package/dist/chunk-LS6U7FAY.cjs +110 -1
- package/dist/chunk-NBZWMBO6.js +101 -1
- package/dist/chunk-NRF6LWBC.cjs +56 -1
- package/dist/chunk-OI5XKNZO.js +53 -1
- package/dist/chunk-ONZFBJVW.js +14 -1
- package/dist/chunk-OYTYSY7G.js +106 -1
- package/dist/chunk-PET42Z7W.js +119 -1
- package/dist/chunk-PZQ6I4JJ.cjs +605 -1
- package/dist/chunk-QBKAEVYG.js +113 -1
- package/dist/chunk-QNKGP5DY.js +14 -1
- package/dist/chunk-RIPKY4RU.js +417 -1
- package/dist/chunk-RZW35UN5.cjs +116 -1
- package/dist/chunk-SBFNXGTJ.js +220 -1
- package/dist/chunk-SBKGWRS5.js +22 -1
- package/dist/chunk-SIM77PU4.js +59 -1
- package/dist/chunk-T2T7K3KR.js +28 -1
- package/dist/chunk-T7PU2V7X.cjs +123 -1
- package/dist/chunk-UDA26MCU.cjs +16 -1
- package/dist/chunk-V45XJKHW.cjs +18 -1
- package/dist/chunk-VJDDGRIK.cjs +16 -1
- package/dist/chunk-W2WNBUDE.js +16 -1
- package/dist/chunk-WVSPXFTY.js +14 -1
- package/dist/chunk-XABCB3Y7.cjs +582 -1
- package/dist/chunk-XEDXFSGI.js +24 -1
- package/dist/chunk-YKPSRP5G.js +571 -1
- package/dist/chunk-YWHHVDT4.js +13 -1
- package/dist/chunk-ZETAZZLD.cjs +38 -1
- package/dist/conversions/index.cjs +104 -1
- package/dist/conversions/index.d.ts +10 -1
- package/dist/conversions/index.js +25 -1
- package/dist/events/index.cjs +32 -1
- package/dist/events/index.d.ts +10 -1
- package/dist/events/index.js +13 -1
- package/dist/formatters/index.cjs +62 -1
- package/dist/formatters/index.d.ts +10 -1
- package/dist/formatters/index.js +19 -1
- package/dist/generators/index.cjs +38 -1
- package/dist/generators/index.d.ts +10 -1
- package/dist/generators/index.js +15 -1
- package/dist/index.d.ts +39 -12
- package/dist/{isPlainObject-CEPWPiXh.d.ts → isPlainObject-FWmcJF6k.d.ts} +13 -4
- package/dist/next/index.cjs +218 -1
- package/dist/next/index.d.ts +10 -1
- package/dist/next/index.js +213 -1
- package/dist/next/server/index.cjs +43 -1
- package/dist/next/server/index.d.ts +10 -1
- package/dist/next/server/index.js +41 -1
- package/dist/operations/index.cjs +33 -1
- package/dist/operations/index.d.ts +10 -1
- package/dist/operations/index.js +18 -1
- package/dist/parsers/index.cjs +18 -1
- package/dist/parsers/index.d.ts +10 -1
- package/dist/parsers/index.js +11 -1
- package/dist/predicates/index.cjs +299 -1
- package/dist/predicates/index.d.ts +13 -4
- package/dist/predicates/index.js +24 -1
- package/dist/promises/index.cjs +25 -1
- package/dist/promises/index.d.ts +10 -1
- package/dist/promises/index.js +14 -1
- package/dist/rzl-utils.global.js +25 -1
- package/dist/strings/index.cjs +82 -1
- package/dist/strings/index.d.ts +10 -1
- package/dist/strings/index.js +15 -1
- package/dist/tailwind/index.cjs +43 -1
- package/dist/tailwind/index.d.ts +10 -1
- package/dist/tailwind/index.js +12 -1
- package/dist/urls/index.cjs +51 -1
- package/dist/urls/index.d.ts +10 -1
- package/dist/urls/index.js +24 -1
- package/package.json +60 -179
- package/dist/chunk-JYQTCICM.js +0 -1
- package/dist/chunk-YLA3DURS.cjs +0 -1
package/dist/chunk-7ODAAXX5.cjs
CHANGED
|
@@ -1 +1,397 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var chunkKHO2SBNA_cjs = require('./chunk-KHO2SBNA.cjs');
|
|
13
|
+
var chunkCAH33WOQ_cjs = require('./chunk-CAH33WOQ.cjs');
|
|
14
|
+
var chunk5KJFVIQT_cjs = require('./chunk-5KJFVIQT.cjs');
|
|
15
|
+
var chunkE55EQK2U_cjs = require('./chunk-E55EQK2U.cjs');
|
|
16
|
+
var chunkHYRQMTRH_cjs = require('./chunk-HYRQMTRH.cjs');
|
|
17
|
+
var chunkJBQMXC5I_cjs = require('./chunk-JBQMXC5I.cjs');
|
|
18
|
+
var chunkZETAZZLD_cjs = require('./chunk-ZETAZZLD.cjs');
|
|
19
|
+
var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
|
|
20
|
+
var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
|
|
21
|
+
|
|
22
|
+
var areArraysEqual = (array1, array2, ignoreOrder = false) => {
|
|
23
|
+
if (!(chunkPZQ6I4JJ_cjs.isArray(array1) && chunkPZQ6I4JJ_cjs.isArray(array2))) {
|
|
24
|
+
throw new TypeError(
|
|
25
|
+
`Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${chunkPZQ6I4JJ_cjs.getPreciseType(
|
|
26
|
+
array1
|
|
27
|
+
)}\`, 'array2': \`${chunkPZQ6I4JJ_cjs.getPreciseType(array2)}\`].`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
chunkPZQ6I4JJ_cjs.assertIsBoolean(ignoreOrder, {
|
|
31
|
+
message: ({ currentType, validType }) => `Third parameter \`ignoreOrder\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
32
|
+
});
|
|
33
|
+
if (!chunkJBQMXC5I_cjs.isEqual(array1.length, array2.length)) return false;
|
|
34
|
+
const deepIgnoreOrder = (arr) => {
|
|
35
|
+
if (!chunkPZQ6I4JJ_cjs.isArray(arr)) return arr;
|
|
36
|
+
const sorted = arr.map((item) => {
|
|
37
|
+
if (chunkPZQ6I4JJ_cjs.isArray(item)) {
|
|
38
|
+
return deepIgnoreOrder(item);
|
|
39
|
+
}
|
|
40
|
+
return item;
|
|
41
|
+
});
|
|
42
|
+
return sorted.sort((a, b) => {
|
|
43
|
+
const sa = chunkT7PU2V7X_cjs.safeStableStringify(a);
|
|
44
|
+
const sb = chunkT7PU2V7X_cjs.safeStableStringify(b);
|
|
45
|
+
return sa < sb ? -1 : sa > sb ? 1 : 0;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const normalizedArr1 = ignoreOrder ? deepIgnoreOrder(array1) : array1;
|
|
49
|
+
const normalizedArr2 = ignoreOrder ? deepIgnoreOrder(array2) : array2;
|
|
50
|
+
if (!chunkJBQMXC5I_cjs.isEqual(normalizedArr1.length, normalizedArr2.length)) return false;
|
|
51
|
+
return normalizedArr1.every(
|
|
52
|
+
(item, index) => chunkT7PU2V7X_cjs.safeStableStringify(item) === chunkT7PU2V7X_cjs.safeStableStringify(normalizedArr2[index])
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var areObjectsEqual = (object1, object2) => {
|
|
57
|
+
return chunkJBQMXC5I_cjs.isEqual(object1, object2);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var areURLsEqualPath = (urlA, urlB) => {
|
|
61
|
+
if (!chunkKHO2SBNA_cjs.isURL(urlA) || !chunkKHO2SBNA_cjs.isURL(urlB)) {
|
|
62
|
+
throw new TypeError(
|
|
63
|
+
`Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return urlA.protocol + "//" + urlA.host + urlA.pathname === urlB.protocol + "//" + urlB.host + urlB.pathname;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var areURLsIdentical = (urlA, urlB) => {
|
|
70
|
+
if (!chunkKHO2SBNA_cjs.isURL(urlA) || !chunkKHO2SBNA_cjs.isURL(urlB)) {
|
|
71
|
+
throw new TypeError(
|
|
72
|
+
`Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return urlA.protocol + "//" + urlA.host + urlA.pathname + urlA.search === urlB.protocol + "//" + urlB.host + urlB.pathname + urlB.search;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var textContainsAll = (text, searchWords, options = {}) => {
|
|
79
|
+
if (!chunkPZQ6I4JJ_cjs.isNonEmptyString(text) || !chunkPZQ6I4JJ_cjs.isArray(searchWords)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
|
|
83
|
+
message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
84
|
+
});
|
|
85
|
+
const { exactMatch = false, flags = "i" } = options;
|
|
86
|
+
chunkPZQ6I4JJ_cjs.assertIsBoolean(exactMatch, {
|
|
87
|
+
message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
88
|
+
});
|
|
89
|
+
chunkHYRQMTRH_cjs.assertIsString(flags, {
|
|
90
|
+
message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
91
|
+
});
|
|
92
|
+
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
93
|
+
const validSearchWords = searchWords.filter((word) => chunkPZQ6I4JJ_cjs.isNonEmptyString(word)).map(escapeRegex);
|
|
94
|
+
if (validSearchWords.length === 0) return false;
|
|
95
|
+
return validSearchWords.every((word) => {
|
|
96
|
+
const pattern = exactMatch ? `(?<!\\S)${word}(?!\\S)` : word;
|
|
97
|
+
return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
var textContainsAny = (text, searchWords, options = {}) => {
|
|
102
|
+
if (!chunkPZQ6I4JJ_cjs.isNonEmptyString(text) || !chunkPZQ6I4JJ_cjs.isArray(searchWords)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
|
|
106
|
+
message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
107
|
+
});
|
|
108
|
+
const { exactMatch = false, flags = "i" } = options;
|
|
109
|
+
chunkPZQ6I4JJ_cjs.assertIsBoolean(exactMatch, {
|
|
110
|
+
message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
111
|
+
});
|
|
112
|
+
chunkHYRQMTRH_cjs.assertIsString(flags, {
|
|
113
|
+
message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
114
|
+
});
|
|
115
|
+
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
116
|
+
const validSearchWords = searchWords.filter((word) => chunkPZQ6I4JJ_cjs.isNonEmptyString(word)).map(escapeRegex);
|
|
117
|
+
if (validSearchWords.length === 0) return false;
|
|
118
|
+
const pattern = exactMatch ? `(?<!\\S)(${validSearchWords.join("|")})(?!\\S)` : `(${validSearchWords.join("|")})`;
|
|
119
|
+
return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
function isPropertyKey(value) {
|
|
123
|
+
const type = typeof value;
|
|
124
|
+
return type === "string" || type === "number" || type === "symbol";
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var doesKeyExist = (object, key) => {
|
|
128
|
+
if (!chunkPZQ6I4JJ_cjs.isObjectOrArray(object)) return false;
|
|
129
|
+
if (!isPropertyKey(key)) {
|
|
130
|
+
throw new TypeError(
|
|
131
|
+
`Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${chunkPZQ6I4JJ_cjs.getPreciseType(
|
|
132
|
+
key
|
|
133
|
+
)}\`.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) return true;
|
|
137
|
+
if (chunkPZQ6I4JJ_cjs.isArray(object)) {
|
|
138
|
+
return object.some((item) => doesKeyExist(item, key));
|
|
139
|
+
}
|
|
140
|
+
return Object.values(object).some(
|
|
141
|
+
(value) => chunkPZQ6I4JJ_cjs.isObjectOrArray(value) && doesKeyExist(value, key)
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
var arrayHasAnyMatch = (sourceArray, targetArray) => {
|
|
146
|
+
if (!chunkPZQ6I4JJ_cjs.isArray(sourceArray) || !chunkPZQ6I4JJ_cjs.isArray(targetArray) || chunkZETAZZLD_cjs.isEmptyArray(sourceArray) || chunkZETAZZLD_cjs.isEmptyArray(targetArray)) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
const sourceSet = new Set(sourceArray);
|
|
150
|
+
return targetArray.some((item) => sourceSet.has(item));
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var isArguments = (value) => {
|
|
154
|
+
return Object.prototype.toString.call(value) === "[object Arguments]";
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
function isLength(value) {
|
|
158
|
+
return typeof value === "number" && value > -1 && Number.isInteger(value) && value <= Number.MAX_SAFE_INTEGER;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function isArrayLike(value) {
|
|
162
|
+
return !chunkPZQ6I4JJ_cjs.isFunction(value) && chunkPZQ6I4JJ_cjs.isObjectOrArray(value) && isLength(value?.length);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function isArrayLikeObject(value) {
|
|
166
|
+
return chunkPZQ6I4JJ_cjs.isObjectOrArray(value) && isLength(value.length);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var isCurrencyLike = (input) => {
|
|
170
|
+
if (!(chunkPZQ6I4JJ_cjs.isString(input) || chunkPZQ6I4JJ_cjs.isNumber(input))) return false;
|
|
171
|
+
const parsed = chunk5KJFVIQT_cjs.parseCurrencyString(input.toString());
|
|
172
|
+
if (parsed !== 0) return true;
|
|
173
|
+
return input.toString().trim() === "0";
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
var isDeepEqual = (a, b) => {
|
|
177
|
+
if (typeof a === "number" && typeof b === "number" && Number.isNaN(a) && Number.isNaN(b)) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
if (a === b) return true;
|
|
181
|
+
if (typeof a !== typeof b) return false;
|
|
182
|
+
if (chunkT7PU2V7X_cjs.isDate(a) && chunkT7PU2V7X_cjs.isDate(b)) {
|
|
183
|
+
return a.getTime() === b.getTime();
|
|
184
|
+
}
|
|
185
|
+
if (chunkJBQMXC5I_cjs.isRegExp(a) && chunkJBQMXC5I_cjs.isRegExp(b)) {
|
|
186
|
+
return a.toString() === b.toString();
|
|
187
|
+
}
|
|
188
|
+
if (chunkPZQ6I4JJ_cjs.isSymbol(a) && chunkPZQ6I4JJ_cjs.isSymbol(b)) {
|
|
189
|
+
return a.toString() === b.toString();
|
|
190
|
+
}
|
|
191
|
+
if (chunkPZQ6I4JJ_cjs.isSet(a) && chunkPZQ6I4JJ_cjs.isSet(b)) {
|
|
192
|
+
if (a.size !== b.size) return false;
|
|
193
|
+
const bValues = Array.from(b);
|
|
194
|
+
const matched = /* @__PURE__ */ new Set();
|
|
195
|
+
for (const aVal of a) {
|
|
196
|
+
let found = false;
|
|
197
|
+
for (let i = 0; i < bValues.length; i++) {
|
|
198
|
+
if (matched.has(i)) continue;
|
|
199
|
+
if (isDeepEqual(aVal, bValues[i])) {
|
|
200
|
+
matched.add(i);
|
|
201
|
+
found = true;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!found) return false;
|
|
206
|
+
}
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
if (chunkT7PU2V7X_cjs.isMap(a) && chunkT7PU2V7X_cjs.isMap(b)) {
|
|
210
|
+
if (a.size !== b.size) return false;
|
|
211
|
+
const bEntries = Array.from(b);
|
|
212
|
+
const matched = /* @__PURE__ */ new Set();
|
|
213
|
+
for (const [aKey, aVal] of a) {
|
|
214
|
+
let found = false;
|
|
215
|
+
for (let i = 0; i < bEntries.length; i++) {
|
|
216
|
+
if (matched.has(i)) continue;
|
|
217
|
+
const [bKey, bVal] = bEntries[i];
|
|
218
|
+
if (isDeepEqual(aKey, bKey) && isDeepEqual(aVal, bVal)) {
|
|
219
|
+
matched.add(i);
|
|
220
|
+
found = true;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (!found) return false;
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
if (chunkPZQ6I4JJ_cjs.isArray(a) && chunkPZQ6I4JJ_cjs.isArray(b)) {
|
|
229
|
+
if (a.length !== b.length) return false;
|
|
230
|
+
return a.every((item, i) => isDeepEqual(item, b[i]));
|
|
231
|
+
}
|
|
232
|
+
if (chunkPZQ6I4JJ_cjs.isObjectOrArray(a) && chunkPZQ6I4JJ_cjs.isObjectOrArray(b) && a && b) {
|
|
233
|
+
if (chunkPZQ6I4JJ_cjs.isArray(a) !== chunkPZQ6I4JJ_cjs.isArray(b)) return false;
|
|
234
|
+
const aKeys = Object.keys(a);
|
|
235
|
+
const bKeys = Object.keys(b);
|
|
236
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
237
|
+
return aKeys.every((key) => isDeepEqual(a[key], b[key]));
|
|
238
|
+
}
|
|
239
|
+
return false;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
function isElement(value) {
|
|
243
|
+
return !!value && typeof value === "object" && value?.nodeType === 1 && !chunkPZQ6I4JJ_cjs.isPlainObject(value);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function isEmpty(value) {
|
|
247
|
+
if (chunkPZQ6I4JJ_cjs.isNil(value)) return true;
|
|
248
|
+
if (chunkPZQ6I4JJ_cjs.isBoolean(value) || chunkPZQ6I4JJ_cjs.isNumber(value, { includeNaN: true }) || chunkPZQ6I4JJ_cjs.isSymbol(value))
|
|
249
|
+
return true;
|
|
250
|
+
if (chunkPZQ6I4JJ_cjs.isFunction(value)) {
|
|
251
|
+
return Object.keys(value).length === 0;
|
|
252
|
+
}
|
|
253
|
+
if (chunkPZQ6I4JJ_cjs.isString(value) || chunkPZQ6I4JJ_cjs.isArray(value) || isArguments(value) || chunkCAH33WOQ_cjs.isTypedArray(value)) {
|
|
254
|
+
return value.length === 0;
|
|
255
|
+
}
|
|
256
|
+
if (chunkT7PU2V7X_cjs.isMap(value) || chunkPZQ6I4JJ_cjs.isSet(value)) {
|
|
257
|
+
return value.size === 0;
|
|
258
|
+
}
|
|
259
|
+
if (chunkPZQ6I4JJ_cjs.isBuffer(value)) {
|
|
260
|
+
return value.length === 0;
|
|
261
|
+
}
|
|
262
|
+
if (chunkPZQ6I4JJ_cjs.isPlainObject(value)) {
|
|
263
|
+
return Object.keys(value).length === 0;
|
|
264
|
+
}
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
var isEmptyDeep = (value) => {
|
|
269
|
+
if (chunkPZQ6I4JJ_cjs.isString(value)) return chunkE55EQK2U_cjs.isEmptyString(value);
|
|
270
|
+
if (chunkPZQ6I4JJ_cjs.isNumber(value)) return chunkPZQ6I4JJ_cjs.isNaN(value);
|
|
271
|
+
if (chunkPZQ6I4JJ_cjs.isArray(value)) {
|
|
272
|
+
return chunkZETAZZLD_cjs.isEmptyArray(value) || value.every(isEmptyDeep);
|
|
273
|
+
}
|
|
274
|
+
if (chunkPZQ6I4JJ_cjs.isObjectOrArray(value)) {
|
|
275
|
+
const keys = Object.keys(value);
|
|
276
|
+
const symbols = Object.getOwnPropertySymbols(value);
|
|
277
|
+
if (keys.length === 0 && symbols.length === 0) return true;
|
|
278
|
+
return [...keys, ...symbols].every((key) => isEmptyDeep(value[key]));
|
|
279
|
+
}
|
|
280
|
+
if (!value) return true;
|
|
281
|
+
return false;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
function isEqualWith(value, other, customizer) {
|
|
285
|
+
return chunkJBQMXC5I_cjs.baseDeepEqual(value, other, customizer, /* @__PURE__ */ new WeakMap());
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function isMatchWith(value, other, customizer) {
|
|
289
|
+
return baseIsMatch(value, other, customizer);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function isSameValue(x, y) {
|
|
293
|
+
return x === y || x === 0 && y === 0 || Number.isNaN(x) && Number.isNaN(y);
|
|
294
|
+
}
|
|
295
|
+
function baseIsMatch(object, source, customizer) {
|
|
296
|
+
if (object === source) return true;
|
|
297
|
+
if (!chunkPZQ6I4JJ_cjs.isObjectOrArray(source)) {
|
|
298
|
+
return isSameValue(object, source);
|
|
299
|
+
}
|
|
300
|
+
if (!chunkPZQ6I4JJ_cjs.isObjectOrArray(object)) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
const keys = Reflect.ownKeys(source).filter(
|
|
304
|
+
(k) => !(chunkPZQ6I4JJ_cjs.isArray(source) && k === "length")
|
|
305
|
+
);
|
|
306
|
+
for (const key of keys) {
|
|
307
|
+
if (!(key in object)) return false;
|
|
308
|
+
const objValue = object[key];
|
|
309
|
+
const srcValue = source[key];
|
|
310
|
+
const result = customizer?.(objValue, srcValue, key, object, source);
|
|
311
|
+
if (!chunkPZQ6I4JJ_cjs.isUndefined(result)) {
|
|
312
|
+
if (!result) return false;
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
if (chunkPZQ6I4JJ_cjs.isObjectOrArray(objValue) && chunkPZQ6I4JJ_cjs.isObjectOrArray(srcValue)) {
|
|
316
|
+
if (!isMatchWith(objValue, srcValue, customizer)) return false;
|
|
317
|
+
} else {
|
|
318
|
+
if (!isSameValue(objValue, srcValue)) return false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function isMatch(object, source) {
|
|
325
|
+
return baseIsMatch(object, source);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
var funcToString = Function.prototype.toString;
|
|
329
|
+
var reIsNative = /\{\s*\[native code\]\s*\}/;
|
|
330
|
+
function isNative(value) {
|
|
331
|
+
if (!chunkPZQ6I4JJ_cjs.isFunction(value)) return false;
|
|
332
|
+
try {
|
|
333
|
+
const source = funcToString.call(value);
|
|
334
|
+
return reIsNative.test(source);
|
|
335
|
+
} catch {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function isObjectLoose(value) {
|
|
341
|
+
return !chunkPZQ6I4JJ_cjs.isNil(value) && (chunkPZQ6I4JJ_cjs.isObjectOrArray(value) || chunkPZQ6I4JJ_cjs.isFunction(value));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function isSafeInteger(value) {
|
|
345
|
+
return typeof value === "number" && Number.isSafeInteger(value);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
var isValidURL = (url) => {
|
|
349
|
+
if (!chunkPZQ6I4JJ_cjs.isNonEmptyString(url)) return false;
|
|
350
|
+
let decodedUrl;
|
|
351
|
+
try {
|
|
352
|
+
decodedUrl = decodeURIComponent(url);
|
|
353
|
+
} catch {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
if (!decodedUrl.startsWith("http://") && !decodedUrl.startsWith("https://")) {
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
const urlPattern = new RegExp(
|
|
360
|
+
/^https?:\/\/(?:localhost(?::\d+)?(?:[\/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?::\d+)?(?:[\/?#][^\s]*)?)$/
|
|
361
|
+
//! DEPRECATED
|
|
362
|
+
// /^https?:\/\/(?:localhost(?::\d+)?(?:[/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6})(?:[/?#][^\s]*)?$/
|
|
363
|
+
// /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/
|
|
364
|
+
);
|
|
365
|
+
return urlPattern.test(decodedUrl);
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
function isWeakMap(value) {
|
|
369
|
+
return chunkPZQ6I4JJ_cjs.isObject(value) && !chunkPZQ6I4JJ_cjs.isNull(value) && value instanceof WeakMap;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
exports.areArraysEqual = areArraysEqual;
|
|
373
|
+
exports.areObjectsEqual = areObjectsEqual;
|
|
374
|
+
exports.areURLsEqualPath = areURLsEqualPath;
|
|
375
|
+
exports.areURLsIdentical = areURLsIdentical;
|
|
376
|
+
exports.arrayHasAnyMatch = arrayHasAnyMatch;
|
|
377
|
+
exports.doesKeyExist = doesKeyExist;
|
|
378
|
+
exports.isArguments = isArguments;
|
|
379
|
+
exports.isArrayLike = isArrayLike;
|
|
380
|
+
exports.isArrayLikeObject = isArrayLikeObject;
|
|
381
|
+
exports.isCurrencyLike = isCurrencyLike;
|
|
382
|
+
exports.isDeepEqual = isDeepEqual;
|
|
383
|
+
exports.isElement = isElement;
|
|
384
|
+
exports.isEmpty = isEmpty;
|
|
385
|
+
exports.isEmptyDeep = isEmptyDeep;
|
|
386
|
+
exports.isEqualWith = isEqualWith;
|
|
387
|
+
exports.isLength = isLength;
|
|
388
|
+
exports.isMatch = isMatch;
|
|
389
|
+
exports.isMatchWith = isMatchWith;
|
|
390
|
+
exports.isNative = isNative;
|
|
391
|
+
exports.isObjectLoose = isObjectLoose;
|
|
392
|
+
exports.isPropertyKey = isPropertyKey;
|
|
393
|
+
exports.isSafeInteger = isSafeInteger;
|
|
394
|
+
exports.isValidURL = isValidURL;
|
|
395
|
+
exports.isWeakMap = isWeakMap;
|
|
396
|
+
exports.textContainsAll = textContainsAll;
|
|
397
|
+
exports.textContainsAny = textContainsAny;
|
package/dist/chunk-BAV5T2E3.cjs
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var noop = () => {
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.noop = noop;
|
package/dist/chunk-CAH33WOQ.cjs
CHANGED
|
@@ -1 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var chunkHQWOFR56_cjs = require('./chunk-HQWOFR56.cjs');
|
|
13
|
+
|
|
14
|
+
var isNonEmptyValue = (value, options = {}) => {
|
|
15
|
+
return !chunkHQWOFR56_cjs.isEmptyValue(value, options);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var typedArrayTags = /* @__PURE__ */ new Set([
|
|
19
|
+
"[object Int8Array]",
|
|
20
|
+
"[object Uint8Array]",
|
|
21
|
+
"[object Uint8ClampedArray]",
|
|
22
|
+
"[object Int16Array]",
|
|
23
|
+
"[object Uint16Array]",
|
|
24
|
+
"[object Int32Array]",
|
|
25
|
+
"[object Uint32Array]",
|
|
26
|
+
"[object Float32Array]",
|
|
27
|
+
"[object Float64Array]",
|
|
28
|
+
"[object BigInt64Array]",
|
|
29
|
+
"[object BigUint64Array]"
|
|
30
|
+
]);
|
|
31
|
+
function isTypedArray(value) {
|
|
32
|
+
return value != null && typeof value === "object" && typedArrayTags.has(Object.prototype.toString.call(value));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.isNonEmptyValue = isNonEmptyValue;
|
|
36
|
+
exports.isTypedArray = isTypedArray;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
import { assertIsArray } from './chunk-CKTLUNWX.js';
|
|
11
|
+
import { isPlainObject, isNumber, isNonEmptyString, isFunction, hasOwnProp, isNonEmptyArray, getPreciseType } from './chunk-CMW2TBOQ.js';
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
import { getDefaultConfig, extendTailwindMerge } from 'tailwind-merge-v3';
|
|
14
|
+
import { getDefaultConfig as getDefaultConfig$1, extendTailwindMerge as extendTailwindMerge$1 } from 'tailwind-merge-v4';
|
|
15
|
+
|
|
16
|
+
var validatorPropsTwMerge = (options) => {
|
|
17
|
+
if (!isPlainObject(options)) options = {};
|
|
18
|
+
let { config, prefix, extend, override, cacheSize, experimentalParseClassName } = options;
|
|
19
|
+
if (!isPlainObject(config)) config = {};
|
|
20
|
+
if (!isPlainObject(extend)) extend = {};
|
|
21
|
+
if (!isPlainObject(override)) override = {};
|
|
22
|
+
if (!isNumber(cacheSize)) cacheSize = void 0;
|
|
23
|
+
if (!isNonEmptyString(prefix)) prefix = void 0;
|
|
24
|
+
if (!isFunction(experimentalParseClassName)) experimentalParseClassName = void 0;
|
|
25
|
+
const theme = hasOwnProp(extend, "theme") ? extend.theme : {};
|
|
26
|
+
const classGroups = hasOwnProp(extend, "classGroups") ? extend.classGroups : {};
|
|
27
|
+
const conflictingClassGroupModifiers = hasOwnProp(
|
|
28
|
+
extend,
|
|
29
|
+
"conflictingClassGroupModifiers"
|
|
30
|
+
) ? extend.conflictingClassGroupModifiers : {};
|
|
31
|
+
const conflictingClassGroups = hasOwnProp(extend, "conflictingClassGroups") ? extend.conflictingClassGroups : {};
|
|
32
|
+
const orderSensitiveModifiers = hasOwnProp(extend, "orderSensitiveModifiers") && isNonEmptyArray(extend.orderSensitiveModifiers) ? extend.orderSensitiveModifiers : [];
|
|
33
|
+
return {
|
|
34
|
+
config,
|
|
35
|
+
override,
|
|
36
|
+
cacheSize,
|
|
37
|
+
prefix,
|
|
38
|
+
experimentalParseClassName,
|
|
39
|
+
theme,
|
|
40
|
+
classGroups,
|
|
41
|
+
conflictingClassGroupModifiers,
|
|
42
|
+
conflictingClassGroups,
|
|
43
|
+
orderSensitiveModifiers
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var defaultConfig = getDefaultConfig();
|
|
48
|
+
var twMergeDefaultV3 = (options = {}) => {
|
|
49
|
+
if (!isPlainObject(options)) options = {};
|
|
50
|
+
const {
|
|
51
|
+
cacheSize,
|
|
52
|
+
classGroups,
|
|
53
|
+
config,
|
|
54
|
+
conflictingClassGroupModifiers,
|
|
55
|
+
conflictingClassGroups,
|
|
56
|
+
override,
|
|
57
|
+
prefix,
|
|
58
|
+
theme,
|
|
59
|
+
experimentalParseClassName
|
|
60
|
+
} = validatorPropsTwMerge(options);
|
|
61
|
+
return extendTailwindMerge({
|
|
62
|
+
prefix: prefix ?? config.prefix,
|
|
63
|
+
cacheSize: cacheSize || defaultConfig.cacheSize,
|
|
64
|
+
experimentalParseClassName,
|
|
65
|
+
override,
|
|
66
|
+
extend: {
|
|
67
|
+
conflictingClassGroupModifiers: {
|
|
68
|
+
...defaultConfig.conflictingClassGroupModifiers,
|
|
69
|
+
...conflictingClassGroupModifiers
|
|
70
|
+
},
|
|
71
|
+
theme: { ...defaultConfig.theme, ...theme },
|
|
72
|
+
conflictingClassGroups: {
|
|
73
|
+
...defaultConfig.conflictingClassGroups,
|
|
74
|
+
...conflictingClassGroups
|
|
75
|
+
},
|
|
76
|
+
classGroups: {
|
|
77
|
+
...defaultConfig.classGroups,
|
|
78
|
+
...classGroups,
|
|
79
|
+
"text-shadow": ["", "-sm", "-md", "-lg", "-xl", "-xxl", "-none", "-default"].map(
|
|
80
|
+
(size) => `text-shadow${size}`
|
|
81
|
+
),
|
|
82
|
+
"font-size": Object.keys({
|
|
83
|
+
...config.theme?.fontSize || {},
|
|
84
|
+
...config.theme?.extend?.fontSize || {}
|
|
85
|
+
}).map((size) => `text-${size}`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
var defaultConfig2 = getDefaultConfig$1();
|
|
91
|
+
var twMergeDefaultV4 = (options = {}) => {
|
|
92
|
+
if (!isPlainObject(options)) options = {};
|
|
93
|
+
const {
|
|
94
|
+
cacheSize,
|
|
95
|
+
classGroups,
|
|
96
|
+
config,
|
|
97
|
+
conflictingClassGroupModifiers,
|
|
98
|
+
conflictingClassGroups,
|
|
99
|
+
orderSensitiveModifiers,
|
|
100
|
+
override,
|
|
101
|
+
prefix,
|
|
102
|
+
theme,
|
|
103
|
+
experimentalParseClassName
|
|
104
|
+
} = validatorPropsTwMerge(options);
|
|
105
|
+
return extendTailwindMerge$1({
|
|
106
|
+
prefix: prefix || config.prefix,
|
|
107
|
+
cacheSize: cacheSize || defaultConfig2.cacheSize,
|
|
108
|
+
experimentalParseClassName,
|
|
109
|
+
override,
|
|
110
|
+
extend: {
|
|
111
|
+
conflictingClassGroupModifiers: {
|
|
112
|
+
...defaultConfig2.conflictingClassGroupModifiers,
|
|
113
|
+
...conflictingClassGroupModifiers
|
|
114
|
+
},
|
|
115
|
+
theme: { ...defaultConfig2.theme, ...theme },
|
|
116
|
+
conflictingClassGroups: {
|
|
117
|
+
...defaultConfig2.conflictingClassGroups,
|
|
118
|
+
...conflictingClassGroups
|
|
119
|
+
},
|
|
120
|
+
orderSensitiveModifiers: [
|
|
121
|
+
...defaultConfig2.orderSensitiveModifiers,
|
|
122
|
+
...orderSensitiveModifiers
|
|
123
|
+
],
|
|
124
|
+
classGroups: {
|
|
125
|
+
...defaultConfig2.classGroups,
|
|
126
|
+
...classGroups,
|
|
127
|
+
"text-shadow": ["", "-sm", "-md", "-lg", "-xl", "-xxl", "-none", "-default"].map(
|
|
128
|
+
(size) => `text-shadow${size}`
|
|
129
|
+
),
|
|
130
|
+
"font-size": Object.keys({
|
|
131
|
+
...config.theme?.fontSize || {},
|
|
132
|
+
...config.theme?.extend?.fontSize || {}
|
|
133
|
+
}).map((size) => `text-${size}`)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
var defaultTwMergeV3 = twMergeDefaultV3();
|
|
140
|
+
var defaultTwMergeV4 = twMergeDefaultV4();
|
|
141
|
+
var cnV3 = (...classes) => {
|
|
142
|
+
return defaultTwMergeV3(clsx(...classes));
|
|
143
|
+
};
|
|
144
|
+
var cnV4 = (...classes) => {
|
|
145
|
+
return defaultTwMergeV4(clsx(...classes));
|
|
146
|
+
};
|
|
147
|
+
var customCnV3 = (customTwMergeV3, ...classes) => {
|
|
148
|
+
if (!isFunction(customTwMergeV3)) {
|
|
149
|
+
throw new TypeError(
|
|
150
|
+
`first Parameter (\`customTwMergeV3\`) must be of type \`function\`, but received: \`${getPreciseType(
|
|
151
|
+
customTwMergeV3
|
|
152
|
+
)}\`.`
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
return customTwMergeV3(clsx(...classes));
|
|
156
|
+
};
|
|
157
|
+
var customCnV4 = (customTwMergeV4, ...classes) => {
|
|
158
|
+
if (!isFunction(customTwMergeV4)) {
|
|
159
|
+
throw new TypeError(
|
|
160
|
+
`first Parameter (\`customTwMergeV4\`) must be of type \`function\`, but received: \`${getPreciseType(
|
|
161
|
+
customTwMergeV4
|
|
162
|
+
)}\`.`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return customTwMergeV4(clsx(...classes));
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
var shouldForwardProp = (props) => {
|
|
169
|
+
assertIsArray(props, {
|
|
170
|
+
message: ({ currentType, validType }) => `First parameter (\`props\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
171
|
+
});
|
|
172
|
+
return (propName) => {
|
|
173
|
+
return !props.map((p) => p.toString()).includes(propName.toString());
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { cnV3, cnV4, customCnV3, customCnV4, shouldForwardProp, twMergeDefaultV3, twMergeDefaultV4 };
|
package/dist/chunk-CKTLUNWX.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.5.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
import { isArray, resolveErrorMessageAssertions } from './chunk-CMW2TBOQ.js';
|
|
11
|
+
|
|
12
|
+
function assertIsArray(value, options) {
|
|
13
|
+
if (isArray(value)) return;
|
|
14
|
+
const errorMessage = resolveErrorMessageAssertions({
|
|
15
|
+
value,
|
|
16
|
+
options,
|
|
17
|
+
requiredValidType: "array"
|
|
18
|
+
});
|
|
19
|
+
throw new TypeError(errorMessage);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { assertIsArray };
|