@rzl-zone/utils-js 3.7.1 → 3.9.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 +28 -1
- package/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +169 -58
- package/dist/assertions/index.js +5 -5
- package/dist/{chunk-EK7FSI7F.cjs → chunk-2XGQQZ6A.cjs} +3 -3
- package/dist/{chunk-YS27V6LS.js → chunk-3LE6NX57.js} +5 -176
- package/dist/{chunk-PZQC3FZY.js → chunk-44X74C26.js} +4 -4
- package/dist/{chunk-4ACKNPL5.js → chunk-5KDVIEVO.js} +2 -2
- package/dist/{chunk-JY4HLZ4W.js → chunk-5O66AUEC.js} +2 -2
- package/dist/chunk-5Y6JL47L.js +302 -0
- package/dist/{chunk-KIYALQQF.cjs → chunk-62FS7WMB.cjs} +35 -35
- package/dist/{chunk-VJVCXEH7.cjs → chunk-6AMDHVS2.cjs} +9 -181
- package/dist/{chunk-6PKW4WCT.js → chunk-6WVOUVWD.js} +27 -15
- package/dist/{chunk-BYUT376O.cjs → chunk-76ATVDCR.cjs} +3 -3
- package/dist/{chunk-F3WBQKRI.cjs → chunk-7C7TQC5J.cjs} +29 -7
- package/dist/{chunk-QUITZ3GP.js → chunk-7EIFPHV3.js} +32 -16
- package/dist/{chunk-6RFNZ2ZZ.cjs → chunk-7NXFGJJE.cjs} +14 -14
- package/dist/{chunk-TFDXRT6D.cjs → chunk-ALRISPTL.cjs} +3 -3
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/{chunk-4ZOXSUXB.js → chunk-C7GC2PFX.js} +3 -3
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/{chunk-XFTUHS4Y.js → chunk-DXPM4NOU.js} +10 -8
- package/dist/{chunk-DPLL67OT.js → chunk-EJV5AF4L.js} +2 -2
- package/dist/{chunk-NREACG6M.cjs → chunk-FWWPEL7J.cjs} +3 -3
- package/dist/{chunk-LEX4TQW2.js → chunk-GHU356XQ.js} +4 -6
- package/dist/chunk-GKDSBOYE.js +209 -0
- package/dist/{chunk-YC7AK3KX.cjs → chunk-H44QVAZL.cjs} +31 -31
- package/dist/{chunk-AKKM6MOX.cjs → chunk-I33PB44Q.cjs} +15 -15
- package/dist/{chunk-LIU4S3JA.cjs → chunk-IX6PF5ZP.cjs} +4 -4
- package/dist/{chunk-3KTD3QDI.js → chunk-J4TT33ZX.js} +29 -7
- package/dist/{chunk-SZJ7OI4S.js → chunk-J6VLFVIL.js} +3 -3
- package/dist/{chunk-KTQLDIIT.cjs → chunk-JI57K7D4.cjs} +173 -163
- package/dist/{chunk-OFBFGFVH.js → chunk-JYOCB6OV.js} +2 -2
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-66WLOZOD.cjs → chunk-KUVRZ2JW.cjs} +53 -51
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-VCVND6CH.js → chunk-M5QB2GM5.js} +2 -2
- package/dist/{chunk-3LEWQV3R.js → chunk-MBFVTGYS.js} +8 -8
- package/dist/{chunk-UKAUXY2U.cjs → chunk-MMRHKYT6.cjs} +12 -12
- package/dist/{chunk-U5VR4TJN.js → chunk-MS2KSKD7.js} +9 -9
- package/dist/{chunk-7ZNEUWYP.js → chunk-MZ3T6L7Z.js} +2 -2
- package/dist/{chunk-ATLFMKAF.cjs → chunk-NAOVH4OH.cjs} +7 -7
- package/dist/chunk-NJ24M6ZH.cjs +308 -0
- package/dist/chunk-OCTHWEZK.cjs +249 -0
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-FI76UZRF.js → chunk-OSSFLQDD.js} +3 -4
- package/dist/{chunk-7WBMA2VE.cjs → chunk-OYFUBKEG.cjs} +4 -5
- package/dist/{chunk-B4SDEBN7.cjs → chunk-PWKOFPAH.cjs} +3 -3
- package/dist/{chunk-2CQI36UD.cjs → chunk-QGTFQ7RO.cjs} +8 -6
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/chunk-QXTJVDWE.js +676 -0
- package/dist/{chunk-B6UIKBHR.cjs → chunk-QZI5PVCI.cjs} +4 -4
- package/dist/{chunk-WNO3EPYT.js → chunk-R2DR7SPJ.js} +102 -26
- package/dist/{chunk-TDYGYHSH.js → chunk-SN5HAK3Y.js} +4 -4
- package/dist/{chunk-D53CE4BT.js → chunk-SRWL4YCP.js} +11 -8
- package/dist/{chunk-7QQV66RX.cjs → chunk-TJ5OY6MC.cjs} +10 -10
- package/dist/{chunk-6WMB5AJR.js → chunk-TXOVQZPU.js} +3 -4
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/{chunk-R3PBF6F7.cjs → chunk-UFYMRRJH.cjs} +73 -61
- package/dist/{chunk-5NN4ZDE2.cjs → chunk-UV5BKAYW.cjs} +6 -8
- package/dist/{chunk-GAJBF6DR.js → chunk-UXT4XSUK.js} +2 -2
- package/dist/{chunk-TDPYR5JY.js → chunk-VBSLIIDB.js} +24 -14
- package/dist/chunk-VCYXNIZ2.cjs +678 -0
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/{chunk-VNADVWSJ.js → chunk-WB3FT62A.js} +6 -4
- package/dist/{chunk-K63WO3XA.cjs → chunk-WKM6UVMG.cjs} +4 -5
- package/dist/{chunk-OS5OT5JA.cjs → chunk-WLEZ2KSG.cjs} +142 -126
- package/dist/{chunk-ZN53RM3R.js → chunk-WRGN6UBK.js} +2 -2
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/{chunk-2VO2CBTU.js → chunk-X6ULJZ3X.js} +2 -2
- package/dist/{chunk-CKUEZF4R.cjs → chunk-XYWC4EQ3.cjs} +71 -71
- package/dist/{chunk-A3YI6Y2P.js → chunk-YHFRCVTN.js} +3 -3
- package/dist/{chunk-RMJC3B5P.cjs → chunk-YQHJB7KR.cjs} +30 -27
- package/dist/{chunk-YGB2BQPB.cjs → chunk-YVRUY4EW.cjs} +8 -8
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/chunk-ZTHJQJ5F.cjs +211 -0
- package/dist/conversions/index.cjs +34 -34
- package/dist/conversions/index.d.ts +10 -12
- package/dist/conversions/index.js +15 -15
- package/dist/events/index.cjs +8 -8
- package/dist/events/index.d.ts +9 -9
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +19 -19
- package/dist/formatters/index.d.ts +19 -24
- package/dist/formatters/index.js +9 -9
- package/dist/generators/index.cjs +12 -8
- package/dist/generators/index.d.ts +155 -26
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/{isPlainObject-FWmcJF6k.d.ts → isPlainObject-BTPjv6zB.d.ts} +2 -2
- package/dist/next/index.cjs +39 -36
- package/dist/next/index.d.ts +11 -11
- package/dist/next/index.js +12 -9
- package/dist/next/server/index.cjs +4 -4
- package/dist/next/server/index.d.ts +4 -4
- package/dist/next/server/index.js +2 -2
- package/dist/operations/index.cjs +11 -11
- package/dist/operations/index.d.ts +8 -9
- package/dist/operations/index.js +8 -8
- package/dist/parsers/index.cjs +6 -4
- package/dist/parsers/index.d.ts +224 -32
- package/dist/parsers/index.js +5 -3
- package/dist/predicates/index.cjs +77 -76
- package/dist/predicates/index.d.ts +15 -28
- package/dist/predicates/index.js +14 -13
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +5 -7
- 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 +18 -18
- package/dist/tailwind/index.js +5 -5
- package/dist/urls/index.cjs +23 -21
- package/dist/urls/index.d.ts +188 -121
- package/dist/urls/index.js +16 -14
- package/package.json +1 -1
- package/dist/chunk-ABA2ZSBQ.js +0 -152
- package/dist/chunk-BG3AS5BU.cjs +0 -173
- package/dist/chunk-K3SONK25.cjs +0 -157
- package/dist/chunk-KPCDDYTZ.js +0 -417
- package/dist/chunk-QAPYHLHC.cjs +0 -419
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isValidDomain } from './chunk-
|
|
11
|
-
import { removeSpaces } from './chunk-
|
|
12
|
-
import { isEmptyString } from './chunk-
|
|
13
|
-
import { safeStableStringify } from './chunk-
|
|
14
|
-
import { assertIsPlainObject, isNonEmptyString, getPreciseType, assertIsBoolean, isNil, isString, isNull, isError, hasOwnProp, isBoolean, isFunction } from './chunk-
|
|
10
|
+
import { isValidDomain } from './chunk-3LE6NX57.js';
|
|
11
|
+
import { removeSpaces } from './chunk-5KDVIEVO.js';
|
|
12
|
+
import { isEmptyString } from './chunk-5O66AUEC.js';
|
|
13
|
+
import { safeStableStringify } from './chunk-X6ULJZ3X.js';
|
|
14
|
+
import { assertIsPlainObject, isNonEmptyString, getPreciseType, assertIsBoolean, isUndefined, isSet, isArray, isNil, isString, isNull, isError, hasOwnProp, isBoolean, isFunction } from './chunk-J4TT33ZX.js';
|
|
15
15
|
|
|
16
16
|
var NormalizePathnameError = class _NormalizePathnameError extends Error {
|
|
17
17
|
/** * ***The original error that triggered this normalization failure.***
|
|
@@ -53,19 +53,68 @@ function normalizePathname(pathname, options = {
|
|
|
53
53
|
return `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
const {
|
|
56
|
+
const {
|
|
57
|
+
defaultPath = "/",
|
|
58
|
+
keepNullable = false,
|
|
59
|
+
keepTrailingSlash = false,
|
|
60
|
+
localhostDomain = false,
|
|
61
|
+
ignoreDomainExtensions = void 0
|
|
62
|
+
} = options;
|
|
57
63
|
if (!isNonEmptyString(defaultPath)) {
|
|
58
64
|
throw new TypeError(
|
|
59
65
|
`Parameter \`defaultPath\` property of the \`options\` (second parameter) must be of type \`string\` and not empty-string, but received: \`${getPreciseType(
|
|
60
66
|
defaultPath
|
|
61
|
-
)}\`, with value: \`${safeStableStringify(defaultPath
|
|
67
|
+
)}\`, with value: \`${safeStableStringify(defaultPath, {
|
|
68
|
+
keepUndefined: true
|
|
69
|
+
})}\`.`
|
|
62
70
|
);
|
|
63
71
|
}
|
|
72
|
+
assertIsBoolean(keepNullable, {
|
|
73
|
+
message({ currentType, validType }) {
|
|
74
|
+
return `Parameter \`keepNullable\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
64
77
|
assertIsBoolean(keepTrailingSlash, {
|
|
65
78
|
message({ currentType, validType }) {
|
|
66
79
|
return `Parameter \`keepTrailingSlash\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
67
80
|
}
|
|
68
81
|
});
|
|
82
|
+
assertIsBoolean(localhostDomain, {
|
|
83
|
+
message({ currentType, validType }) {
|
|
84
|
+
return `Parameter \`localhostDomain\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
let ignoreDomainExtsSet;
|
|
88
|
+
if (!isUndefined(ignoreDomainExtensions)) {
|
|
89
|
+
if (!isSet(ignoreDomainExtensions) && !isArray(ignoreDomainExtensions)) {
|
|
90
|
+
throw new TypeError(
|
|
91
|
+
`Parameter \`ignoreDomainExtensions\` must be of type a \`Set<string>\` or \`string[]\`, but received: \`${getPreciseType(
|
|
92
|
+
ignoreDomainExtensions
|
|
93
|
+
)}\`.`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
ignoreDomainExtsSet = isSet(ignoreDomainExtensions) ? ignoreDomainExtensions : new Set(ignoreDomainExtensions);
|
|
97
|
+
let idx = 0;
|
|
98
|
+
for (const ext of ignoreDomainExtsSet) {
|
|
99
|
+
if (!isNonEmptyString(ext)) {
|
|
100
|
+
throw new TypeError(
|
|
101
|
+
`Parameter \`ignoreDomainExtensions[${idx}]\` must be a \`string\` and \`non-empty string\`, but received: \`${safeStableStringify(
|
|
102
|
+
ext,
|
|
103
|
+
{ keepUndefined: true }
|
|
104
|
+
)}\`.`
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
if (!ext.startsWith(".")) {
|
|
108
|
+
throw new TypeError(
|
|
109
|
+
`Parameter \`ignoreDomainExtensions[${idx}]\` must start with a dot (.), but received: ${safeStableStringify(
|
|
110
|
+
ext,
|
|
111
|
+
{ keepUndefined: true }
|
|
112
|
+
)}`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
idx++;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
69
118
|
try {
|
|
70
119
|
if (keepNullable && (isNil(pathname) || !isString(pathname))) {
|
|
71
120
|
if (isNull(pathname)) return null;
|
|
@@ -76,7 +125,11 @@ function normalizePathname(pathname, options = {
|
|
|
76
125
|
/\s+/g,
|
|
77
126
|
""
|
|
78
127
|
);
|
|
79
|
-
currentPathName = stripLeadingDomain(currentPathName
|
|
128
|
+
currentPathName = stripLeadingDomain(currentPathName, {
|
|
129
|
+
keepTrailingSlash,
|
|
130
|
+
localhostDomain,
|
|
131
|
+
ignoreDomainExtensions: ignoreDomainExtsSet
|
|
132
|
+
});
|
|
80
133
|
let _pathName = currentPathName;
|
|
81
134
|
let search = "";
|
|
82
135
|
let hash = "";
|
|
@@ -105,14 +158,10 @@ function normalizePathname(pathname, options = {
|
|
|
105
158
|
hash = decodeUnicodeSequences(hash);
|
|
106
159
|
return _pathName + search + hash;
|
|
107
160
|
} catch (error) {
|
|
108
|
-
|
|
109
|
-
throw new NormalizePathnameError(
|
|
110
|
-
`Failed to normalize pathname in function \`normalizePathname()\`: ${err.message}`,
|
|
111
|
-
err
|
|
112
|
-
);
|
|
161
|
+
throwError(error);
|
|
113
162
|
}
|
|
114
163
|
}
|
|
115
|
-
|
|
164
|
+
var decodeUnicodeSequences = (str) => {
|
|
116
165
|
return str.replace(/(?:%(?:[0-9A-F]{2})){2,}/gi, (match) => {
|
|
117
166
|
try {
|
|
118
167
|
const decoded = decodeURIComponent(match);
|
|
@@ -122,32 +171,59 @@ function decodeUnicodeSequences(str) {
|
|
|
122
171
|
return match;
|
|
123
172
|
}
|
|
124
173
|
});
|
|
125
|
-
}
|
|
126
|
-
|
|
174
|
+
};
|
|
175
|
+
var stripLeadingDomain = (path, options) => {
|
|
127
176
|
let currentPath = path;
|
|
177
|
+
const { ignoreDomainExtensions, localhostDomain } = options;
|
|
128
178
|
if (/^https?:\/\//i.test(currentPath)) {
|
|
129
179
|
try {
|
|
130
180
|
const url = new URL(currentPath);
|
|
131
|
-
currentPath =
|
|
132
|
-
|
|
181
|
+
currentPath = url.pathname.replace(/^\/+/, "").replace(/\/{2,}/g, "/") + url.search + url.hash;
|
|
182
|
+
return ensureLeadingSlash(currentPath);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
throwError(error);
|
|
133
185
|
}
|
|
134
186
|
}
|
|
135
187
|
if (currentPath.startsWith("/")) {
|
|
136
188
|
currentPath = currentPath.replace(/\/{2,}/g, "/").slice(1);
|
|
137
189
|
}
|
|
138
|
-
const
|
|
190
|
+
const segments = currentPath.split("/");
|
|
191
|
+
const firstPart = segments[0];
|
|
139
192
|
const domainPart = firstPart.split(":")[0];
|
|
140
|
-
|
|
193
|
+
const isDomain = isValidDomain(domainPart, {
|
|
141
194
|
subdomain: true,
|
|
142
195
|
allowUnicode: true,
|
|
143
196
|
wildcard: true,
|
|
197
|
+
allowLocalhost: localhostDomain,
|
|
198
|
+
allowPort: true,
|
|
199
|
+
allowProtocol: true,
|
|
144
200
|
topLevel: false
|
|
145
|
-
})
|
|
146
|
-
|
|
201
|
+
});
|
|
202
|
+
let hasIgnoredExtension = false;
|
|
203
|
+
if (ignoreDomainExtensions) {
|
|
204
|
+
for (const ext of ignoreDomainExtensions) {
|
|
205
|
+
if (firstPart.endsWith(ext)) {
|
|
206
|
+
hasIgnoredExtension = true;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
147
210
|
}
|
|
148
|
-
if (!
|
|
149
|
-
|
|
150
|
-
}
|
|
211
|
+
if (isDomain && !hasIgnoredExtension) {
|
|
212
|
+
segments.shift();
|
|
213
|
+
}
|
|
214
|
+
return ensureLeadingSlash(segments.join("/"));
|
|
215
|
+
};
|
|
216
|
+
var ensureLeadingSlash = (path) => {
|
|
217
|
+
if (!path.startsWith("/")) path = "/" + path;
|
|
218
|
+
return path;
|
|
219
|
+
};
|
|
220
|
+
var throwError = (error) => {
|
|
221
|
+
const err = isError(error) ? error : new Error("Unknown error from function `normalizePathname()`.");
|
|
222
|
+
throw new NormalizePathnameError(
|
|
223
|
+
`Failed to normalize pathname in function \`normalizePathname()\`: ${err.message}`,
|
|
224
|
+
err
|
|
225
|
+
);
|
|
226
|
+
};
|
|
151
227
|
|
|
152
228
|
var formatEnvPort = (envVar, options = {}) => {
|
|
153
229
|
if (!isNonEmptyString(envVar)) return "";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isFinite } from './chunk-
|
|
11
|
-
import { isEmptyArray } from './chunk-
|
|
10
|
+
import { isFinite } from './chunk-MZ3T6L7Z.js';
|
|
11
|
+
import { isEmptyArray } from './chunk-M5QB2GM5.js';
|
|
12
12
|
import { isBigInt } from './chunk-QNKGP5DY.js';
|
|
13
|
-
import { isNil, isArray, assertIsPlainObject, hasOwnProp, assertIsBoolean, isString, isBoolean, isNull } from './chunk-
|
|
13
|
+
import { isNil, isArray, assertIsPlainObject, hasOwnProp, assertIsBoolean, isString, isBoolean, isNull } from './chunk-J4TT33ZX.js';
|
|
14
14
|
|
|
15
15
|
function filterNilArray(input) {
|
|
16
16
|
if (isNil(input)) return void 0;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.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-DXPM4NOU.js';
|
|
11
|
+
import { isEqual } from './chunk-J6VLFVIL.js';
|
|
12
|
+
import { isEmptyArray } from './chunk-M5QB2GM5.js';
|
|
13
|
+
import { assertIsArray } from './chunk-TXOVQZPU.js';
|
|
14
|
+
import { safeStableStringify } from './chunk-X6ULJZ3X.js';
|
|
15
|
+
import { isPlainObject, isNonEmptyArray, isObjectOrArray, isArray, isNaN, isUndefined } from './chunk-J4TT33ZX.js';
|
|
16
16
|
|
|
17
17
|
var findDuplicates = (values) => {
|
|
18
18
|
assertIsArray(values, {
|
|
@@ -57,7 +57,10 @@ var omitKeysDeep = (object, keysToOmit) => {
|
|
|
57
57
|
if (isNonEmptyArray(duplicates)) {
|
|
58
58
|
throw new Error(
|
|
59
59
|
`Function "omitKeysDeep" Error: Duplicate keys detected - \`${safeStableStringify(
|
|
60
|
-
duplicates
|
|
60
|
+
duplicates,
|
|
61
|
+
{
|
|
62
|
+
keepUndefined: true
|
|
63
|
+
}
|
|
61
64
|
)}\`.`
|
|
62
65
|
);
|
|
63
66
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.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
|
|
12
|
+
var chunkH44QVAZL_cjs = require('./chunk-H44QVAZL.cjs');
|
|
13
|
+
var chunk7C7TQC5J_cjs = require('./chunk-7C7TQC5J.cjs');
|
|
14
14
|
|
|
15
15
|
var isRegExp = (value) => {
|
|
16
16
|
return value instanceof RegExp;
|
|
@@ -23,7 +23,7 @@ function isArrayBuffer(value) {
|
|
|
23
23
|
function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new WeakMap()) {
|
|
24
24
|
if (value === other) return true;
|
|
25
25
|
if (value !== value && other !== other) return true;
|
|
26
|
-
if (!
|
|
26
|
+
if (!chunk7C7TQC5J_cjs.isObjectOrArray(value) || !chunk7C7TQC5J_cjs.isObjectOrArray(other)) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
if (seen.get(value) === other) return true;
|
|
@@ -31,14 +31,14 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
31
31
|
const callCustomizer = (v, o, key, valObj, othObj) => {
|
|
32
32
|
if (customizer) {
|
|
33
33
|
const result = customizer(v, o, key, valObj, othObj, seen);
|
|
34
|
-
if (!
|
|
34
|
+
if (!chunk7C7TQC5J_cjs.isUndefined(result)) return result;
|
|
35
35
|
}
|
|
36
36
|
return baseDeepEqual(v, o, customizer, seen);
|
|
37
37
|
};
|
|
38
|
-
if (
|
|
38
|
+
if (chunkH44QVAZL_cjs.isDate(value) && chunkH44QVAZL_cjs.isDate(other)) return value.getTime() === other.getTime();
|
|
39
39
|
if (isRegExp(value) && isRegExp(other))
|
|
40
40
|
return value.source === other.source && value.flags === other.flags;
|
|
41
|
-
if (
|
|
41
|
+
if (chunk7C7TQC5J_cjs.isError(value) && chunk7C7TQC5J_cjs.isError(other))
|
|
42
42
|
return value.name === other.name && value.message === other.message;
|
|
43
43
|
if (ArrayBuffer.isView(value) && ArrayBuffer.isView(other)) {
|
|
44
44
|
const v = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
@@ -53,7 +53,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
53
53
|
for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (chunkH44QVAZL_cjs.isMap(value) && chunkH44QVAZL_cjs.isMap(other)) {
|
|
57
57
|
if (value.size !== other.size) return false;
|
|
58
58
|
for (const [k, v] of value) {
|
|
59
59
|
if (!other.has(k)) return false;
|
|
@@ -61,7 +61,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
61
61
|
}
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
|
-
if (
|
|
64
|
+
if (chunk7C7TQC5J_cjs.isSet(value) && chunk7C7TQC5J_cjs.isSet(other)) {
|
|
65
65
|
if (value.size !== other.size) return false;
|
|
66
66
|
for (const v of value) {
|
|
67
67
|
let matched = false;
|
|
@@ -75,7 +75,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
|
|
|
75
75
|
}
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (chunk7C7TQC5J_cjs.isArray(value) && chunk7C7TQC5J_cjs.isArray(other)) {
|
|
79
79
|
if (value.length !== other.length) return false;
|
|
80
80
|
for (let i = 0; i < value.length; i++) {
|
|
81
81
|
if (!callCustomizer(value[i], other[i], i, value, other)) return false;
|
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isArray, resolveErrorMessageAssertions } from './chunk-
|
|
10
|
+
import { isArray, resolveErrorMessageAssertions } from './chunk-J4TT33ZX.js';
|
|
11
11
|
|
|
12
12
|
function assertIsArray(value, options) {
|
|
13
13
|
if (isArray(value)) return;
|
|
14
|
-
|
|
14
|
+
resolveErrorMessageAssertions({
|
|
15
15
|
value,
|
|
16
16
|
options,
|
|
17
17
|
requiredValidType: "array"
|
|
18
18
|
});
|
|
19
|
-
throw new TypeError(errorMessage);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
export { assertIsArray };
|
package/dist/chunk-UDA26MCU.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -10,64 +10,70 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkKHO2SBNA_cjs = require('./chunk-KHO2SBNA.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
13
|
+
var chunk76ATVDCR_cjs = require('./chunk-76ATVDCR.cjs');
|
|
14
|
+
var chunkI33PB44Q_cjs = require('./chunk-I33PB44Q.cjs');
|
|
15
|
+
var chunkMMRHKYT6_cjs = require('./chunk-MMRHKYT6.cjs');
|
|
16
16
|
var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
17
|
+
var chunkOCTHWEZK_cjs = require('./chunk-OCTHWEZK.cjs');
|
|
18
|
+
var chunkFWWPEL7J_cjs = require('./chunk-FWWPEL7J.cjs');
|
|
19
|
+
var chunkOYFUBKEG_cjs = require('./chunk-OYFUBKEG.cjs');
|
|
20
|
+
var chunkH44QVAZL_cjs = require('./chunk-H44QVAZL.cjs');
|
|
21
|
+
var chunk7C7TQC5J_cjs = require('./chunk-7C7TQC5J.cjs');
|
|
22
22
|
|
|
23
23
|
var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
24
|
-
if (
|
|
25
|
-
if (
|
|
24
|
+
if (chunk7C7TQC5J_cjs.isString(baseUrl)) {
|
|
25
|
+
if (chunkFWWPEL7J_cjs.isEmptyString(baseUrl)) {
|
|
26
26
|
throw new TypeError(`First parameter (\`baseUrl\`) cannot be an empty-string.`);
|
|
27
27
|
}
|
|
28
|
-
baseUrl =
|
|
28
|
+
baseUrl = chunk76ATVDCR_cjs.normalizeString(baseUrl);
|
|
29
29
|
} else if (!chunkKHO2SBNA_cjs.isURL(baseUrl)) {
|
|
30
30
|
throw new TypeError(
|
|
31
|
-
`First parameter (\`baseUrl\`) must be of type an URL instance or a \`string\` and a non empty-string, but received: \`${
|
|
31
|
+
`First parameter (\`baseUrl\`) must be of type an URL instance or a \`string\` and a non empty-string, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
32
32
|
baseUrl
|
|
33
|
-
)}\`, with current value: \`${
|
|
33
|
+
)}\`, with current value: \`${chunkH44QVAZL_cjs.safeStableStringify(baseUrl, {
|
|
34
|
+
keepUndefined: true
|
|
35
|
+
})}\`.`
|
|
34
36
|
);
|
|
35
37
|
}
|
|
36
|
-
if (!
|
|
37
|
-
|
|
38
|
+
if (!chunk7C7TQC5J_cjs.isUndefined(removeParams)) {
|
|
39
|
+
chunkOYFUBKEG_cjs.assertIsArray(removeParams, {
|
|
38
40
|
message: ({ currentType, validType }) => `Third parameter (\`removeParams\`) must be of type \`${validType} of strings\`, but received: \`${currentType}\`.`
|
|
39
41
|
});
|
|
40
|
-
if (!removeParams.every((param) =>
|
|
42
|
+
if (!removeParams.every((param) => chunk7C7TQC5J_cjs.isNonEmptyString(param))) {
|
|
41
43
|
throw new TypeError(
|
|
42
44
|
`Third parameter (\`removeParams\`) must be of type \`array\` and contains \`string\` only and non empty-string.`
|
|
43
45
|
);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
try {
|
|
47
|
-
if (!
|
|
49
|
+
if (!chunk7C7TQC5J_cjs.isUndefined(queryParams) && !chunk7C7TQC5J_cjs.isFunction(queryParams[Symbol.iterator])) {
|
|
48
50
|
throw new TypeError(
|
|
49
|
-
`Second parameter (\`queryParams\`) must be iterable (like URLSearchParams.entries() or an array of [[string, string | number]...]), but received: \`${
|
|
51
|
+
`Second parameter (\`queryParams\`) must be iterable (like URLSearchParams.entries() or an array of [[string, string | number]...]), but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
50
52
|
queryParams
|
|
51
|
-
)}\`, with value: \`${
|
|
53
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(queryParams, {
|
|
54
|
+
keepUndefined: true
|
|
55
|
+
})}\`.`
|
|
52
56
|
);
|
|
53
57
|
}
|
|
54
58
|
const urlInstance = new URL(baseUrl);
|
|
55
|
-
if (!
|
|
59
|
+
if (!chunk7C7TQC5J_cjs.isUndefined(queryParams)) {
|
|
56
60
|
const paramObject = Object.fromEntries(queryParams);
|
|
57
|
-
if (!
|
|
61
|
+
if (!chunkMMRHKYT6_cjs.isEmptyValue(paramObject)) {
|
|
58
62
|
const mergedParams = new URLSearchParams(urlInstance.search);
|
|
59
63
|
for (const [key, value] of Object.entries(paramObject)) {
|
|
60
|
-
if (!
|
|
64
|
+
if (!chunk7C7TQC5J_cjs.isNonEmptyString(value) && !chunk7C7TQC5J_cjs.isNumber(value, { includeNaN: true })) {
|
|
61
65
|
throw new TypeError(
|
|
62
|
-
`Second parameter (\`queryParams\`) must be iterable (like URLSearchParams.entries() or an array of [[string, string | number]...]), but received: \`${
|
|
66
|
+
`Second parameter (\`queryParams\`) must be iterable (like URLSearchParams.entries() or an array of [[string, string | number]...]), but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
63
67
|
queryParams
|
|
64
|
-
)}\`, with value: \`${
|
|
68
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(queryParams, {
|
|
69
|
+
keepUndefined: true
|
|
70
|
+
})}\`.`
|
|
65
71
|
);
|
|
66
72
|
}
|
|
67
73
|
mergedParams.set(key, String(value));
|
|
68
74
|
}
|
|
69
75
|
if (removeParams?.length) {
|
|
70
|
-
|
|
76
|
+
chunkI33PB44Q_cjs.toStringArrayUnRecursive(removeParams).map((paramKey) => {
|
|
71
77
|
mergedParams.delete(paramKey);
|
|
72
78
|
});
|
|
73
79
|
}
|
|
@@ -77,7 +83,7 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
|
77
83
|
removeParams?.forEach((param) => urlInstance.searchParams.delete(param));
|
|
78
84
|
return urlInstance;
|
|
79
85
|
} catch (error) {
|
|
80
|
-
if (
|
|
86
|
+
if (chunk7C7TQC5J_cjs.isError(error)) throw error;
|
|
81
87
|
throw new Error(
|
|
82
88
|
"Failed to construct a valid URL in `constructURL()`, Error:" + error
|
|
83
89
|
);
|
|
@@ -85,7 +91,7 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
|
85
91
|
};
|
|
86
92
|
|
|
87
93
|
var extractURLs = (url) => {
|
|
88
|
-
if (!
|
|
94
|
+
if (!chunk7C7TQC5J_cjs.isNonEmptyString(url)) return null;
|
|
89
95
|
let decoded;
|
|
90
96
|
try {
|
|
91
97
|
decoded = decodeURIComponent(url);
|
|
@@ -107,62 +113,66 @@ var extractURLs = (url) => {
|
|
|
107
113
|
};
|
|
108
114
|
|
|
109
115
|
var getFirstPrefixPathname = (result, defaultValue = "/") => {
|
|
110
|
-
if (!
|
|
116
|
+
if (!chunk7C7TQC5J_cjs.isNonEmptyString(defaultValue)) {
|
|
111
117
|
throw new TypeError(
|
|
112
|
-
`Second parameter (\`defaultValue\`) must be of type \`string\` and not an \`empty-string\`, but received: \`${
|
|
118
|
+
`Second parameter (\`defaultValue\`) must be of type \`string\` and not an \`empty-string\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
113
119
|
defaultValue
|
|
114
|
-
)}\`, with value: \`${
|
|
120
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(defaultValue, {
|
|
121
|
+
keepUndefined: true
|
|
122
|
+
})}\`.`
|
|
115
123
|
);
|
|
116
124
|
}
|
|
117
|
-
if (
|
|
118
|
-
if (!result.every((item) =>
|
|
125
|
+
if (chunk7C7TQC5J_cjs.isArray(result)) {
|
|
126
|
+
if (!result.every((item) => chunk7C7TQC5J_cjs.isString(item))) {
|
|
119
127
|
throw new TypeError(
|
|
120
|
-
`First parameter (\`result\`) must be of type \`string\` or \`array of string\`, but received: \`${
|
|
128
|
+
`First parameter (\`result\`) must be of type \`string\` or \`array of string\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
121
129
|
result
|
|
122
|
-
)}\`, with value: \`${
|
|
130
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(result, {
|
|
131
|
+
keepUndefined: true
|
|
132
|
+
})}\`.`
|
|
123
133
|
);
|
|
124
134
|
}
|
|
125
135
|
for (const item of result) {
|
|
126
|
-
const normalized =
|
|
136
|
+
const normalized = chunkOCTHWEZK_cjs.normalizePathname(item);
|
|
127
137
|
if (normalized !== "/") {
|
|
128
138
|
return normalized;
|
|
129
139
|
}
|
|
130
140
|
}
|
|
131
|
-
return
|
|
141
|
+
return chunkOCTHWEZK_cjs.normalizePathname(defaultValue);
|
|
132
142
|
}
|
|
133
|
-
if (
|
|
134
|
-
const normalized =
|
|
135
|
-
return normalized !== "/" ? normalized :
|
|
143
|
+
if (chunk7C7TQC5J_cjs.isString(result)) {
|
|
144
|
+
const normalized = chunkOCTHWEZK_cjs.normalizePathname(result);
|
|
145
|
+
return normalized !== "/" ? normalized : chunkOCTHWEZK_cjs.normalizePathname(defaultValue);
|
|
136
146
|
}
|
|
137
|
-
if (!
|
|
147
|
+
if (!chunk7C7TQC5J_cjs.isNil(result)) {
|
|
138
148
|
throw new TypeError(
|
|
139
|
-
`First parameter (\`result\`) must be of type \`string\`, \`array-string\`, \`null\` or \`undefined\`, but received: \`${
|
|
149
|
+
`First parameter (\`result\`) must be of type \`string\`, \`array-string\`, \`null\` or \`undefined\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
140
150
|
result
|
|
141
151
|
)}\`.`
|
|
142
152
|
);
|
|
143
153
|
}
|
|
144
|
-
return
|
|
154
|
+
return chunkOCTHWEZK_cjs.normalizePathname(defaultValue);
|
|
145
155
|
};
|
|
146
156
|
|
|
147
157
|
var getPrefixPathname = (url, base = null, options = {}) => {
|
|
148
158
|
const errors = [];
|
|
149
|
-
if (!
|
|
159
|
+
if (!chunk7C7TQC5J_cjs.isString(url) && !chunk7C7TQC5J_cjs.isArray(url)) {
|
|
150
160
|
errors.push(
|
|
151
|
-
`First parameter (\`url\`) must be of type \`string\` or \`array-string\`, but received: \`${
|
|
161
|
+
`First parameter (\`url\`) must be of type \`string\` or \`array-string\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
152
162
|
url
|
|
153
163
|
)}\`.`
|
|
154
164
|
);
|
|
155
165
|
}
|
|
156
|
-
if (!
|
|
166
|
+
if (!chunk7C7TQC5J_cjs.isString(base) && !chunk7C7TQC5J_cjs.isArray(base) && !chunk7C7TQC5J_cjs.isNull(base)) {
|
|
157
167
|
errors.push(
|
|
158
|
-
`Second parameter (\`base\`) must be of type \`string\`, \`array-string\` or \`null\`, but received: \`${
|
|
168
|
+
`Second parameter (\`base\`) must be of type \`string\`, \`array-string\` or \`null\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
159
169
|
base
|
|
160
170
|
)}\`.`
|
|
161
171
|
);
|
|
162
172
|
}
|
|
163
|
-
if (!
|
|
173
|
+
if (!chunk7C7TQC5J_cjs.isPlainObject(options)) {
|
|
164
174
|
errors.push(
|
|
165
|
-
`Second parameter (\`options\`) must be of type \`plain-object\`, but received: \`${
|
|
175
|
+
`Second parameter (\`options\`) must be of type \`plain-object\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
166
176
|
options
|
|
167
177
|
)}\`.`
|
|
168
178
|
);
|
|
@@ -170,46 +180,48 @@ var getPrefixPathname = (url, base = null, options = {}) => {
|
|
|
170
180
|
const { levels = 1, removeDuplicates = true } = options;
|
|
171
181
|
if (!chunkDVMHRLKP_cjs.isInteger(levels) || chunkDVMHRLKP_cjs.isInteger(levels) && levels < 0) {
|
|
172
182
|
errors.push(
|
|
173
|
-
`Parameter \`levels\` property of the \`options\` (second parameter) must be of type \`integer-number\` and minimum is \`0\`, but received: \`${
|
|
183
|
+
`Parameter \`levels\` property of the \`options\` (second parameter) must be of type \`integer-number\` and minimum is \`0\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
174
184
|
levels
|
|
175
|
-
)}\`, with value: \`${
|
|
185
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(levels, {
|
|
186
|
+
keepUndefined: true
|
|
187
|
+
})}\`.`
|
|
176
188
|
);
|
|
177
189
|
}
|
|
178
|
-
if (!
|
|
190
|
+
if (!chunk7C7TQC5J_cjs.isBoolean(removeDuplicates)) {
|
|
179
191
|
errors.push(
|
|
180
|
-
`Parameter \`removeDuplicates\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: \`${
|
|
192
|
+
`Parameter \`removeDuplicates\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
181
193
|
removeDuplicates
|
|
182
194
|
)}\`.`
|
|
183
195
|
);
|
|
184
196
|
}
|
|
185
|
-
if (
|
|
197
|
+
if (chunk7C7TQC5J_cjs.isNonEmptyArray(errors)) {
|
|
186
198
|
throw new TypeError(
|
|
187
199
|
`Invalid parameter(s) in \`getPrefixPathname\` function:
|
|
188
200
|
- ${errors.join("\n- ")}`
|
|
189
201
|
);
|
|
190
202
|
}
|
|
191
203
|
function getLevel(singleUrl) {
|
|
192
|
-
const parts =
|
|
204
|
+
const parts = chunkOCTHWEZK_cjs.normalizePathname(singleUrl).split("/").filter(Boolean);
|
|
193
205
|
return `/${parts.slice(0, levels).join("/")}`;
|
|
194
206
|
}
|
|
195
207
|
function processUrl(singleUrl) {
|
|
196
208
|
if (base) {
|
|
197
|
-
singleUrl =
|
|
198
|
-
if (
|
|
209
|
+
singleUrl = chunkOCTHWEZK_cjs.normalizePathname(singleUrl);
|
|
210
|
+
if (chunk7C7TQC5J_cjs.isArray(base)) {
|
|
199
211
|
for (const b of base) {
|
|
200
|
-
if (singleUrl.startsWith(
|
|
212
|
+
if (singleUrl.startsWith(chunkOCTHWEZK_cjs.normalizePathname(b))) {
|
|
201
213
|
return getLevel(singleUrl);
|
|
202
214
|
}
|
|
203
215
|
}
|
|
204
|
-
} else if (
|
|
216
|
+
} else if (chunk7C7TQC5J_cjs.isNonEmptyString(base) && singleUrl.startsWith(chunkOCTHWEZK_cjs.normalizePathname(base))) {
|
|
205
217
|
return getLevel(singleUrl);
|
|
206
218
|
}
|
|
207
219
|
return null;
|
|
208
220
|
}
|
|
209
221
|
return getLevel(singleUrl);
|
|
210
222
|
}
|
|
211
|
-
if (
|
|
212
|
-
const result = url.map(processUrl).filter((r) => !
|
|
223
|
+
if (chunk7C7TQC5J_cjs.isArray(url)) {
|
|
224
|
+
const result = url.map(processUrl).filter((r) => !chunk7C7TQC5J_cjs.isNull(r));
|
|
213
225
|
const uniqueResult = removeDuplicates ? [...new Set(result)] : result;
|
|
214
226
|
if (uniqueResult.length === 1) {
|
|
215
227
|
return uniqueResult[0];
|