@rzl-zone/utils-js 3.7.1 → 3.8.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 (118) hide show
  1. package/README.md +23 -0
  2. package/dist/assertions/index.cjs +1 -1
  3. package/dist/assertions/index.d.ts +8 -8
  4. package/dist/assertions/index.js +1 -1
  5. package/dist/chunk-2VO2CBTU.js +1 -1
  6. package/dist/{chunk-KTQLDIIT.cjs → chunk-3JD53UUH.cjs} +15 -5
  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-6PKW4WCT.js → chunk-5IKZ3JDV.js} +20 -8
  11. package/dist/chunk-5NN4ZDE2.cjs +1 -1
  12. package/dist/{chunk-OS5OT5JA.cjs → chunk-5PF7KRCP.cjs} +25 -9
  13. package/dist/{chunk-66WLOZOD.cjs → chunk-6NORJBI6.cjs} +7 -5
  14. package/dist/chunk-6RFNZ2ZZ.cjs +1 -1
  15. package/dist/{chunk-TDPYR5JY.js → chunk-6VA4F6VR.js} +15 -5
  16. package/dist/chunk-6WMB5AJR.js +1 -1
  17. package/dist/chunk-7QQV66RX.cjs +1 -1
  18. package/dist/chunk-7WBMA2VE.cjs +1 -1
  19. package/dist/chunk-7ZNEUWYP.js +1 -1
  20. package/dist/chunk-A3YI6Y2P.js +1 -1
  21. package/dist/{chunk-RMJC3B5P.cjs → chunk-A4H7474O.cjs} +7 -4
  22. package/dist/chunk-AKKM6MOX.cjs +1 -1
  23. package/dist/chunk-ATLFMKAF.cjs +1 -1
  24. package/dist/chunk-B4SDEBN7.cjs +1 -1
  25. package/dist/chunk-B6UIKBHR.cjs +1 -1
  26. package/dist/chunk-BAV5T2E3.cjs +1 -1
  27. package/dist/chunk-BYUT376O.cjs +1 -1
  28. package/dist/chunk-CKUEZF4R.cjs +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-K3SONK25.cjs → chunk-HKJZ7K2K.cjs} +165 -14
  36. package/dist/{chunk-QUITZ3GP.js → chunk-I3IXLEEG.js} +25 -9
  37. package/dist/{chunk-VNADVWSJ.js → chunk-JIROTDOU.js} +4 -2
  38. package/dist/chunk-JY4HLZ4W.js +1 -1
  39. package/dist/chunk-K63WO3XA.cjs +1 -1
  40. package/dist/chunk-KHO2SBNA.cjs +1 -1
  41. package/dist/chunk-KPCDDYTZ.js +1 -1
  42. package/dist/{chunk-XFTUHS4Y.js → chunk-KVZ3HL2B.js} +7 -5
  43. package/dist/chunk-L5RDAVVH.js +1 -1
  44. package/dist/chunk-LEX4TQW2.js +1 -1
  45. package/dist/chunk-LIU4S3JA.cjs +1 -1
  46. package/dist/{chunk-R3PBF6F7.cjs → chunk-LVFTN6DK.cjs} +29 -17
  47. package/dist/chunk-NREACG6M.cjs +1 -1
  48. package/dist/chunk-OFBFGFVH.js +1 -1
  49. package/dist/chunk-ONZFBJVW.js +1 -1
  50. package/dist/{chunk-D53CE4BT.js → chunk-P3ST4UZA.js} +6 -3
  51. package/dist/{chunk-WNO3EPYT.js → chunk-PW2VMJLT.js} +4 -2
  52. package/dist/chunk-PZQC3FZY.js +1 -1
  53. package/dist/chunk-QAPYHLHC.cjs +1 -1
  54. package/dist/chunk-QNKGP5DY.js +1 -1
  55. package/dist/{chunk-2CQI36UD.cjs → chunk-RJYWBVGD.cjs} +4 -2
  56. package/dist/{chunk-3LEWQV3R.js → chunk-RRJIRXHS.js} +5 -5
  57. package/dist/{chunk-BG3AS5BU.cjs → chunk-SGCN4ED4.cjs} +4 -2
  58. package/dist/chunk-SLP24LUV.js +302 -0
  59. package/dist/chunk-SZJ7OI4S.js +1 -1
  60. package/dist/chunk-TDYGYHSH.js +1 -1
  61. package/dist/chunk-TFDXRT6D.cjs +1 -1
  62. package/dist/chunk-U5VR4TJN.js +1 -1
  63. package/dist/chunk-UDA26MCU.cjs +1 -1
  64. package/dist/chunk-UKAUXY2U.cjs +1 -1
  65. package/dist/chunk-VCVND6CH.js +1 -1
  66. package/dist/chunk-VJDDGRIK.cjs +1 -1
  67. package/dist/chunk-VJVCXEH7.cjs +1 -1
  68. package/dist/chunk-WVSPXFTY.js +1 -1
  69. package/dist/chunk-YC7AK3KX.cjs +1 -1
  70. package/dist/chunk-YGB2BQPB.cjs +1 -1
  71. package/dist/chunk-YS27V6LS.js +1 -1
  72. package/dist/chunk-YWHHVDT4.js +1 -1
  73. package/dist/chunk-ZN53RM3R.js +1 -1
  74. package/dist/{chunk-KIYALQQF.cjs → chunk-ZW3VYES4.cjs} +5 -5
  75. package/dist/conversions/index.cjs +18 -18
  76. package/dist/conversions/index.d.ts +10 -12
  77. package/dist/conversions/index.js +3 -3
  78. package/dist/events/index.cjs +1 -1
  79. package/dist/events/index.d.ts +9 -9
  80. package/dist/events/index.js +1 -1
  81. package/dist/formatters/index.cjs +12 -12
  82. package/dist/formatters/index.d.ts +19 -24
  83. package/dist/formatters/index.js +2 -2
  84. package/dist/generators/index.cjs +10 -6
  85. package/dist/generators/index.d.ts +155 -26
  86. package/dist/generators/index.js +2 -2
  87. package/dist/index.d.ts +1 -1
  88. package/dist/{isPlainObject-FWmcJF6k.d.ts → isPlainObject-BTPjv6zB.d.ts} +2 -2
  89. package/dist/next/index.cjs +11 -9
  90. package/dist/next/index.d.ts +11 -11
  91. package/dist/next/index.js +5 -3
  92. package/dist/next/server/index.cjs +1 -1
  93. package/dist/next/server/index.d.ts +4 -4
  94. package/dist/next/server/index.js +1 -1
  95. package/dist/operations/index.cjs +6 -6
  96. package/dist/operations/index.d.ts +8 -9
  97. package/dist/operations/index.js +3 -3
  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 +1 -1
  102. package/dist/predicates/index.d.ts +15 -28
  103. package/dist/predicates/index.js +1 -1
  104. package/dist/promises/index.cjs +4 -4
  105. package/dist/promises/index.d.ts +6 -7
  106. package/dist/promises/index.js +2 -2
  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 +10 -10
  112. package/dist/tailwind/index.d.ts +18 -18
  113. package/dist/tailwind/index.js +2 -2
  114. package/dist/urls/index.cjs +9 -9
  115. package/dist/urls/index.d.ts +9 -10
  116. package/dist/urls/index.js +3 -3
  117. package/package.json +1 -1
  118. package/dist/chunk-ABA2ZSBQ.js +0 -152
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -27,16 +27,25 @@ var randomInt = (min, max) => {
27
27
  max
28
28
  )}value, but received: ['min': \`${chunkF3WBQKRI_cjs.getPreciseType(
29
29
  min
30
- )}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(min)})\`, 'max': \`${chunkF3WBQKRI_cjs.getPreciseType(
31
- max
32
- )}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(max)}\`)].`
30
+ )}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(min, {
31
+ keepUndefined: true
32
+ })})\`, 'max': \`${chunkF3WBQKRI_cjs.getPreciseType(max)}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(
33
+ max,
34
+ {
35
+ keepUndefined: true
36
+ }
37
+ )}\`)].`
33
38
  );
