@rzl-zone/utils-js 3.11.0 → 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.
Files changed (119) hide show
  1. package/README.md +96 -112
  2. package/dist/assertions/index.cjs +11 -11
  3. package/dist/assertions/index.d.ts +5 -5
  4. package/dist/assertions/index.js +5 -5
  5. package/dist/{chunk-TER22LO4.cjs → chunk-2AFQ33D3.cjs} +8 -8
  6. package/dist/{chunk-SZUNAEMR.js → chunk-2CYDJVGM.js} +6 -6
  7. package/dist/{chunk-6EDFZJZ5.cjs → chunk-2MW4JDQ2.cjs} +126 -126
  8. package/dist/{chunk-M7ELWZXM.cjs → chunk-2VTDXC3N.cjs} +9 -9
  9. package/dist/{chunk-6YGBRENU.js → chunk-44XX2P34.js} +3 -3
  10. package/dist/{chunk-WLOQQFDS.cjs → chunk-4YLBKLGS.cjs} +3 -3
  11. package/dist/{chunk-Q4GEQS7X.cjs → chunk-566CXQW7.cjs} +163 -167
  12. package/dist/{chunk-MV3TSQSH.cjs → chunk-57EPKYID.cjs} +71 -71
  13. package/dist/{chunk-2XSZ2ANI.js → chunk-5MGEC3YG.js} +2 -2
  14. package/dist/{chunk-HYN6FC5A.cjs → chunk-6EF52423.cjs} +34 -34
  15. package/dist/{chunk-LJHPTLWB.js → chunk-6SCOKU3S.js} +7 -7
  16. package/dist/{chunk-AXDYWO67.js → chunk-6VUXD3CF.js} +2 -2
  17. package/dist/{chunk-C2PV3VWC.cjs → chunk-7B76BSNK.cjs} +6 -6
  18. package/dist/{chunk-ZPDMWDGZ.cjs → chunk-7Y6I2DSU.cjs} +14 -14
  19. package/dist/{chunk-KXJ7X325.cjs → chunk-A7S7E2EE.cjs} +37 -37
  20. package/dist/{chunk-BPYW5YL7.js → chunk-AJZ6PMMZ.js} +2 -2
  21. package/dist/{chunk-PGNL7JXO.cjs → chunk-AXGBL2IO.cjs} +40 -40
  22. package/dist/{chunk-NLZLXWAU.cjs → chunk-B4TC6FBV.cjs} +9 -9
  23. package/dist/chunk-BAV5T2E3.cjs +1 -1
  24. package/dist/{chunk-3T6VSWYX.js → chunk-BKIJBNIE.js} +2 -2
  25. package/dist/{chunk-RBWZII5I.js → chunk-BNIMTFK5.js} +3 -3
  26. package/dist/{chunk-5WIEDF2J.js → chunk-BXW7YXB7.js} +4 -4
  27. package/dist/{chunk-22V4WP3H.js → chunk-CFYZC4S6.js} +4 -4
  28. package/dist/{chunk-MSUW5VHZ.js → chunk-CSG4SCL3.js} +10 -13
  29. package/dist/{chunk-JIE447J5.js → chunk-CWQW7AKK.js} +3 -3
  30. package/dist/chunk-DVMHRLKP.cjs +1 -1
  31. package/dist/{chunk-U7HHN47R.js → chunk-EN7LVZBZ.js} +12 -16
  32. package/dist/{chunk-EBYFYZW4.cjs → chunk-EV4Y7HCY.cjs} +4 -4
  33. package/dist/{chunk-NVRZPF5M.cjs → chunk-F66VDYIZ.cjs} +3 -3
  34. package/dist/{chunk-BMZZXZJ2.cjs → chunk-FLJX37EL.cjs} +4 -4
  35. package/dist/{chunk-SYHPSOUU.cjs → chunk-GKC3UDMC.cjs} +10 -13
  36. package/dist/{chunk-GIKL4PUF.cjs → chunk-H65I3GRZ.cjs} +10 -10
  37. package/dist/{chunk-HNBRGN4R.js → chunk-HHYWB7VZ.js} +2 -2
  38. package/dist/{chunk-MUHRPRR7.cjs → chunk-HNGGISFL.cjs} +3 -3
  39. package/dist/{chunk-B6PMNZ4M.cjs → chunk-HNSQAVSZ.cjs} +6 -6
  40. package/dist/{chunk-RZOGBYIS.js → chunk-HSP6IWZK.js} +3 -7
  41. package/dist/{chunk-IZGVBYFN.js → chunk-IDZS7J6T.js} +13 -13
  42. package/dist/{chunk-ENMRZ4BE.js → chunk-JS6R55VL.js} +3 -3
  43. package/dist/{chunk-WETQI6HM.js → chunk-JZVT5FK7.js} +9 -9
  44. package/dist/chunk-KHO2SBNA.cjs +1 -1
  45. package/dist/{chunk-TJHGRQ4P.js → chunk-KIDJCMNJ.js} +2 -2
  46. package/dist/{chunk-7FGNVDEV.cjs → chunk-KOLEURVT.cjs} +7 -7
  47. package/dist/{chunk-K5536YHG.cjs → chunk-L4V53MQK.cjs} +50 -50
  48. package/dist/chunk-L5RDAVVH.js +1 -1
  49. package/dist/{chunk-CCJ2MSN7.js → chunk-NODTV4F3.js} +2 -2
  50. package/dist/{chunk-QYI2VJLS.cjs → chunk-NYK5K3V2.cjs} +9 -9
  51. package/dist/{chunk-XPVTIGU2.cjs → chunk-ODUO3RTL.cjs} +26 -26
  52. package/dist/chunk-ONZFBJVW.js +1 -1
  53. package/dist/{chunk-ZVWZEGQP.js → chunk-PFXCTE37.js} +2 -2
  54. package/dist/{chunk-FJ4BQFVO.js → chunk-PPST7QAQ.js} +8 -8
  55. package/dist/{chunk-RMP7VMPB.cjs → chunk-Q5IMYDFL.cjs} +12 -12
  56. package/dist/{chunk-UIAWUZ4H.js → chunk-QFFBIOJ4.js} +4 -4
  57. package/dist/chunk-QNKGP5DY.js +1 -1
  58. package/dist/{chunk-DLS3G6WQ.cjs → chunk-RRQHMOPE.cjs} +4 -8
  59. package/dist/{chunk-BLF7SD66.js → chunk-RU5OSRBU.js} +3 -3
  60. package/dist/{chunk-GOFINGT6.js → chunk-SDMPEJ4F.js} +2 -2
  61. package/dist/{chunk-K47GZDBH.js → chunk-SYNL5IKP.js} +3 -3
  62. package/dist/{chunk-ULQPCIA2.js → chunk-TCDOWZQE.js} +2 -2
  63. package/dist/{chunk-DAPAK2W3.cjs → chunk-TQPGXGKB.cjs} +31 -31
  64. package/dist/{chunk-DNMCR5JH.js → chunk-TULOI4GL.js} +9 -9
  65. package/dist/{chunk-SU3UELUB.cjs → chunk-UBHCP4N5.cjs} +3 -3
  66. package/dist/{chunk-U23I7JPB.cjs → chunk-UCHF3M34.cjs} +15 -15
  67. package/dist/chunk-UDA26MCU.cjs +1 -1
  68. package/dist/{chunk-XX6RUGTM.cjs → chunk-V3C4FYZL.cjs} +3 -3
  69. package/dist/{chunk-6LXWT2I5.js → chunk-VAAHZFBF.js} +2 -2
  70. package/dist/chunk-VJDDGRIK.cjs +1 -1
  71. package/dist/chunk-WVSPXFTY.js +1 -1
  72. package/dist/{chunk-GXKQ3LHF.js → chunk-WYP76WXB.js} +3 -3
  73. package/dist/{chunk-JXEIJM5M.cjs → chunk-YDE4ZBB7.cjs} +61 -61
  74. package/dist/{chunk-WXFTVXBF.cjs → chunk-YKQEOO7C.cjs} +4 -4
  75. package/dist/{chunk-BOYP3ARU.js → chunk-YSZC56SZ.js} +4 -4
  76. package/dist/chunk-YWHHVDT4.js +1 -1
  77. package/dist/conversions/index.cjs +34 -34
  78. package/dist/conversions/index.d.ts +1 -1
  79. package/dist/conversions/index.js +15 -15
  80. package/dist/events/index.cjs +8 -8
  81. package/dist/events/index.d.ts +1 -1
  82. package/dist/events/index.js +4 -4
  83. package/dist/formatters/index.cjs +19 -19
  84. package/dist/formatters/index.d.ts +1 -1
  85. package/dist/formatters/index.js +9 -9
  86. package/dist/generators/index.cjs +9 -9
  87. package/dist/generators/index.d.ts +1 -1
  88. package/dist/generators/index.js +4 -4
  89. package/dist/index.d.ts +1 -1
  90. package/dist/{isPlainObject-0p3VveWr.d.ts → isPlainObject-DTJVV2Kf.d.ts} +5 -3
  91. package/dist/next/index.cjs +41 -39
  92. package/dist/next/index.d.ts +1 -1
  93. package/dist/next/index.js +13 -11
  94. package/dist/next/server/index.cjs +4 -4
  95. package/dist/next/server/index.d.ts +1 -1
  96. package/dist/next/server/index.js +2 -2
  97. package/dist/operations/index.cjs +11 -11
  98. package/dist/operations/index.d.ts +1 -1
  99. package/dist/operations/index.js +8 -8
  100. package/dist/parsers/index.cjs +6 -6
  101. package/dist/parsers/index.d.ts +1 -1
  102. package/dist/parsers/index.js +5 -5
  103. package/dist/predicates/index.cjs +77 -77
  104. package/dist/predicates/index.d.ts +6 -6
  105. package/dist/predicates/index.js +14 -14
  106. package/dist/promises/index.cjs +6 -6
  107. package/dist/promises/index.d.ts +1 -1
  108. package/dist/promises/index.js +4 -4
  109. package/dist/rzl-utils.global.js +2 -2
  110. package/dist/strings/index.cjs +23 -23
  111. package/dist/strings/index.d.ts +1 -1
  112. package/dist/strings/index.js +7 -7
  113. package/dist/tailwind/index.cjs +13 -13
  114. package/dist/tailwind/index.d.ts +1 -1
  115. package/dist/tailwind/index.js +5 -5
  116. package/dist/urls/index.cjs +23 -23
  117. package/dist/urls/index.d.ts +1 -1
  118. package/dist/urls/index.js +16 -16
  119. package/package.json +22 -20
