@rzl-zone/utils-js 3.5.7 → 3.6.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 +1 -1
  2. package/dist/assertions/index.cjs +1 -1
  3. package/dist/assertions/index.d.ts +1 -1
  4. package/dist/assertions/index.js +1 -1
  5. package/dist/chunk-2CQI36UD.cjs +1 -1
  6. package/dist/chunk-2VO2CBTU.js +1 -1
  7. package/dist/chunk-3KTD3QDI.js +1 -1
  8. package/dist/chunk-4ACKNPL5.js +1 -1
  9. package/dist/chunk-4ZOXSUXB.js +1 -1
  10. package/dist/chunk-5NN4ZDE2.cjs +1 -1
  11. package/dist/chunk-66WLOZOD.cjs +1 -1
  12. package/dist/{chunk-6DSPJA5U.js → chunk-6PKW4WCT.js} +2 -2
  13. package/dist/chunk-6RFNZ2ZZ.cjs +1 -1
  14. package/dist/chunk-6WMB5AJR.js +1 -1
  15. package/dist/chunk-7QQV66RX.cjs +1 -1
  16. package/dist/chunk-7WBMA2VE.cjs +1 -1
  17. package/dist/chunk-7ZNEUWYP.js +1 -1
  18. package/dist/chunk-A3YI6Y2P.js +1 -1
  19. package/dist/chunk-ABA2ZSBQ.js +1 -1
  20. package/dist/chunk-AKKM6MOX.cjs +1 -1
  21. package/dist/chunk-ATLFMKAF.cjs +1 -1
  22. package/dist/chunk-B4SDEBN7.cjs +1 -1
  23. package/dist/chunk-B6UIKBHR.cjs +1 -1
  24. package/dist/chunk-BAV5T2E3.cjs +1 -1
  25. package/dist/chunk-BG3AS5BU.cjs +173 -0
  26. package/dist/chunk-BYUT376O.cjs +1 -1
  27. package/dist/{chunk-RIEYB2AW.cjs → chunk-CKUEZF4R.cjs} +1 -1
  28. package/dist/chunk-D53CE4BT.js +1 -1
  29. package/dist/chunk-DPLL67OT.js +1 -1
  30. package/dist/chunk-DVMHRLKP.cjs +1 -1
  31. package/dist/chunk-EK7FSI7F.cjs +1 -1
  32. package/dist/chunk-F3WBQKRI.cjs +1 -1
  33. package/dist/chunk-FI76UZRF.js +1 -1
  34. package/dist/chunk-GAJBF6DR.js +1 -1
  35. package/dist/chunk-JY4HLZ4W.js +1 -1
  36. package/dist/chunk-K3SONK25.cjs +1 -1
  37. package/dist/chunk-K63WO3XA.cjs +1 -1
  38. package/dist/chunk-KHO2SBNA.cjs +1 -1
  39. package/dist/chunk-KPCDDYTZ.js +1 -1
  40. package/dist/chunk-KTQLDIIT.cjs +1 -1
  41. package/dist/chunk-L5RDAVVH.js +1 -1
  42. package/dist/chunk-LEX4TQW2.js +1 -1
  43. package/dist/chunk-LIU4S3JA.cjs +1 -1
  44. package/dist/chunk-NREACG6M.cjs +1 -1
  45. package/dist/chunk-OFBFGFVH.js +1 -1
  46. package/dist/chunk-ONZFBJVW.js +1 -1
  47. package/dist/chunk-OS5OT5JA.cjs +1 -1
  48. package/dist/chunk-PZQC3FZY.js +1 -1
  49. package/dist/chunk-QAPYHLHC.cjs +1 -1
  50. package/dist/chunk-QNKGP5DY.js +1 -1
  51. package/dist/chunk-QUITZ3GP.js +1 -1
  52. package/dist/{chunk-H5NWBTHW.cjs → chunk-R3PBF6F7.cjs} +11 -11
  53. package/dist/chunk-RMJC3B5P.cjs +1 -1
  54. package/dist/chunk-RS5RBLPB.js +1 -1
  55. package/dist/chunk-SZJ7OI4S.js +1 -1
  56. package/dist/chunk-TDPYR5JY.js +1 -1
  57. package/dist/chunk-TDYGYHSH.js +1 -1
  58. package/dist/chunk-TFDXRT6D.cjs +1 -1
  59. package/dist/chunk-TPYENEQ4.cjs +1 -1
  60. package/dist/{chunk-SN6YRDLG.js → chunk-U5VR4TJN.js} +1 -1
  61. package/dist/chunk-UDA26MCU.cjs +1 -1
  62. package/dist/chunk-UKAUXY2U.cjs +1 -1
  63. package/dist/chunk-VCVND6CH.js +1 -1
  64. package/dist/chunk-VJDDGRIK.cjs +1 -1
  65. package/dist/chunk-VJVCXEH7.cjs +1997 -0
  66. package/dist/chunk-VNADVWSJ.js +1 -1
  67. package/dist/chunk-WNO3EPYT.js +170 -0
  68. package/dist/chunk-WVSPXFTY.js +1 -1
  69. package/dist/chunk-XFTUHS4Y.js +1 -1
  70. package/dist/chunk-YC7AK3KX.cjs +1 -1
  71. package/dist/chunk-YGB2BQPB.cjs +1 -1
  72. package/dist/chunk-YS27V6LS.js +1994 -0
  73. package/dist/chunk-YWHHVDT4.js +1 -1
  74. package/dist/chunk-ZN53RM3R.js +1 -1
  75. package/dist/conversions/index.cjs +1 -1
  76. package/dist/conversions/index.d.ts +1 -1
  77. package/dist/conversions/index.js +1 -1
  78. package/dist/events/index.cjs +1 -1
  79. package/dist/events/index.d.ts +1 -1
  80. package/dist/events/index.js +1 -1
  81. package/dist/formatters/index.cjs +1 -1
  82. package/dist/formatters/index.d.ts +1 -1
  83. package/dist/formatters/index.js +1 -1
  84. package/dist/generators/index.cjs +1 -1
  85. package/dist/generators/index.d.ts +1 -1
  86. package/dist/generators/index.js +1 -1
  87. package/dist/index.d.ts +1 -1
  88. package/dist/isPlainObject-FWmcJF6k.d.ts +1 -1
  89. package/dist/next/index.cjs +9 -8
  90. package/dist/next/index.d.ts +1 -1
  91. package/dist/next/index.js +3 -2
  92. package/dist/next/server/index.cjs +1 -1
  93. package/dist/next/server/index.d.ts +1 -1
  94. package/dist/next/server/index.js +1 -1
  95. package/dist/operations/index.cjs +1 -1
  96. package/dist/operations/index.d.ts +1 -1
  97. package/dist/operations/index.js +1 -1
  98. package/dist/parsers/index.cjs +1 -1
  99. package/dist/parsers/index.d.ts +1 -1
  100. package/dist/parsers/index.js +1 -1
  101. package/dist/predicates/index.cjs +33 -28
  102. package/dist/predicates/index.d.ts +142 -2
  103. package/dist/predicates/index.js +3 -2
  104. package/dist/promises/index.cjs +1 -1
  105. package/dist/promises/index.d.ts +1 -1
  106. package/dist/promises/index.js +1 -1
  107. package/dist/rzl-utils.global.js +2 -2
  108. package/dist/strings/index.cjs +1 -1
  109. package/dist/strings/index.d.ts +1 -1
  110. package/dist/strings/index.js +1 -1
  111. package/dist/tailwind/index.cjs +1 -1
  112. package/dist/tailwind/index.d.ts +1 -1
  113. package/dist/tailwind/index.js +1 -1
  114. package/dist/urls/index.cjs +14 -9
  115. package/dist/urls/index.d.ts +268 -19
  116. package/dist/urls/index.js +4 -3
  117. package/package.json +11 -2
  118. package/dist/chunk-LBNOZIZ6.js +0 -90
  119. package/dist/chunk-URDI3IMY.cjs +0 -93