34
39
  }
35
40
  if (min > max) {
36
41
  throw new RangeError(
37
42
  `First parameter (\`min\`) must be less than or equal to second parameter (\`max\`), but received: ['min': ${formatValue(
38
43
  min
39
- )}, 'max': ${formatValue(max)}].`
44
+ )} - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(min, {
45
+ keepUndefined: true
46
+ })})\`, 'max': ${formatValue(max)} - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(max, {
47
+ keepUndefined: true
48
+ })})\`].`
40
49
  );
41
50
  }
42
51
  min = Math.max(1, min);
@@ -64,11 +73,13 @@ var randomIntByLength = (options) => {
64
73
  throw new TypeError(
65
74
  `Parameters \`minLength\` and \`maxLength\` must be of type \`integer-number\`, but received: ['minLength': \`${chunkF3WBQKRI_cjs.getPreciseType(
66
75
  minLength
67
- )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(
68
- minLength
69
- )}), 'maxLength': \`${chunkF3WBQKRI_cjs.getPreciseType(
76
+ )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(minLength, {
77
+ keepUndefined: true
78
+ })}), 'maxLength': \`${chunkF3WBQKRI_cjs.getPreciseType(
70
79
  maxLength
71
- )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(maxLength)})].`
80
+ )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(maxLength, {
81
+ keepUndefined: true
82
+ })})].`
72
83
  );
73
84
  }
74
85
  if (minLength < 1 || maxLength > 16 || minLength > maxLength) {
@@ -105,11 +116,13 @@ var randomStr = (options) => {
105
116
  throw new TypeError(
106
117
  `Parameters \`minLength\` and \`maxLength\` must be of type \`integer-number\`, but received: ['minLength': \`${chunkF3WBQKRI_cjs.getPreciseType(
107
118
  minLength
108
- )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(
109
- minLength
110
- )}), 'maxLength': \`${chunkF3WBQKRI_cjs.getPreciseType(
119
+ )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(minLength, {
120
+ keepUndefined: true
121
+ })}), 'maxLength': \`${chunkF3WBQKRI_cjs.getPreciseType(
111
122
  maxLength
112
- )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(maxLength)})].`
123
+ )}\` - (with value: ${chunkYC7AK3KX_cjs.safeStableStringify(maxLength, {
124
+ keepUndefined: true
125
+ })})].`
113
126
  );
