@rzl-zone/utils-js 3.11.1 → 3.12.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/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +5 -5
- package/dist/assertions/index.js +5 -5
- package/dist/{chunk-TER22LO4.cjs → chunk-2AFQ33D3.cjs} +8 -8
- package/dist/{chunk-SZUNAEMR.js → chunk-2CYDJVGM.js} +6 -6
- package/dist/{chunk-6EDFZJZ5.cjs → chunk-2MW4JDQ2.cjs} +126 -126
- package/dist/{chunk-M7ELWZXM.cjs → chunk-2VTDXC3N.cjs} +9 -9
- package/dist/{chunk-6YGBRENU.js → chunk-44XX2P34.js} +3 -3
- package/dist/{chunk-WLOQQFDS.cjs → chunk-4YLBKLGS.cjs} +3 -3
- package/dist/{chunk-Q4GEQS7X.cjs → chunk-566CXQW7.cjs} +163 -167
- package/dist/{chunk-MV3TSQSH.cjs → chunk-57EPKYID.cjs} +71 -71
- package/dist/{chunk-2XSZ2ANI.js → chunk-5MGEC3YG.js} +2 -2
- package/dist/{chunk-HYN6FC5A.cjs → chunk-6EF52423.cjs} +34 -34
- package/dist/{chunk-LJHPTLWB.js → chunk-6SCOKU3S.js} +7 -7
- package/dist/{chunk-AXDYWO67.js → chunk-6VUXD3CF.js} +2 -2
- package/dist/{chunk-C2PV3VWC.cjs → chunk-7B76BSNK.cjs} +6 -6
- package/dist/{chunk-ZPDMWDGZ.cjs → chunk-7Y6I2DSU.cjs} +14 -14
- package/dist/{chunk-KXJ7X325.cjs → chunk-A7S7E2EE.cjs} +37 -37
- package/dist/{chunk-BPYW5YL7.js → chunk-AJZ6PMMZ.js} +2 -2
- package/dist/{chunk-PGNL7JXO.cjs → chunk-AXGBL2IO.cjs} +40 -40
- package/dist/{chunk-NLZLXWAU.cjs → chunk-B4TC6FBV.cjs} +9 -9
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/{chunk-3T6VSWYX.js → chunk-BKIJBNIE.js} +2 -2
- package/dist/{chunk-RBWZII5I.js → chunk-BNIMTFK5.js} +3 -3
- package/dist/{chunk-5WIEDF2J.js → chunk-BXW7YXB7.js} +4 -4
- package/dist/{chunk-22V4WP3H.js → chunk-CFYZC4S6.js} +4 -4
- package/dist/{chunk-MSUW5VHZ.js → chunk-CSG4SCL3.js} +10 -13
- package/dist/{chunk-JIE447J5.js → chunk-CWQW7AKK.js} +3 -3
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/{chunk-U7HHN47R.js → chunk-EN7LVZBZ.js} +12 -16
- package/dist/{chunk-EBYFYZW4.cjs → chunk-EV4Y7HCY.cjs} +4 -4
- package/dist/{chunk-NVRZPF5M.cjs → chunk-F66VDYIZ.cjs} +3 -3
- package/dist/{chunk-BMZZXZJ2.cjs → chunk-FLJX37EL.cjs} +4 -4
- package/dist/{chunk-SYHPSOUU.cjs → chunk-GKC3UDMC.cjs} +10 -13
- package/dist/{chunk-GIKL4PUF.cjs → chunk-H65I3GRZ.cjs} +10 -10
- package/dist/{chunk-HNBRGN4R.js → chunk-HHYWB7VZ.js} +2 -2
- package/dist/{chunk-MUHRPRR7.cjs → chunk-HNGGISFL.cjs} +3 -3
- package/dist/{chunk-B6PMNZ4M.cjs → chunk-HNSQAVSZ.cjs} +6 -6
- package/dist/{chunk-RZOGBYIS.js → chunk-HSP6IWZK.js} +3 -7
- package/dist/{chunk-IZGVBYFN.js → chunk-IDZS7J6T.js} +13 -13
- package/dist/{chunk-ENMRZ4BE.js → chunk-JS6R55VL.js} +3 -3
- package/dist/{chunk-WETQI6HM.js → chunk-JZVT5FK7.js} +9 -9
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-TJHGRQ4P.js → chunk-KIDJCMNJ.js} +2 -2
- package/dist/{chunk-7FGNVDEV.cjs → chunk-KOLEURVT.cjs} +7 -7
- package/dist/{chunk-K5536YHG.cjs → chunk-L4V53MQK.cjs} +50 -50
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-CCJ2MSN7.js → chunk-NODTV4F3.js} +2 -2
- package/dist/{chunk-QYI2VJLS.cjs → chunk-NYK5K3V2.cjs} +9 -9
- package/dist/{chunk-XPVTIGU2.cjs → chunk-ODUO3RTL.cjs} +26 -26
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-ZVWZEGQP.js → chunk-PFXCTE37.js} +2 -2
- package/dist/{chunk-FJ4BQFVO.js → chunk-PPST7QAQ.js} +8 -8
- package/dist/{chunk-RMP7VMPB.cjs → chunk-Q5IMYDFL.cjs} +12 -12
- package/dist/{chunk-UIAWUZ4H.js → chunk-QFFBIOJ4.js} +4 -4
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/{chunk-DLS3G6WQ.cjs → chunk-RRQHMOPE.cjs} +4 -8
- package/dist/{chunk-BLF7SD66.js → chunk-RU5OSRBU.js} +3 -3
- package/dist/{chunk-GOFINGT6.js → chunk-SDMPEJ4F.js} +2 -2
- package/dist/{chunk-K47GZDBH.js → chunk-SYNL5IKP.js} +3 -3
- package/dist/{chunk-ULQPCIA2.js → chunk-TCDOWZQE.js} +2 -2
- package/dist/{chunk-DAPAK2W3.cjs → chunk-TQPGXGKB.cjs} +31 -31
- package/dist/{chunk-DNMCR5JH.js → chunk-TULOI4GL.js} +9 -9
- package/dist/{chunk-SU3UELUB.cjs → chunk-UBHCP4N5.cjs} +3 -3
- package/dist/{chunk-U23I7JPB.cjs → chunk-UCHF3M34.cjs} +15 -15
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/{chunk-XX6RUGTM.cjs → chunk-V3C4FYZL.cjs} +3 -3
- package/dist/{chunk-6LXWT2I5.js → chunk-VAAHZFBF.js} +2 -2
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/{chunk-GXKQ3LHF.js → chunk-WYP76WXB.js} +3 -3
- package/dist/{chunk-JXEIJM5M.cjs → chunk-YDE4ZBB7.cjs} +61 -61
- package/dist/{chunk-WXFTVXBF.cjs → chunk-YKQEOO7C.cjs} +4 -4
- package/dist/{chunk-BOYP3ARU.js → chunk-YSZC56SZ.js} +4 -4
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/conversions/index.cjs +34 -34
- package/dist/conversions/index.d.ts +1 -1
- package/dist/conversions/index.js +15 -15
- package/dist/events/index.cjs +8 -8
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +19 -19
- package/dist/formatters/index.d.ts +1 -1
- package/dist/formatters/index.js +9 -9
- package/dist/generators/index.cjs +9 -9
- package/dist/generators/index.d.ts +1 -1
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/{isPlainObject-0p3VveWr.d.ts → isPlainObject-DTJVV2Kf.d.ts} +5 -3
- package/dist/next/index.cjs +41 -39
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +13 -11
- package/dist/next/server/index.cjs +4 -4
- package/dist/next/server/index.d.ts +1 -1
- package/dist/next/server/index.js +2 -2
- package/dist/operations/index.cjs +11 -11
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +8 -8
- package/dist/parsers/index.cjs +6 -6
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.js +5 -5
- package/dist/predicates/index.cjs +77 -77
- package/dist/predicates/index.d.ts +6 -6
- package/dist/predicates/index.js +14 -14
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +1 -1
- package/dist/promises/index.js +4 -4
- package/dist/rzl-utils.global.js +2 -2
- package/dist/strings/index.cjs +23 -23
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +7 -7
- package/dist/tailwind/index.cjs +13 -13
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/tailwind/index.js +5 -5
- package/dist/urls/index.cjs +23 -23
- package/dist/urls/index.d.ts +1 -1
- package/dist/urls/index.js +16 -16
- package/package.json +18 -18
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -10,51 +10,51 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkKHO2SBNA_cjs = require('./chunk-KHO2SBNA.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
13
|
+
var chunkUBHCP4N5_cjs = require('./chunk-UBHCP4N5.cjs');
|
|
14
|
+
var chunkHNGGISFL_cjs = require('./chunk-HNGGISFL.cjs');
|
|
15
|
+
var chunk4YLBKLGS_cjs = require('./chunk-4YLBKLGS.cjs');
|
|
16
|
+
var chunkYKQEOO7C_cjs = require('./chunk-YKQEOO7C.cjs');
|
|
17
|
+
var chunkH65I3GRZ_cjs = require('./chunk-H65I3GRZ.cjs');
|
|
18
|
+
var chunkKOLEURVT_cjs = require('./chunk-KOLEURVT.cjs');
|
|
19
|
+
var chunkTQPGXGKB_cjs = require('./chunk-TQPGXGKB.cjs');
|
|
20
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
21
21
|
|
|
22
22
|
var areArraysEqual = (array1, array2, ignoreOrder = false) => {
|
|
23
|
-
if (!(
|
|
23
|
+
if (!(chunkGKC3UDMC_cjs.isArray(array1) && chunkGKC3UDMC_cjs.isArray(array2))) {
|
|
24
24
|
throw new TypeError(
|
|
25
|
-
`Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${
|
|
25
|
+
`Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
26
26
|
array1
|
|
27
|
-
)}\`, 'array2': \`${
|
|
27
|
+
)}\`, 'array2': \`${chunkGKC3UDMC_cjs.getPreciseType(array2)}\`].`
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(ignoreOrder, {
|
|
31
31
|
message: ({ currentType, validType }) => `Third parameter \`ignoreOrder\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
32
32
|
});
|
|
33
|
-
if (!
|
|
33
|
+
if (!chunkH65I3GRZ_cjs.isEqual(array1.length, array2.length)) return false;
|
|
34
34
|
const deepIgnoreOrder = (arr) => {
|
|
35
|
-
if (!
|
|
35
|
+
if (!chunkGKC3UDMC_cjs.isArray(arr)) return arr;
|
|
36
36
|
const sorted = arr.map((item) => {
|
|
37
|
-
if (
|
|
37
|
+
if (chunkGKC3UDMC_cjs.isArray(item)) {
|
|
38
38
|
return deepIgnoreOrder(item);
|
|
39
39
|
}
|
|
40
40
|
return item;
|
|
41
41
|
});
|
|
42
42
|
return sorted.sort((a, b) => {
|
|
43
|
-
const sa =
|
|
44
|
-
const sb =
|
|
43
|
+
const sa = chunkTQPGXGKB_cjs.safeStableStringify(a);
|
|
44
|
+
const sb = chunkTQPGXGKB_cjs.safeStableStringify(b);
|
|
45
45
|
return sa < sb ? -1 : sa > sb ? 1 : 0;
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
const normalizedArr1 = ignoreOrder ? deepIgnoreOrder(array1) : array1;
|
|
49
49
|
const normalizedArr2 = ignoreOrder ? deepIgnoreOrder(array2) : array2;
|
|
50
|
-
if (!
|
|
50
|
+
if (!chunkH65I3GRZ_cjs.isEqual(normalizedArr1.length, normalizedArr2.length)) return false;
|
|
51
51
|
return normalizedArr1.every(
|
|
52
|
-
(item, index) =>
|
|
52
|
+
(item, index) => chunkTQPGXGKB_cjs.safeStableStringify(item) === chunkTQPGXGKB_cjs.safeStableStringify(normalizedArr2[index])
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
var areObjectsEqual = (object1, object2) => {
|
|
57
|
-
return
|
|
57
|
+
return chunkH65I3GRZ_cjs.isEqual(object1, object2);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
var areURLsEqualPath = (urlA, urlB) => {
|
|
@@ -76,21 +76,21 @@ var areURLsIdentical = (urlA, urlB) => {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
var textContainsAll = (text, searchWords, options = {}) => {
|
|
79
|
-
if (!
|
|
79
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(text) || !chunkGKC3UDMC_cjs.isArray(searchWords)) {
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
83
83
|
message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
84
84
|
});
|
|
85
85
|
const { exactMatch = false, flags = "i" } = options;
|
|
86
|
-
|
|
86
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(exactMatch, {
|
|
87
87
|
message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
88
88
|
});
|
|
89
|
-
|
|
89
|
+
chunkYKQEOO7C_cjs.assertIsString(flags, {
|
|
90
90
|
message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
91
91
|
});
|
|
92
92
|
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
93
|
-
const validSearchWords = searchWords.filter((word) =>
|
|
93
|
+
const validSearchWords = searchWords.filter((word) => chunkGKC3UDMC_cjs.isNonEmptyString(word)).map(escapeRegex);
|
|
94
94
|
if (validSearchWords.length === 0) return false;
|
|
95
95
|
return validSearchWords.every((word) => {
|
|
96
96
|
const pattern = exactMatch ? `(?<!\\S)${word}(?!\\S)` : word;
|
|
@@ -99,21 +99,21 @@ var textContainsAll = (text, searchWords, options = {}) => {
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
var textContainsAny = (text, searchWords, options = {}) => {
|
|
102
|
-
if (!
|
|
102
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(text) || !chunkGKC3UDMC_cjs.isArray(searchWords)) {
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
106
106
|
message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
107
107
|
});
|
|
108
108
|
const { exactMatch = false, flags = "i" } = options;
|
|
109
|
-
|
|
109
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(exactMatch, {
|
|
110
110
|
message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
chunkYKQEOO7C_cjs.assertIsString(flags, {
|
|
113
113
|
message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
114
114
|
});
|
|
115
115
|
const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
116
|
-
const validSearchWords = searchWords.filter((word) =>
|
|
116
|
+
const validSearchWords = searchWords.filter((word) => chunkGKC3UDMC_cjs.isNonEmptyString(word)).map(escapeRegex);
|
|
117
117
|
if (validSearchWords.length === 0) return false;
|
|
118
118
|
const pattern = exactMatch ? `(?<!\\S)(${validSearchWords.join("|")})(?!\\S)` : `(${validSearchWords.join("|")})`;
|
|
119
119
|
return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
|
|
@@ -125,25 +125,25 @@ function isPropertyKey(value) {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
var doesKeyExist = (object, key) => {
|
|
128
|
-
if (!
|
|
128
|
+
if (!chunkGKC3UDMC_cjs.isObjectOrArray(object)) return false;
|
|
129
129
|
if (!isPropertyKey(key)) {
|
|
130
130
|
throw new TypeError(
|
|
131
|
-
`Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${
|
|
131
|
+
`Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
132
132
|
key
|
|
133
133
|
)}\`.`
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
if (Object.prototype.hasOwnProperty.call(object, key)) return true;
|
|
137
|
-
if (
|
|
137
|
+
if (chunkGKC3UDMC_cjs.isArray(object)) {
|
|
138
138
|
return object.some((item) => doesKeyExist(item, key));
|
|
139
139
|
}
|
|
140
140
|
return Object.values(object).some(
|
|
141
|
-
(value) =>
|
|
141
|
+
(value) => chunkGKC3UDMC_cjs.isObjectOrArray(value) && doesKeyExist(value, key)
|
|
142
142
|
);
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
var arrayHasAnyMatch = (sourceArray, targetArray) => {
|
|
146
|
-
if (!
|
|
146
|
+
if (!chunkGKC3UDMC_cjs.isArray(sourceArray) || !chunkGKC3UDMC_cjs.isArray(targetArray) || chunkKOLEURVT_cjs.isEmptyArray(sourceArray) || chunkKOLEURVT_cjs.isEmptyArray(targetArray)) {
|
|
147
147
|
return false;
|
|
148
148
|
}
|
|
149
149
|
const sourceSet = new Set(sourceArray);
|
|
@@ -159,16 +159,16 @@ function isLength(value) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
function isArrayLike(value) {
|
|
162
|
-
return !
|
|
162
|
+
return !chunkGKC3UDMC_cjs.isFunction(value) && chunkGKC3UDMC_cjs.isObjectOrArray(value) && isLength(value?.length);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
function isArrayLikeObject(value) {
|
|
166
|
-
return
|
|
166
|
+
return chunkGKC3UDMC_cjs.isObjectOrArray(value) && isLength(value.length);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
var isCurrencyLike = (input) => {
|
|
170
|
-
if (!(
|
|
171
|
-
const parsed =
|
|
170
|
+
if (!(chunkGKC3UDMC_cjs.isString(input) || chunkGKC3UDMC_cjs.isNumber(input))) return false;
|
|
171
|
+
const parsed = chunkHNGGISFL_cjs.parseCurrencyString(input.toString());
|
|
172
172
|
if (parsed !== 0) return true;
|
|
173
173
|
return input.toString().trim() === "0";
|
|
174
174
|
};
|
|
@@ -179,16 +179,16 @@ var isDeepEqual = (a, b) => {
|
|
|
179
179
|
}
|
|
180
180
|
if (a === b) return true;
|
|
181
181
|
if (typeof a !== typeof b) return false;
|
|
182
|
-
if (
|
|
182
|
+
if (chunkTQPGXGKB_cjs.isDate(a) && chunkTQPGXGKB_cjs.isDate(b)) {
|
|
183
183
|
return a.getTime() === b.getTime();
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (chunkH65I3GRZ_cjs.isRegExp(a) && chunkH65I3GRZ_cjs.isRegExp(b)) {
|
|
186
186
|
return a.toString() === b.toString();
|
|
187
187
|
}
|
|
188
|
-
if (
|
|
188
|
+
if (chunkGKC3UDMC_cjs.isSymbol(a) && chunkGKC3UDMC_cjs.isSymbol(b)) {
|
|
189
189
|
return a.toString() === b.toString();
|
|
190
190
|
}
|
|
191
|
-
if (
|
|
191
|
+
if (chunkGKC3UDMC_cjs.isSet(a) && chunkGKC3UDMC_cjs.isSet(b)) {
|
|
192
192
|
if (a.size !== b.size) return false;
|
|
193
193
|
const bValues = Array.from(b);
|
|
194
194
|
const matched = /* @__PURE__ */ new Set();
|
|
@@ -206,7 +206,7 @@ var isDeepEqual = (a, b) => {
|
|
|
206
206
|
}
|
|
207
207
|
return true;
|
|
208
208
|
}
|
|
209
|
-
if (
|
|
209
|
+
if (chunkTQPGXGKB_cjs.isMap(a) && chunkTQPGXGKB_cjs.isMap(b)) {
|
|
210
210
|
if (a.size !== b.size) return false;
|
|
211
211
|
const bEntries = Array.from(b);
|
|
212
212
|
const matched = /* @__PURE__ */ new Set();
|
|
@@ -225,12 +225,12 @@ var isDeepEqual = (a, b) => {
|
|
|
225
225
|
}
|
|
226
226
|
return true;
|
|
227
227
|
}
|
|
228
|
-
if (
|
|
228
|
+
if (chunkGKC3UDMC_cjs.isArray(a) && chunkGKC3UDMC_cjs.isArray(b)) {
|
|
229
229
|
if (a.length !== b.length) return false;
|
|
230
230
|
return a.every((item, i) => isDeepEqual(item, b[i]));
|
|
231
231
|
}
|
|
232
|
-
if (
|
|
233
|
-
if (
|
|
232
|
+
if (chunkGKC3UDMC_cjs.isObjectOrArray(a) && chunkGKC3UDMC_cjs.isObjectOrArray(b) && a && b) {
|
|
233
|
+
if (chunkGKC3UDMC_cjs.isArray(a) !== chunkGKC3UDMC_cjs.isArray(b)) return false;
|
|
234
234
|
const aKeys = Object.keys(a);
|
|
235
235
|
const bKeys = Object.keys(b);
|
|
236
236
|
if (aKeys.length !== bKeys.length) return false;
|
|
@@ -240,38 +240,38 @@ var isDeepEqual = (a, b) => {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
function isElement(value) {
|
|
243
|
-
return !!value && typeof value === "object" && value?.nodeType === 1 && !
|
|
243
|
+
return !!value && typeof value === "object" && value?.nodeType === 1 && !chunkGKC3UDMC_cjs.isPlainObject(value);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
function isEmpty(value) {
|
|
247
|
-
if (
|
|
248
|
-
if (
|
|
247
|
+
if (chunkGKC3UDMC_cjs.isNil(value)) return true;
|
|
248
|
+
if (chunkGKC3UDMC_cjs.isBoolean(value) || chunkGKC3UDMC_cjs.isNumber(value, { includeNaN: true }) || chunkGKC3UDMC_cjs.isSymbol(value))
|
|
249
249
|
return true;
|
|
250
|
-
if (
|
|
250
|
+
if (chunkGKC3UDMC_cjs.isFunction(value)) {
|
|
251
251
|
return Object.keys(value).length === 0;
|
|
252
252
|
}
|
|
253
|
-
if (
|
|
253
|
+
if (chunkGKC3UDMC_cjs.isString(value) || chunkGKC3UDMC_cjs.isArray(value) || isArguments(value) || chunkUBHCP4N5_cjs.isTypedArray(value)) {
|
|
254
254
|
return value.length === 0;
|
|
255
255
|
}
|
|
256
|
-
if (
|
|
256
|
+
if (chunkTQPGXGKB_cjs.isMap(value) || chunkGKC3UDMC_cjs.isSet(value)) {
|
|
257
257
|
return value.size === 0;
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
259
|
+
if (chunkGKC3UDMC_cjs.isBuffer(value)) {
|
|
260
260
|
return value.length === 0;
|
|
261
261
|
}
|
|
262
|
-
if (
|
|
262
|
+
if (chunkGKC3UDMC_cjs.isPlainObject(value)) {
|
|
263
263
|
return Object.keys(value).length === 0;
|
|
264
264
|
}
|
|
265
265
|
return false;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
var isEmptyDeep = (value) => {
|
|
269
|
-
if (
|
|
270
|
-
if (
|
|
271
|
-
if (
|
|
272
|
-
return
|
|
269
|
+
if (chunkGKC3UDMC_cjs.isString(value)) return chunk4YLBKLGS_cjs.isEmptyString(value);
|
|
270
|
+
if (chunkGKC3UDMC_cjs.isNumber(value)) return chunkGKC3UDMC_cjs.isNaN(value);
|
|
271
|
+
if (chunkGKC3UDMC_cjs.isArray(value)) {
|
|
272
|
+
return chunkKOLEURVT_cjs.isEmptyArray(value) || value.every(isEmptyDeep);
|
|
273
273
|
}
|
|
274
|
-
if (
|
|
274
|
+
if (chunkGKC3UDMC_cjs.isObjectOrArray(value)) {
|
|
275
275
|
const keys = Object.keys(value);
|
|
276
276
|
const symbols = Object.getOwnPropertySymbols(value);
|
|
277
277
|
if (keys.length === 0 && symbols.length === 0) return true;
|
|
@@ -282,7 +282,7 @@ var isEmptyDeep = (value) => {
|
|
|
282
282
|
};
|
|
283
283
|
|
|
284
284
|
function isEqualWith(value, other, customizer) {
|
|
285
|
-
return
|
|
285
|
+
return chunkH65I3GRZ_cjs.baseDeepEqual(value, other, customizer, /* @__PURE__ */ new WeakMap());
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
function isMatchWith(value, other, customizer) {
|
|
@@ -294,25 +294,25 @@ function isSameValue(x, y) {
|
|
|
294
294
|
}
|
|
295
295
|
function baseIsMatch(object, source, customizer) {
|
|
296
296
|
if (object === source) return true;
|
|
297
|
-
if (!
|
|
297
|
+
if (!chunkGKC3UDMC_cjs.isObjectOrArray(source)) {
|
|
298
298
|
return isSameValue(object, source);
|
|
299
299
|
}
|
|
300
|
-
if (!
|
|
300
|
+
if (!chunkGKC3UDMC_cjs.isObjectOrArray(object)) {
|
|
301
301
|
return false;
|
|
302
302
|
}
|
|
303
303
|
const keys = Reflect.ownKeys(source).filter(
|
|
304
|
-
(k) => !(
|
|
304
|
+
(k) => !(chunkGKC3UDMC_cjs.isArray(source) && k === "length")
|
|
305
305
|
);
|
|
306
306
|
for (const key of keys) {
|
|
307
307
|
if (!(key in object)) return false;
|
|
308
308
|
const objValue = object[key];
|
|
309
309
|
const srcValue = source[key];
|
|
310
310
|
const result = customizer?.(objValue, srcValue, key, object, source);
|
|
311
|
-
if (!
|
|
311
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(result)) {
|
|
312
312
|
if (!result) return false;
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
|
-
if (
|
|
315
|
+
if (chunkGKC3UDMC_cjs.isObjectOrArray(objValue) && chunkGKC3UDMC_cjs.isObjectOrArray(srcValue)) {
|
|
316
316
|
if (!isMatchWith(objValue, srcValue, customizer)) return false;
|
|
317
317
|
} else {
|
|
318
318
|
if (!isSameValue(objValue, srcValue)) return false;
|
|
@@ -328,7 +328,7 @@ function isMatch(object, source) {
|
|
|
328
328
|
var funcToString = Function.prototype.toString;
|
|
329
329
|
var reIsNative = /\{\s*\[native code\]\s*\}/;
|
|
330
330
|
function isNative(value) {
|
|
331
|
-
if (!
|
|
331
|
+
if (!chunkGKC3UDMC_cjs.isFunction(value)) return false;
|
|
332
332
|
try {
|
|
333
333
|
const source = funcToString.call(value);
|
|
334
334
|
return reIsNative.test(source);
|
|
@@ -338,7 +338,7 @@ function isNative(value) {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
function isObjectLoose(value) {
|
|
341
|
-
return !
|
|
341
|
+
return !chunkGKC3UDMC_cjs.isNil(value) && (chunkGKC3UDMC_cjs.isObjectOrArray(value) || chunkGKC3UDMC_cjs.isFunction(value));
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
function isSafeInteger(value) {
|
|
@@ -346,7 +346,7 @@ function isSafeInteger(value) {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
var isValidURL = (url) => {
|
|
349
|
-
if (!
|
|
349
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(url)) return false;
|
|
350
350
|
let decodedUrl;
|
|
351
351
|
try {
|
|
352
352
|
decodedUrl = decodeURIComponent(url);
|
|
@@ -366,7 +366,7 @@ var isValidURL = (url) => {
|
|
|
366
366
|
};
|
|
367
367
|
|
|
368
368
|
function isWeakMap(value) {
|
|
369
|
-
return
|
|
369
|
+
return chunkGKC3UDMC_cjs.isObject(value) && !chunkGKC3UDMC_cjs.isNull(value) && value instanceof WeakMap;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
exports.areArraysEqual = areArraysEqual;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isNonEmptyString } from './chunk-
|
|
10
|
+
import { isNonEmptyString } from './chunk-CSG4SCL3.js';
|
|
11
11
|
|
|
12
12
|
var parseCurrencyString = (input) => {
|
|
13
13
|
if (!isNonEmptyString(input)) return 0;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
12
|
+
var chunk2VTDXC3N_cjs = require('./chunk-2VTDXC3N.cjs');
|
|
13
|
+
var chunkEV4Y7HCY_cjs = require('./chunk-EV4Y7HCY.cjs');
|
|
14
|
+
var chunk4YLBKLGS_cjs = require('./chunk-4YLBKLGS.cjs');
|
|
15
|
+
var chunkTQPGXGKB_cjs = require('./chunk-TQPGXGKB.cjs');
|
|
16
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
17
17
|
|
|
18
18
|
var NormalizePathnameError = class _NormalizePathnameError extends Error {
|
|
19
19
|
/** * ***The original error that triggered this normalization failure.***
|
|
@@ -22,10 +22,10 @@ var NormalizePathnameError = class _NormalizePathnameError extends Error {
|
|
|
22
22
|
*/
|
|
23
23
|
originalError;
|
|
24
24
|
constructor(message, originalError) {
|
|
25
|
-
super(message,
|
|
25
|
+
super(message, chunkGKC3UDMC_cjs.isFunction(Error) ? { cause: originalError } : void 0);
|
|
26
26
|
this.name = "NormalizePathnameError";
|
|
27
27
|
this.originalError = originalError;
|
|
28
|
-
if (
|
|
28
|
+
if (chunkGKC3UDMC_cjs.isFunction(Error.captureStackTrace)) {
|
|
29
29
|
Error.captureStackTrace(this, _NormalizePathnameError);
|
|
30
30
|
} else {
|
|
31
31
|
this.stack = new Error(message).stack;
|
|
@@ -50,7 +50,7 @@ function normalizePathname(pathname, options = {
|
|
|
50
50
|
defaultPath: "/",
|
|
51
51
|
keepNullable: false
|
|
52
52
|
}) {
|
|
53
|
-
|
|
53
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
54
54
|
message({ currentType, validType }) {
|
|
55
55
|
return `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
56
56
|
}
|
|
@@ -62,45 +62,45 @@ function normalizePathname(pathname, options = {
|
|
|
62
62
|
localhostDomain = false,
|
|
63
63
|
ignoreDomainExtensions = void 0
|
|
64
64
|
} = options;
|
|
65
|
-
if (!
|
|
65
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(defaultPath)) {
|
|
66
66
|
throw new TypeError(
|
|
67
|
-
`Parameter \`defaultPath\` property of the \`options\` (second parameter) must be of type \`string\` and not empty-string, but received: \`${
|
|
67
|
+
`Parameter \`defaultPath\` property of the \`options\` (second parameter) must be of type \`string\` and not empty-string, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
68
68
|
defaultPath
|
|
69
|
-
)}\`, with value: \`${
|
|
69
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(defaultPath, {
|
|
70
70
|
keepUndefined: true
|
|
71
71
|
})}\`.`
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(keepNullable, {
|
|
75
75
|
message({ currentType, validType }) {
|
|
76
76
|
return `Parameter \`keepNullable\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
|
|
79
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(keepTrailingSlash, {
|
|
80
80
|
message({ currentType, validType }) {
|
|
81
81
|
return `Parameter \`keepTrailingSlash\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
|
|
84
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(localhostDomain, {
|
|
85
85
|
message({ currentType, validType }) {
|
|
86
86
|
return `Parameter \`localhostDomain\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
let ignoreDomainExtsSet;
|
|
90
|
-
if (!
|
|
91
|
-
if (!
|
|
90
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(ignoreDomainExtensions)) {
|
|
91
|
+
if (!chunkGKC3UDMC_cjs.isSet(ignoreDomainExtensions) && !chunkGKC3UDMC_cjs.isArray(ignoreDomainExtensions)) {
|
|
92
92
|
throw new TypeError(
|
|
93
|
-
`Parameter \`ignoreDomainExtensions\` must be of type a \`Set<string>\` or \`string[]\`, but received: \`${
|
|
93
|
+
`Parameter \`ignoreDomainExtensions\` must be of type a \`Set<string>\` or \`string[]\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
94
94
|
ignoreDomainExtensions
|
|
95
95
|
)}\`.`
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
ignoreDomainExtsSet =
|
|
98
|
+
ignoreDomainExtsSet = chunkGKC3UDMC_cjs.isSet(ignoreDomainExtensions) ? ignoreDomainExtensions : new Set(ignoreDomainExtensions);
|
|
99
99
|
let idx = 0;
|
|
100
100
|
for (const ext of ignoreDomainExtsSet) {
|
|
101
|
-
if (!
|
|
101
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(ext)) {
|
|
102
102
|
throw new TypeError(
|
|
103
|
-
`Parameter \`ignoreDomainExtensions[${idx}]\` must be a \`string\` and \`non-empty string\`, but received: \`${
|
|
103
|
+
`Parameter \`ignoreDomainExtensions[${idx}]\` must be a \`string\` and \`non-empty string\`, but received: \`${chunkTQPGXGKB_cjs.safeStableStringify(
|
|
104
104
|
ext,
|
|
105
105
|
{ keepUndefined: true }
|
|
106
106
|
)}\`.`
|
|
@@ -108,7 +108,7 @@ function normalizePathname(pathname, options = {
|
|
|
108
108
|
}
|
|
109
109
|
if (!ext.startsWith(".")) {
|
|
110
110
|
throw new TypeError(
|
|
111
|
-
`Parameter \`ignoreDomainExtensions[${idx}]\` must start with a dot (.), but received: ${
|
|
111
|
+
`Parameter \`ignoreDomainExtensions[${idx}]\` must start with a dot (.), but received: ${chunkTQPGXGKB_cjs.safeStableStringify(
|
|
112
112
|
ext,
|
|
113
113
|
{ keepUndefined: true }
|
|
114
114
|
)}`
|
|
@@ -118,12 +118,12 @@ function normalizePathname(pathname, options = {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
try {
|
|
121
|
-
if (keepNullable && (
|
|
122
|
-
if (
|
|
121
|
+
if (keepNullable && (chunkGKC3UDMC_cjs.isNil(pathname) || !chunkGKC3UDMC_cjs.isString(pathname))) {
|
|
122
|
+
if (chunkGKC3UDMC_cjs.isNull(pathname)) return null;
|
|
123
123
|
return void 0;
|
|
124
124
|
}
|
|
125
|
-
let currentPathName =
|
|
126
|
-
currentPathName =
|
|
125
|
+
let currentPathName = chunkGKC3UDMC_cjs.isNonEmptyString(pathname) ? pathname : defaultPath;
|
|
126
|
+
currentPathName = chunkEV4Y7HCY_cjs.removeSpaces(currentPathName, { trimOnly: true }).replace(
|
|
127
127
|
/\s+/g,
|
|
128
128
|
""
|
|
129
129
|
);
|
|
@@ -192,7 +192,7 @@ var stripLeadingDomain = (path, options) => {
|
|
|
192
192
|
const segments = currentPath.split("/");
|
|
193
193
|
const firstPart = segments[0];
|
|
194
194
|
const domainPart = firstPart.split(":")[0];
|
|
195
|
-
const isDomain =
|
|
195
|
+
const isDomain = chunk2VTDXC3N_cjs.isValidDomain(domainPart, {
|
|
196
196
|
subdomain: true,
|
|
197
197
|
allowUnicode: true,
|
|
198
198
|
wildcard: true,
|
|
@@ -220,7 +220,7 @@ var ensureLeadingSlash = (path) => {
|
|
|
220
220
|
return path;
|
|
221
221
|
};
|
|
222
222
|
var throwError = (error) => {
|
|
223
|
-
const err =
|
|
223
|
+
const err = chunkGKC3UDMC_cjs.isError(error) ? error : new Error("Unknown error from function `normalizePathname()`.");
|
|
224
224
|
throw new NormalizePathnameError(
|
|
225
225
|
`Failed to normalize pathname in function \`normalizePathname()\`: ${err.message}`,
|
|
226
226
|
err
|
|
@@ -228,20 +228,20 @@ var throwError = (error) => {
|
|
|
228
228
|
};
|
|
229
229
|
|
|
230
230
|
var formatEnvPort = (envVar, options = {}) => {
|
|
231
|
-
if (!
|
|
232
|
-
|
|
231
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(envVar)) return "";
|
|
232
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
233
233
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
234
234
|
});
|
|
235
|
-
const prefixColon =
|
|
236
|
-
if (!
|
|
235
|
+
const prefixColon = chunkGKC3UDMC_cjs.hasOwnProp(options, "prefixColon") ? options.prefixColon : false;
|
|
236
|
+
if (!chunkGKC3UDMC_cjs.isBoolean(prefixColon)) {
|
|
237
237
|
throw new TypeError(
|
|
238
|
-
`Parameter \`prefixColon\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: \`${
|
|
238
|
+
`Parameter \`prefixColon\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
239
239
|
prefixColon
|
|
240
240
|
)}\`.`
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
const digitsOnly = envVar.replace(/\D+/g, "");
|
|
244
|
-
if (
|
|
244
|
+
if (chunk4YLBKLGS_cjs.isEmptyString(digitsOnly)) return "";
|
|
245
245
|
return prefixColon ? `:${digitsOnly}` : digitsOnly;
|
|
246
246
|
};
|
|
247
247
|
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { safeJsonParse } from './chunk-
|
|
11
|
-
import { isEqual } from './chunk-
|
|
12
|
-
import { isEmptyArray } from './chunk-
|
|
13
|
-
import { assertIsArray } from './chunk-
|
|
14
|
-
import { safeStableStringify } from './chunk-
|
|
15
|
-
import { isPlainObject, isNonEmptyArray, isObjectOrArray, isArray, isNaN, isUndefined } from './chunk-
|
|
10
|
+
import { safeJsonParse } from './chunk-YSZC56SZ.js';
|
|
11
|
+
import { isEqual } from './chunk-WYP76WXB.js';
|
|
12
|
+
import { isEmptyArray } from './chunk-SDMPEJ4F.js';
|
|
13
|
+
import { assertIsArray } from './chunk-HSP6IWZK.js';
|
|
14
|
+
import { safeStableStringify } from './chunk-6VUXD3CF.js';
|
|
15
|
+
import { isPlainObject, isNonEmptyArray, isObjectOrArray, isArray, isNaN, isUndefined } from './chunk-CSG4SCL3.js';
|
|
16
16
|
|
|
17
17
|
var findDuplicates = (values) => {
|
|
18
18
|
assertIsArray(values, {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
import { isBigInt } from './chunk-QNKGP5DY.js';
|
|
11
|
-
import { assertIsPlainObject, isPlainObject, isBoolean, isNaN, hasOwnProp, getPreciseType, isUndefined, isNumberObject, isInfinityNumber, isStringObject, isBooleanObject, isFunction, isSymbol, isObjectOrArray, isSet, isArray,
|
|
11
|
+
import { assertIsPlainObject, isPlainObject, isBoolean, isNaN, hasOwnProp, getPreciseType, isUndefined, isNumberObject, isInfinityNumber, isStringObject, isBooleanObject, isFunction, isSymbol, isObjectOrArray, isSet, isArray, isNumber, isObject, isNull } from './chunk-CSG4SCL3.js';
|
|
12
12
|
|
|
13
13
|
function isMap(value) {
|
|
14
14
|
return Object.prototype.toString.call(value) === "[object Map]" || value instanceof Map;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var chunkTQPGXGKB_cjs = require('./chunk-TQPGXGKB.cjs');
|
|
14
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
15
15
|
|
|
16
16
|
var CustomPromise = class extends Promise {
|
|
17
17
|
_value;
|
|
@@ -74,14 +74,14 @@ var AbortError = class extends Error {
|
|
|
74
74
|
var delay = (milliSeconds = 1e3, signal) => {
|
|
75
75
|
if (!chunkDVMHRLKP_cjs.isInteger(milliSeconds) || milliSeconds <= 0) {
|
|
76
76
|
throw new TypeError(
|
|
77
|
-
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${
|
|
77
|
+
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
78
78
|
milliSeconds
|
|
79
|
-
)}\`, with value: \`${
|
|
79
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(milliSeconds, {
|
|
80
80
|
keepUndefined: true
|
|
81
81
|
})}\`.`
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
84
|
+
if (chunkGKC3UDMC_cjs.isNull(signal) || signal && !(signal instanceof AbortSignal)) {
|
|
85
85
|
throw new TypeError(
|
|
86
86
|
"Second parameter (`signal`) must be an `instance of AbortSignal` if provided."
|
|
87
87
|
);
|