@rzl-zone/utils-js 3.8.0 → 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 +5 -1
- package/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +168 -57
- 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-SLP24LUV.js → chunk-5Y6JL47L.js} +3 -3
- package/dist/{chunk-ZW3VYES4.cjs → chunk-62FS7WMB.cjs} +31 -31
- package/dist/{chunk-VJVCXEH7.cjs → chunk-6AMDHVS2.cjs} +9 -181
- package/dist/{chunk-5IKZ3JDV.js → chunk-6WVOUVWD.js} +9 -9
- package/dist/{chunk-BYUT376O.cjs → chunk-76ATVDCR.cjs} +3 -3
- package/dist/{chunk-F3WBQKRI.cjs → chunk-7C7TQC5J.cjs} +29 -7
- package/dist/{chunk-I3IXLEEG.js → chunk-7EIFPHV3.js} +8 -8
- 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-KVZ3HL2B.js → chunk-DXPM4NOU.js} +4 -4
- 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-3JD53UUH.cjs → chunk-JI57K7D4.cjs} +161 -161
- package/dist/{chunk-OFBFGFVH.js → chunk-JYOCB6OV.js} +2 -2
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-6NORJBI6.cjs → chunk-KUVRZ2JW.cjs} +50 -50
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-VCVND6CH.js → chunk-M5QB2GM5.js} +2 -2
- package/dist/{chunk-RRJIRXHS.js → chunk-MBFVTGYS.js} +4 -4
- 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-HKJZ7K2K.cjs → chunk-NJ24M6ZH.cjs} +37 -37
- 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-RJYWBVGD.cjs → chunk-QGTFQ7RO.cjs} +6 -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-PW2VMJLT.js → chunk-R2DR7SPJ.js} +99 -25
- package/dist/{chunk-TDYGYHSH.js → chunk-SN5HAK3Y.js} +4 -4
- package/dist/{chunk-P3ST4UZA.js → chunk-SRWL4YCP.js} +7 -7
- 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-LVFTN6DK.cjs → chunk-UFYMRRJH.cjs} +61 -61
- package/dist/{chunk-5NN4ZDE2.cjs → chunk-UV5BKAYW.cjs} +6 -8
- package/dist/{chunk-GAJBF6DR.js → chunk-UXT4XSUK.js} +2 -2
- package/dist/{chunk-6VA4F6VR.js → chunk-VBSLIIDB.js} +10 -10
- package/dist/chunk-VCYXNIZ2.cjs +678 -0
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/{chunk-JIROTDOU.js → chunk-WB3FT62A.js} +3 -3
- package/dist/{chunk-K63WO3XA.cjs → chunk-WKM6UVMG.cjs} +4 -5
- package/dist/{chunk-5PF7KRCP.cjs → chunk-WLEZ2KSG.cjs} +126 -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-A4H7474O.cjs → chunk-YQHJB7KR.cjs} +26 -26
- 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 +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-BTPjv6zB.d.ts +1 -1
- package/dist/next/index.cjs +37 -36
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +9 -8
- 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 -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 +1 -1
- package/dist/predicates/index.js +14 -13
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +2 -3
- 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 -21
- package/dist/urls/index.d.ts +182 -114
- package/dist/urls/index.js +16 -14
- package/package.json +1 -1
- package/dist/chunk-KPCDDYTZ.js +0 -417
- package/dist/chunk-QAPYHLHC.cjs +0 -419
- package/dist/chunk-SGCN4ED4.cjs +0 -175
package/dist/generators/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
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
|
-
export { getRandomItem, randomInt, randomIntByLength, randomStr, randomUUID } from '../chunk-
|
|
10
|
+
export { getRandomItem, randomInt, randomIntByLength, randomStr, randomUUID } from '../chunk-5Y6JL47L.js';
|
|
11
11
|
import '../chunk-WVSPXFTY.js';
|
|
12
12
|
export { noop } from '../chunk-YWHHVDT4.js';
|
|
13
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-X6ULJZ3X.js';
|
|
14
14
|
import '../chunk-QNKGP5DY.js';
|
|
15
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-J4TT33ZX.js';
|
package/dist/index.d.ts
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
|
* ====================================================
|
package/dist/next/index.cjs
CHANGED
|
@@ -2,30 +2,31 @@
|
|
|
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
|
-
require('../chunk-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
12
|
+
var chunkOCTHWEZK_cjs = require('../chunk-OCTHWEZK.cjs');
|
|
13
|
+
require('../chunk-6AMDHVS2.cjs');
|
|
14
|
+
require('../chunk-ZTHJQJ5F.cjs');
|
|
15
|
+
var chunkIX6PF5ZP_cjs = require('../chunk-IX6PF5ZP.cjs');
|
|
16
|
+
var chunkFWWPEL7J_cjs = require('../chunk-FWWPEL7J.cjs');
|
|
17
|
+
var chunkWKM6UVMG_cjs = require('../chunk-WKM6UVMG.cjs');
|
|
18
|
+
var chunkH44QVAZL_cjs = require('../chunk-H44QVAZL.cjs');
|
|
18
19
|
require('../chunk-UDA26MCU.cjs');
|
|
19
|
-
var
|
|
20
|
+
var chunk7C7TQC5J_cjs = require('../chunk-7C7TQC5J.cjs');
|
|
20
21
|
|
|
21
22
|
function generateRoute(route, params) {
|
|
22
|
-
if (!
|
|
23
|
+
if (!chunk7C7TQC5J_cjs.isString(route) || chunkFWWPEL7J_cjs.isEmptyString(route)) {
|
|
23
24
|
throw new TypeError(
|
|
24
25
|
`\u274C 'generateRoute' Failed:
|
|
25
26
|
- Invalid 'route' value.
|
|
26
|
-
- Must be of type \`string\` and non-empty string, but received: "${
|
|
27
|
+
- Must be of type \`string\` and non-empty string, but received: "${chunk7C7TQC5J_cjs.getPreciseType(
|
|
27
28
|
route
|
|
28
|
-
)}": \`${
|
|
29
|
+
)}": \`${chunkH44QVAZL_cjs.safeStableStringify(route, {
|
|
29
30
|
keepUndefined: true
|
|
30
31
|
})}\`.`
|
|
31
32
|
);
|
|
@@ -33,11 +34,11 @@ function generateRoute(route, params) {
|
|
|
33
34
|
if (!/[\\[\]]/.test(route)) {
|
|
34
35
|
return route;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
chunk7C7TQC5J_cjs.assertIsPlainObject(params, {
|
|
37
38
|
message: ({ validType }) => `\u274C 'generateRoute' Failed cause in route "${route}":
|
|
38
39
|
- Missing or invalid parameters \`${validType}\` for route: "${route}", must be of type \`${validType}\` mapping parameters.`
|
|
39
40
|
});
|
|
40
|
-
if (
|
|
41
|
+
if (chunk7C7TQC5J_cjs.isNil(params)) {
|
|
41
42
|
throw new TypeError(
|
|
42
43
|
`\u274C 'generateRoute' Failed cause in route "${route}":
|
|
43
44
|
- Missing parameters \`plain-object\` for route: "${route}".`
|
|
@@ -66,15 +67,15 @@ function generateRoute(route, params) {
|
|
|
66
67
|
const requiredKeys = Array.from(route.matchAll(/\[(\w+)\]/g)).map((m) => m[1]);
|
|
67
68
|
for (const key of requiredKeys) {
|
|
68
69
|
const value = params[key];
|
|
69
|
-
if (!
|
|
70
|
+
if (!chunk7C7TQC5J_cjs.isString(value)) {
|
|
70
71
|
errors.push(
|
|
71
|
-
`- Invalid parameter: "${key}" must be of type \`string\`, but received: \`${
|
|
72
|
+
`- Invalid parameter: "${key}" must be of type \`string\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
72
73
|
value
|
|
73
74
|
)}\`.`
|
|
74
75
|
);
|
|
75
76
|
continue;
|
|
76
77
|
}
|
|
77
|
-
if (
|
|
78
|
+
if (chunkFWWPEL7J_cjs.isEmptyString(value)) {
|
|
78
79
|
errors.push(`- Parameter "${key}" cannot be empty string.`);
|
|
79
80
|
continue;
|
|
80
81
|
}
|
|
@@ -99,14 +100,14 @@ function generateRoute(route, params) {
|
|
|
99
100
|
);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
if (
|
|
103
|
+
if (chunk7C7TQC5J_cjs.isNonEmptyArray(errors)) {
|
|
103
104
|
throw new Error(
|
|
104
105
|
`\u274C 'generateRoute' Failed cause in route "${route}":
|
|
105
106
|
${errors.join("\n")}.`
|
|
106
107
|
);
|
|
107
108
|
}
|
|
108
109
|
return route.replace(/\[(\w+)\]/g, (_, key) => {
|
|
109
|
-
const paramKey =
|
|
110
|
+
const paramKey = chunk7C7TQC5J_cjs.isNonEmptyString(params[key]) ? params[key] : "";
|
|
110
111
|
return paramKey.trim().replace(/^\/+|\/+$/g, "");
|
|
111
112
|
}).replace(/\/+/g, "/");
|
|
112
113
|
}
|
|
@@ -117,40 +118,40 @@ var createBeApiUrl = (pathname, options = {}) => {
|
|
|
117
118
|
return `${a.replace(/\/+$/, "")}/${b.replace(/^\/+/, "")}`;
|
|
118
119
|
};
|
|
119
120
|
var joinPath = joinPath2;
|
|
120
|
-
|
|
121
|
+
chunkWKM6UVMG_cjs.assertIsString(chunk7C7TQC5J_cjs.isNil(pathname) ? "" : pathname, {
|
|
121
122
|
message({ currentType, validType }) {
|
|
122
123
|
return `First parameter (\`pathname\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
|
-
if (!
|
|
126
|
+
if (!chunk7C7TQC5J_cjs.isPlainObject(options)) {
|
|
126
127
|
options = {};
|
|
127
128
|
}
|
|
128
129
|
let {
|
|
129
130
|
prefix = "/api",
|
|
130
131
|
withOrigin = true
|
|
131
132
|
} = options;
|
|
132
|
-
if (!
|
|
133
|
+
if (!chunk7C7TQC5J_cjs.isUndefined(prefix) && !chunk7C7TQC5J_cjs.isString(prefix)) {
|
|
133
134
|
throw new TypeError(
|
|
134
|
-
`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: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
135
136
|
prefix
|
|
136
137
|
)}\`.`
|
|
137
138
|
);
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
+
chunk7C7TQC5J_cjs.assertIsBoolean(withOrigin, {
|
|
140
141
|
message: ({ currentType, validType }) => `Parameter \`withOrigin\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
141
142
|
});
|
|
142
|
-
pathname =
|
|
143
|
-
prefix =
|
|
143
|
+
pathname = chunkOCTHWEZK_cjs.normalizePathname(pathname);
|
|
144
|
+
prefix = chunkOCTHWEZK_cjs.normalizePathname(prefix);
|
|
144
145
|
const normalizedPrefix = prefix.endsWith("/") ? prefix : prefix + "/";
|
|
145
146
|
if (pathname === prefix || pathname === prefix + "/" || pathname.startsWith(normalizedPrefix)) {
|
|
146
147
|
pathname = pathname.slice(prefix.length);
|
|
147
|
-
pathname =
|
|
148
|
+
pathname = chunkOCTHWEZK_cjs.normalizePathname(pathname);
|
|
148
149
|
}
|
|
149
150
|
const baseApiUrl = getBeApiUrl({ suffix: prefix });
|
|
150
151
|
const fullPath = withOrigin ? joinPath2(baseApiUrl, pathname) : joinPath2(new URL(baseApiUrl).pathname, pathname);
|
|
151
152
|
return fullPath.replace(/\/+$/, "");
|
|
152
153
|
} catch (err) {
|
|
153
|
-
if (
|
|
154
|
+
if (chunk7C7TQC5J_cjs.isError(err)) {
|
|
154
155
|
throw err;
|
|
155
156
|
} else
|
|
156
157
|
throw new Error(
|
|
@@ -160,9 +161,9 @@ var createBeApiUrl = (pathname, options = {}) => {
|
|
|
160
161
|
};
|
|
161
162
|
|
|
162
163
|
var getBeApiUrl = (options = {}) => {
|
|
163
|
-
if (!
|
|
164
|
-
let suffix =
|
|
165
|
-
|
|
164
|
+
if (!chunk7C7TQC5J_cjs.isPlainObject(options)) options = {};
|
|
165
|
+
let suffix = chunk7C7TQC5J_cjs.hasOwnProp(options, "suffix") ? options.suffix : "/";
|
|
166
|
+
chunkWKM6UVMG_cjs.assertIsString(suffix, {
|
|
166
167
|
message({ currentType, validType }) {
|
|
167
168
|
return `Parameter \`suffix\` property of the first parameter must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
168
169
|
}
|
|
@@ -170,20 +171,20 @@ var getBeApiUrl = (options = {}) => {
|
|
|
170
171
|
try {
|
|
171
172
|
let rawBaseUrl = process.env.NEXT_PUBLIC_BACKEND_API_URL?.trim();
|
|
172
173
|
if (rawBaseUrl) {
|
|
173
|
-
rawBaseUrl =
|
|
174
|
+
rawBaseUrl = chunkIX6PF5ZP_cjs.removeSpaces(rawBaseUrl);
|
|
174
175
|
const urlObj = new URL(rawBaseUrl);
|
|
175
176
|
const hasPort = !!urlObj.port;
|
|
176
177
|
if (!hasPort && process.env.NEXT_PUBLIC_PORT_BE) {
|
|
177
|
-
rawBaseUrl = urlObj.origin +
|
|
178
|
+
rawBaseUrl = urlObj.origin + chunkOCTHWEZK_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE, {
|
|
178
179
|
prefixColon: true
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
182
|
} else {
|
|
182
|
-
rawBaseUrl = "http://localhost" +
|
|
183
|
+
rawBaseUrl = "http://localhost" + chunkOCTHWEZK_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE || "8000", {
|
|
183
184
|
prefixColon: true
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
|
-
suffix =
|
|
187
|
+
suffix = chunkIX6PF5ZP_cjs.removeSpaces(suffix).length ? chunkIX6PF5ZP_cjs.removeSpaces(suffix) : "/";
|
|
187
188
|
const baseApiUrl = new URL(rawBaseUrl.replace(/\/+$/, "")).origin;
|
|
188
189
|
const finalSuffix = suffix === "/" ? "/" : `${suffix.startsWith("/") ? "" : "/"}${suffix.replace(/\/+$/, "")}`;
|
|
189
190
|
return `${baseApiUrl}${finalSuffix}`;
|
|
@@ -199,10 +200,10 @@ var getBaseUrl = () => {
|
|
|
199
200
|
const baseEnv = process.env.NEXT_PUBLIC_BASE_URL?.trim();
|
|
200
201
|
const portEnv = process.env.NEXT_PUBLIC_PORT_FE?.trim();
|
|
201
202
|
let baseUrl = baseEnv || "http://localhost";
|
|
202
|
-
baseUrl =
|
|
203
|
+
baseUrl = chunkIX6PF5ZP_cjs.removeSpaces(baseUrl).replace(/\/+$/, "");
|
|
203
204
|
const hasPort = /:\/\/[^/]+:\d+/.test(baseUrl);
|
|
204
205
|
if (!hasPort && portEnv) {
|
|
205
|
-
baseUrl +=
|
|
206
|
+
baseUrl += chunkOCTHWEZK_cjs.formatEnvPort(portEnv, { prefixColon: true });
|
|
206
207
|
} else if (!hasPort && !baseEnv) {
|
|
207
208
|
baseUrl += ":3000";
|
|
208
209
|
}
|
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.9.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,19 +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 { normalizePathname, formatEnvPort } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
10
|
+
import { normalizePathname, formatEnvPort } from '../chunk-R2DR7SPJ.js';
|
|
11
|
+
import '../chunk-3LE6NX57.js';
|
|
12
|
+
import '../chunk-GKDSBOYE.js';
|
|
13
|
+
import { removeSpaces } from '../chunk-5KDVIEVO.js';
|
|
14
|
+
import { isEmptyString } from '../chunk-5O66AUEC.js';
|
|
15
|
+
import { assertIsString } from '../chunk-OSSFLQDD.js';
|
|
16
|
+
import { safeStableStringify } from '../chunk-X6ULJZ3X.js';
|
|
16
17
|
import '../chunk-QNKGP5DY.js';
|
|
17
|
-
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-J4TT33ZX.js';
|
|
18
19
|
|
|
19
20
|
function generateRoute(route, params) {
|
|
20
21
|
if (!isString(route) || isEmptyString(route)) {
|
|
@@ -2,19 +2,19 @@
|
|
|
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
|
|
12
|
+
var chunk7C7TQC5J_cjs = require('../../chunk-7C7TQC5J.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 (!chunk7C7TQC5J_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
|
+
chunk7C7TQC5J_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.9.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.9.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-J4TT33ZX.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.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
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
12
|
+
var chunkYQHJB7KR_cjs = require('../chunk-YQHJB7KR.cjs');
|
|
13
|
+
require('../chunk-KUVRZ2JW.cjs');
|
|
14
|
+
require('../chunk-TJ5OY6MC.cjs');
|
|
15
|
+
require('../chunk-NAOVH4OH.cjs');
|
|
16
|
+
require('../chunk-OYFUBKEG.cjs');
|
|
17
17
|
require('../chunk-BAV5T2E3.cjs');
|
|
18
|
-
require('../chunk-
|
|
18
|
+
require('../chunk-H44QVAZL.cjs');
|
|
19
19
|
require('../chunk-UDA26MCU.cjs');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-7C7TQC5J.cjs');
|
|
21
21
|
|
|
22
22
|
Object.defineProperty(exports, "findDuplicates", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkYQHJB7KR_cjs.findDuplicates; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "omitKeys", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkYQHJB7KR_cjs.omitKeys; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "omitKeysDeep", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkYQHJB7KR_cjs.omitKeysDeep; }
|
|
33
33
|
});
|
|
@@ -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
|
* ====================================================
|
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.9.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-SRWL4YCP.js';
|
|
11
|
+
import '../chunk-DXPM4NOU.js';
|
|
12
|
+
import '../chunk-J6VLFVIL.js';
|
|
13
|
+
import '../chunk-M5QB2GM5.js';
|
|
14
|
+
import '../chunk-TXOVQZPU.js';
|
|
15
15
|
import '../chunk-YWHHVDT4.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-X6ULJZ3X.js';
|
|
17
17
|
import '../chunk-QNKGP5DY.js';
|
|
18
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-J4TT33ZX.js';
|
package/dist/parsers/index.cjs
CHANGED
|
@@ -2,17 +2,19 @@
|
|
|
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
|
-
require('../chunk-
|
|
12
|
+
var chunkVCYXNIZ2_cjs = require('../chunk-VCYXNIZ2.cjs');
|
|
13
|
+
require('../chunk-ZTHJQJ5F.cjs');
|
|
14
|
+
require('../chunk-WKM6UVMG.cjs');
|
|
15
|
+
require('../chunk-7C7TQC5J.cjs');
|
|
14
16
|
|
|
15
17
|
Object.defineProperty(exports, "extractFileName", {
|
|
16
18
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkVCYXNIZ2_cjs.extractFileName; }
|
|
18
20
|
});
|