114
127
  }
115
128
  if (minLength < 1 || maxLength > 5e3 || minLength > maxLength) {
@@ -121,7 +134,9 @@ var randomStr = (options) => {
121
134
  throw new TypeError(
122
135
  `Parameter \`type\` must be of type \`string\` with value one of "string" | "number", but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
123
136
  type
124
- )}\`, with value: ${chunkYC7AK3KX_cjs.safeStableStringify(type)}.`
137
+ )}\`, with value: ${chunkYC7AK3KX_cjs.safeStableStringify(type, {
138
+ keepUndefined: true
139
+ })}.`
125
140
  );
126
141
  }
127
142
  const length = randomInt(minLength, maxLength);
@@ -151,7 +166,143 @@ var randomStr = (options) => {
151
166
  return result;
152
167
  };
153
168
 
169
+ function randomUUID(options = {}) {
170
+ if (!chunkF3WBQKRI_cjs.isPlainObject(options)) {
171
+ throw new TypeError(
172
+ `First parameter (\`options\`) must be a plain object with optional properties \`version\` and \`monotonic\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
173
+ options
174
+ )}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(options, { keepUndefined: true })}\`).`
175
+ );
176
+ }
177
+ const { version = "v4", monotonic = false } = options;
178
+ if (!chunkF3WBQKRI_cjs.isNonEmptyString(version)) {
179
+ throw new TypeError(
180
+ `Parameter \`version\` property of the \`options\` (first parameter) must be a \`string\` of either "v4" or "v7", but received type: \`${chunkF3WBQKRI_cjs.getPreciseType(
181
+ version
182
+ )}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(version, { keepUndefined: true })}\`).`
183
+ );
184
+ }
185
+ if (version !== "v4" && version !== "v7") {
186
+ throw new RangeError(
187
+ `Unsupported UUID version. Allowed values are "v4" or "v7". (received: \`${chunkYC7AK3KX_cjs.safeStableStringify(
188
+ version,
189
+ {
190
+ keepUndefined: true
191
+ }
192
+ )}\`).`
193
+ );
194
+ }
195
+ if (!chunkF3WBQKRI_cjs.isBoolean(monotonic)) {
196
+ throw new TypeError(
197
+ `Parameter \`monotonic\` property of the \`options\` (first parameter) must be a \`boolean\` when provided, but received type: \`${chunkF3WBQKRI_cjs.getPreciseType(
198
+ monotonic
199
+ )}\` - (with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(monotonic, {
200
+ keepUndefined: true
201
+ })}\`).`
202
+ );
203
+ }
204
+ if (monotonic && version !== "v7") {
205
+ throw new TypeError(
206
+ `Parameter \`monotonic\` property of the \`options\` (first parameter) is only supported for version "v7". Received: version=${chunkYC7AK3KX_cjs.safeStableStringify(
207
+ version,
208
+ { keepUndefined: true }
209
+ )}.`
210
+ );
211
+ }
212
+ if (version === "v4") {
213
+ return generateUUIDv4();
214
+ }
215
+ return generateUUIDv7({ monotonic });
216
+ }
217
+ function hasCryptoGetRandomValues() {
218
+ return typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function";
219
+ }
220
+ function hasCryptoRandomUUID() {
221
+ return typeof crypto !== "undefined" && typeof crypto.randomUUID === "function";
222
+ }
223
+ function getRandomBytes(len) {
224
+ if (hasCryptoGetRandomValues()) {
225
+ return crypto.getRandomValues(new Uint8Array(len));
226
+ }
227
+ const arr = new Uint8Array(len);
228
+ for (let i = 0; i < len; i++) {
229
+ arr[i] = Math.floor(Math.random() * 256);
230
+ }
231
+ return arr;
232
+ }
233
+ var byteToHex = (() => {
234
+ const arr = [];
235
+ for (let i = 0; i < 256; ++i) {
236
+ arr.push((i + 256).toString(16).substring(1));
237
+ }
238
+ return arr;
239
+ })();
240
+ function generateUUIDv4() {
241
+ if (hasCryptoRandomUUID()) {
242
+ return crypto.randomUUID();
243
+ }
244
+ if (hasCryptoGetRandomValues()) {
245
+ const rnd = crypto.getRandomValues(new Uint8Array(16));
246
+ rnd[6] = rnd[6] & 15 | 64;
247
+ rnd[8] = rnd[8] & 63 | 128;
248
+ return byteToHex[rnd[0]] + byteToHex[rnd[1]] + byteToHex[rnd[2]] + byteToHex[rnd[3]] + "-" + byteToHex[rnd[4]] + byteToHex[rnd[5]] + "-" + byteToHex[rnd[6]] + byteToHex[rnd[7]] + "-" + byteToHex[rnd[8]] + byteToHex[rnd[9]] + "-" + byteToHex[rnd[10]] + byteToHex[rnd[11]] + byteToHex[rnd[12]] + byteToHex[rnd[13]] + byteToHex[rnd[14]] + byteToHex[rnd[15]];
249
+ }
250
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
251
+ const r = Math.random() * 16 | 0;
252
+ const v = c === "x" ? r : r & 3 | 8;
253
+ return v.toString(16);
254
+ });
255
+ }
256
+ var monotonicState = {
257
+ lastTimestampMs: -1,
258
+ lastRand: null
259
+ };
260
+ function incrementUint8ArrayBigEndian(arr) {
261
+ for (let i = arr.length - 1; i >= 0; i--) {
262
+ if (arr[i] === 255) {
263
+ arr[i] = 0;
264
+ continue;
265
+ }
266
+ arr[i] = arr[i] + 1 & 255;
267
+ return false;
268
+ }
269
+ return true;
270
+ }
271
+ function generateUUIDv7({ monotonic = false } = {}) {
272
+ const nowMs = Date.now();
273
+ const tsHex = BigInt(nowMs).toString(16).padStart(12, "0");
274
+ let rand = getRandomBytes(10);
275
+ if (monotonic) {
276
+ if (monotonicState.lastTimestampMs === nowMs && monotonicState.lastRand) {
277
+ const copy = new Uint8Array(monotonicState.lastRand);
278
+ const overflow = incrementUint8ArrayBigEndian(copy);
279
+ if (overflow) {
280
+ throw new RangeError(
281
+ "Monotonic UUID sequence overflow: too many UUIDs generated within the same millisecond."
282
+ );
283
+ }
284
+ rand = copy;
285
+ monotonicState.lastRand = copy;
286
+ } else {
287
+ const fresh = getRandomBytes(10);
288
+ monotonicState.lastRand = new Uint8Array(fresh);
289
+ monotonicState.lastTimestampMs = nowMs;
290
+ rand = fresh;
291
+ }
292
+ }
293
+ rand[0] = rand[0] & 15 | 112;
294
+ rand[2] = rand[2] & 63 | 128;
295
+ const randHex = Array.from(rand, (b) => byteToHex[b]).join("");
296
+ const part1 = tsHex.slice(0, 8);
297
+ const part2 = tsHex.slice(8, 12);
298
+ const part3 = randHex.slice(0, 4);
299
+ const part4 = randHex.slice(4, 8);
300
+ const part5 = randHex.slice(8, 20);
301
+ return [part1, part2, part3, part4, part5].join("-");
302
+ }
303
+
154
304
  exports.getRandomItem = getRandomItem;
