@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,60 +10,60 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
14
14
|
|
|
15
15
|
function isMap(value) {
|
|
16
16
|
return Object.prototype.toString.call(value) === "[object Map]" || value instanceof Map;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
var isDate = (value, options = {}) => {
|
|
20
|
-
|
|
20
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
21
21
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
22
22
|
});
|
|
23
|
-
const skipInvalidDate =
|
|
23
|
+
const skipInvalidDate = chunkGKC3UDMC_cjs.isPlainObject(options) && chunkGKC3UDMC_cjs.isBoolean(options.skipInvalidDate) ? options.skipInvalidDate : false;
|
|
24
24
|
const instanceDate = value instanceof Date;
|
|
25
25
|
if (skipInvalidDate) return instanceDate;
|
|
26
|
-
return instanceDate && !
|
|
26
|
+
return instanceDate && !chunkGKC3UDMC_cjs.isNaN(value.getTime());
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
var safeStableStringify = (value, options = {}) => {
|
|
30
|
-
|
|
30
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
31
31
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
32
32
|
});
|
|
33
|
-
const pretty =
|
|
34
|
-
const sortKeys =
|
|
35
|
-
const sortArray =
|
|
36
|
-
const keepUndefined =
|
|
37
|
-
if (!
|
|
33
|
+
const pretty = chunkGKC3UDMC_cjs.hasOwnProp(options, "pretty") ? options.pretty : false;
|
|
34
|
+
const sortKeys = chunkGKC3UDMC_cjs.hasOwnProp(options, "sortKeys") ? options.sortKeys : true;
|
|
35
|
+
const sortArray = chunkGKC3UDMC_cjs.hasOwnProp(options, "sortArray") ? options.sortArray : false;
|
|
36
|
+
const keepUndefined = chunkGKC3UDMC_cjs.hasOwnProp(options, "keepUndefined") ? options.keepUndefined : false;
|
|
37
|
+
if (!chunkGKC3UDMC_cjs.isBoolean(sortKeys) || !chunkGKC3UDMC_cjs.isBoolean(sortArray) || !chunkGKC3UDMC_cjs.isBoolean(pretty) || !chunkGKC3UDMC_cjs.isBoolean(keepUndefined)) {
|
|
38
38
|
throw new TypeError(
|
|
39
|
-
`Parameters \`sortKeys\`, \`sortArray\`, \`keepUndefined\` and \`pretty\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: "['sortKeys': \`${
|
|
39
|
+
`Parameters \`sortKeys\`, \`sortArray\`, \`keepUndefined\` and \`pretty\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: "['sortKeys': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
40
40
|
sortKeys
|
|
41
|
-
)}\`, 'sortArray': \`${
|
|
41
|
+
)}\`, 'sortArray': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
42
42
|
sortArray
|
|
43
|
-
)}\`, 'keepUndefined': \`${
|
|
43
|
+
)}\`, 'keepUndefined': \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
44
44
|
keepUndefined
|
|
45
|
-
)}\`, 'pretty': \`${
|
|
45
|
+
)}\`, 'pretty': \`${chunkGKC3UDMC_cjs.getPreciseType(pretty)}\`]".`
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
if (
|
|
48
|
+
if (chunkGKC3UDMC_cjs.isUndefined(value)) {
|
|
49
49
|
return keepUndefined ? "undefined" : "null";
|
|
50
50
|
}
|
|
51
51
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
52
|
-
const isPrimitive = (val) =>
|
|
52
|
+
const isPrimitive = (val) => chunkGKC3UDMC_cjs.isNull(val) || !chunkGKC3UDMC_cjs.isObjectOrArray(val) && !chunkGKC3UDMC_cjs.isFunction(val);
|
|
53
53
|
const deepProcess = (val) => {
|
|
54
|
-
if (
|
|
54
|
+
if (chunkGKC3UDMC_cjs.isNumberObject(val)) {
|
|
55
55
|
const valOf = val.valueOf();
|
|
56
|
-
return
|
|
56
|
+
return chunkGKC3UDMC_cjs.isNaN(valOf) || chunkGKC3UDMC_cjs.isInfinityNumber(valOf) ? null : valOf;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
if (
|
|
60
|
-
if (
|
|
58
|
+
if (chunkGKC3UDMC_cjs.isStringObject(val)) return val.valueOf();
|
|
59
|
+
if (chunkGKC3UDMC_cjs.isBooleanObject(val)) return val.valueOf();
|
|
60
|
+
if (chunkGKC3UDMC_cjs.isFunction(val) || chunkGKC3UDMC_cjs.isSymbol(val)) return void 0;
|
|
61
61
|
if (chunkUDA26MCU_cjs.isBigInt(val)) return val.toString();
|
|
62
|
-
if (
|
|
63
|
-
if (
|
|
62
|
+
if (chunkGKC3UDMC_cjs.isNaN(val) || chunkGKC3UDMC_cjs.isInfinityNumber(val)) return null;
|
|
63
|
+
if (chunkGKC3UDMC_cjs.isUndefined(val)) {
|
|
64
64
|
return keepUndefined ? void 0 : null;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
66
|
+
if (chunkGKC3UDMC_cjs.isObjectOrArray(val)) {
|
|
67
67
|
if (seen.has(val)) return "[Circular]";
|
|
68
68
|
seen.add(val);
|
|
69
69
|
if (isDate(val)) return val.toISOString();
|
|
@@ -72,8 +72,8 @@ var safeStableStringify = (value, options = {}) => {
|
|
|
72
72
|
map: Array.from(val.entries()).map(([k, v]) => [k, deepProcess(v)])
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
75
|
+
if (chunkGKC3UDMC_cjs.isSet(val)) return { set: Array.from(val.values()).map(deepProcess) };
|
|
76
|
+
if (chunkGKC3UDMC_cjs.isArray(val)) {
|
|
77
77
|
const processedArr = val.map(deepProcess);
|
|
78
78
|
if (sortArray) {
|
|
79
79
|
const primitives = [];
|
|
@@ -83,7 +83,7 @@ var safeStableStringify = (value, options = {}) => {
|
|
|
83
83
|
else nonPrimitives.push(item);
|
|
84
84
|
}
|
|
85
85
|
primitives.sort((a, b) => {
|
|
86
|
-
if (
|
|
86
|
+
if (chunkGKC3UDMC_cjs.isNumber(a) && chunkGKC3UDMC_cjs.isNumber(b)) return a - b;
|
|
87
87
|
return String(a).localeCompare(String(b));
|
|
88
88
|
});
|
|
89
89
|
return [...primitives, ...nonPrimitives];
|
|
@@ -95,15 +95,15 @@ var safeStableStringify = (value, options = {}) => {
|
|
|
95
95
|
keys.sort((a, b) => {
|
|
96
96
|
const na = Number(a);
|
|
97
97
|
const nb = Number(b);
|
|
98
|
-
if (!
|
|
98
|
+
if (!chunkGKC3UDMC_cjs.isNaN(na) && !chunkGKC3UDMC_cjs.isNaN(nb)) return na - nb;
|
|
99
99
|
return a.localeCompare(b);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
const result = {};
|
|
103
|
-
if (
|
|
103
|
+
if (chunkGKC3UDMC_cjs.isObject(val)) {
|
|
104
104
|
for (const k of keys) {
|
|
105
105
|
const v = deepProcess(val[k]);
|
|
106
|
-
if (!
|
|
106
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(v)) result[k] = v;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
return result;
|
|
@@ -2,20 +2,20 @@
|
|
|
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 { isURL } from './chunk-ONZFBJVW.js';
|
|
11
|
-
import { isTypedArray } from './chunk-
|
|
12
|
-
import { parseCurrencyString } from './chunk-
|
|
13
|
-
import { isEmptyString } from './chunk-
|
|
14
|
-
import { assertIsString } from './chunk-
|
|
15
|
-
import { isEqual, isRegExp, baseDeepEqual } from './chunk-
|
|
16
|
-
import { isEmptyArray } from './chunk-
|
|
17
|
-
import { safeStableStringify, isDate, isMap } from './chunk-
|
|
18
|
-
import { isArray, getPreciseType, assertIsBoolean, isNonEmptyString, assertIsPlainObject, isObjectOrArray, isFunction, isString, isNumber, isSymbol, isSet, isPlainObject, isNil, isBoolean, isBuffer, isNaN, isUndefined, isObject, isNull } from './chunk-
|
|
11
|
+
import { isTypedArray } from './chunk-KIDJCMNJ.js';
|
|
12
|
+
import { parseCurrencyString } from './chunk-5MGEC3YG.js';
|
|
13
|
+
import { isEmptyString } from './chunk-TCDOWZQE.js';
|
|
14
|
+
import { assertIsString } from './chunk-BKIJBNIE.js';
|
|
15
|
+
import { isEqual, isRegExp, baseDeepEqual } from './chunk-WYP76WXB.js';
|
|
16
|
+
import { isEmptyArray } from './chunk-SDMPEJ4F.js';
|
|
17
|
+
import { safeStableStringify, isDate, isMap } from './chunk-6VUXD3CF.js';
|
|
18
|
+
import { isArray, getPreciseType, assertIsBoolean, isNonEmptyString, assertIsPlainObject, isObjectOrArray, isFunction, isString, isNumber, isSymbol, isSet, isPlainObject, isNil, isBoolean, isBuffer, isNaN, isUndefined, isObject, isNull } from './chunk-CSG4SCL3.js';
|
|
19
19
|
|
|
20
20
|
var areArraysEqual = (array1, array2, ignoreOrder = false) => {
|
|
21
21
|
if (!(isArray(array1) && isArray(array2))) {
|
|
@@ -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
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var chunkQ5IMYDFL_cjs = require('./chunk-Q5IMYDFL.cjs');
|
|
13
13
|
|
|
14
14
|
var isNonEmptyValue = (value, options = {}) => {
|
|
15
|
-
return !
|
|
15
|
+
return !chunkQ5IMYDFL_cjs.isEmptyValue(value, options);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
var typedArrayTags = /* @__PURE__ */ new Set([
|
|
@@ -2,26 +2,26 @@
|
|
|
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
|
|
12
|
+
var chunkV3C4FYZL_cjs = require('./chunk-V3C4FYZL.cjs');
|
|
13
|
+
var chunkKOLEURVT_cjs = require('./chunk-KOLEURVT.cjs');
|
|
14
14
|
var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
16
16
|
|
|
17
17
|
function filterNilArray(input) {
|
|
18
|
-
if (
|
|
19
|
-
if (!
|
|
18
|
+
if (chunkGKC3UDMC_cjs.isNil(input)) return void 0;
|
|
19
|
+
if (!chunkGKC3UDMC_cjs.isArray(input)) return [];
|
|
20
20
|
const filtered = input.reduce((output, element) => {
|
|
21
|
-
if (!
|
|
22
|
-
if (
|
|
21
|
+
if (!chunkGKC3UDMC_cjs.isNil(element)) {
|
|
22
|
+
if (chunkGKC3UDMC_cjs.isArray(element)) {
|
|
23
23
|
const cleanedNested = filterNilArray(element);
|
|
24
|
-
if (cleanedNested && !
|
|
24
|
+
if (cleanedNested && !chunkKOLEURVT_cjs.isEmptyArray(cleanedNested)) {
|
|
25
25
|
output.push(cleanedNested);
|
|
26
26
|
}
|
|
27
27
|
} else {
|
|
@@ -34,17 +34,17 @@ function filterNilArray(input) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function toStringArrayUnRecursive(array, options = {}) {
|
|
37
|
-
|
|
37
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
|
|
38
38
|
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
39
39
|
});
|
|
40
|
-
const riv =
|
|
41
|
-
|
|
40
|
+
const riv = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeInvalidValue") ? options.removeInvalidValue : true;
|
|
41
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(riv, {
|
|
42
42
|
message: ({ currentType, validType }) => `Parameter \`removeInvalidValue\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
43
43
|
});
|
|
44
|
-
if (
|
|
44
|
+
if (chunkGKC3UDMC_cjs.isArray(array)) {
|
|
45
45
|
const result = Array.from(array, (x) => {
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
46
|
+
if (chunkGKC3UDMC_cjs.isString(x) || chunkV3C4FYZL_cjs.isFinite(x) || chunkGKC3UDMC_cjs.isBoolean(x) || chunkUDA26MCU_cjs.isBigInt(x)) return String(x);
|
|
47
|
+
return chunkGKC3UDMC_cjs.isNull(x) ? null : void 0;
|
|
48
48
|
});
|
|
49
49
|
if (riv) return filterNilArray(result);
|
|
50
50
|
return result;
|
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.12.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -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
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
13
13
|
|
|
14
14
|
function isFinite(value) {
|
|
15
|
-
return
|
|
15
|
+
return chunkGKC3UDMC_cjs.isNumber(value) && Number.isFinite(value);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
exports.isFinite = isFinite;
|
|
@@ -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 { resolveErrorMessageAssertions, hasOwnProp, isNumber } from './chunk-
|
|
11
|
+
import { resolveErrorMessageAssertions, hasOwnProp, isNumber } from './chunk-CSG4SCL3.js';
|
|
12
12
|
|
|
13
13
|
var assertIsBigInt = (value, options = {}) => {
|
|
14
14
|
if (isBigInt(value)) return;
|
package/dist/chunk-VJDDGRIK.cjs
CHANGED
|
@@ -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
|
* ====================================================
|
package/dist/chunk-WVSPXFTY.js
CHANGED
|
@@ -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
|
* ====================================================
|
|
@@ -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
|
-
import { isDate, isMap } from './chunk-
|
|
11
|
-
import { isObjectOrArray, isError, isSet, isArray, isUndefined } from './chunk-
|
|
10
|
+
import { isDate, isMap } from './chunk-6VUXD3CF.js';
|
|
11
|
+
import { isObjectOrArray, isError, isSet, isArray, isUndefined } from './chunk-CSG4SCL3.js';
|
|
12
12
|
|
|
13
13
|
var isRegExp = (value) => {
|
|
14
14
|
return value instanceof RegExp;
|
|
@@ -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,62 +10,62 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkKHO2SBNA_cjs = require('./chunk-KHO2SBNA.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
13
|
+
var chunkF66VDYIZ_cjs = require('./chunk-F66VDYIZ.cjs');
|
|
14
|
+
var chunkUCHF3M34_cjs = require('./chunk-UCHF3M34.cjs');
|
|
15
|
+
var chunkQ5IMYDFL_cjs = require('./chunk-Q5IMYDFL.cjs');
|
|
16
16
|
var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
17
|
+
var chunk6EF52423_cjs = require('./chunk-6EF52423.cjs');
|
|
18
|
+
var chunk4YLBKLGS_cjs = require('./chunk-4YLBKLGS.cjs');
|
|
19
|
+
var chunkRRQHMOPE_cjs = require('./chunk-RRQHMOPE.cjs');
|
|
20
|
+
var chunkTQPGXGKB_cjs = require('./chunk-TQPGXGKB.cjs');
|
|
21
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
22
22
|
|
|
23
23
|
var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
24
|
-
if (
|
|
25
|
-
if (
|
|
24
|
+
if (chunkGKC3UDMC_cjs.isString(baseUrl)) {
|
|
25
|
+
if (chunk4YLBKLGS_cjs.isEmptyString(baseUrl)) {
|
|
26
26
|
throw new TypeError(`First parameter (\`baseUrl\`) cannot be an empty-string.`);
|
|
27
27
|
}
|
|
28
|
-
baseUrl =
|
|
28
|
+
baseUrl = chunkF66VDYIZ_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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
32
32
|
baseUrl
|
|
33
|
-
)}\`, with current value: \`${
|
|
33
|
+
)}\`, with current value: \`${chunkTQPGXGKB_cjs.safeStableStringify(baseUrl, {
|
|
34
34
|
keepUndefined: true
|
|
35
35
|
})}\`.`
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
if (!
|
|
39
|
-
|
|
38
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(removeParams)) {
|
|
39
|
+
chunkRRQHMOPE_cjs.assertIsArray(removeParams, {
|
|
40
40
|
message: ({ currentType, validType }) => `Third parameter (\`removeParams\`) must be of type \`${validType} of strings\`, but received: \`${currentType}\`.`
|
|
41
41
|
});
|
|
42
|
-
if (!removeParams.every((param) =>
|
|
42
|
+
if (!removeParams.every((param) => chunkGKC3UDMC_cjs.isNonEmptyString(param))) {
|
|
43
43
|
throw new TypeError(
|
|
44
44
|
`Third parameter (\`removeParams\`) must be of type \`array\` and contains \`string\` only and non empty-string.`
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
if (!
|
|
49
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(queryParams) && !chunkGKC3UDMC_cjs.isFunction(queryParams[Symbol.iterator])) {
|
|
50
50
|
throw new TypeError(
|
|
51
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
52
52
|
queryParams
|
|
53
|
-
)}\`, with value: \`${
|
|
53
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(queryParams, {
|
|
54
54
|
keepUndefined: true
|
|
55
55
|
})}\`.`
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
const urlInstance = new URL(baseUrl);
|
|
59
|
-
if (!
|
|
59
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(queryParams)) {
|
|
60
60
|
const paramObject = Object.fromEntries(queryParams);
|
|
61
|
-
if (!
|
|
61
|
+
if (!chunkQ5IMYDFL_cjs.isEmptyValue(paramObject)) {
|
|
62
62
|
const mergedParams = new URLSearchParams(urlInstance.search);
|
|
63
63
|
for (const [key, value] of Object.entries(paramObject)) {
|
|
64
|
-
if (!
|
|
64
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(value) && !chunkGKC3UDMC_cjs.isNumber(value, { includeNaN: true })) {
|
|
65
65
|
throw new TypeError(
|
|
66
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
67
67
|
queryParams
|
|
68
|
-
)}\`, with value: \`${
|
|
68
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(queryParams, {
|
|
69
69
|
keepUndefined: true
|
|
70
70
|
})}\`.`
|
|
71
71
|
);
|
|
@@ -73,7 +73,7 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
|
73
73
|
mergedParams.set(key, String(value));
|
|
74
74
|
}
|
|
75
75
|
if (removeParams?.length) {
|
|
76
|
-
|
|
76
|
+
chunkUCHF3M34_cjs.toStringArrayUnRecursive(removeParams).map((paramKey) => {
|
|
77
77
|
mergedParams.delete(paramKey);
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -83,7 +83,7 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
|
83
83
|
removeParams?.forEach((param) => urlInstance.searchParams.delete(param));
|
|
84
84
|
return urlInstance;
|
|
85
85
|
} catch (error) {
|
|
86
|
-
if (
|
|
86
|
+
if (chunkGKC3UDMC_cjs.isError(error)) throw error;
|
|
87
87
|
throw new Error(
|
|
88
88
|
"Failed to construct a valid URL in `constructURL()`, Error:" + error
|
|
89
89
|
);
|
|
@@ -91,7 +91,7 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
var extractURLs = (url) => {
|
|
94
|
-
if (!
|
|
94
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(url)) return null;
|
|
95
95
|
let decoded;
|
|
96
96
|
try {
|
|
97
97
|
decoded = decodeURIComponent(url);
|
|
@@ -113,66 +113,66 @@ var extractURLs = (url) => {
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
var getFirstPrefixPathname = (result, defaultValue = "/") => {
|
|
116
|
-
if (!
|
|
116
|
+
if (!chunkGKC3UDMC_cjs.isNonEmptyString(defaultValue)) {
|
|
117
117
|
throw new TypeError(
|
|
118
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
119
119
|
defaultValue
|
|
120
|
-
)}\`, with value: \`${
|
|
120
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(defaultValue, {
|
|
121
121
|
keepUndefined: true
|
|
122
122
|
})}\`.`
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
|
-
if (
|
|
126
|
-
if (!result.every((item) =>
|
|
125
|
+
if (chunkGKC3UDMC_cjs.isArray(result)) {
|
|
126
|
+
if (!result.every((item) => chunkGKC3UDMC_cjs.isString(item))) {
|
|
127
127
|
throw new TypeError(
|
|
128
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
129
129
|
result
|
|
130
|
-
)}\`, with value: \`${
|
|
130
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(result, {
|
|
131
131
|
keepUndefined: true
|
|
132
132
|
})}\`.`
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
135
|
for (const item of result) {
|
|
136
|
-
const normalized =
|
|
136
|
+
const normalized = chunk6EF52423_cjs.normalizePathname(item);
|
|
137
137
|
if (normalized !== "/") {
|
|
138
138
|
return normalized;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
return
|
|
141
|
+
return chunk6EF52423_cjs.normalizePathname(defaultValue);
|
|
142
142
|
}
|
|
143
|
-
if (
|
|
144
|
-
const normalized =
|
|
145
|
-
return normalized !== "/" ? normalized :
|
|
143
|
+
if (chunkGKC3UDMC_cjs.isString(result)) {
|
|
144
|
+
const normalized = chunk6EF52423_cjs.normalizePathname(result);
|
|
145
|
+
return normalized !== "/" ? normalized : chunk6EF52423_cjs.normalizePathname(defaultValue);
|
|
146
146
|
}
|
|
147
|
-
if (!
|
|
147
|
+
if (!chunkGKC3UDMC_cjs.isNil(result)) {
|
|
148
148
|
throw new TypeError(
|
|
149
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
150
150
|
result
|
|
151
151
|
)}\`.`
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
return
|
|
154
|
+
return chunk6EF52423_cjs.normalizePathname(defaultValue);
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
var getPrefixPathname = (url, base = null, options = {}) => {
|
|
158
158
|
const errors = [];
|
|
159
|
-
if (!
|
|
159
|
+
if (!chunkGKC3UDMC_cjs.isString(url) && !chunkGKC3UDMC_cjs.isArray(url)) {
|
|
160
160
|
errors.push(
|
|
161
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
162
162
|
url
|
|
163
163
|
)}\`.`
|
|
164
164
|
);
|
|
165
165
|
}
|
|
166
|
-
if (!
|
|
166
|
+
if (!chunkGKC3UDMC_cjs.isString(base) && !chunkGKC3UDMC_cjs.isArray(base) && !chunkGKC3UDMC_cjs.isNull(base)) {
|
|
167
167
|
errors.push(
|
|
168
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
169
169
|
base
|
|
170
170
|
)}\`.`
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
if (!
|
|
173
|
+
if (!chunkGKC3UDMC_cjs.isPlainObject(options)) {
|
|
174
174
|
errors.push(
|
|
175
|
-
`Second parameter (\`options\`) must be of type \`plain-object\`, but received: \`${
|
|
175
|
+
`Second parameter (\`options\`) must be of type \`plain-object\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
176
176
|
options
|
|
177
177
|
)}\`.`
|
|
178
178
|
);
|
|
@@ -180,48 +180,48 @@ var getPrefixPathname = (url, base = null, options = {}) => {
|
|
|
180
180
|
const { levels = 1, removeDuplicates = true } = options;
|
|
181
181
|
if (!chunkDVMHRLKP_cjs.isInteger(levels) || chunkDVMHRLKP_cjs.isInteger(levels) && levels < 0) {
|
|
182
182
|
errors.push(
|
|
183
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
184
184
|
levels
|
|
185
|
-
)}\`, with value: \`${
|
|
185
|
+
)}\`, with value: \`${chunkTQPGXGKB_cjs.safeStableStringify(levels, {
|
|
186
186
|
keepUndefined: true
|
|
187
187
|
})}\`.`
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
|
-
if (!
|
|
190
|
+
if (!chunkGKC3UDMC_cjs.isBoolean(removeDuplicates)) {
|
|
191
191
|
errors.push(
|
|
192
|
-
`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: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
193
193
|
removeDuplicates
|
|
194
194
|
)}\`.`
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
|
-
if (
|
|
197
|
+
if (chunkGKC3UDMC_cjs.isNonEmptyArray(errors)) {
|
|
198
198
|
throw new TypeError(
|
|
199
199
|
`Invalid parameter(s) in \`getPrefixPathname\` function:
|
|
200
200
|
- ${errors.join("\n- ")}`
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
203
|
function getLevel(singleUrl) {
|
|
204
|
-
const parts =
|
|
204
|
+
const parts = chunk6EF52423_cjs.normalizePathname(singleUrl).split("/").filter(Boolean);
|
|
205
205
|
return `/${parts.slice(0, levels).join("/")}`;
|
|
206
206
|
}
|
|
207
207
|
function processUrl(singleUrl) {
|
|
208
208
|
if (base) {
|
|
209
|
-
singleUrl =
|
|
210
|
-
if (
|
|
209
|
+
singleUrl = chunk6EF52423_cjs.normalizePathname(singleUrl);
|
|
210
|
+
if (chunkGKC3UDMC_cjs.isArray(base)) {
|
|
211
211
|
for (const b of base) {
|
|
212
|
-
if (singleUrl.startsWith(
|
|
212
|
+
if (singleUrl.startsWith(chunk6EF52423_cjs.normalizePathname(b))) {
|
|
213
213
|
return getLevel(singleUrl);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
} else if (
|
|
216
|
+
} else if (chunkGKC3UDMC_cjs.isNonEmptyString(base) && singleUrl.startsWith(chunk6EF52423_cjs.normalizePathname(base))) {
|
|
217
217
|
return getLevel(singleUrl);
|
|
218
218
|
}
|
|
219
219
|
return null;
|
|
220
220
|
}
|
|
221
221
|
return getLevel(singleUrl);
|
|
222
222
|
}
|
|
223
|
-
if (
|
|
224
|
-
const result = url.map(processUrl).filter((r) => !
|
|
223
|
+
if (chunkGKC3UDMC_cjs.isArray(url)) {
|
|
224
|
+
const result = url.map(processUrl).filter((r) => !chunkGKC3UDMC_cjs.isNull(r));
|
|
225
225
|
const uniqueResult = removeDuplicates ? [...new Set(result)] : result;
|
|
226
226
|
if (uniqueResult.length === 1) {
|
|
227
227
|
return uniqueResult[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
|
|
12
|
+
var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
|
|
13
13
|
|
|
14
14
|
var assertIsString = (value, options = {}) => {
|
|
15
|
-
if (
|
|
16
|
-
|
|
15
|
+
if (chunkGKC3UDMC_cjs.isString(value)) return;
|
|
16
|
+
chunkGKC3UDMC_cjs.resolveErrorMessageAssertions({
|
|
17
17
|
value,
|
|
18
18
|
options,
|
|
19
19
|
requiredValidType: "string"
|