@rzl-zone/utils-js 3.7.1 → 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 +28 -1
- package/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +169 -58
- 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-5Y6JL47L.js +302 -0
- package/dist/{chunk-KIYALQQF.cjs → chunk-62FS7WMB.cjs} +35 -35
- package/dist/{chunk-VJVCXEH7.cjs → chunk-6AMDHVS2.cjs} +9 -181
- package/dist/{chunk-6PKW4WCT.js → chunk-6WVOUVWD.js} +27 -15
- package/dist/{chunk-BYUT376O.cjs → chunk-76ATVDCR.cjs} +3 -3
- package/dist/{chunk-F3WBQKRI.cjs → chunk-7C7TQC5J.cjs} +29 -7
- package/dist/{chunk-QUITZ3GP.js → chunk-7EIFPHV3.js} +32 -16
- 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-XFTUHS4Y.js → chunk-DXPM4NOU.js} +10 -8
- 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-KTQLDIIT.cjs → chunk-JI57K7D4.cjs} +173 -163
- package/dist/{chunk-OFBFGFVH.js → chunk-JYOCB6OV.js} +2 -2
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-66WLOZOD.cjs → chunk-KUVRZ2JW.cjs} +53 -51
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-VCVND6CH.js → chunk-M5QB2GM5.js} +2 -2
- package/dist/{chunk-3LEWQV3R.js → chunk-MBFVTGYS.js} +8 -8
- 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-NJ24M6ZH.cjs +308 -0
- 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-2CQI36UD.cjs → chunk-QGTFQ7RO.cjs} +8 -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-WNO3EPYT.js → chunk-R2DR7SPJ.js} +102 -26
- package/dist/{chunk-TDYGYHSH.js → chunk-SN5HAK3Y.js} +4 -4
- package/dist/{chunk-D53CE4BT.js → chunk-SRWL4YCP.js} +11 -8
- 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-R3PBF6F7.cjs → chunk-UFYMRRJH.cjs} +73 -61
- package/dist/{chunk-5NN4ZDE2.cjs → chunk-UV5BKAYW.cjs} +6 -8
- package/dist/{chunk-GAJBF6DR.js → chunk-UXT4XSUK.js} +2 -2
- package/dist/{chunk-TDPYR5JY.js → chunk-VBSLIIDB.js} +24 -14
- package/dist/chunk-VCYXNIZ2.cjs +678 -0
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/{chunk-VNADVWSJ.js → chunk-WB3FT62A.js} +6 -4
- package/dist/{chunk-K63WO3XA.cjs → chunk-WKM6UVMG.cjs} +4 -5
- package/dist/{chunk-OS5OT5JA.cjs → chunk-WLEZ2KSG.cjs} +142 -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-RMJC3B5P.cjs → chunk-YQHJB7KR.cjs} +30 -27
- 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 +10 -12
- package/dist/conversions/index.js +15 -15
- package/dist/events/index.cjs +8 -8
- package/dist/events/index.d.ts +9 -9
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +19 -19
- package/dist/formatters/index.d.ts +19 -24
- package/dist/formatters/index.js +9 -9
- package/dist/generators/index.cjs +12 -8
- package/dist/generators/index.d.ts +155 -26
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/{isPlainObject-FWmcJF6k.d.ts → isPlainObject-BTPjv6zB.d.ts} +2 -2
- package/dist/next/index.cjs +39 -36
- package/dist/next/index.d.ts +11 -11
- package/dist/next/index.js +12 -9
- package/dist/next/server/index.cjs +4 -4
- package/dist/next/server/index.d.ts +4 -4
- package/dist/next/server/index.js +2 -2
- package/dist/operations/index.cjs +11 -11
- package/dist/operations/index.d.ts +8 -9
- 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 +15 -28
- package/dist/predicates/index.js +14 -13
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +5 -7
- 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 +18 -18
- package/dist/tailwind/index.js +5 -5
- package/dist/urls/index.cjs +23 -21
- package/dist/urls/index.d.ts +188 -121
- package/dist/urls/index.js +16 -14
- package/package.json +1 -1
- package/dist/chunk-ABA2ZSBQ.js +0 -152
- package/dist/chunk-BG3AS5BU.cjs +0 -173
- package/dist/chunk-K3SONK25.cjs +0 -157
- package/dist/chunk-KPCDDYTZ.js +0 -417
- package/dist/chunk-QAPYHLHC.cjs +0 -419
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ====================================================
|
|
3
|
+
* Rzl Utils-JS.
|
|
4
|
+
* ----------------------------------------------------
|
|
5
|
+
* Version: 3.9.0.
|
|
6
|
+
* Author: Rizalvin Dwiky.
|
|
7
|
+
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
|
+
* ====================================================
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var chunkWKM6UVMG_cjs = require('./chunk-WKM6UVMG.cjs');
|
|
13
|
+
var chunk7C7TQC5J_cjs = require('./chunk-7C7TQC5J.cjs');
|
|
14
|
+
|
|
15
|
+
var maxInt = 2147483647;
|
|
16
|
+
var base = 36;
|
|
17
|
+
var tMin = 1;
|
|
18
|
+
var tMax = 26;
|
|
19
|
+
var skew = 38;
|
|
20
|
+
var damp = 700;
|
|
21
|
+
var initialBias = 72;
|
|
22
|
+
var initialN = 128;
|
|
23
|
+
var delimiter = "-";
|
|
24
|
+
var regexPunycode = /^xn--/;
|
|
25
|
+
var regexNonASCII = /[^\0-\x7F]/;
|
|
26
|
+
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
|
|
27
|
+
var errors = {
|
|
28
|
+
overflow: "Overflow: input needs wider integers to process",
|
|
29
|
+
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
30
|
+
"invalid-input": "Invalid input"
|
|
31
|
+
};
|
|
32
|
+
var floor = Math.floor;
|
|
33
|
+
var stringFromCharCode = String.fromCharCode;
|
|
34
|
+
function error(type) {
|
|
35
|
+
throw new RangeError(errors[type]);
|
|
36
|
+
}
|
|
37
|
+
function map(array, fn) {
|
|
38
|
+
const result = [];
|
|
39
|
+
let length = array.length;
|
|
40
|
+
while (length--) result[length] = fn(array[length]);
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
function mapDomain(domain, fn) {
|
|
44
|
+
const parts = domain.split("@");
|
|
45
|
+
let result = "";
|
|
46
|
+
if (parts.length > 1) {
|
|
47
|
+
result = parts[0] + "@";
|
|
48
|
+
domain = parts[1];
|
|
49
|
+
}
|
|
50
|
+
domain = domain.replace(regexSeparators, ".");
|
|
51
|
+
const labels = domain.split(".");
|
|
52
|
+
return result + map(labels, fn).join(".");
|
|
53
|
+
}
|
|
54
|
+
function ucs2decode(input) {
|
|
55
|
+
chunkWKM6UVMG_cjs.assertIsString(input, {
|
|
56
|
+
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.ucs2.decode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
57
|
+
});
|
|
58
|
+
const output = [];
|
|
59
|
+
let counter = 0;
|
|
60
|
+
const length = input.length;
|
|
61
|
+
while (counter < length) {
|
|
62
|
+
const value = input.charCodeAt(counter++);
|
|
63
|
+
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
64
|
+
const extra = input.charCodeAt(counter++);
|
|
65
|
+
if ((extra & 64512) === 56320)
|
|
66
|
+
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
67
|
+
else {
|
|
68
|
+
output.push(value);
|
|
69
|
+
counter--;
|
|
70
|
+
}
|
|
71
|
+
} else output.push(value);
|
|
72
|
+
}
|
|
73
|
+
return output;
|
|
74
|
+
}
|
|
75
|
+
var ucs2encode = (points) => {
|
|
76
|
+
if (!Array.isArray(points) || !points.every((p) => typeof p === "number" && Number.isFinite(p))) {
|
|
77
|
+
throw new TypeError(
|
|
78
|
+
`Utils \`punycodeUtilsJS.ucs2.encode\`, parameter \`points\` must be an array of numbers, but received: \`${chunk7C7TQC5J_cjs.getPreciseType(
|
|
79
|
+
points
|
|
80
|
+
)}\`.`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return String.fromCodePoint(...points);
|
|
84
|
+
};
|
|
85
|
+
function basicToDigit(codePoint) {
|
|
86
|
+
if (codePoint >= 48 && codePoint < 58) return 26 + (codePoint - 48);
|
|
87
|
+
if (codePoint >= 65 && codePoint < 91) return codePoint - 65;
|
|
88
|
+
if (codePoint >= 97 && codePoint < 123) return codePoint - 97;
|
|
89
|
+
return base;
|
|
90
|
+
}
|
|
91
|
+
function digitToBasic(digit, flag) {
|
|
92
|
+
return digit + 22 + 75 * (digit < 26 ? 1 : 0) - Number(flag !== 0) * 32;
|
|
93
|
+
}
|
|
94
|
+
function adapt(delta, numPoints, firstTime) {
|
|
95
|
+
let k = 0;
|
|
96
|
+
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
97
|
+
delta += floor(delta / numPoints);
|
|
98
|
+
while (delta > (base - tMin) * tMax >> 1) {
|
|
99
|
+
delta = floor(delta / (base - tMin));
|
|
100
|
+
k += base;
|
|
101
|
+
}
|
|
102
|
+
return floor(k + (base - tMin + 1) * delta / (delta + skew));
|
|
103
|
+
}
|
|
104
|
+
function decode(input) {
|
|
105
|
+
chunkWKM6UVMG_cjs.assertIsString(input, {
|
|
106
|
+
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.decode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
107
|
+
});
|
|
108
|
+
const output = [];
|
|
109
|
+
const inputLength = input.length;
|
|
110
|
+
let i = 0, n = initialN, bias = initialBias;
|
|
111
|
+
let basic = input.lastIndexOf(delimiter);
|
|
112
|
+
if (basic < 0) basic = 0;
|
|
113
|
+
for (let j = 0; j < basic; j++) {
|
|
114
|
+
if (input.charCodeAt(j) >= 128) error("not-basic");
|
|
115
|
+
output.push(input.charCodeAt(j));
|
|
116
|
+
}
|
|
117
|
+
for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
118
|
+
const oldi = i;
|
|
119
|
+
let w = 1;
|
|
120
|
+
for (let k = base; ; k += base) {
|
|
121
|
+
if (index >= inputLength) error("invalid-input");
|
|
122
|
+
const digit = basicToDigit(input.charCodeAt(index++));
|
|
123
|
+
if (digit >= base) error("invalid-input");
|
|
124
|
+
if (digit > floor((maxInt - i) / w)) error("overflow");
|
|
125
|
+
i += digit * w;
|
|
126
|
+
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
127
|
+
if (digit < t) break;
|
|
128
|
+
const baseMinusT = base - t;
|
|
129
|
+
if (w > floor(maxInt / baseMinusT)) error("overflow");
|
|
130
|
+
w *= baseMinusT;
|
|
131
|
+
}
|
|
132
|
+
const out = output.length + 1;
|
|
133
|
+
bias = adapt(i - oldi, out, oldi === 0);
|
|
134
|
+
if (floor(i / out) > maxInt - n) error("overflow");
|
|
135
|
+
n += floor(i / out);
|
|
136
|
+
i %= out;
|
|
137
|
+
output.splice(i++, 0, n);
|
|
138
|
+
}
|
|
139
|
+
return String.fromCodePoint(...output);
|
|
140
|
+
}
|
|
141
|
+
function encode(input) {
|
|
142
|
+
chunkWKM6UVMG_cjs.assertIsString(input, {
|
|
143
|
+
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.encode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
144
|
+
});
|
|
145
|
+
const output = [];
|
|
146
|
+
const points = ucs2decode(input);
|
|
147
|
+
const inputLength = points.length;
|
|
148
|
+
let n = initialN, delta = 0, bias = initialBias;
|
|
149
|
+
for (const cp of points) if (cp < 128) output.push(stringFromCharCode(cp));
|
|
150
|
+
const basicLength = output.length;
|
|
151
|
+
let handledCPCount = basicLength;
|
|
152
|
+
if (basicLength) output.push(delimiter);
|
|
153
|
+
while (handledCPCount < inputLength) {
|
|
154
|
+
let m = maxInt;
|
|
155
|
+
for (const cp of points) if (cp >= n && cp < m) m = cp;
|
|
156
|
+
const handledCPCountPlusOne = handledCPCount + 1;
|
|
157
|
+
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) error("overflow");
|
|
158
|
+
delta += (m - n) * handledCPCountPlusOne;
|
|
159
|
+
n = m;
|
|
160
|
+
for (const cp of points) {
|
|
161
|
+
if (cp < n) delta++;
|
|
162
|
+
if (cp === n) {
|
|
163
|
+
let q = delta;
|
|
164
|
+
for (let k = base; ; k += base) {
|
|
165
|
+
const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
166
|
+
if (q < t) break;
|
|
167
|
+
output.push(stringFromCharCode(digitToBasic(t + (q - t) % (base - t), 0)));
|
|
168
|
+
q = floor((q - t) / (base - t));
|
|
169
|
+
}
|
|
170
|
+
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
171
|
+
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
|
|
172
|
+
delta = 0;
|
|
173
|
+
handledCPCount++;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
delta++;
|
|
177
|
+
n++;
|
|
178
|
+
}
|
|
179
|
+
return output.join("");
|
|
180
|
+
}
|
|
181
|
+
function toUnicode(input) {
|
|
182
|
+
chunkWKM6UVMG_cjs.assertIsString(input, {
|
|
183
|
+
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.toUnicode\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
184
|
+
});
|
|
185
|
+
return mapDomain(
|
|
186
|
+
input,
|
|
187
|
+
(str) => regexPunycode.test(str) ? decode(str.slice(4).toLowerCase()) : str
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function toASCII(input) {
|
|
191
|
+
chunkWKM6UVMG_cjs.assertIsString(input, {
|
|
192
|
+
message: ({ currentType, validType }) => `Utils \`punycodeUtilsJS.toASCII\`, parameter \`input\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
|
|
193
|
+
});
|
|
194
|
+
return mapDomain(
|
|
195
|
+
input,
|
|
196
|
+
(str) => regexNonASCII.test(str) ? "xn--" + encode(str) : str
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
var punycodeUtilsJS = {
|
|
200
|
+
version: "1.0.0",
|
|
201
|
+
ucs2: {
|
|
202
|
+
decode: ucs2decode,
|
|
203
|
+
encode: ucs2encode
|
|
204
|
+
},
|
|
205
|
+
decode,
|
|
206
|
+
encode,
|
|
207
|
+
toASCII,
|
|
208
|
+
toUnicode
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
exports.punycodeUtilsJS = punycodeUtilsJS;
|
|
@@ -2,103 +2,103 @@
|
|
|
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
|
-
var
|
|
15
|
-
require('../chunk-
|
|
16
|
-
var
|
|
17
|
-
require('../chunk-
|
|
18
|
-
require('../chunk-
|
|
19
|
-
require('../chunk-
|
|
20
|
-
var
|
|
21
|
-
require('../chunk-
|
|
22
|
-
require('../chunk-
|
|
23
|
-
require('../chunk-
|
|
12
|
+
var chunkJI57K7D4_cjs = require('../chunk-JI57K7D4.cjs');
|
|
13
|
+
require('../chunk-ALRISPTL.cjs');
|
|
14
|
+
var chunkI33PB44Q_cjs = require('../chunk-I33PB44Q.cjs');
|
|
15
|
+
require('../chunk-MMRHKYT6.cjs');
|
|
16
|
+
var chunk2XGQQZ6A_cjs = require('../chunk-2XGQQZ6A.cjs');
|
|
17
|
+
require('../chunk-PWKOFPAH.cjs');
|
|
18
|
+
require('../chunk-FWWPEL7J.cjs');
|
|
19
|
+
require('../chunk-WKM6UVMG.cjs');
|
|
20
|
+
var chunkKUVRZ2JW_cjs = require('../chunk-KUVRZ2JW.cjs');
|
|
21
|
+
require('../chunk-TJ5OY6MC.cjs');
|
|
22
|
+
require('../chunk-NAOVH4OH.cjs');
|
|
23
|
+
require('../chunk-OYFUBKEG.cjs');
|
|
24
24
|
require('../chunk-BAV5T2E3.cjs');
|
|
25
|
-
var
|
|
25
|
+
var chunkH44QVAZL_cjs = require('../chunk-H44QVAZL.cjs');
|
|
26
26
|
require('../chunk-UDA26MCU.cjs');
|
|
27
|
-
require('../chunk-
|
|
27
|
+
require('../chunk-7C7TQC5J.cjs');
|
|
28
28
|
|
|
29
29
|
Object.defineProperty(exports, "convertType", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkJI57K7D4_cjs.convertType; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "dedupeArray", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkJI57K7D4_cjs.dedupeArray; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "removeObjectPaths", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkJI57K7D4_cjs.removeObjectPaths; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "toBooleanContent", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkJI57K7D4_cjs.toBooleanContent; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "toBooleanContentDeep", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkJI57K7D4_cjs.toBooleanContentDeep; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "toBooleanExplicit", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkJI57K7D4_cjs.toBooleanExplicit; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "toBooleanLoose", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkJI57K7D4_cjs.toBooleanLoose; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "toNumberArrayUnRecursive", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkJI57K7D4_cjs.toNumberArrayUnRecursive; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "toNumberDeep", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkJI57K7D4_cjs.toNumberDeep; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "toStringDeep", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkJI57K7D4_cjs.toStringDeep; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "toStringDeepForce", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkJI57K7D4_cjs.toStringDeepForce; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "filterNilArray", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkI33PB44Q_cjs.filterNilArray; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "toStringArrayUnRecursive", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkI33PB44Q_cjs.toStringArrayUnRecursive; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "parseCurrencyString", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunk2XGQQZ6A_cjs.parseCurrencyString; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "cleanParsedData", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkKUVRZ2JW_cjs.cleanParsedData; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "extractDigits", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkKUVRZ2JW_cjs.extractDigits; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "parseCustomDate", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkKUVRZ2JW_cjs.parseCustomDate; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "safeJsonParse", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkKUVRZ2JW_cjs.safeJsonParse; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "safeStableStringify", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkH44QVAZL_cjs.safeStableStringify; }
|
|
104
104
|
});
|
|
@@ -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
|
* ====================================================
|
|
@@ -72,7 +72,7 @@ removeInvalidValueNumber?:T;};
|
|
|
72
72
|
* - Other values ➔ coerced into `undefined`.
|
|
73
73
|
* - Invalid values can be **removed** (`removeInvalidValueNumber: true`) or **kept** (`false`).
|
|
74
74
|
* - **ℹ️ Note:**
|
|
75
|
-
* - _For recursive / nested arrays, use
|
|
75
|
+
* - _For recursive / nested arrays, use ***`toNumberDeep` utility function*** instead._
|
|
76
76
|
* @template T - Element type of the input array.
|
|
77
77
|
* @template R - Whether invalid values should be removed (`true`) or kept (`false`).
|
|
78
78
|
* @param {Array<T> | readonly T[] | null | undefined} [array] - The array to convert, returns `undefined` if not an array.
|
|
@@ -154,7 +154,7 @@ removeInvalidValue?:T;};
|
|
|
154
154
|
* - Other unsupported types will be converted to `undefined` (and removed
|
|
155
155
|
* if `removeInvalidValue=true`).
|
|
156
156
|
* - **ℹ️ Note:**
|
|
157
|
-
* - _For recursive / nested arrays, use
|
|
157
|
+
* - _For recursive / nested arrays, use ***`toStringDeep` utility function*** instead._
|
|
158
158
|
* @template T - Element type of the input array.
|
|
159
159
|
* @template R - Whether invalid values should be removed (`true`) or kept (`false`).
|
|
160
160
|
* @param {Array<string | number | bigint | boolean | null | undefined> | null | undefined} [array] - The array to convert, returns `undefined` if not an array.
|
|
@@ -220,7 +220,7 @@ flatten?:Fl;};
|
|
|
220
220
|
* @param {unknown[]} inputArray - The array to deduplicate, can be deeply nested and contain any mix of types.
|
|
221
221
|
* @param {DedupeArrayOptions<ForceToString, Flattening>|undefined} [options] - Options to control string conversion.
|
|
222
222
|
* @returns {DedupeResult<ForceToString, Flattening>} Deduplicated array with optional transformations.
|
|
223
|
-
* @throws {TypeError}
|
|
223
|
+
* @throws **{@link TypeError | `TypeError`}** if the input is not an array, or options is not an object, or if `forceToString` is invalid.
|
|
224
224
|
* @example
|
|
225
225
|
* ```ts
|
|
226
226
|
* dedupeArray(["apple", "banana", "apple"]);
|
|
@@ -430,7 +430,7 @@ includeIndeterminate?:boolean;};
|
|
|
430
430
|
* @param {ToBooleanExplicitOptions["trimString"]} [options.trimString=true] - Whether to trim whitespace before comparison, default: `true`.
|
|
431
431
|
* @param {ToBooleanExplicitOptions["includeIndeterminate"]} [options.includeIndeterminate=false] - If `true`, the string `"indeterminate"` is considered a truthy value, defaults to `false`.
|
|
432
432
|
* @returns {boolean} Return `true` if the value matches a truthy representation, otherwise `false`.
|
|
433
|
-
* @throws {TypeError}
|
|
433
|
+
* @throws **{@link TypeError | `TypeError`}** if any option provided is not a boolean.
|
|
434
434
|
* @example
|
|
435
435
|
* toBooleanExplicit(1);
|
|
436
436
|
* // ➔ true
|
|
@@ -703,7 +703,7 @@ checkSymbols?:boolean;};
|
|
|
703
703
|
* @param {*} data - The parsed JSON data.
|
|
704
704
|
* @param {ParseParsedDataOptions} [options] - The cleaning options.
|
|
705
705
|
* @returns {T | null | undefined} The cleaned data.
|
|
706
|
-
* - ***⚠️ Notice:*** _If data is JSON string, we recommend use
|
|
706
|
+
* - ***⚠️ Notice:*** _If data is JSON string, we recommend use ***`safeJsonParse` utility function*** for more safe._
|
|
707
707
|
* - ***⚠️ Note:*** _If using **`convertDates`** **options**, result may contain Date objects, you may need type assertions in strict TypeScript settings._
|
|
708
708
|
* @example
|
|
709
709
|
* ```ts
|
|
@@ -728,7 +728,7 @@ declare const cleanParsedData:<T=unknown>(data:T,options?:ParseParsedDataOptions
|
|
|
728
728
|
* @param {string} dateString - Date string to parse.
|
|
729
729
|
* @param {string} format - Date format to match.
|
|
730
730
|
* @returns {Date | null} Returns a `Date` object if valid, otherwise `null`.
|
|
731
|
-
* @throws {TypeError
|
|
731
|
+
* @throws **{@link TypeError | `TypeError`}** if `dateString` **(first parameter)** and `format` **(second parameter)** is not a string or empty-string.
|
|
732
732
|
* @example
|
|
733
733
|
* // Valid: European format (DD/MM/YYYY)
|
|
734
734
|
* const date1 = parseCustomDate("03/09/2025", "DD/MM/YYYY");
|
|
@@ -797,7 +797,7 @@ type SafeJsonParseResult<TData,T>=IfNotExtends<T,NonJsonParsableType>extends tru
|
|
|
797
797
|
* @param {ParseParsedDataOptions} [options] - Options to clean, convert types, enable strict mode,
|
|
798
798
|
* support custom date formats, enable logging, or handle errors via callback.
|
|
799
799
|
* @returns {SafeJsonParseResult<TData, TInput>} Parsed and optionally cleaned result, or `null`/`undefined`.
|
|
800
|
-
* @throws {TypeError}
|
|
800
|
+
* @throws **{@link TypeError | `TypeError`}** if `options` is provided but not a valid object.
|
|
801
801
|
* @example
|
|
802
802
|
* 1. ***Basic parse with number & boolean conversion:***
|
|
803
803
|
* ```ts
|
|
@@ -1038,8 +1038,7 @@ type ResultRemoveObjectPaths<T,K extends readonly ConfigRemoveObjectPaths<T>[]>=
|
|
|
1038
1038
|
* @returns {Partial<T>}
|
|
1039
1039
|
* - A new object with specified keys removed if `deepClone` is `true`.
|
|
1040
1040
|
* - The *same mutated object* if `deepClone` is `false`.
|
|
1041
|
-
* @throws {TypeError}
|
|
1042
|
-
* - If `keysToDelete` is not an array of `{ key, deep? }` objects.
|
|
1041
|
+
* @throws **{@link TypeError | `TypeError`}** if `keysToDelete` is not an array of `{ key, deep? }` objects.
|
|
1043
1042
|
* @example
|
|
1044
1043
|
* // Shallow deletion
|
|
1045
1044
|
* removeObjectPaths(
|
|
@@ -1199,8 +1198,7 @@ keepUndefined?:boolean;};
|
|
|
1199
1198
|
* - `pretty` (boolean) – Whether to pretty-print JSON output with 2-space indentation, default: `false`.
|
|
1200
1199
|
* @returns {string}
|
|
1201
1200
|
* A stable JSON string representation of the input value.
|
|
1202
|
-
* @throws {TypeError}
|
|
1203
|
-
* Throws if `sortKeys`, `sortArray`, or `pretty` are not strictly boolean.
|
|
1201
|
+
* @throws **{@link TypeError | `TypeError`}** if `sortKeys`, `sortArray`, or `pretty` are not strictly boolean.
|
|
1204
1202
|
* @example
|
|
1205
1203
|
* ```ts
|
|
1206
1204
|
* // Basic object key sorting
|
|
@@ -2,24 +2,24 @@
|
|
|
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 { convertType, dedupeArray, removeObjectPaths, toBooleanContent, toBooleanContentDeep, toBooleanExplicit, toBooleanLoose, toNumberArrayUnRecursive, toNumberDeep, toStringDeep, toStringDeepForce } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
export { filterNilArray, toStringArrayUnRecursive } from '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
export { parseCurrencyString } from '../chunk-
|
|
15
|
-
import '../chunk-
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import '../chunk-
|
|
18
|
-
export { cleanParsedData, extractDigits, parseCustomDate, safeJsonParse } from '../chunk-
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-
|
|
10
|
+
export { convertType, dedupeArray, removeObjectPaths, toBooleanContent, toBooleanContentDeep, toBooleanExplicit, toBooleanLoose, toNumberArrayUnRecursive, toNumberDeep, toStringDeep, toStringDeepForce } from '../chunk-VBSLIIDB.js';
|
|
11
|
+
import '../chunk-WRGN6UBK.js';
|
|
12
|
+
export { filterNilArray, toStringArrayUnRecursive } from '../chunk-SN5HAK3Y.js';
|
|
13
|
+
import '../chunk-44X74C26.js';
|
|
14
|
+
export { parseCurrencyString } from '../chunk-EJV5AF4L.js';
|
|
15
|
+
import '../chunk-MZ3T6L7Z.js';
|
|
16
|
+
import '../chunk-5O66AUEC.js';
|
|
17
|
+
import '../chunk-OSSFLQDD.js';
|
|
18
|
+
export { cleanParsedData, extractDigits, parseCustomDate, safeJsonParse } from '../chunk-DXPM4NOU.js';
|
|
19
|
+
import '../chunk-J6VLFVIL.js';
|
|
20
|
+
import '../chunk-M5QB2GM5.js';
|
|
21
|
+
import '../chunk-TXOVQZPU.js';
|
|
22
22
|
import '../chunk-YWHHVDT4.js';
|
|
23
|
-
export { safeStableStringify } from '../chunk-
|
|
23
|
+
export { safeStableStringify } from '../chunk-X6ULJZ3X.js';
|
|
24
24
|
import '../chunk-QNKGP5DY.js';
|
|
25
|
-
import '../chunk-
|
|
25
|
+
import '../chunk-J4TT33ZX.js';
|
package/dist/events/index.cjs
CHANGED
|
@@ -2,31 +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
|
|
12
|
+
var chunkYVRUY4EW_cjs = require('../chunk-YVRUY4EW.cjs');
|
|
13
13
|
require('../chunk-VJDDGRIK.cjs');
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-WKM6UVMG.cjs');
|
|
15
|
+
require('../chunk-7C7TQC5J.cjs');
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "disableUserInteraction", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkYVRUY4EW_cjs.disableUserInteraction; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "enableUserInteraction", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkYVRUY4EW_cjs.enableUserInteraction; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "removeElementFocus", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkYVRUY4EW_cjs.removeElementFocus; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "scrollToTop", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkYVRUY4EW_cjs.scrollToTop; }
|
|
32
32
|
});
|
package/dist/events/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
|
* ====================================================
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* - Throws `TypeError` if the `className` parameter is not a string.
|
|
26
26
|
* @defaultValue `"on_processing"`
|
|
27
27
|
* @param {string} [className="on_processing"] - The CSS class to add, defaults to `"on_processing"`.
|
|
28
|
-
* @returns {void} Does not return anything.
|
|
29
|
-
* @throws {TypeError}
|
|
28
|
+
* @returns {void} Does not return anything (void).
|
|
29
|
+
* @throws **{@link TypeError | `TypeError`}** if `className` is not a string.
|
|
30
30
|
* @example
|
|
31
31
|
* * ***Example in your code:***
|
|
32
32
|
* ```ts
|
|
@@ -69,8 +69,8 @@ declare const disableUserInteraction:(className?:string)=>void;
|
|
|
69
69
|
* - Throws `TypeError` if the `className` parameter is not a string.
|
|
70
70
|
* @defaultValue `"on_processing"`
|
|
71
71
|
* @param {string} [className="on_processing"] - The CSS class to remove, defaults to `"on_processing"`.
|
|
72
|
-
* @returns {void} Does not return anything.
|
|
73
|
-
* @throws {TypeError}
|
|
72
|
+
* @returns {void} Does not return anything (void).
|
|
73
|
+
* @throws **{@link TypeError | `TypeError`}** if `className` is not a string.
|
|
74
74
|
* @example
|
|
75
75
|
* * ***Example in your code:***
|
|
76
76
|
* ```ts
|
|
@@ -100,10 +100,10 @@ declare const enableUserInteraction:(className?:string)=>void;
|
|
|
100
100
|
* ----------------------------------------------------------
|
|
101
101
|
* **Removes focus from the currently active element in the document.**
|
|
102
102
|
* - **Features**:
|
|
103
|
-
* - This function works **only in browser environments
|
|
104
|
-
* - If an element is focused, it will lose focus by calling `blur()`.
|
|
103
|
+
* - This function works **only in browser environments** ***(safely no-ops in server environments)***.
|
|
104
|
+
* - If an element is focused, it will lose focus by calling `HTMLElement.blur()`.
|
|
105
105
|
* - If no element is focused or the active element is not an `HTMLElement`, nothing happens.
|
|
106
|
-
* @returns {void} Does not return anything.
|
|
106
|
+
* @returns {void} Does not return anything (void).
|
|
107
107
|
* @example
|
|
108
108
|
* removeElementFocus(); // ➔ Removes focus from the currently active element
|
|
109
109
|
*/
|
|
@@ -153,7 +153,7 @@ timeout?:number|undefined;};
|
|
|
153
153
|
* - Non-integer number are truncated to an integer.
|
|
154
154
|
* - Force to `2147483647` if number is larger than `2147483647`.
|
|
155
155
|
* - Default force to `1` if `missing`, `NaN`, `invalid`, or `less-than` `1`.
|
|
156
|
-
* @returns {void} Does not return anything, only scrolling to top.
|
|
156
|
+
* @returns {void} Does not return anything, only scrolling to top (void).
|
|
157
157
|
* @example
|
|
158
158
|
* // ✅ Valid options value:
|
|
159
159
|
* scrollToTop();
|
package/dist/events/index.js
CHANGED
|
@@ -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
|
-
export { disableUserInteraction, enableUserInteraction, removeElementFocus, scrollToTop } from '../chunk-
|
|
10
|
+
export { disableUserInteraction, enableUserInteraction, removeElementFocus, scrollToTop } from '../chunk-C7GC2PFX.js';
|
|
11
11
|
import '../chunk-L5RDAVVH.js';
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-OSSFLQDD.js';
|
|
13
|
+
import '../chunk-J4TT33ZX.js';
|