155
305
  exports.randomInt = randomInt;
156
306
  exports.randomIntByLength = randomIntByLength;
157
307
  exports.randomStr = randomStr;
308
+ exports.randomUUID = randomUUID;
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.7.1.
5
+ * Version: 3.8.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -30,7 +30,9 @@ var formatCurrency = (value, options = {}) => {
30
30
  throw new TypeError(
31
31
  `First parameter (\`value\`) must be of type \`string\` or \`primitive-number\`, but received: \`${getPreciseType(
32
32
  value
33
- )}\`, with value: \`${safeStableStringify(value)}\`.`
33
+ )}\`, with value: \`${safeStableStringify(value, {
34
+ keepUndefined: true
35
+ })}\`.`
34
36
  );
35
37
  }
36
38
  assertIsPlainObject(options, {
@@ -70,21 +72,27 @@ var formatCurrency = (value, options = {}) => {
70
72
  throw new TypeError(
71
73
  `Parameter \`totalDecimal\` property of the \`options\` (second parameter) must be of type \`integer-number\`, but received: \`${getPreciseType(
72
74
  totalDecimal
73
- )}\`, with value: \`${safeStableStringify(length)}\`.`
75
+ )}\`, with value: \`${safeStableStringify(length, {
76
+ keepUndefined: true
77
+ })}\`.`
74
78
  );
75
79
  }
