@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
package/dist/next/index.cjs
CHANGED
|
@@ -2,31 +2,31 @@
|
|
|
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
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
12
|
+
var chunk6EF52423_cjs = require('../chunk-6EF52423.cjs');
|
|
13
|
+
require('../chunk-2VTDXC3N.cjs');
|
|
14
|
+
require('../chunk-NYK5K3V2.cjs');
|
|
15
|
+
var chunkEV4Y7HCY_cjs = require('../chunk-EV4Y7HCY.cjs');
|
|
16
|
+
var chunk4YLBKLGS_cjs = require('../chunk-4YLBKLGS.cjs');
|
|
17
|
+
var chunkYKQEOO7C_cjs = require('../chunk-YKQEOO7C.cjs');
|
|
18
|
+
var chunkTQPGXGKB_cjs = require('../chunk-TQPGXGKB.cjs');
|
|
19
19
|
require('../chunk-UDA26MCU.cjs');
|
|
20
|
-
var
|
|
20
|
+
var chunkGKC3UDMC_cjs = require('../chunk-GKC3UDMC.cjs');
|
|
21
21
|
|
|
22
22
|
function generateRoute(route, params) {
|
|
23
|
-
if (!
|
|
23
|
+
if (!chunkGKC3UDMC_cjs.isString(route) || chunk4YLBKLGS_cjs.isEmptyString(route)) {
|
|
24
24
|
throw new TypeError(
|
|
25
25
|
`\u274C 'generateRoute' Failed:
|
|
26
26
|
- Invalid 'route' value.
|
|
27
|
-
- Must be of type \`string\` and non-empty string, but received: "${
|
|
27
|
+
- Must be of type \`string\` and non-empty string, but received: "${chunkGKC3UDMC_cjs.getPreciseType(
|
|
28
28
|
route
|
|
29
|
-
)}": \`${
|
|
29
|
+
)}": \`${chunkTQPGXGKB_cjs.safeStableStringify(route, {
|
|
30
30
|
keepUndefined: true
|
|
31
31
|
})}\`.`
|
|
32
32
|
);
|
|
@@ -34,11 +34,11 @@ function generateRoute(route, params) {
|
|
|
34
34
|
if (!/[\\[\]]/.test(route)) {
|
|
35
35
|
return route;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
chunkGKC3UDMC_cjs.assertIsPlainObject(params, {
|
|
38
38
|
message: ({ validType }) => `\u274C 'generateRoute' Failed cause in route "${route}":
|
|
39
39
|
- Missing or invalid parameters \`${validType}\` for route: "${route}", must be of type \`${validType}\` mapping parameters.`
|
|
40
40
|
});
|
|
41
|
-
if (
|
|
41
|
+
if (chunkGKC3UDMC_cjs.isNil(params)) {
|
|
42
42
|
throw new TypeError(
|
|
43
43
|
`\u274C 'generateRoute' Failed cause in route "${route}":
|
|
44
44
|
- Missing parameters \`plain-object\` for route: "${route}".`
|
|
@@ -67,15 +67,15 @@ function generateRoute(route, params) {
|
|
|
67
67
|
const requiredKeys = Array.from(route.matchAll(/\[(\w+)\]/g)).map((m) => m[1]);
|
|
68
68
|
for (const key of requiredKeys) {
|
|
69
69
|
const value = params[key];
|
|
70
|
-
if (!
|
|
70
|
+
if (!chunkGKC3UDMC_cjs.isString(value)) {
|
|
71
71
|
errors.push(
|
|
72
|
-
`- Invalid parameter: "${key}" must be of type \`string\`, but received: \`${
|
|
72
|
+
`- Invalid parameter: "${key}" must be of type \`string\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
73
73
|
value
|
|
74
74
|
)}\`.`
|
|
75
75
|
);
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (chunk4YLBKLGS_cjs.isEmptyString(value)) {
|
|
79
79
|
errors.push(`- Parameter "${key}" cannot be empty string.`);
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
@@ -100,14 +100,14 @@ function generateRoute(route, params) {
|
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
103
|
+
if (chunkGKC3UDMC_cjs.isNonEmptyArray(errors)) {
|
|
104
104
|
throw new Error(
|
|
105
105
|
`\u274C 'generateRoute' Failed cause in route "${route}":
|
|
106
106
|
${errors.join("\n")}.`
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
return route.replace(/\[(\w+)\]/g, (_, key) => {
|
|
110
|
-
const paramKey =
|
|
110
|
+
const paramKey = chunkGKC3UDMC_cjs.isNonEmptyString(params[key]) ? params[key] : "";
|
|
111
111
|
return paramKey.trim().replace(/^\/+|\/+$/g, "");
|
|
112
112
|
}).replace(/\/+/g, "/");
|
|
113
113
|
}
|
|
@@ -118,52 +118,54 @@ var createBeApiUrl = (pathname, options = {}) => {
|
|
|
118
118
|
return `${a.replace(/\/+$/, "")}/${b.replace(/^\/+/, "")}`;
|
|
119
119
|
};
|
|
120
120
|
var joinPath = joinPath2;
|
|
121
|
-
|
|
121
|
+
chunkYKQEOO7C_cjs.assertIsString(chunkGKC3UDMC_cjs.isNil(pathname) ? "" : pathname, {
|
|
122
122
|
message({ currentType, validType }) {
|
|
123
123
|
return `First parameter (\`pathname\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
if (!
|
|
126
|
+
if (!chunkGKC3UDMC_cjs.isPlainObject(options)) {
|
|
127
127
|
options = {};
|
|
128
128
|
}
|
|
129
129
|
let {
|
|
130
130
|
prefix = "/api",
|
|
131
131
|
withOrigin = true
|
|
132
132
|
} = options;
|
|
133
|
-
if (!
|
|
133
|
+
if (!chunkGKC3UDMC_cjs.isUndefined(prefix) && !chunkGKC3UDMC_cjs.isString(prefix)) {
|
|
134
134
|
throw new TypeError(
|
|
135
|
-
`Parameter \`prefix\` property of the \`options\` (second parameter) must be of type \`string\`, but received: \`${
|
|
135
|
+
`Parameter \`prefix\` property of the \`options\` (second parameter) must be of type \`string\`, but received: \`${chunkGKC3UDMC_cjs.getPreciseType(
|
|
136
136
|
prefix
|
|
137
137
|
)}\`.`
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(withOrigin, {
|
|
141
141
|
message: ({ currentType, validType }) => `Parameter \`withOrigin\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
142
142
|
});
|
|
143
|
-
pathname =
|
|
144
|
-
prefix =
|
|
143
|
+
pathname = chunk6EF52423_cjs.normalizePathname(pathname);
|
|
144
|
+
prefix = chunk6EF52423_cjs.normalizePathname(prefix);
|
|
145
145
|
const normalizedPrefix = prefix.endsWith("/") ? prefix : prefix + "/";
|
|
146
146
|
if (pathname === prefix || pathname === prefix + "/" || pathname.startsWith(normalizedPrefix)) {
|
|
147
147
|
pathname = pathname.slice(prefix.length);
|
|
148
|
-
pathname =
|
|
148
|
+
pathname = chunk6EF52423_cjs.normalizePathname(pathname);
|
|
149
149
|
}
|
|
150
150
|
const baseApiUrl = getBeApiUrl({ suffix: prefix });
|
|
151
151
|
const fullPath = withOrigin ? joinPath2(baseApiUrl, pathname) : joinPath2(new URL(baseApiUrl).pathname, pathname);
|
|
152
152
|
return fullPath.replace(/\/+$/, "");
|
|
153
153
|
} catch (err) {
|
|
154
|
-
if (
|
|
154
|
+
if (chunkGKC3UDMC_cjs.isError(err)) {
|
|
155
155
|
throw err;
|
|
156
|
-
} else
|
|
156
|
+
} else {
|
|
157
157
|
throw new Error(
|
|
158
|
-
"Failed to generate backend API URL in `createBeApiUrl()`, Error: " +
|
|
158
|
+
"Failed to generate backend API URL in `createBeApiUrl()`, Error: " + String(err).trim(),
|
|
159
|
+
{ cause: err }
|
|
159
160
|
);
|
|
161
|
+
}
|
|
160
162
|
}
|
|
161
163
|
};
|
|
162
164
|
|
|
163
165
|
var getBeApiUrl = (options = {}) => {
|
|
164
|
-
if (!
|
|
165
|
-
let suffix =
|
|
166
|
-
|
|
166
|
+
if (!chunkGKC3UDMC_cjs.isPlainObject(options)) options = {};
|
|
167
|
+
let suffix = chunkGKC3UDMC_cjs.hasOwnProp(options, "suffix") ? options.suffix : "/";
|
|
168
|
+
chunkYKQEOO7C_cjs.assertIsString(suffix, {
|
|
167
169
|
message({ currentType, validType }) {
|
|
168
170
|
return `Parameter \`suffix\` property of the first parameter must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
169
171
|
}
|
|
@@ -171,20 +173,20 @@ var getBeApiUrl = (options = {}) => {
|
|
|
171
173
|
try {
|
|
172
174
|
let rawBaseUrl = process.env.NEXT_PUBLIC_BACKEND_API_URL?.trim();
|
|
173
175
|
if (rawBaseUrl) {
|
|
174
|
-
rawBaseUrl =
|
|
176
|
+
rawBaseUrl = chunkEV4Y7HCY_cjs.removeSpaces(rawBaseUrl);
|
|
175
177
|
const urlObj = new URL(rawBaseUrl);
|
|
176
178
|
const hasPort = !!urlObj.port;
|
|
177
179
|
if (!hasPort && process.env.NEXT_PUBLIC_PORT_BE) {
|
|
178
|
-
rawBaseUrl = urlObj.origin +
|
|
180
|
+
rawBaseUrl = urlObj.origin + chunk6EF52423_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE, {
|
|
179
181
|
prefixColon: true
|
|
180
182
|
});
|
|
181
183
|
}
|
|
182
184
|
} else {
|
|
183
|
-
rawBaseUrl = "http://localhost" +
|
|
185
|
+
rawBaseUrl = "http://localhost" + chunk6EF52423_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE || "8000", {
|
|
184
186
|
prefixColon: true
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
|
-
suffix =
|
|
189
|
+
suffix = chunkEV4Y7HCY_cjs.removeSpaces(suffix).length ? chunkEV4Y7HCY_cjs.removeSpaces(suffix) : "/";
|
|
188
190
|
const baseApiUrl = new URL(rawBaseUrl.replace(/\/+$/, "")).origin;
|
|
189
191
|
const finalSuffix = suffix === "/" ? "/" : `${suffix.startsWith("/") ? "" : "/"}${suffix.replace(/\/+$/, "")}`;
|
|
190
192
|
return `${baseApiUrl}${finalSuffix}`;
|
|
@@ -200,10 +202,10 @@ var getBaseUrl = () => {
|
|
|
200
202
|
const baseEnv = process.env.NEXT_PUBLIC_BASE_URL?.trim();
|
|
201
203
|
const portEnv = process.env.NEXT_PUBLIC_PORT_FE?.trim();
|
|
202
204
|
let baseUrl = baseEnv || "http://localhost";
|
|
203
|
-
baseUrl =
|
|
205
|
+
baseUrl = chunkEV4Y7HCY_cjs.removeSpaces(baseUrl).replace(/\/+$/, "");
|
|
204
206
|
const hasPort = /:\/\/[^/]+:\d+/.test(baseUrl);
|
|
205
207
|
if (!hasPort && portEnv) {
|
|
206
|
-
baseUrl +=
|
|
208
|
+
baseUrl += chunk6EF52423_cjs.formatEnvPort(portEnv, { prefixColon: true });
|
|
207
209
|
} else if (!hasPort && !baseEnv) {
|
|
208
210
|
baseUrl += ":3000";
|
|
209
211
|
}
|
package/dist/next/index.d.ts
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/next/index.js
CHANGED
|
@@ -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
|
-
import { normalizePathname, formatEnvPort } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import { removeSpaces } from '../chunk-
|
|
14
|
-
import { isEmptyString } from '../chunk-
|
|
15
|
-
import { assertIsString } from '../chunk-
|
|
16
|
-
import { safeStableStringify } from '../chunk-
|
|
10
|
+
import { normalizePathname, formatEnvPort } from '../chunk-2CYDJVGM.js';
|
|
11
|
+
import '../chunk-BXW7YXB7.js';
|
|
12
|
+
import '../chunk-44XX2P34.js';
|
|
13
|
+
import { removeSpaces } from '../chunk-HHYWB7VZ.js';
|
|
14
|
+
import { isEmptyString } from '../chunk-TCDOWZQE.js';
|
|
15
|
+
import { assertIsString } from '../chunk-BKIJBNIE.js';
|
|
16
|
+
import { safeStableStringify } from '../chunk-6VUXD3CF.js';
|
|
17
17
|
import '../chunk-QNKGP5DY.js';
|
|
18
|
-
import { isString, getPreciseType, assertIsPlainObject, isNil, isNonEmptyArray, isNonEmptyString, isPlainObject, isUndefined, assertIsBoolean, isError, hasOwnProp } from '../chunk-
|
|
18
|
+
import { isString, getPreciseType, assertIsPlainObject, isNil, isNonEmptyArray, isNonEmptyString, isPlainObject, isUndefined, assertIsBoolean, isError, hasOwnProp } from '../chunk-CSG4SCL3.js';
|
|
19
19
|
|
|
20
20
|
function generateRoute(route, params) {
|
|
21
21
|
if (!isString(route) || isEmptyString(route)) {
|
|
@@ -151,10 +151,12 @@ var createBeApiUrl = (pathname, options = {}) => {
|
|
|
151
151
|
} catch (err) {
|
|
152
152
|
if (isError(err)) {
|
|
153
153
|
throw err;
|
|
154
|
-
} else
|
|
154
|
+
} else {
|
|
155
155
|
throw new Error(
|
|
156
|
-
"Failed to generate backend API URL in `createBeApiUrl()`, Error: " +
|
|
156
|
+
"Failed to generate backend API URL in `createBeApiUrl()`, Error: " + String(err).trim(),
|
|
157
|
+
{ cause: err }
|
|
157
158
|
);
|
|
159
|
+
}
|
|
158
160
|
}
|
|
159
161
|
};
|
|
160
162
|
|
|
@@ -2,19 +2,19 @@
|
|
|
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
|
require('server-only');
|
|
14
14
|
var server = require('next/server');
|
|
15
15
|
|
|
16
16
|
var getClientIpOrUrl = (request, includeFullUrl = true) => {
|
|
17
|
-
if (!
|
|
17
|
+
if (!chunkGKC3UDMC_cjs.isFunction(server.NextRequest)) {
|
|
18
18
|
throw new Error(
|
|
19
19
|
"Function `getClientIpOrUrl` is designed to be used in a `NextJS` environment."
|
|
20
20
|
);
|
|
@@ -24,7 +24,7 @@ var getClientIpOrUrl = (request, includeFullUrl = true) => {
|
|
|
24
24
|
"First parameter (`request`) must be an `instance of NextRequest` from `NextJS`."
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
chunkGKC3UDMC_cjs.assertIsBoolean(includeFullUrl, {
|
|
28
28
|
message: ({ currentType, validType }) => `Second parameter (\`includeFullUrl\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
29
29
|
});
|
|
30
30
|
const forwardedIps = (request.headers.get("x-forwarded-for") ?? "127.0.0.1").trim().split(",");
|
|
@@ -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,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 { isFunction, assertIsBoolean } from '../../chunk-
|
|
10
|
+
import { isFunction, assertIsBoolean } from '../../chunk-CSG4SCL3.js';
|
|
11
11
|
import 'server-only';
|
|
12
12
|
import { NextRequest } from 'next/server';
|
|
13
13
|
|
|
@@ -2,32 +2,32 @@
|
|
|
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
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
12
|
+
var chunkODUO3RTL_cjs = require('../chunk-ODUO3RTL.cjs');
|
|
13
|
+
require('../chunk-L4V53MQK.cjs');
|
|
14
|
+
require('../chunk-H65I3GRZ.cjs');
|
|
15
|
+
require('../chunk-KOLEURVT.cjs');
|
|
16
|
+
require('../chunk-RRQHMOPE.cjs');
|
|
17
17
|
require('../chunk-BAV5T2E3.cjs');
|
|
18
|
-
require('../chunk-
|
|
18
|
+
require('../chunk-TQPGXGKB.cjs');
|
|
19
19
|
require('../chunk-UDA26MCU.cjs');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-GKC3UDMC.cjs');
|
|
21
21
|
|
|
22
22
|
Object.defineProperty(exports, "findDuplicates", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkODUO3RTL_cjs.findDuplicates; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "omitKeys", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkODUO3RTL_cjs.omitKeys; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "omitKeysDeep", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkODUO3RTL_cjs.omitKeysDeep; }
|
|
33
33
|
});
|
|
@@ -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/operations/index.js
CHANGED
|
@@ -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
|
-
export { findDuplicates, omitKeys, omitKeysDeep } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
10
|
+
export { findDuplicates, omitKeys, omitKeysDeep } from '../chunk-6SCOKU3S.js';
|
|
11
|
+
import '../chunk-YSZC56SZ.js';
|
|
12
|
+
import '../chunk-WYP76WXB.js';
|
|
13
|
+
import '../chunk-SDMPEJ4F.js';
|
|
14
|
+
import '../chunk-HSP6IWZK.js';
|
|
15
15
|
import '../chunk-YWHHVDT4.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-6VUXD3CF.js';
|
|
17
17
|
import '../chunk-QNKGP5DY.js';
|
|
18
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-CSG4SCL3.js';
|
package/dist/parsers/index.cjs
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
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
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
12
|
+
var chunkB4TC6FBV_cjs = require('../chunk-B4TC6FBV.cjs');
|
|
13
|
+
require('../chunk-NYK5K3V2.cjs');
|
|
14
|
+
require('../chunk-YKQEOO7C.cjs');
|
|
15
|
+
require('../chunk-GKC3UDMC.cjs');
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "extractFileName", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkB4TC6FBV_cjs.extractFileName; }
|
|
20
20
|
});
|
package/dist/parsers/index.d.ts
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/parsers/index.js
CHANGED
|
@@ -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
|
-
export { extractFileName } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
10
|
+
export { extractFileName } from '../chunk-CWQW7AKK.js';
|
|
11
|
+
import '../chunk-44XX2P34.js';
|
|
12
|
+
import '../chunk-BKIJBNIE.js';
|
|
13
|
+
import '../chunk-CSG4SCL3.js';
|