package/README.md CHANGED
@@ -134,7 +134,7 @@
134
134
 
135
135
  <h2 id="detailed-features">💎 <strong>Detailed Features</strong></h2>
136
136
 
137
- ### **Full documentation <a href="https://docs-rzl-utils-js.vercel.app" target="_blank" rel="nofollow noreferrer noopener">Rzl UtilsJS</a> is **currently under construction** 🏗️.**
137
+ ### **Full documentation <a href="https://rzlzone.pages.dev/docs/utils-js" target="_blank" rel="nofollow noreferrer noopener">Rzl UtilsJS</a> is **currently under construction** 🏗️.**
138
138
  #### For now, explore the examples or dive into the source — all utilities are documented via **TSDoc** and typed properly.
139
139
 
140
140
  ```ts
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.5.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -12,7 +12,7 @@ import { normalizeString } from './chunk-GAJBF6DR.js';
12
12
  import { toStringArrayUnRecursive } from './chunk-TDYGYHSH.js';
13
13
  import { isEmptyValue } from './chunk-PZQC3FZY.js';
14
14
  import { isInteger } from './chunk-WVSPXFTY.js';
15
- import { normalizePathname } from './chunk-LBNOZIZ6.js';
15
+ import { normalizePathname } from './chunk-WNO3EPYT.js';
16
16
  import { isEmptyString } from './chunk-JY4HLZ4W.js';
17
17
  import { assertIsArray } from './chunk-6WMB5AJR.js';
18
18
  import { safeStableStringify } from './chunk-2VO2CBTU.js';
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.5.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -0,0 +1,173 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.6.0.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
10
+ 'use strict';
11
+
12
+ var chunkVJVCXEH7_cjs = require('./chunk-VJVCXEH7.cjs');
13
+ var chunkLIU4S3JA_cjs = require('./chunk-LIU4S3JA.cjs');
14
+ var chunkNREACG6M_cjs = require('./chunk-NREACG6M.cjs');
15
+ var chunkYC7AK3KX_cjs = require('./chunk-YC7AK3KX.cjs');
16
+ var chunkF3WBQKRI_cjs = require('./chunk-F3WBQKRI.cjs');
17
+
18
+ var NormalizePathnameError = class _NormalizePathnameError extends Error {
19
+ /** * ***The original error that triggered this normalization failure.***
20
+ *
21
+ * **Always available for backward compatibility.**
22
+ */
23
+ originalError;
24
+ constructor(message, originalError) {
25
+ super(message, chunkF3WBQKRI_cjs.isFunction(Error) ? { cause: originalError } : void 0);
26
+ this.name = "NormalizePathnameError";
27
+ this.originalError = originalError;
28
+ if (chunkF3WBQKRI_cjs.isFunction(Error.captureStackTrace)) {
29
+ Error.captureStackTrace(this, _NormalizePathnameError);
30
+ } else {
31
+ this.stack = new Error(message).stack;
32
+ }
33
+ }
34
+ /** * ***Safe JSON representation for logging or IPC.*** */
35
+ toJSON() {
36
+ return {
37
+ name: this.name,
38
+ message: this.message,
39
+ stack: this.stack,
40
+ originalError: {
41
+ name: this.originalError.name,
42
+ message: this.originalError.message,
43
+ stack: this.originalError.stack
44
+ }
45
+ };
46
+ }
47
+ };
48
+
49
+ function normalizePathname(pathname, options = {
50
+ defaultPath: "/",
51
+ keepNullable: false
52
+ }) {
53
+ chunkF3WBQKRI_cjs.assertIsPlainObject(options, {
54
+ message({ currentType, validType }) {
55
+ return `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
56
+ }
57
+ });
58
+ const { defaultPath = "/", keepNullable = false, keepTrailingSlash = false } = options;
59
+ if (!chunkF3WBQKRI_cjs.isNonEmptyString(defaultPath)) {
60
+ throw new TypeError(
61
+ `Parameter \`defaultPath\` property of the \`options\` (second parameter) must be of type \`string\` and not empty-string, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
62
+ defaultPath
63
+ )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(defaultPath)}\`.`
64
+ );
65
+ }
66
+ chunkF3WBQKRI_cjs.assertIsBoolean(keepTrailingSlash, {
67
+ message({ currentType, validType }) {
68
+ return `Parameter \`keepTrailingSlash\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
69
+ }
70
+ });
71
+ try {
72
+ if (keepNullable && (chunkF3WBQKRI_cjs.isNil(pathname) || !chunkF3WBQKRI_cjs.isString(pathname))) {
73
+ if (chunkF3WBQKRI_cjs.isNull(pathname)) return null;
74
+ return void 0;
75
+ }
76
+ let currentPathName = chunkF3WBQKRI_cjs.isNonEmptyString(pathname) ? pathname : defaultPath;
77
+ currentPathName = chunkLIU4S3JA_cjs.removeSpaces(currentPathName, { trimOnly: true }).replace(
78
+ /\s+/g,
79
+ ""
80
+ );
81
+ currentPathName = stripLeadingDomain(currentPathName);
82
+ let _pathName = currentPathName;
83
+ let search = "";
84
+ let hash = "";
85
+ const searchIndex = currentPathName.indexOf("?");
86
+ const hashIndex = currentPathName.indexOf("#");
87
+ if (searchIndex !== -1) {
88
+ search = currentPathName.slice(
89
+ searchIndex,
90
+ hashIndex !== -1 ? hashIndex : void 0
91
+ );
92
+ }
93
+ if (hashIndex !== -1) {
94
+ hash = currentPathName.slice(hashIndex);
95
+ }
96
+ const endIndex = Math.min(
97
+ searchIndex !== -1 ? searchIndex : currentPathName.length,
98
+ hashIndex !== -1 ? hashIndex : currentPathName.length
99
+ );
100
+ _pathName = currentPathName.slice(0, endIndex);
101
+ _pathName = "/" + _pathName.replace(/^\/+/, "").replace(/\/{2,}/g, "/");
102
+ if (!keepTrailingSlash && _pathName !== "/") {
103
+ _pathName = _pathName.replace(/\/+$/, "");
104
+ }
105
+ _pathName = decodeUnicodeSequences(_pathName);
106
+ search = decodeUnicodeSequences(search);
107
+ hash = decodeUnicodeSequences(hash);
108
+ return _pathName + search + hash;
109
+ } catch (error) {
110
+ const err = chunkF3WBQKRI_cjs.isError(error) ? error : new Error("Unknown error from function `normalizePathname()`.");
111
+ throw new NormalizePathnameError(
112
+ `Failed to normalize pathname in function \`normalizePathname()\`: ${err.message}`,
113
+ err
114
+ );
115
+ }
116
+ }
117
+ function decodeUnicodeSequences(str) {
118
+ return str.replace(/(?:%(?:[0-9A-F]{2})){2,}/gi, (match) => {
119
+ try {
120
+ const decoded = decodeURIComponent(match);
121
+ if (/^[\u0000-\u007F]+$/.test(decoded)) return match;
122
+ return decoded;
123
+ } catch {
124
+ return match;
125
+ }
126
+ });
127
+ }
128
+ function stripLeadingDomain(path) {
129
+ let currentPath = path;
130
+ if (/^https?:\/\//i.test(currentPath)) {
131
+ try {
132
+ const url = new URL(currentPath);
133
+ currentPath = "/" + url.pathname.replace(/^\/+/, "").replace(/\/{2,}/g, "/") + url.search + url.hash;
134
+ } catch {
135
+ }
136
+ }
137
+ if (currentPath.startsWith("/")) {
138
+ currentPath = currentPath.replace(/\/{2,}/g, "/").slice(1);
139
+ }
140
+ const firstPart = currentPath.split("/")[0];
141
+ const domainPart = firstPart.split(":")[0];
142
+ if (chunkVJVCXEH7_cjs.isValidDomain(domainPart, {
143
+ subdomain: true,
144
+ allowUnicode: true,
145
+ wildcard: true,
146
+ topLevel: false
147
+ }) || domainPart === "localhost") {
148
+ currentPath = currentPath.slice(firstPart.length);
149
+ }
150
+ if (!currentPath.startsWith("/")) currentPath = "/" + currentPath;
151
+ return currentPath;
152
+ }
153
+
154
+ var formatEnvPort = (envVar, options = {}) => {
155
+ if (!chunkF3WBQKRI_cjs.isNonEmptyString(envVar)) return "";
156
+ chunkF3WBQKRI_cjs.assertIsPlainObject(options, {
157
+ message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
158
+ });
159
+ const prefixColon = chunkF3WBQKRI_cjs.hasOwnProp(options, "prefixColon") ? options.prefixColon : false;
160
+ if (!chunkF3WBQKRI_cjs.isBoolean(prefixColon)) {
161
+ throw new TypeError(
162
+ `Parameter \`prefixColon\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
163
+ prefixColon
164
+ )}\`.`
165
+ );
166
+ }
167
+ const digitsOnly = envVar.replace(/\D+/g, "");
168
+ if (chunkNREACG6M_cjs.isEmptyString(digitsOnly)) return "";
169
+ return prefixColon ? `:${digitsOnly}` : digitsOnly;
170
+ };
171
+
172
+ exports.formatEnvPort = formatEnvPort;
173
+ exports.normalizePathname = normalizePathname;
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.5.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.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.7.
5
+ * Version: 3.6.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================