76
80
  if (!(roundedDecimal === false || roundedDecimal === "round" || roundedDecimal === "ceil" || roundedDecimal === "floor")) {
77
81
  throw new TypeError(
78
82
  `Parameter \`roundedDecimal\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` must be one of "round" | "ceil" | "floor", but received: \`${getPreciseType(
79
83
  roundedDecimal
80
- )}\`, with value: \`${safeStableStringify(roundedDecimal)}\`.`
84
+ )}\`, with value: \`${safeStableStringify(roundedDecimal, {
85
+ keepUndefined: true
86
+ })}\`.`
81
87
  );
82
88
  }
83
89
  if (!(negativeFormat === "abs" || negativeFormat === "brackets" || negativeFormat === "dash" || isPlainObject(negativeFormat))) {
84
90
  throw new TypeError(
85
91
  `Parameter \`negativeFormat\` property of the \`options\` (second parameter) must be of type \`string\` must be one of "abs" | "brackets" | "dash" or \`plain-object\` type, but received: \`${getPreciseType(
86
92
  negativeFormat
87
- )}\`, with value: \`${safeStableStringify(negativeFormat)}\`.`
93
+ )}\`, with value: \`${safeStableStringify(negativeFormat, {
94
+ keepUndefined: true
95
+ })}\`.`
88
96
  );
