@rzl-zone/utils-js 3.8.0 → 3.9.1
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
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.9.1.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var chunk6AMDHVS2_cjs = require('./chunk-6AMDHVS2.cjs');
|
|
13
|
+
var chunkIX6PF5ZP_cjs = require('./chunk-IX6PF5ZP.cjs');
|
|
14
|
+
var chunkFWWPEL7J_cjs = require('./chunk-FWWPEL7J.cjs');
|
|
15
|
+
var chunkH44QVAZL_cjs = require('./chunk-H44QVAZL.cjs');
|
|
16
|
+
var chunk7C7TQC5J_cjs = require('./chunk-7C7TQC5J.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, chunk7C7TQC5J_cjs.isFunction(Error) ? { cause: originalError } : void 0);
|
|
26
|
+
this.name = "NormalizePathnameError";
|
|
27
|
+
this.originalError = originalError;
|
|
28
|
+
if (chunk7C7TQC5J_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
|
+
chunk7C7TQC5J_cjs.assertIsPlainObject(options, {
|
|
54
|
+
message({ currentType, validType }) {
|
|
55
|
+
return `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const {
|
|
59
|
+
defaultPath = "/",
|
|
60
|
+
keepNullable = false,
|
|
61
|
+
keepTrailingSlash = false,
|
|
62
|
+
localhostDomain = false,
|
|
63
|
+
ignoreDomainExtensions = void 0
|
|
64
|
+
} = options;
|
|
65
|
+
if (!chunk7C7TQC5J_cjs.isNonEmptyString(defaultPath)) {
|
|
66
|
+
throw new TypeError(
|
|
67
|
+
`Parameter \`defaultPath\` property of the \`options\` (second parameter) must be of type \`string\` and not empty-string, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
68
|
+
defaultPath
|
|
69
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(defaultPath, {
|
|
70
|
+
keepUndefined: true
|
|
71
|
+
})}\`.`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
chunk7C7TQC5J_cjs.assertIsBoolean(keepNullable, {
|
|
75
|
+
message({ currentType, validType }) {
|
|
76
|
+
return `Parameter \`keepNullable\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
chunk7C7TQC5J_cjs.assertIsBoolean(keepTrailingSlash, {
|
|
80
|
+
message({ currentType, validType }) {
|
|
81
|
+
return `Parameter \`keepTrailingSlash\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
chunk7C7TQC5J_cjs.assertIsBoolean(localhostDomain, {
|
|
85
|
+
message({ currentType, validType }) {
|
|
86
|
+
return `Parameter \`localhostDomain\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
let ignoreDomainExtsSet;
|
|
90
|
+
if (!chunk7C7TQC5J_cjs.isUndefined(ignoreDomainExtensions)) {
|
|
91
|
+
if (!chunk7C7TQC5J_cjs.isSet(ignoreDomainExtensions) && !chunk7C7TQC5J_cjs.isArray(ignoreDomainExtensions)) {
|
|
92
|
+
throw new TypeError(
|
|
93
|
+
`Parameter \`ignoreDomainExtensions\` must be of type a \`Set<string>\` or \`string[]\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
94
|
+
ignoreDomainExtensions
|
|
95
|
+
)}\`.`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
ignoreDomainExtsSet = chunk7C7TQC5J_cjs.isSet(ignoreDomainExtensions) ? ignoreDomainExtensions : new Set(ignoreDomainExtensions);
|
|
99
|
+
let idx = 0;
|
|
100
|
+
for (const ext of ignoreDomainExtsSet) {
|
|
101
|
+
if (!chunk7C7TQC5J_cjs.isNonEmptyString(ext)) {
|
|
102
|
+
throw new TypeError(
|
|
103
|
+
`Parameter \`ignoreDomainExtensions[${idx}]\` must be a \`string\` and \`non-empty string\`, but received: \`${chunkH44QVAZL_cjs.safeStableStringify(
|
|
104
|
+
ext,
|
|
105
|
+
{ keepUndefined: true }
|
|
106
|
+
)}\`.`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
if (!ext.startsWith(".")) {
|
|
110
|
+
throw new TypeError(
|
|
111
|
+
`Parameter \`ignoreDomainExtensions[${idx}]\` must start with a dot (.), but received: ${chunkH44QVAZL_cjs.safeStableStringify(
|
|
112
|
+
ext,
|
|
113
|
+
{ keepUndefined: true }
|
|
114
|
+
)}`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
idx++;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
if (keepNullable && (chunk7C7TQC5J_cjs.isNil(pathname) || !chunk7C7TQC5J_cjs.isString(pathname))) {
|
|
122
|
+
if (chunk7C7TQC5J_cjs.isNull(pathname)) return null;
|
|
123
|
+
return void 0;
|
|
124
|
+
}
|
|
125
|
+
let currentPathName = chunk7C7TQC5J_cjs.isNonEmptyString(pathname) ? pathname : defaultPath;
|
|
126
|
+
currentPathName = chunkIX6PF5ZP_cjs.removeSpaces(currentPathName, { trimOnly: true }).replace(
|
|
127
|
+
/\s+/g,
|
|
128
|
+
""
|
|
129
|
+
);
|
|
130
|
+
currentPathName = stripLeadingDomain(currentPathName, {
|
|
131
|
+
keepTrailingSlash,
|
|
132
|
+
localhostDomain,
|
|
133
|
+
ignoreDomainExtensions: ignoreDomainExtsSet
|
|
134
|
+
});
|
|
135
|
+
let _pathName = currentPathName;
|
|
136
|
+
let search = "";
|
|
137
|
+
let hash = "";
|
|
138
|
+
const searchIndex = currentPathName.indexOf("?");
|
|
139
|
+
const hashIndex = currentPathName.indexOf("#");
|
|
140
|
+
if (searchIndex !== -1) {
|
|
141
|
+
search = currentPathName.slice(
|
|
142
|
+
searchIndex,
|
|
143
|
+
hashIndex !== -1 ? hashIndex : void 0
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
if (hashIndex !== -1) {
|
|
147
|
+
hash = currentPathName.slice(hashIndex);
|
|
148
|
+
}
|
|
149
|
+
const endIndex = Math.min(
|
|
150
|
+
searchIndex !== -1 ? searchIndex : currentPathName.length,
|
|
151
|
+
hashIndex !== -1 ? hashIndex : currentPathName.length
|
|
152
|
+
);
|
|
153
|
+
_pathName = currentPathName.slice(0, endIndex);
|
|
154
|
+
_pathName = "/" + _pathName.replace(/^\/+/, "").replace(/\/{2,}/g, "/");
|
|
155
|
+
if (!keepTrailingSlash && _pathName !== "/") {
|
|
156
|
+
_pathName = _pathName.replace(/\/+$/, "");
|
|
157
|
+
}
|
|
158
|
+
_pathName = decodeUnicodeSequences(_pathName);
|
|
159
|
+
search = decodeUnicodeSequences(search);
|
|
160
|
+
hash = decodeUnicodeSequences(hash);
|
|
161
|
+
return _pathName + search + hash;
|
|
162
|
+
} catch (error) {
|
|
163
|
+
throwError(error);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var decodeUnicodeSequences = (str) => {
|
|
167
|
+
return str.replace(/(?:%(?:[0-9A-F]{2})){2,}/gi, (match) => {
|
|
168
|
+
try {
|
|
169
|
+
const decoded = decodeURIComponent(match);
|
|
170
|
+
if (/^[\u0000-\u007F]+$/.test(decoded)) return match;
|
|
171
|
+
return decoded;
|
|
172
|
+
} catch {
|
|
173
|
+
return match;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
var stripLeadingDomain = (path, options) => {
|
|
178
|
+
let currentPath = path;
|
|
179
|
+
const { ignoreDomainExtensions, localhostDomain } = options;
|
|
180
|
+
if (/^https?:\/\//i.test(currentPath)) {
|
|
181
|
+
try {
|
|
182
|
+
const url = new URL(currentPath);
|
|
183
|
+
currentPath = url.pathname.replace(/^\/+/, "").replace(/\/{2,}/g, "/") + url.search + url.hash;
|
|
184
|
+
return ensureLeadingSlash(currentPath);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
throwError(error);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (currentPath.startsWith("/")) {
|
|
190
|
+
currentPath = currentPath.replace(/\/{2,}/g, "/").slice(1);
|
|
191
|
+
}
|
|
192
|
+
const segments = currentPath.split("/");
|
|
193
|
+
const firstPart = segments[0];
|
|
194
|
+
const domainPart = firstPart.split(":")[0];
|
|
195
|
+
const isDomain = chunk6AMDHVS2_cjs.isValidDomain(domainPart, {
|
|
196
|
+
subdomain: true,
|
|
197
|
+
allowUnicode: true,
|
|
198
|
+
wildcard: true,
|
|
199
|
+
allowLocalhost: localhostDomain,
|
|
200
|
+
allowPort: true,
|
|
201
|
+
allowProtocol: true,
|
|
202
|
+
topLevel: false
|
|
203
|
+
});
|
|
204
|
+
let hasIgnoredExtension = false;
|
|
205
|
+
if (ignoreDomainExtensions) {
|
|
206
|
+
for (const ext of ignoreDomainExtensions) {
|
|
207
|
+
if (firstPart.endsWith(ext)) {
|
|
208
|
+
hasIgnoredExtension = true;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (isDomain && !hasIgnoredExtension) {
|
|
214
|
+
segments.shift();
|
|
215
|
+
}
|
|
216
|
+
return ensureLeadingSlash(segments.join("/"));
|
|
217
|
+
};
|
|
218
|
+
var ensureLeadingSlash = (path) => {
|
|
219
|
+
if (!path.startsWith("/")) path = "/" + path;
|
|
220
|
+
return path;
|
|
221
|
+
};
|
|
222
|
+
var throwError = (error) => {
|
|
223
|
+
const err = chunk7C7TQC5J_cjs.isError(error) ? error : new Error("Unknown error from function `normalizePathname()`.");
|
|
224
|
+
throw new NormalizePathnameError(
|
|
225
|
+
`Failed to normalize pathname in function \`normalizePathname()\`: ${err.message}`,
|
|
226
|
+
err
|
|
227
|
+
);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
var formatEnvPort = (envVar, options = {}) => {
|
|
231
|
+
if (!chunk7C7TQC5J_cjs.isNonEmptyString(envVar)) return "";
|
|
232
|
+
chunk7C7TQC5J_cjs.assertIsPlainObject(options, {
|
|
233
|
+
message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
234
|
+
});
|
|
235
|
+
const prefixColon = chunk7C7TQC5J_cjs.hasOwnProp(options, "prefixColon") ? options.prefixColon : false;
|
|
236
|
+
if (!chunk7C7TQC5J_cjs.isBoolean(prefixColon)) {
|
|
237
|
+
throw new TypeError(
|
|
238
|
+
`Parameter \`prefixColon\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
239
|
+
prefixColon
|
|
240
|
+
)}\`.`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
const digitsOnly = envVar.replace(/\D+/g, "");
|
|
244
|
+
if (chunkFWWPEL7J_cjs.isEmptyString(digitsOnly)) return "";
|
|
245
|
+
return prefixColon ? `:${digitsOnly}` : digitsOnly;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
exports.formatEnvPort = formatEnvPort;
|
|
249
|
+
exports.normalizePathname = normalizePathname;
|
package/dist/chunk-ONZFBJVW.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.1.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.1.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import { isString, resolveErrorMessageAssertions } from './chunk-
|
|
10
|
+
import { isString, resolveErrorMessageAssertions } from './chunk-J4TT33ZX.js';
|
|
11
11
|
|
|
12
12
|
var assertIsString = (value, options = {}) => {
|
|
13
13
|
if (isString(value)) return;
|
|
14
|
-
|
|
14
|
+
resolveErrorMessageAssertions({
|
|
15
15
|
value,
|
|
16
16
|
options,
|
|
17
17
|
requiredValidType: "string"
|
|
18
18
|
});
|
|
19
|
-
throw new TypeError(errorMessage);
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
export { assertIsString };
|
|
@@ -2,23 +2,22 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.1.
|
|
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
|
|
|
14
14
|
function assertIsArray(value, options) {
|
|
15
|
-
if (
|
|
16
|
-
|
|
15
|
+
if (chunk7C7TQC5J_cjs.isArray(value)) return;
|
|
16
|
+
chunk7C7TQC5J_cjs.resolveErrorMessageAssertions({
|
|
17
17
|
value,
|
|
18
18
|
options,
|
|
19
19
|
requiredValidType: "array"
|
|
20
20
|
});
|
|
21
|
-
throw new TypeError(errorMessage);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
exports.assertIsArray = assertIsArray;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.1.
|
|
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
|
|
|
14
14
|
function isFinite(value) {
|
|
15
|
-
return
|
|
15
|
+
return chunk7C7TQC5J_cjs.isNumber(value) && Number.isFinite(value);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
exports.isFinite = isFinite;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.1.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var chunkH44QVAZL_cjs = require('./chunk-H44QVAZL.cjs');
|
|
14
|
+
var chunk7C7TQC5J_cjs = require('./chunk-7C7TQC5J.cjs');
|
|
15
15
|
|
|
16
16
|
var CustomPromise = class extends Promise {
|
|
17
17
|
_value;
|
|
@@ -74,14 +74,14 @@ var AbortError = class extends Error {
|
|
|
74
74
|
var delay = (milliSeconds = 1e3, signal) => {
|
|
75
75
|
if (!chunkDVMHRLKP_cjs.isInteger(milliSeconds) || milliSeconds <= 0) {
|
|
76
76
|
throw new TypeError(
|
|
77
|
-
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${
|
|
77
|
+
`First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
78
78
|
milliSeconds
|
|
79
|
-
)}\`, with value: \`${
|
|
79
|
+
)}\`, with value: \`${chunkH44QVAZL_cjs.safeStableStringify(milliSeconds, {
|
|
80
80
|
keepUndefined: true
|
|
81
81
|
})}\`.`
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
84
|
+
if (chunk7C7TQC5J_cjs.isNull(signal) || signal && !(signal instanceof AbortSignal)) {
|
|
85
85
|
throw new TypeError(
|
|
86
86
|
"Second parameter (`signal`) must be an `instance of AbortSignal` if provided."
|
|
87
87
|
);
|
package/dist/chunk-QNKGP5DY.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.9.1.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|