@rzl-zone/utils-js 3.5.0 → 3.5.2

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 (115) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/assertions/index.cjs +11 -4
  3. package/dist/assertions/index.d.ts +9 -0
  4. package/dist/assertions/index.js +9 -0
  5. package/dist/chunk-2CQX5CBG.js +15 -0
  6. package/dist/chunk-2IOOEY45.cjs +10 -0
  7. package/dist/chunk-2WA36TC5.cjs +13 -0
  8. package/dist/chunk-3IBQ5MOM.js +10 -0
  9. package/dist/chunk-3VA554KW.js +11 -0
  10. package/dist/chunk-5757UBXJ.cjs +13 -0
  11. package/dist/chunk-5IGC6PBH.js +11 -0
  12. package/dist/chunk-5KJFVIQT.cjs +10 -0
  13. package/dist/chunk-6JFCSH7J.js +11 -0
  14. package/dist/chunk-6JFZL7YE.cjs +10 -0
  15. package/dist/chunk-7ODAAXX5.cjs +36 -0
  16. package/dist/chunk-BAV5T2E3.cjs +10 -0
  17. package/dist/chunk-CAH33WOQ.cjs +11 -0
  18. package/dist/chunk-CDCERIZ2.js +13 -0
  19. package/dist/chunk-CKTLUNWX.js +10 -0
  20. package/dist/chunk-CMW2TBOQ.js +45 -0
  21. package/dist/chunk-D3ENH7H6.cjs +14 -0
  22. package/dist/chunk-DEZZUYE2.js +13 -0
  23. package/dist/chunk-DVMHRLKP.cjs +10 -0
  24. package/dist/chunk-DWF2R5GD.cjs +13 -0
  25. package/dist/chunk-E55EQK2U.cjs +10 -0
  26. package/dist/chunk-E74U6CYP.cjs +10 -0
  27. package/dist/chunk-EL6A35UR.cjs +13 -0
  28. package/dist/chunk-F6IPNNSJ.cjs +23 -0
  29. package/dist/chunk-FJZGG54N.cjs +15 -0
  30. package/dist/chunk-FWCKOJZM.js +23 -0
  31. package/dist/chunk-FWHNWL2P.cjs +10 -0
  32. package/dist/chunk-GGEADHZO.js +12 -0
  33. package/dist/chunk-GQR4R5WY.js +10 -0
  34. package/dist/chunk-H66AC7GK.cjs +12 -0
  35. package/dist/chunk-HQWOFR56.cjs +10 -0
  36. package/dist/chunk-HYRQMTRH.cjs +10 -0
  37. package/dist/chunk-IRFL4MAX.js +10 -0
  38. package/dist/chunk-IVL7CKVH.cjs +11 -0
  39. package/dist/chunk-IZPBKKPO.js +10 -0
  40. package/dist/chunk-JBQMXC5I.cjs +13 -0
  41. package/dist/chunk-JEQEF5WD.js +14 -0
  42. package/dist/chunk-JMJQCN74.js +36 -0
  43. package/dist/chunk-KHO2SBNA.cjs +10 -0
  44. package/dist/chunk-KVAL5PAG.cjs +10 -0
  45. package/dist/chunk-L5RDAVVH.js +9 -0
  46. package/dist/chunk-LS6U7FAY.cjs +12 -0
  47. package/dist/chunk-NBZWMBO6.js +13 -0
  48. package/dist/chunk-NRF6LWBC.cjs +11 -0
  49. package/dist/chunk-OI5XKNZO.js +11 -0
  50. package/dist/chunk-ONZFBJVW.js +9 -0
  51. package/dist/chunk-OYTYSY7G.js +12 -0
  52. package/dist/chunk-PET42Z7W.js +12 -0
  53. package/dist/chunk-PZQ6I4JJ.cjs +46 -0
  54. package/dist/chunk-QBKAEVYG.js +11 -0
  55. package/dist/chunk-QNKGP5DY.js +9 -0
  56. package/dist/chunk-RIPKY4RU.js +10 -0
  57. package/dist/chunk-RZW35UN5.cjs +11 -0
  58. package/dist/chunk-SBFNXGTJ.js +13 -0
  59. package/dist/chunk-SBKGWRS5.js +10 -0
  60. package/dist/chunk-SIM77PU4.js +13 -0
  61. package/dist/chunk-T2T7K3KR.js +10 -0
  62. package/dist/chunk-T7PU2V7X.cjs +12 -0
  63. package/dist/chunk-UDA26MCU.cjs +10 -0
  64. package/dist/chunk-V45XJKHW.cjs +10 -0
  65. package/dist/chunk-VJDDGRIK.cjs +10 -0
  66. package/dist/chunk-W2WNBUDE.js +10 -0
  67. package/dist/chunk-WVSPXFTY.js +9 -0
  68. package/dist/chunk-XABCB3Y7.cjs +19 -0
  69. package/dist/chunk-XEDXFSGI.js +10 -0
  70. package/dist/chunk-YKPSRP5G.js +19 -0
  71. package/dist/chunk-YWHHVDT4.js +9 -0
  72. package/dist/chunk-ZETAZZLD.cjs +11 -0
  73. package/dist/conversions/index.cjs +11 -4
  74. package/dist/conversions/index.d.ts +9 -0
  75. package/dist/conversions/index.js +9 -0
  76. package/dist/events/index.cjs +11 -4
  77. package/dist/events/index.d.ts +9 -0
  78. package/dist/events/index.js +9 -0
  79. package/dist/formatters/index.cjs +11 -4
  80. package/dist/formatters/index.d.ts +9 -0
  81. package/dist/formatters/index.js +9 -0
  82. package/dist/generators/index.cjs +11 -4
  83. package/dist/generators/index.d.ts +9 -0
  84. package/dist/generators/index.js +9 -0
  85. package/dist/index.d.ts +34 -11
  86. package/dist/isPlainObject-FWmcJF6k.d.ts +9 -0
  87. package/dist/next/index.cjs +13 -0
  88. package/dist/next/index.d.ts +9 -0
  89. package/dist/next/index.js +13 -0
  90. package/dist/next/server/index.cjs +9 -0
  91. package/dist/next/server/index.d.ts +9 -0
  92. package/dist/next/server/index.js +9 -0
  93. package/dist/operations/index.cjs +11 -4
  94. package/dist/operations/index.d.ts +9 -0
  95. package/dist/operations/index.js +9 -0
  96. package/dist/parsers/index.cjs +11 -4
  97. package/dist/parsers/index.d.ts +9 -0
  98. package/dist/parsers/index.js +9 -0
  99. package/dist/predicates/index.cjs +11 -4
  100. package/dist/predicates/index.d.ts +9 -0
  101. package/dist/predicates/index.js +9 -0
  102. package/dist/promises/index.cjs +11 -4
  103. package/dist/promises/index.d.ts +9 -0
  104. package/dist/promises/index.js +9 -0
  105. package/dist/rzl-utils.global.js +23 -14
  106. package/dist/strings/index.cjs +11 -4
  107. package/dist/strings/index.d.ts +9 -0
  108. package/dist/strings/index.js +9 -0
  109. package/dist/tailwind/index.cjs +11 -4
  110. package/dist/tailwind/index.d.ts +9 -0
  111. package/dist/tailwind/index.js +9 -0
  112. package/dist/urls/index.cjs +11 -4
  113. package/dist/urls/index.d.ts +9 -0
  114. package/dist/urls/index.js +9 -0
  115. package/package.json +50 -166