89
97
  }
90
98
  const rawNum = isString(value) ? parseCurrencyString(value) : value;
@@ -162,7 +170,9 @@ var formatCurrency = (value, options = {}) => {
162
170
  throw new TypeError(
163
171
  `Parameter \`negativeFormat.style\` property of the \`options\` (second parameter) must be of type \`string\` must be of type "abs" | "brackets" | "dash", but received: \`${getPreciseType(
164
172
  formatStyleNegative
165
- )}\`, with value: \`${safeStableStringify(formatStyleNegative)}\`.`
173
+ )}\`, with value: \`${safeStableStringify(formatStyleNegative, {
174
+ keepUndefined: true
175
+ })}\`.`
166
176
  );
167
177
  }
168
178
  switch (formatStyleNegative) {
@@ -355,7 +365,9 @@ var censorEmail = (email, options = {}) => {
355
365
  throw new TypeError(
356
366
  `Parameter \`mode\` property of the \`options\` (second parameter) must be one of "fixed" or "random", but received: \`${getPreciseType(
357
367
  mode
358
- )}\`, with value: \`${safeStableStringify(mode)}\`.`
368
+ )}\`, with value: \`${safeStableStringify(mode, {
369
+ keepUndefined: true
370
+ })}\`.`
359
371
  );
360
372
  }
361
373
  const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
@@ -383,7 +395,9 @@ function chunkString(subject, limiter, options = {}) {
383
395
  throw new TypeError(
384
396
  `Second parameter (\`limiter\`) must be of type \`integer-number\`, but received: \`${getPreciseType(
385
397
  limiter
386
- )}\`, with value: \`${safeStableStringify(limiter)}\`.`
398
+ )}\`, with value: \`${safeStableStringify(limiter, {
399
+ keepUndefined: true
400
+ })}\`.`
387
401
  );
388
402
  }
389
403
  assertIsPlainObject(options, {
@@ -451,7 +465,9 @@ var truncateString = (text, options = {}) => {
451
465
  throw new TypeError(
452
466
  `Parameter \`length\` property of the \`options\` (second parameter) must be of type \`integer-number\`, but received: \`${getPreciseType(
453
467
  length2
454
- )}\`, with value: \`${safeStableStringify(length2)}\`.`
468
+ )}\`, with value: \`${safeStableStringify(length2, {
469
+ keepUndefined: true
470
+ })}\`.`
455
471
  );
456
472
  }
457
473
  if (length2 < 1) return "";
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.7.1.
5
+ * Version: 3.8.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -74,7 +74,9 @@ var delay = (milliSeconds = 1e3, signal) => {
74
74
  throw new TypeError(
75
75
  `First parameter (\`milliSeconds\`) must be of type \`number\` and value must be a \`non-zero\`, \`non-NaN\`, \`non-negative\`, and \`integer-number\`, but received: \`${getPreciseType(
76
76
  milliSeconds
77
- )}\`, with value: \`${safeStableStringify(milliSeconds)}\`.`
77
+ )}\`, with value: \`${safeStableStringify(milliSeconds, {
78
+ keepUndefined: true
79
+ })}\`.`
78
80
  );
79
81
  }
80
82
  if (isNull(signal) || signal && !(signal instanceof AbortSignal)) {
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -17,11 +17,13 @@ var parseCustomDate = (dateString, format) => {
17
17
  throw new TypeError(
18
18
  `Parameter \`dateString\` and \`format\` must be of type \`string\` and not empty-string, but received: "['dateString': \`${getPreciseType(
19
19
  dateString
20
- )}\` - (current value: \`${safeStableStringify(
21
- dateString
22
- )}\`), 'format': \`${getPreciseType(
20
+ )}\` - (current value: \`${safeStableStringify(dateString, {
21
+ keepUndefined: true
22
+ })}\`), 'format': \`${getPreciseType(
23
23
  format
24
- )}\` - (current value: \`${safeStableStringify(format)}\`)]".`
24
+ )}\` - (current value: \`${safeStableStringify(format, {
25
+ keepUndefined: true
26
+ })}\`)]".`
25
27
  );