@@ -2,31 +2,31 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.11.0.
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 chunkHYN6FC5A_cjs = require('../chunk-HYN6FC5A.cjs');
13
- require('../chunk-M7ELWZXM.cjs');
14
- require('../chunk-QYI2VJLS.cjs');
15
- var chunkEBYFYZW4_cjs = require('../chunk-EBYFYZW4.cjs');
16
- var chunkWLOQQFDS_cjs = require('../chunk-WLOQQFDS.cjs');
17
- var chunkWXFTVXBF_cjs = require('../chunk-WXFTVXBF.cjs');
18
- var chunkDAPAK2W3_cjs = require('../chunk-DAPAK2W3.cjs');
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 chunkSYHPSOUU_cjs = require('../chunk-SYHPSOUU.cjs');
20
+ var chunkGKC3UDMC_cjs = require('../chunk-GKC3UDMC.cjs');
21
21
 
22
22
  function generateRoute(route, params) {
23
- if (!chunkSYHPSOUU_cjs.isString(route) || chunkWLOQQFDS_cjs.isEmptyString(route)) {
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: "${chunkSYHPSOUU_cjs.getPreciseType(
27
+ - Must be of type \`string\` and non-empty string, but received: "${chunkGKC3UDMC_cjs.getPreciseType(
28
28
  route
29
- )}": \`${chunkDAPAK2W3_cjs.safeStableStringify(route, {
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
- chunkSYHPSOUU_cjs.assertIsPlainObject(params, {
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 (chunkSYHPSOUU_cjs.isNil(params)) {
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 (!chunkSYHPSOUU_cjs.isString(value)) {
70
+ if (!chunkGKC3UDMC_cjs.isString(value)) {
71
71
  errors.push(
72
- `- Invalid parameter: "${key}" must be of type \`string\`, but received: \`${chunkSYHPSOUU_cjs.getPreciseType(
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 (chunkWLOQQFDS_cjs.isEmptyString(value)) {
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 (chunkSYHPSOUU_cjs.isNonEmptyArray(errors)) {
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 = chunkSYHPSOUU_cjs.isNonEmptyString(params[key]) ? params[key] : "";
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
- chunkWXFTVXBF_cjs.assertIsString(chunkSYHPSOUU_cjs.isNil(pathname) ? "" : pathname, {
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 (!chunkSYHPSOUU_cjs.isPlainObject(options)) {
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 (!chunkSYHPSOUU_cjs.isUndefined(prefix) && !chunkSYHPSOUU_cjs.isString(prefix)) {
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: \`${chunkSYHPSOUU_cjs.getPreciseType(
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
- chunkSYHPSOUU_cjs.assertIsBoolean(withOrigin, {
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 = chunkHYN6FC5A_cjs.normalizePathname(pathname);
144
- prefix = chunkHYN6FC5A_cjs.normalizePathname(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 = chunkHYN6FC5A_cjs.normalizePathname(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 (chunkSYHPSOUU_cjs.isError(err)) {
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: " + new Error(String(err)).message.trim()
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 (!chunkSYHPSOUU_cjs.isPlainObject(options)) options = {};
165
- let suffix = chunkSYHPSOUU_cjs.hasOwnProp(options, "suffix") ? options.suffix : "/";
166
- chunkWXFTVXBF_cjs.assertIsString(suffix, {
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 = chunkEBYFYZW4_cjs.removeSpaces(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 + chunkHYN6FC5A_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE, {
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" + chunkHYN6FC5A_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE || "8000", {
185
+ rawBaseUrl = "http://localhost" + chunk6EF52423_cjs.formatEnvPort(process.env.NEXT_PUBLIC_PORT_BE || "8000", {
184
186
  prefixColon: true
185
187
  });
186
188
  }
187
- suffix = chunkEBYFYZW4_cjs.removeSpaces(suffix).length ? chunkEBYFYZW4_cjs.removeSpaces(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 = chunkEBYFYZW4_cjs.removeSpaces(baseUrl).replace(/\/+$/, "");
205
+ baseUrl = chunkEV4Y7HCY_cjs.removeSpaces(baseUrl).replace(/\/+$/, "");
204
206
  const hasPort = /:\/\/[^/]+:\d+/.test(baseUrl);
205
207
  if (!hasPort && portEnv) {
206
- baseUrl += chunkHYN6FC5A_cjs.formatEnvPort(portEnv, { prefixColon: true });
208
+ baseUrl += chunk6EF52423_cjs.formatEnvPort(portEnv, { prefixColon: true });
207
209
  } else if (!hasPort && !baseEnv) {
208
210
  baseUrl += ":3000";
209
211
  }
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.11.0.
5
+ * Version: 3.12.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -2,20 +2,20 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.11.0.
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-SZUNAEMR.js';
11
- import '../chunk-5WIEDF2J.js';
12
- import '../chunk-6YGBRENU.js';
13
- import { removeSpaces } from '../chunk-HNBRGN4R.js';
14
- import { isEmptyString } from '../chunk-ULQPCIA2.js';
15
- import { assertIsString } from '../chunk-3T6VSWYX.js';
16
- import { safeStableStringify } from '../chunk-AXDYWO67.js';
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-MSUW5VHZ.js';
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: " + new Error(String(err)).message.trim()
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.11.0.
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 chunkSYHPSOUU_cjs = require('../../chunk-SYHPSOUU.cjs');
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 (!chunkSYHPSOUU_cjs.isFunction(server.NextRequest)) {
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
- chunkSYHPSOUU_cjs.assertIsBoolean(includeFullUrl, {
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.11.0.
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.11.0.
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-MSUW5VHZ.js';
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.11.0.
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 chunkXPVTIGU2_cjs = require('../chunk-XPVTIGU2.cjs');
13
- require('../chunk-K5536YHG.cjs');
14
- require('../chunk-GIKL4PUF.cjs');
15
- require('../chunk-7FGNVDEV.cjs');
16
- require('../chunk-DLS3G6WQ.cjs');
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-DAPAK2W3.cjs');
18
+ require('../chunk-TQPGXGKB.cjs');
19
19
  require('../chunk-UDA26MCU.cjs');
20
- require('../chunk-SYHPSOUU.cjs');
20
+ require('../chunk-GKC3UDMC.cjs');
21
21
 
22
22
  Object.defineProperty(exports, "findDuplicates", {
23
23
  enumerable: true,
24
- get: function () { return chunkXPVTIGU2_cjs.findDuplicates; }
24
+ get: function () { return chunkODUO3RTL_cjs.findDuplicates; }
25
25
  });
26
26
  Object.defineProperty(exports, "omitKeys", {
27
27
  enumerable: true,
28
- get: function () { return chunkXPVTIGU2_cjs.omitKeys; }
28
+ get: function () { return chunkODUO3RTL_cjs.omitKeys; }
29
29
  });
30
30
  Object.defineProperty(exports, "omitKeysDeep", {
31
31
  enumerable: true,
32
- get: function () { return chunkXPVTIGU2_cjs.omitKeysDeep; }
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.11.0.
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.11.0.
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-LJHPTLWB.js';
11
- import '../chunk-BOYP3ARU.js';
12
- import '../chunk-GXKQ3LHF.js';
13
- import '../chunk-GOFINGT6.js';
14
- import '../chunk-RZOGBYIS.js';
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-AXDYWO67.js';
16
+ import '../chunk-6VUXD3CF.js';
17
17
  import '../chunk-QNKGP5DY.js';
18
- import '../chunk-MSUW5VHZ.js';
18
+ import '../chunk-CSG4SCL3.js';
@@ -2,19 +2,19 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.11.0.
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 chunkNLZLXWAU_cjs = require('../chunk-NLZLXWAU.cjs');
13
- require('../chunk-QYI2VJLS.cjs');
14
- require('../chunk-WXFTVXBF.cjs');
15
- require('../chunk-SYHPSOUU.cjs');
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 chunkNLZLXWAU_cjs.extractFileName; }
19
+ get: function () { return chunkB4TC6FBV_cjs.extractFileName; }
20
20
  });
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.11.0.
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.11.0.
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-JIE447J5.js';
11
- import '../chunk-6YGBRENU.js';
12
- import '../chunk-3T6VSWYX.js';
13
- import '../chunk-MSUW5VHZ.js';
10
+ export { extractFileName } from '../chunk-CWQW7AKK.js';
11
+ import '../chunk-44XX2P34.js';
12
+ import '../chunk-BKIJBNIE.js';
13
+ import '../chunk-CSG4SCL3.js';