@@ -1,3 +1,12 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { isNonEmptyValue, isTypedArray } from './chunk-5IGC6PBH.js';
2
11
  import { filterNilArray } from './chunk-OI5XKNZO.js';
3
12
  import { isEmptyString } from './chunk-W2WNBUDE.js';
@@ -8,6 +17,7 @@ import { assertIsArray } from './chunk-CKTLUNWX.js';
8
17
  import { safeStableStringify, isDate, isMap } from './chunk-PET42Z7W.js';
9
18
  import { isBigInt } from './chunk-QNKGP5DY.js';
10
19
  import { assertIsPlainObject, hasOwnProp, assertIsBoolean, isArray, isNull, getPreciseType, isNaN, isString, isNumber, isBoolean, isNil, isNumberObject, isBooleanObject, isStringObject, isSymbol, isFunction, isObjectOrArray, isError, isSet, isObject, isNonEmptyString, isPlainObject, isUndefined, isInfinityNumber, isBuffer } from './chunk-CMW2TBOQ.js';
20
+
11
21
  function toNumberArrayUnRecursive(array, options = {}) {
12
22
  assertIsPlainObject(options, {
13
23
  message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
@@ -27,6 +37,7 @@ function toNumberArrayUnRecursive(array, options = {}) {
27
37
  }
28
38
  return void 0;
29
39
  }
40
+
30
41
  function toStringDeepForce(value, forceToString) {
31
42
  if (!(forceToString === false || forceToString === "stringOrNumber" || forceToString === "primitives" || forceToString === "all")) {
32
43
  throw new TypeError(
@@ -85,6 +96,7 @@ function toStringDeepForce(value, forceToString) {
85
96
  }
86
97
  return value;
87
98
  }
99
+
88
100
  var dedupeArray = (inputArray, options = {}) => {
89
101
  assertIsArray(inputArray, {
90
102
  message: ({ currentType, validType }) => `First parameter (\`inputArray\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.`
@@ -129,6 +141,7 @@ var dedupeArray = (inputArray, options = {}) => {
129
141
  };
130
142
  return flatten ? process(deepFlatten(inputArray)) : process(inputArray);
131
143
  };
144
+
132
145
  var toBooleanContent = (value) => {
133
146
  if (isNil(value)) return false;
134
147
  if (isString(value)) return isNonEmptyString(value);
@@ -137,6 +150,7 @@ var toBooleanContent = (value) => {
137
150
  if (isArray(value) || isObject(value)) return isNonEmptyValue(value);
138
151
  return Boolean(value);
139
152
  };
153
+
140
154
  var toBooleanContentDeep = (value) => {
141
155
  if (isNil(value)) return false;
142
156
  if (isString(value)) return isNonEmptyString(value);
@@ -146,6 +160,7 @@ var toBooleanContentDeep = (value) => {
146
160
  if (isObject(value)) return Object.values(value).some(toBooleanContentDeep);
147
161
  return false;
148
162
  };
163
+
149
164
  var toBooleanExplicit = (value, options = {}) => {
150
165
  if (isNil(value)) return false;
151
166
  if (!isPlainObject(options)) options = {};
@@ -173,6 +188,7 @@ var toBooleanExplicit = (value, options = {}) => {
173
188
  if (isBoolean(value)) return value;
174
189
  return false;
175
190
  };
191
+
176
192
  var toBooleanLoose = (value) => {
177
193
  if (isNil(value)) return false;
178
194
  if (isString(value)) return !isEmptyString(value);
@@ -181,6 +197,7 @@ var toBooleanLoose = (value) => {
181
197
  if (isArray(value)) return value.length > 0;
182
198
  return Boolean(value);
183
199
  };
200
+
184
201
  var convertType = (value) => {
185
202
  const predefinedValues = {
186
203
  undefined: void 0,
@@ -205,6 +222,7 @@ var convertType = (value) => {
205
222
  }
206
223
  return value;
207
224
  };
225
+
208
226
  var deepCloneSafe = (obj) => {
209
227
  try {
210
228
  if (isFunction(structuredClone)) {
@@ -214,6 +232,7 @@ var deepCloneSafe = (obj) => {
214
232
  }
215
233
  return JSON.parse(JSON.stringify(obj));
216
234
  };
235
+
217
236
  var deleteNestedKey = (obj, path) => {
218
237
  if (!isObjectOrArray(obj)) return obj;
219
238
  const [currentKey, ...rest] = path;
@@ -228,6 +247,7 @@ var deleteNestedKey = (obj, path) => {
228
247
  }
229
248
  return obj;
230
249
  };
250
+
231
251
  var deleteExactPathOnce = (obj, path) => {
232
252
  if (!isPlainObject(obj)) return obj;
233
253
  const [currentKey, ...rest] = path;
@@ -238,6 +258,7 @@ var deleteExactPathOnce = (obj, path) => {
238
258
  }
239
259
  return obj;
240
260
  };
261
+
241
262
  function removeObjectPaths(object, keysToDelete, deepClone = true) {
242
263
  if (isEmptyObject(object, { checkSymbols: true }))
243
264
  return {};
@@ -270,6 +291,7 @@ function removeObjectPaths(object, keysToDelete, deepClone = true) {
270
291
  }
271
292
  return result;
272
293
  }
294
+
273
295
  function toNumberDeep(input, options = {}) {
274
296
  assertIsPlainObject(options, {
275
297
  message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
@@ -402,6 +424,7 @@ function toNumberDeep(input, options = {}) {
402
424
  isRoot: true
403
425
  });
404
426
  }
427
+
405
428
  function toStringDeep(input, options = {}) {
406
429
  assertIsPlainObject(options, {
407
430
  message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
@@ -1,6 +1,16 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
13
+
4
14
  var KNOWN_EXTENSIONS = /* @__PURE__ */ new Set([
5
15
  // 📄 Text & Document
6
16
  "txt",
@@ -1,7 +1,17 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { removeSpaces } from './chunk-XEDXFSGI.js';
2
11
  import { isEmptyString } from './chunk-W2WNBUDE.js';
3
12
  import { safeStableStringify } from './chunk-PET42Z7W.js';
4
13
  import { isNonEmptyString, getPreciseType, isError, assertIsPlainObject, hasOwnProp, isBoolean, isFunction } from './chunk-CMW2TBOQ.js';
14
+
5
15
  var NormalizePathnameError = class _NormalizePathnameError extends Error {
6
16
  /** * ***The original error that triggered this normalization failure.***
7
17
  *
@@ -32,6 +42,7 @@ var NormalizePathnameError = class _NormalizePathnameError extends Error {
32
42
  };
33
43
  }
34
44
  };
45
+
35
46
  var normalizePathname = (pathname, defaultPath = "/") => {
36
47
  if (!isNonEmptyString(defaultPath)) {
37
48
  throw new TypeError(
@@ -57,6 +68,7 @@ var normalizePathname = (pathname, defaultPath = "/") => {
57
68
  );
58
69
  }
59
70
  };
71
+
60
72
  var formatEnvPort = (envVar, options = {}) => {
61
73
  if (!isNonEmptyString(envVar)) return "";
62
74
  assertIsPlainObject(options, {
@@ -1,6 +1,16 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { isEmptyString } from './chunk-W2WNBUDE.js';
2
11
  import { isEmptyArray, isEmptyObject } from './chunk-6JFCSH7J.js';
3
12
  import { assertIsPlainObject, hasOwnProp, assertIsBoolean, isNil, isNaN, isString, isArray, isObject } from './chunk-CMW2TBOQ.js';
13
+
4
14
  var isEmptyValue = (value, options = {}) => {
5
15
  assertIsPlainObject(options, {
6
16
  message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
@@ -1,9 +1,19 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkKVAL5PAG_cjs = require('./chunk-KVAL5PAG.cjs');
4
13
  var chunkE55EQK2U_cjs = require('./chunk-E55EQK2U.cjs');
5
14
  var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
6
15
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
16
+
7
17
  var NormalizePathnameError = class _NormalizePathnameError extends Error {
8
18
  /** * ***The original error that triggered this normalization failure.***
9
19
  *
@@ -34,6 +44,7 @@ var NormalizePathnameError = class _NormalizePathnameError extends Error {
34
44
  };
35
45
  }
36
46
  };
47
+
37
48
  var normalizePathname = (pathname, defaultPath = "/") => {
38
49
  if (!chunkPZQ6I4JJ_cjs.isNonEmptyString(defaultPath)) {
39
50
  throw new TypeError(
@@ -59,6 +70,7 @@ var normalizePathname = (pathname, defaultPath = "/") => {
59
70
  );
60
71
  }
61
72
  };
73
+
62
74
  var formatEnvPort = (envVar, options = {}) => {
63
75
  if (!chunkPZQ6I4JJ_cjs.isNonEmptyString(envVar)) return "";
64
76
  chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
@@ -1,8 +1,18 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkE55EQK2U_cjs = require('./chunk-E55EQK2U.cjs');
4
13
  var chunkZETAZZLD_cjs = require('./chunk-ZETAZZLD.cjs');
5
14
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
15
+
6
16
  var isEmptyValue = (value, options = {}) => {
7
17
  chunkPZQ6I4JJ_cjs.assertIsPlainObject(options, {
8
18
  message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
@@ -1,6 +1,16 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
13
+
4
14
  var assertIsString = (value, options = {}) => {
5
15
  if (chunkPZQ6I4JJ_cjs.isString(value)) return;
6
16
  const errorMessage = chunkPZQ6I4JJ_cjs.resolveErrorMessageAssertions({
@@ -1,4 +1,14 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { isNonEmptyString } from './chunk-CMW2TBOQ.js';
11
+
2
12
  var parseCurrencyString = (input) => {
3
13
  if (!isNonEmptyString(input)) return 0;
4
14
  let trimmed = input.trim().replace(/\u00A0/g, "").replace(/\u202F/g, "");
@@ -1,7 +1,17 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
4
13
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
14
+
5
15
  var assertIsBigInt = (value, options = {}) => {
6
16
  if (chunkUDA26MCU_cjs.isBigInt(value)) return;
7
17
  const errorMessage = chunkPZQ6I4JJ_cjs.resolveErrorMessageAssertions({
@@ -11,6 +21,7 @@ var assertIsBigInt = (value, options = {}) => {
11
21
  });
12
22
  throw new TypeError(errorMessage);
13
23
  };
24
+
14
25
  var assertIsNumber = (value, options = {}) => {
15
26
  const includeNaN = chunkPZQ6I4JJ_cjs.hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
16
27
  if (chunkPZQ6I4JJ_cjs.isNumber(value, { includeNaN })) return;
@@ -1,4 +1,14 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { isNonEmptyString } from './chunk-CMW2TBOQ.js';
11
+
2
12
  var normalizeString = (input) => {
3
13
  return isNonEmptyString(input) ? input.trim() : "";
4
14
  };
@@ -1,13 +1,25 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
4
13
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
14
+
5
15
  var isRegExp = (value) => {
6
16
  return value instanceof RegExp;
7
17
  };
18
+
8
19
  function isArrayBuffer(value) {
9
20
  return value instanceof ArrayBuffer;
10
21
  }
22
+
11
23
  function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new WeakMap()) {
12
24
  if (value === other) return true;
13
25
  if (value !== value && other !== other) return true;
@@ -83,6 +95,7 @@ function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new Weak
83
95
  }
84
96
  return true;
85
97
  }
98
+
86
99
  function isEqual(value, other) {
87
100
  return baseDeepEqual(value, other, void 0, /* @__PURE__ */ new WeakMap());
88
101
  }
@@ -1,5 +1,15 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { isEmptyString } from './chunk-W2WNBUDE.js';
2
11
  import { isNonEmptyString, isPlainObject, isString, isNumber, getPreciseType } from './chunk-CMW2TBOQ.js';
12
+
3
13
  var capitalizeFirst = (string, options = {
4
14
  lowerCaseNextRest: true,
5
15
  trim: false
@@ -13,6 +23,7 @@ var capitalizeFirst = (string, options = {
13
23
  if (trim) string = string.trim();
14
24
  return string[0].toUpperCase() + (lowerCaseNextRest ? string.slice(1).toLowerCase() : string.slice(1));
15
25
  };
26
+
16
27
  var capitalizeWords = (value, options = {
17
28
  collapseSpaces: false,
18
29
  trim: false
@@ -35,6 +46,7 @@ var capitalizeWords = (value, options = {
35
46
  }
36
47
  return result.toLowerCase().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
37
48
  };
49
+
38
50
  function stripHtmlTags(input) {
39
51
  if (!isString(input)) {
40
52
  return void 0;
@@ -46,6 +58,7 @@ function stripHtmlTags(input) {
46
58
  const cleaned = stripped.replace(/\s+/g, " ").trim();
47
59
  return cleaned;
48
60
  }
61
+
49
62
  var getInitialsName = (name) => {
50
63
  if (!isNonEmptyString(name)) return "";
51
64
  name = name.replace(/\s+/g, " ").trim();
@@ -58,6 +71,7 @@ var getInitialsName = (name) => {
58
71
  name[0].toUpperCase()
59
72
  );
60
73
  };
74
+
61
75
  var replaceAt = (index, originalString, replaceTo) => {
62
76
  if (!isNumber(index) || !isString(replaceTo) || !isString(originalString)) {
63
77
  throw new TypeError(
@@ -1,3 +1,12 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  import { isURL } from './chunk-ONZFBJVW.js';
2
11
  import { isTypedArray } from './chunk-5IGC6PBH.js';
3
12
  import { parseCurrencyString } from './chunk-IRFL4MAX.js';
@@ -7,6 +16,7 @@ import { isEqual, isRegExp, baseDeepEqual } from './chunk-NBZWMBO6.js';
7
16
  import { isEmptyArray } from './chunk-6JFCSH7J.js';
8
17
  import { safeStableStringify, isDate, isMap } from './chunk-PET42Z7W.js';
9
18
  import { isArray, getPreciseType, assertIsBoolean, isNonEmptyString, assertIsPlainObject, isObjectOrArray, isFunction, isString, isNumber, isSymbol, isSet, isPlainObject, isNil, isBoolean, isBuffer, isNaN, isUndefined, isObject, isNull } from './chunk-CMW2TBOQ.js';
19
+
10
20
  var areArraysEqual = (array1, array2, ignoreOrder = false) => {
11
21
  if (!(isArray(array1) && isArray(array2))) {
12
22
  throw new TypeError(
@@ -40,9 +50,11 @@ var areArraysEqual = (array1, array2, ignoreOrder = false) => {
40
50
  (item, index) => safeStableStringify(item) === safeStableStringify(normalizedArr2[index])
41
51
  );
42
52
  };
53
+
43
54
  var areObjectsEqual = (object1, object2) => {
44
55
  return isEqual(object1, object2);
45
56
  };
57
+
46
58
  var areURLsEqualPath = (urlA, urlB) => {
47
59
  if (!isURL(urlA) || !isURL(urlB)) {
48
60
  throw new TypeError(
@@ -51,6 +63,7 @@ var areURLsEqualPath = (urlA, urlB) => {
51
63
  }
52
64
  return urlA.protocol + "//" + urlA.host + urlA.pathname === urlB.protocol + "//" + urlB.host + urlB.pathname;
53
65
  };
66
+
54
67
  var areURLsIdentical = (urlA, urlB) => {
55
68
  if (!isURL(urlA) || !isURL(urlB)) {
56
69
  throw new TypeError(
@@ -59,6 +72,7 @@ var areURLsIdentical = (urlA, urlB) => {
59
72
  }
60
73
  return urlA.protocol + "//" + urlA.host + urlA.pathname + urlA.search === urlB.protocol + "//" + urlB.host + urlB.pathname + urlB.search;
61
74
  };
75
+
62
76
  var textContainsAll = (text, searchWords, options = {}) => {
63
77
  if (!isNonEmptyString(text) || !isArray(searchWords)) {
64
78
  return false;
@@ -81,6 +95,7 @@ var textContainsAll = (text, searchWords, options = {}) => {
81
95
  return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
82
96
  });
83
97
  };
98
+
84
99
  var textContainsAny = (text, searchWords, options = {}) => {
85
100
  if (!isNonEmptyString(text) || !isArray(searchWords)) {
86
101
  return false;
@@ -101,10 +116,12 @@ var textContainsAny = (text, searchWords, options = {}) => {
101
116
  const pattern = exactMatch ? `(?<!\\S)(${validSearchWords.join("|")})(?!\\S)` : `(${validSearchWords.join("|")})`;
102
117
  return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
103
118
  };
119
+
104
120
  function isPropertyKey(value) {
105
121
  const type = typeof value;
106
122
  return type === "string" || type === "number" || type === "symbol";
107
123
  }
124
+
108
125
  var doesKeyExist = (object, key) => {
109
126
  if (!isObjectOrArray(object)) return false;
110
127
  if (!isPropertyKey(key)) {
@@ -122,6 +139,7 @@ var doesKeyExist = (object, key) => {
122
139
  (value) => isObjectOrArray(value) && doesKeyExist(value, key)
123
140
  );
124
141
  };
142
+
125
143
  var arrayHasAnyMatch = (sourceArray, targetArray) => {
126
144
  if (!isArray(sourceArray) || !isArray(targetArray) || isEmptyArray(sourceArray) || isEmptyArray(targetArray)) {
127
145
  return false;
@@ -129,24 +147,30 @@ var arrayHasAnyMatch = (sourceArray, targetArray) => {
129
147
  const sourceSet = new Set(sourceArray);
130
148
  return targetArray.some((item) => sourceSet.has(item));
131
149
  };
150
+
132
151
  var isArguments = (value) => {
133
152
  return Object.prototype.toString.call(value) === "[object Arguments]";
134
153
  };
154
+
135
155
  function isLength(value) {
136
156
  return typeof value === "number" && value > -1 && Number.isInteger(value) && value <= Number.MAX_SAFE_INTEGER;
137
157
  }
158
+
138
159
  function isArrayLike(value) {
139
160
  return !isFunction(value) && isObjectOrArray(value) && isLength(value?.length);
140
161
  }
162
+
141
163
  function isArrayLikeObject(value) {
142
164
  return isObjectOrArray(value) && isLength(value.length);
143
165
  }
166
+
144
167
  var isCurrencyLike = (input) => {
145
168
  if (!(isString(input) || isNumber(input))) return false;
146
169
  const parsed = parseCurrencyString(input.toString());
147
170
  if (parsed !== 0) return true;
148
171
  return input.toString().trim() === "0";
149
172
  };
173
+
150
174
  var isDeepEqual = (a, b) => {
151
175
  if (typeof a === "number" && typeof b === "number" && Number.isNaN(a) && Number.isNaN(b)) {
152
176
  return true;
@@ -212,9 +236,11 @@ var isDeepEqual = (a, b) => {
212
236
  }
213
237
  return false;
214
238
  };
239
+
215
240
  function isElement(value) {
216
241
  return !!value && typeof value === "object" && value?.nodeType === 1 && !isPlainObject(value);
217
242
  }
243
+
218
244
  function isEmpty(value) {
219
245
  if (isNil(value)) return true;
220
246
  if (isBoolean(value) || isNumber(value, { includeNaN: true }) || isSymbol(value))
@@ -236,6 +262,7 @@ function isEmpty(value) {
236
262
  }
237
263
  return false;
238
264
  }
265
+
239
266
  var isEmptyDeep = (value) => {
240
267
  if (isString(value)) return isEmptyString(value);
241
268
  if (isNumber(value)) return isNaN(value);
@@ -251,12 +278,15 @@ var isEmptyDeep = (value) => {
251
278
  if (!value) return true;
252
279
  return false;
253
280
  };
281
+
254
282
  function isEqualWith(value, other, customizer) {
255
283
  return baseDeepEqual(value, other, customizer, /* @__PURE__ */ new WeakMap());
256
284
  }
285
+
257
286
  function isMatchWith(value, other, customizer) {
258
287
  return baseIsMatch(value, other, customizer);
259
288
  }
289
+
260
290
  function isSameValue(x, y) {
261
291
  return x === y || x === 0 && y === 0 || Number.isNaN(x) && Number.isNaN(y);
262
292
  }
@@ -288,9 +318,11 @@ function baseIsMatch(object, source, customizer) {
288
318
  }
289
319
  return true;
290
320
  }
321
+
291
322
  function isMatch(object, source) {
292
323
  return baseIsMatch(object, source);
293
324
  }
325
+
294
326
  var funcToString = Function.prototype.toString;
295
327
  var reIsNative = /\{\s*\[native code\]\s*\}/;
296
328
  function isNative(value) {
@@ -302,12 +334,15 @@ function isNative(value) {
302
334
  return false;
303
335
  }
304
336
  }
337
+
305
338
  function isObjectLoose(value) {
306
339
  return !isNil(value) && (isObjectOrArray(value) || isFunction(value));
307
340
  }
341
+
308
342
  function isSafeInteger(value) {
309
343
  return typeof value === "number" && Number.isSafeInteger(value);
310
344
  }
345
+
311
346
  var isValidURL = (url) => {
312
347
  if (!isNonEmptyString(url)) return false;
313
348
  let decodedUrl;
@@ -327,6 +362,7 @@ var isValidURL = (url) => {
327
362
  );
328
363
  return urlPattern.test(decodedUrl);
329
364
  };
365
+
330
366
  function isWeakMap(value) {
331
367
  return isObject(value) && !isNull(value) && value instanceof WeakMap;
332
368
  }
@@ -1,4 +1,14 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
11
+
2
12
  var isURL = (value) => {
3
13
  return value instanceof URL;
4
14
  };
@@ -1,6 +1,16 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
13
+
4
14
  var removeSpaces = (value, options = {
5
15
  trimOnly: false
6
16
  }) => {
@@ -1,3 +1,12 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  var isServer = () => {
2
11
  return typeof window === "undefined" || typeof document === "undefined";
3
12
  };
@@ -1,3 +1,12 @@
1
+ /*!
2
+ * ====================================================
3
+ * Rzl Utils-JS.
4
+ * ----------------------------------------------------
5
+ * Version: 3.5.2.
6
+ * Author: Rizalvin Dwiky.
7
+ * Repository: https://github.com/rzl-zone/utils-js.
8
+ * ====================================================
9
+ */
1
10
  'use strict';
2
11
 
3
12
  var chunkFJZGG54N_cjs = require('./chunk-FJZGG54N.cjs');
@@ -6,6 +15,7 @@ var chunkZETAZZLD_cjs = require('./chunk-ZETAZZLD.cjs');
6
15
  var chunk6JFZL7YE_cjs = require('./chunk-6JFZL7YE.cjs');
7
16
  var chunkT7PU2V7X_cjs = require('./chunk-T7PU2V7X.cjs');
8
17
  var chunkPZQ6I4JJ_cjs = require('./chunk-PZQ6I4JJ.cjs');
18
+
9
19
  var findDuplicates = (values) => {
10
20
  chunk6JFZL7YE_cjs.assertIsArray(values, {
11
21
  message: ({ currentType, validType }) => `First parameter (\`values\`) must be of type \`${validType}\` (array literal or instance), but received: \`${currentType}\`.`
@@ -23,6 +33,7 @@ var findDuplicates = (values) => {
23
33
  });
24
34
  return duplicates;
25
35
  };
36
+
26
37
  var omitKeys = (object, keysToOmit) => {
27
38
  if (!chunkPZQ6I4JJ_cjs.isPlainObject(object)) return {};
28
39
  chunk6JFZL7YE_cjs.assertIsArray(keysToOmit, {
@@ -38,6 +49,7 @@ var omitKeys = (object, keysToOmit) => {
38
49
  Object.entries(object).filter(([key]) => !keysToOmit.includes(key))
39
50
  );
40
51
  };
52
+
41
53
  var omitKeysDeep = (object, keysToOmit) => {
42
54
  if (!chunkPZQ6I4JJ_cjs.isPlainObject(object)) return {};
43
55
  chunk6JFZL7YE_cjs.assertIsArray(keysToOmit, {