26
28
  }
27
29
  const dateParts = dateString.split(/[-/]/).map(Number);
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================
@@ -14,7 +14,7 @@ var chunkBYUT376O_cjs = require('./chunk-BYUT376O.cjs');
14
14
  var chunkAKKM6MOX_cjs = require('./chunk-AKKM6MOX.cjs');
15
15
  var chunkUKAUXY2U_cjs = require('./chunk-UKAUXY2U.cjs');
16
16
  var chunkDVMHRLKP_cjs = require('./chunk-DVMHRLKP.cjs');
17
- var chunkBG3AS5BU_cjs = require('./chunk-BG3AS5BU.cjs');
17
+ var chunkSGCN4ED4_cjs = require('./chunk-SGCN4ED4.cjs');
18
18
  var chunkNREACG6M_cjs = require('./chunk-NREACG6M.cjs');
19
19
  var chunk7WBMA2VE_cjs = require('./chunk-7WBMA2VE.cjs');
20
20
  var chunkYC7AK3KX_cjs = require('./chunk-YC7AK3KX.cjs');
@@ -30,7 +30,9 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
30
30
  throw new TypeError(
31
31
  `First parameter (\`baseUrl\`) must be of type an URL instance or a \`string\` and a non empty-string, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
32
32
  baseUrl
33
- )}\`, with current value: \`${chunkYC7AK3KX_cjs.safeStableStringify(baseUrl)}\`.`
33
+ )}\`, with current value: \`${chunkYC7AK3KX_cjs.safeStableStringify(baseUrl, {
34
+ keepUndefined: true
35
+ })}\`.`
34
36
  );
35
37
  }
36
38
  if (!chunkF3WBQKRI_cjs.isUndefined(removeParams)) {
@@ -48,7 +50,9 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
48
50
  throw new TypeError(
49
51
  `Second parameter (\`queryParams\`) must be iterable (like URLSearchParams.entries() or an array of [[string, string | number]...]), but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
50
52
  queryParams
51
- )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(queryParams)}\`.`
53
+ )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(queryParams, {
54
+ keepUndefined: true
55
+ })}\`.`
52
56
  );
53
57
  }
54
58
  const urlInstance = new URL(baseUrl);
@@ -61,7 +65,9 @@ var constructURL = (baseUrl, queryParams, removeParams) => {
61
65
  throw new TypeError(
62
66
  `Second parameter (\`queryParams\`) must be iterable (like URLSearchParams.entries() or an array of [[string, string | number]...]), but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
63
67
  queryParams
64
- )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(queryParams)}\`.`
68
+ )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(queryParams, {
69
+ keepUndefined: true
70
+ })}\`.`
65
71
  );
66
72
  }
67
73
  mergedParams.set(key, String(value));
@@ -111,7 +117,9 @@ var getFirstPrefixPathname = (result, defaultValue = "/") => {
111
117
  throw new TypeError(
112
118
  `Second parameter (\`defaultValue\`) must be of type \`string\` and not an \`empty-string\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
113
119
  defaultValue
114
- )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(defaultValue)}\`.`
120
+ )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(defaultValue, {
121
+ keepUndefined: true
122
+ })}\`.`
115
123
  );
116
124
  }
117
125
  if (chunkF3WBQKRI_cjs.isArray(result)) {
@@ -119,20 +127,22 @@ var getFirstPrefixPathname = (result, defaultValue = "/") => {
119
127
  throw new TypeError(
120
128
  `First parameter (\`result\`) must be of type \`string\` or \`array of string\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
121
129
  result
122
- )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(result)}\`.`
130
+ )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(result, {
131
+ keepUndefined: true
132
+ })}\`.`
123
133
  );
124
134
  }
125
135
  for (const item of result) {
126
- const normalized = chunkBG3AS5BU_cjs.normalizePathname(item);
136
+ const normalized = chunkSGCN4ED4_cjs.normalizePathname(item);
127
137
  if (normalized !== "/") {
128
138
  return normalized;
129
139
  }
130
140
  }
131
- return chunkBG3AS5BU_cjs.normalizePathname(defaultValue);
141
+ return chunkSGCN4ED4_cjs.normalizePathname(defaultValue);
132
142
  }
133
143
  if (chunkF3WBQKRI_cjs.isString(result)) {
134
- const normalized = chunkBG3AS5BU_cjs.normalizePathname(result);
135
- return normalized !== "/" ? normalized : chunkBG3AS5BU_cjs.normalizePathname(defaultValue);
144
+ const normalized = chunkSGCN4ED4_cjs.normalizePathname(result);
145
+ return normalized !== "/" ? normalized : chunkSGCN4ED4_cjs.normalizePathname(defaultValue);
136
146
  }
137
147
  if (!chunkF3WBQKRI_cjs.isNil(result)) {
138
148
  throw new TypeError(
@@ -141,7 +151,7 @@ var getFirstPrefixPathname = (result, defaultValue = "/") => {
141
151
  )}\`.`
142
152
  );
143
153
  }
144
- return chunkBG3AS5BU_cjs.normalizePathname(defaultValue);
154
+ return chunkSGCN4ED4_cjs.normalizePathname(defaultValue);
145
155
  };
146
156
 
147
157
  var getPrefixPathname = (url, base = null, options = {}) => {
@@ -172,7 +182,9 @@ var getPrefixPathname = (url, base = null, options = {}) => {
172
182
  errors.push(
173
183
  `Parameter \`levels\` property of the \`options\` (second parameter) must be of type \`integer-number\` and minimum is \`0\`, but received: \`${chunkF3WBQKRI_cjs.getPreciseType(
174
184
  levels
175
- )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(levels)}\`.`
185
+ )}\`, with value: \`${chunkYC7AK3KX_cjs.safeStableStringify(levels, {
186
+ keepUndefined: true
187
+ })}\`.`
176
188
  );
177
189
  }
178
190
  if (!chunkF3WBQKRI_cjs.isBoolean(removeDuplicates)) {
@@ -189,19 +201,19 @@ var getPrefixPathname = (url, base = null, options = {}) => {
189
201
  );
190
202
  }
191
203
  function getLevel(singleUrl) {
192
- const parts = chunkBG3AS5BU_cjs.normalizePathname(singleUrl).split("/").filter(Boolean);
204
+ const parts = chunkSGCN4ED4_cjs.normalizePathname(singleUrl).split("/").filter(Boolean);
193
205
  return `/${parts.slice(0, levels).join("/")}`;
194
206
  }
195
207
  function processUrl(singleUrl) {
196
208
  if (base) {
197
- singleUrl = chunkBG3AS5BU_cjs.normalizePathname(singleUrl);
209
+ singleUrl = chunkSGCN4ED4_cjs.normalizePathname(singleUrl);
198
210
  if (chunkF3WBQKRI_cjs.isArray(base)) {
199
211
  for (const b of base) {
200
- if (singleUrl.startsWith(chunkBG3AS5BU_cjs.normalizePathname(b))) {
212
+ if (singleUrl.startsWith(chunkSGCN4ED4_cjs.normalizePathname(b))) {
201
213
  return getLevel(singleUrl);
202
214
  }
203
215
  }
204
- } else if (chunkF3WBQKRI_cjs.isNonEmptyString(base) && singleUrl.startsWith(chunkBG3AS5BU_cjs.normalizePathname(base))) {
216
+ } else if (chunkF3WBQKRI_cjs.isNonEmptyString(base) && singleUrl.startsWith(chunkSGCN4ED4_cjs.normalizePathname(base))) {
205
217
  return getLevel(singleUrl);
206
218
  }
207
219
  return null;
@@ -2,7 +2,7 @@
2
2
  * ====================================================
3
3
  * Rzl Utils-JS.
4
4
  * ----------------------------------------------------
5
- * Version: 3.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.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.7.1.
5
+ * Version: 3.8.0.
6
6
  * Author: Rizalvin Dwiky.
7
7
  * Repository: https://github.com/rzl-zone/utils-js.
8
8
  * ====================================================