@rzl-zone/utils-js 3.12.0 → 3.12.1-beta.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 (286) hide show
  1. package/{LICENSE.md → LICENSE} +3 -3
  2. package/README.md +62 -89
  3. package/dist/.references/index.d.cts +25 -0
  4. package/dist/.references/index.d.ts +25 -0
  5. package/dist/assertIsArray-BChqwPiP.cjs +26 -0
  6. package/dist/assertIsArray-BChqwPiP.cjs.map +1 -0
  7. package/dist/assertIsArray-BfAbIUfa.js +20 -0
  8. package/dist/assertIsArray-BfAbIUfa.js.map +1 -0
  9. package/dist/assertIsBoolean-BlBct0Fc.js +1073 -0
  10. package/dist/assertIsBoolean-BlBct0Fc.js.map +1 -0
  11. package/dist/assertIsBoolean-DozdtbNi.cjs +1283 -0
  12. package/dist/assertIsBoolean-DozdtbNi.cjs.map +1 -0
  13. package/dist/assertIsString-Bvk7bUL7.cjs +26 -0
  14. package/dist/assertIsString-Bvk7bUL7.cjs.map +1 -0
  15. package/dist/assertIsString-DqV9NwbI.js +20 -0
  16. package/dist/assertIsString-DqV9NwbI.js.map +1 -0
  17. package/dist/assertions/index.cjs +37 -40
  18. package/dist/assertions/index.cjs.map +1 -0
  19. package/dist/assertions/index.d.cts +12 -0
  20. package/dist/assertions/index.d.ts +10 -824
  21. package/dist/assertions/index.js +30 -13
  22. package/dist/assertions/index.js.map +1 -0
  23. package/dist/conversions/index.cjs +34 -103
  24. package/dist/conversions/index.d.cts +12 -0
  25. package/dist/conversions/index.d.ts +10 -1791
  26. package/dist/conversions/index.js +14 -24
  27. package/dist/conversions-CBs8-REq.cjs +448 -0
  28. package/dist/conversions-CBs8-REq.cjs.map +1 -0
  29. package/dist/conversions-EMJa3g-D.js +382 -0
  30. package/dist/conversions-EMJa3g-D.js.map +1 -0
  31. package/dist/events/index.cjs +55 -31
  32. package/dist/events/index.cjs.map +1 -0
  33. package/dist/events/index.d.cts +174 -0
  34. package/dist/events/index.d.ts +31 -35
  35. package/dist/events/index.js +50 -12
  36. package/dist/events/index.js.map +1 -0
  37. package/dist/formatEnvPort-DpIXzPAZ.js +159 -0
  38. package/dist/formatEnvPort-DpIXzPAZ.js.map +1 -0
  39. package/dist/formatEnvPort-hHNvOim-.cjs +171 -0
  40. package/dist/formatEnvPort-hHNvOim-.cjs.map +1 -0
  41. package/dist/formatters/index.cjs +21 -61
  42. package/dist/formatters/index.d.cts +12 -0
  43. package/dist/formatters/index.d.ts +10 -2152
  44. package/dist/formatters/index.js +10 -18
  45. package/dist/formatters-QcZO_Cpx.js +367 -0
  46. package/dist/formatters-QcZO_Cpx.js.map +1 -0
  47. package/dist/formatters-lAYgA11L.cjs +427 -0
  48. package/dist/formatters-lAYgA11L.cjs.map +1 -0
  49. package/dist/generators/index.cjs +161 -41
  50. package/dist/generators/index.cjs.map +1 -0
  51. package/dist/generators/index.d.cts +12 -0
  52. package/dist/generators/index.d.ts +10 -338
  53. package/dist/generators/index.js +154 -14
  54. package/dist/generators/index.js.map +1 -0
  55. package/dist/index-26W7ItWx.d.ts +760 -0
  56. package/dist/index-BPPQjAfs.d.cts +2359 -0
  57. package/dist/index-BXjlgBLz.d.cts +2139 -0
  58. package/dist/index-B_Wwo91H.d.ts +2359 -0
  59. package/dist/index-CpufydcI.d.cts +704 -0
  60. package/dist/index-Czc4O526.d.ts +333 -0
  61. package/dist/index-DPs1_p5G.d.cts +760 -0
  62. package/dist/index-DRpOyBSC.d.ts +1703 -0
  63. package/dist/index-DWWvtHUn.d.cts +822 -0
  64. package/dist/index-DnM0LD0n.d.cts +333 -0
  65. package/dist/index-GUZ9fK6T.d.ts +2139 -0
  66. package/dist/index-I4fAzwXV.d.ts +704 -0
  67. package/dist/index-JDrOl_19.d.ts +822 -0
  68. package/dist/index-b66P49Qe.d.cts +1703 -0
  69. package/dist/isBigInt-B1cijjqm.cjs +20 -0
  70. package/dist/isBigInt-B1cijjqm.cjs.map +1 -0
  71. package/dist/isBigInt-C0bN0Rhu.js +14 -0
  72. package/dist/isBigInt-C0bN0Rhu.js.map +1 -0
  73. package/dist/isEmptyObject-DI42NEo0.cjs +37 -0
  74. package/dist/isEmptyObject-DI42NEo0.cjs.map +1 -0
  75. package/dist/isEmptyObject-DeLVIJpl.js +25 -0
  76. package/dist/isEmptyObject-DeLVIJpl.js.map +1 -0
  77. package/dist/isEmptyString-BTUWYTbw.js +15 -0
  78. package/dist/isEmptyString-BTUWYTbw.js.map +1 -0
  79. package/dist/isEmptyString-CCK3bP74.cjs +21 -0
  80. package/dist/isEmptyString-CCK3bP74.cjs.map +1 -0
  81. package/dist/isEmptyValue-DMSMFTU8.cjs +30 -0
  82. package/dist/isEmptyValue-DMSMFTU8.cjs.map +1 -0
  83. package/dist/isEmptyValue-fjnfQnt5.js +24 -0
  84. package/dist/isEmptyValue-fjnfQnt5.js.map +1 -0
  85. package/dist/isEqual-B1fRgEuU.cjs +111 -0
  86. package/dist/isEqual-B1fRgEuU.cjs.map +1 -0
  87. package/dist/isEqual-DhyP8fB_.js +87 -0
  88. package/dist/isEqual-DhyP8fB_.js.map +1 -0
  89. package/dist/isFinite-BYMOo0os.js +15 -0
  90. package/dist/isFinite-BYMOo0os.js.map +1 -0
  91. package/dist/isFinite-sFkps2TY.cjs +21 -0
  92. package/dist/isFinite-sFkps2TY.cjs.map +1 -0
  93. package/dist/isInteger-DS9V7l_f.js +14 -0
  94. package/dist/isInteger-DS9V7l_f.js.map +1 -0
  95. package/dist/isInteger-FTCthMre.cjs +20 -0
  96. package/dist/isInteger-FTCthMre.cjs.map +1 -0
  97. package/dist/isPlainObject-DcFGh3_5.d.ts +530 -0
  98. package/dist/isPlainObject-doTI11Ib.d.cts +530 -0
  99. package/dist/isServer-D1TXfOs3.js +14 -0
  100. package/dist/isServer-D1TXfOs3.js.map +1 -0
  101. package/dist/isServer-q-QLFCqE.cjs +20 -0
  102. package/dist/isServer-q-QLFCqE.cjs.map +1 -0
  103. package/dist/isTypedArray-47R0wdrc.js +31 -0
  104. package/dist/isTypedArray-47R0wdrc.js.map +1 -0
  105. package/dist/isTypedArray-DiCoqffZ.cjs +43 -0
  106. package/dist/isTypedArray-DiCoqffZ.cjs.map +1 -0
  107. package/dist/isURL-CQiowFq2.js +14 -0
  108. package/dist/isURL-CQiowFq2.js.map +1 -0
  109. package/dist/isURL-WZypXsax.cjs +20 -0
  110. package/dist/isURL-WZypXsax.cjs.map +1 -0
  111. package/dist/isValidDomain-BSXshgkC.cjs +1788 -0
  112. package/dist/isValidDomain-BSXshgkC.cjs.map +1 -0
  113. package/dist/isValidDomain-DwA2EN79.js +1782 -0
  114. package/dist/isValidDomain-DwA2EN79.js.map +1 -0
  115. package/dist/next/index.cjs +119 -214
  116. package/dist/next/index.cjs.map +1 -0
  117. package/dist/next/index.d.cts +226 -0
  118. package/dist/next/index.d.ts +26 -31
  119. package/dist/next/index.js +117 -212
  120. package/dist/next/index.js.map +1 -0
  121. package/dist/next/server/index.cjs +25 -40
  122. package/dist/next/server/index.cjs.map +1 -0
  123. package/dist/next/server/index.d.cts +39 -0
  124. package/dist/next/server/index.d.ts +9 -10
  125. package/dist/next/server/index.js +23 -38
  126. package/dist/next/server/index.js.map +1 -0
  127. package/dist/noop-B2mTBhW-.cjs +18 -0
  128. package/dist/noop-B2mTBhW-.cjs.map +1 -0
  129. package/dist/noop-BzktGBVz.js +12 -0
  130. package/dist/noop-BzktGBVz.js.map +1 -0
  131. package/dist/normalizeSpaces-DQHR3Tlr.cjs +29 -0
  132. package/dist/normalizeSpaces-DQHR3Tlr.cjs.map +1 -0
  133. package/dist/normalizeSpaces-WS_iERJk.js +23 -0
  134. package/dist/normalizeSpaces-WS_iERJk.js.map +1 -0
  135. package/dist/normalizeString-2WLth_Gj.js +15 -0
  136. package/dist/normalizeString-2WLth_Gj.js.map +1 -0
  137. package/dist/normalizeString-D8euBcRD.cjs +21 -0
  138. package/dist/normalizeString-D8euBcRD.cjs.map +1 -0
  139. package/dist/operations/index.cjs +65 -32
  140. package/dist/operations/index.cjs.map +1 -0
  141. package/dist/operations/index.d.cts +139 -0
  142. package/dist/operations/index.d.ts +10 -15
  143. package/dist/operations/index.js +61 -17
  144. package/dist/operations/index.js.map +1 -0
  145. package/dist/parsers/index.cjs +12 -19
  146. package/dist/parsers/index.d.cts +239 -0
  147. package/dist/parsers/index.d.ts +71 -72
  148. package/dist/parsers/index.js +10 -12
  149. package/dist/parsers-DXtpsDyj.cjs +649 -0
  150. package/dist/parsers-DXtpsDyj.cjs.map +1 -0
  151. package/dist/parsers-Dpuq-V4u.js +643 -0
  152. package/dist/parsers-Dpuq-V4u.js.map +1 -0
  153. package/dist/parsing-B43x1sxn.js +50 -0
  154. package/dist/parsing-B43x1sxn.js.map +1 -0
  155. package/dist/parsing-lRoxn1Nz.cjs +56 -0
  156. package/dist/parsing-lRoxn1Nz.cjs.map +1 -0
  157. package/dist/predicates/index.cjs +91 -296
  158. package/dist/predicates/index.d.cts +13 -0
  159. package/dist/predicates/index.d.ts +12 -2482
  160. package/dist/predicates/index.js +23 -25
  161. package/dist/predicates-DiaYA7Ps.cjs +413 -0
  162. package/dist/predicates-DiaYA7Ps.cjs.map +1 -0
  163. package/dist/predicates-gNepszvo.js +257 -0
  164. package/dist/predicates-gNepszvo.js.map +1 -0
  165. package/dist/promises/index.cjs +76 -24
  166. package/dist/promises/index.cjs.map +1 -0
  167. package/dist/promises/index.d.cts +123 -0
  168. package/dist/promises/index.d.ts +28 -31
  169. package/dist/promises/index.js +73 -13
  170. package/dist/promises/index.js.map +1 -0
  171. package/dist/punyCode-CTWXVVFo.cjs +185 -0
  172. package/dist/punyCode-CTWXVVFo.cjs.map +1 -0
  173. package/dist/punyCode-hmiFzLWT.js +179 -0
  174. package/dist/punyCode-hmiFzLWT.js.map +1 -0
  175. package/dist/removeSpaces-BE8lfh-4.js +19 -0
  176. package/dist/removeSpaces-BE8lfh-4.js.map +1 -0
  177. package/dist/removeSpaces-DRRxNWlb.cjs +25 -0
  178. package/dist/removeSpaces-DRRxNWlb.cjs.map +1 -0
  179. package/dist/safeJsonParse-BBnQElk8.cjs +208 -0
  180. package/dist/safeJsonParse-BBnQElk8.cjs.map +1 -0
  181. package/dist/safeJsonParse-CXruaP0p.js +184 -0
  182. package/dist/safeJsonParse-CXruaP0p.js.map +1 -0
  183. package/dist/safeStableStringify-BNh3D0K0.js +88 -0
  184. package/dist/safeStableStringify-BNh3D0K0.js.map +1 -0
  185. package/dist/safeStableStringify-Cc62pfRp.cjs +106 -0
  186. package/dist/safeStableStringify-Cc62pfRp.cjs.map +1 -0
  187. package/dist/strings/index.cjs +76 -81
  188. package/dist/strings/index.cjs.map +1 -0
  189. package/dist/strings/index.d.cts +12 -0
  190. package/dist/strings/index.d.ts +10 -775
  191. package/dist/strings/index.js +59 -14
  192. package/dist/strings/index.js.map +1 -0
  193. package/dist/tailwind/index.cjs +19 -47
  194. package/dist/tailwind/index.d.cts +12 -0
  195. package/dist/tailwind/index.d.ts +11 -712
  196. package/dist/tailwind/index.js +10 -12
  197. package/dist/tailwind-DJ4cmLUw.cjs +247 -0
  198. package/dist/tailwind-DJ4cmLUw.cjs.map +1 -0
  199. package/dist/tailwind-IJvOdkZp.js +199 -0
  200. package/dist/tailwind-IJvOdkZp.js.map +1 -0
  201. package/dist/toStringArrayUnRecursive-CFs0jTEg.js +39 -0
  202. package/dist/toStringArrayUnRecursive-CFs0jTEg.js.map +1 -0
  203. package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs +51 -0
  204. package/dist/toStringArrayUnRecursive-xUaU8Ot9.cjs.map +1 -0
  205. package/dist/urls/index.cjs +129 -57
  206. package/dist/urls/index.cjs.map +1 -0
  207. package/dist/urls/index.d.cts +740 -0
  208. package/dist/urls/index.d.ts +218 -224
  209. package/dist/urls/index.js +121 -26
  210. package/dist/urls/index.js.map +1 -0
  211. package/package.json +203 -194
  212. package/dist/chunk-2AFQ33D3.cjs +0 -64
  213. package/dist/chunk-2CYDJVGM.js +0 -246
  214. package/dist/chunk-2MW4JDQ2.cjs +0 -598
  215. package/dist/chunk-2VTDXC3N.cjs +0 -1825
  216. package/dist/chunk-44XX2P34.js +0 -209
  217. package/dist/chunk-4YLBKLGS.cjs +0 -18
  218. package/dist/chunk-566CXQW7.cjs +0 -560
  219. package/dist/chunk-57EPKYID.cjs +0 -397
  220. package/dist/chunk-5MGEC3YG.js +0 -63
  221. package/dist/chunk-6EF52423.cjs +0 -249
  222. package/dist/chunk-6SCOKU3S.js +0 -109
  223. package/dist/chunk-6VUXD3CF.js +0 -119
  224. package/dist/chunk-7B76BSNK.cjs +0 -118
  225. package/dist/chunk-7Y6I2DSU.cjs +0 -101
  226. package/dist/chunk-A7S7E2EE.cjs +0 -308
  227. package/dist/chunk-AJZ6PMMZ.js +0 -16
  228. package/dist/chunk-AXGBL2IO.cjs +0 -251
  229. package/dist/chunk-B4TC6FBV.cjs +0 -678
  230. package/dist/chunk-BAV5T2E3.cjs +0 -15
  231. package/dist/chunk-BKIJBNIE.js +0 -21
  232. package/dist/chunk-BNIMTFK5.js +0 -59
  233. package/dist/chunk-BXW7YXB7.js +0 -1823
  234. package/dist/chunk-CFYZC4S6.js +0 -53
  235. package/dist/chunk-CSG4SCL3.js +0 -1587
  236. package/dist/chunk-CWQW7AKK.js +0 -676
  237. package/dist/chunk-DVMHRLKP.cjs +0 -16
  238. package/dist/chunk-EN7LVZBZ.js +0 -548
  239. package/dist/chunk-EV4Y7HCY.cjs +0 -26
  240. package/dist/chunk-F66VDYIZ.cjs +0 -18
  241. package/dist/chunk-FLJX37EL.cjs +0 -30
  242. package/dist/chunk-GKC3UDMC.cjs +0 -1623
  243. package/dist/chunk-H65I3GRZ.cjs +0 -106
  244. package/dist/chunk-HHYWB7VZ.js +0 -24
  245. package/dist/chunk-HNGGISFL.cjs +0 -65
  246. package/dist/chunk-HNSQAVSZ.cjs +0 -35
  247. package/dist/chunk-HSP6IWZK.js +0 -17
  248. package/dist/chunk-IDZS7J6T.js +0 -242
  249. package/dist/chunk-JS6R55VL.js +0 -302
  250. package/dist/chunk-JZVT5FK7.js +0 -232
  251. package/dist/chunk-KHO2SBNA.cjs +0 -16
  252. package/dist/chunk-KIDJCMNJ.js +0 -33
  253. package/dist/chunk-KOLEURVT.cjs +0 -38
  254. package/dist/chunk-L4V53MQK.cjs +0 -269
  255. package/dist/chunk-L5RDAVVH.js +0 -14
  256. package/dist/chunk-NODTV4F3.js +0 -16
  257. package/dist/chunk-NYK5K3V2.cjs +0 -211
  258. package/dist/chunk-ODUO3RTL.cjs +0 -113
  259. package/dist/chunk-ONZFBJVW.js +0 -14
  260. package/dist/chunk-PFXCTE37.js +0 -28
  261. package/dist/chunk-PPST7QAQ.js +0 -587
  262. package/dist/chunk-Q5IMYDFL.cjs +0 -33
  263. package/dist/chunk-QFFBIOJ4.js +0 -31
  264. package/dist/chunk-QNKGP5DY.js +0 -14
  265. package/dist/chunk-RRQHMOPE.cjs +0 -19
  266. package/dist/chunk-RU5OSRBU.js +0 -95
  267. package/dist/chunk-SDMPEJ4F.js +0 -35
  268. package/dist/chunk-SYNL5IKP.js +0 -115
  269. package/dist/chunk-TCDOWZQE.js +0 -16
  270. package/dist/chunk-TQPGXGKB.cjs +0 -123
  271. package/dist/chunk-TULOI4GL.js +0 -370
  272. package/dist/chunk-UBHCP4N5.cjs +0 -36
  273. package/dist/chunk-UCHF3M34.cjs +0 -56
  274. package/dist/chunk-UDA26MCU.cjs +0 -16
  275. package/dist/chunk-V3C4FYZL.cjs +0 -18
  276. package/dist/chunk-VAAHZFBF.js +0 -32
  277. package/dist/chunk-VJDDGRIK.cjs +0 -16
  278. package/dist/chunk-WVSPXFTY.js +0 -14
  279. package/dist/chunk-WYP76WXB.js +0 -101
  280. package/dist/chunk-YDE4ZBB7.cjs +0 -237
  281. package/dist/chunk-YKQEOO7C.cjs +0 -23
  282. package/dist/chunk-YSZC56SZ.js +0 -264
  283. package/dist/chunk-YWHHVDT4.js +0 -13
  284. package/dist/index.d.ts +0 -24
  285. package/dist/isPlainObject-DTJVV2Kf.d.ts +0 -536
  286. package/dist/rzl-utils.global.js +0 -10
@@ -1,370 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- import { isURL } from './chunk-ONZFBJVW.js';
11
- import { isTypedArray } from './chunk-KIDJCMNJ.js';
12
- import { parseCurrencyString } from './chunk-5MGEC3YG.js';
13
- import { isEmptyString } from './chunk-TCDOWZQE.js';
14
- import { assertIsString } from './chunk-BKIJBNIE.js';
15
- import { isEqual, isRegExp, baseDeepEqual } from './chunk-WYP76WXB.js';
16
- import { isEmptyArray } from './chunk-SDMPEJ4F.js';
17
- import { safeStableStringify, isDate, isMap } from './chunk-6VUXD3CF.js';
18
- import { isArray, getPreciseType, assertIsBoolean, isNonEmptyString, assertIsPlainObject, isObjectOrArray, isFunction, isString, isNumber, isSymbol, isSet, isPlainObject, isNil, isBoolean, isBuffer, isNaN, isUndefined, isObject, isNull } from './chunk-CSG4SCL3.js';
19
-
20
- var areArraysEqual = (array1, array2, ignoreOrder = false) => {
21
- if (!(isArray(array1) && isArray(array2))) {
22
- throw new TypeError(
23
- `Parameters \`array1\` and \`array2\` property of the \`options\` (second parameter) must be of type \`array\`, but received: ['array1': \`${getPreciseType(
24
- array1
25
- )}\`, 'array2': \`${getPreciseType(array2)}\`].`
26
- );
27
- }
28
- assertIsBoolean(ignoreOrder, {
29
- message: ({ currentType, validType }) => `Third parameter \`ignoreOrder\` must be of type \`${validType}\`, but received: \`${currentType}\`.`
30
- });
31
- if (!isEqual(array1.length, array2.length)) return false;
32
- const deepIgnoreOrder = (arr) => {
33
- if (!isArray(arr)) return arr;
34
- const sorted = arr.map((item) => {
35
- if (isArray(item)) {
36
- return deepIgnoreOrder(item);
37
- }
38
- return item;
39
- });
40
- return sorted.sort((a, b) => {
41
- const sa = safeStableStringify(a);
42
- const sb = safeStableStringify(b);
43
- return sa < sb ? -1 : sa > sb ? 1 : 0;
44
- });
45
- };
46
- const normalizedArr1 = ignoreOrder ? deepIgnoreOrder(array1) : array1;
47
- const normalizedArr2 = ignoreOrder ? deepIgnoreOrder(array2) : array2;
48
- if (!isEqual(normalizedArr1.length, normalizedArr2.length)) return false;
49
- return normalizedArr1.every(
50
- (item, index) => safeStableStringify(item) === safeStableStringify(normalizedArr2[index])
51
- );
52
- };
53
-
54
- var areObjectsEqual = (object1, object2) => {
55
- return isEqual(object1, object2);
56
- };
57
-
58
- var areURLsEqualPath = (urlA, urlB) => {
59
- if (!isURL(urlA) || !isURL(urlB)) {
60
- throw new TypeError(
61
- `Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
62
- );
63
- }
64
- return urlA.protocol + "//" + urlA.host + urlA.pathname === urlB.protocol + "//" + urlB.host + urlB.pathname;
65
- };
66
-
67
- var areURLsIdentical = (urlA, urlB) => {
68
- if (!isURL(urlA) || !isURL(urlB)) {
69
- throw new TypeError(
70
- `Parameters \`urlA\` and \`urlB\` (first and second parameter) must be instance of URL.`
71
- );
72
- }
73
- return urlA.protocol + "//" + urlA.host + urlA.pathname + urlA.search === urlB.protocol + "//" + urlB.host + urlB.pathname + urlB.search;
74
- };
75
-
76
- var textContainsAll = (text, searchWords, options = {}) => {
77
- if (!isNonEmptyString(text) || !isArray(searchWords)) {
78
- return false;
79
- }
80
- assertIsPlainObject(options, {
81
- message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
82
- });
83
- const { exactMatch = false, flags = "i" } = options;
84
- assertIsBoolean(exactMatch, {
85
- message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
86
- });
87
- assertIsString(flags, {
88
- message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
89
- });
90
- const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
91
- const validSearchWords = searchWords.filter((word) => isNonEmptyString(word)).map(escapeRegex);
92
- if (validSearchWords.length === 0) return false;
93
- return validSearchWords.every((word) => {
94
- const pattern = exactMatch ? `(?<!\\S)${word}(?!\\S)` : word;
95
- return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
96
- });
97
- };
98
-
99
- var textContainsAny = (text, searchWords, options = {}) => {
100
- if (!isNonEmptyString(text) || !isArray(searchWords)) {
101
- return false;
102
- }
103
- assertIsPlainObject(options, {
104
- message: ({ currentType, validType }) => `Third parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
105
- });
106
- const { exactMatch = false, flags = "i" } = options;
107
- assertIsBoolean(exactMatch, {
108
- message: ({ currentType, validType }) => `Parameter \`exactMatch\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
109
- });
110
- assertIsString(flags, {
111
- message: ({ currentType, validType }) => `Parameter \`flags\` property of the \`options\` (third parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
112
- });
113
- const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
114
- const validSearchWords = searchWords.filter((word) => isNonEmptyString(word)).map(escapeRegex);
115
- if (validSearchWords.length === 0) return false;
116
- const pattern = exactMatch ? `(?<!\\S)(${validSearchWords.join("|")})(?!\\S)` : `(${validSearchWords.join("|")})`;
117
- return new RegExp(pattern, flags.includes("u") ? flags : flags + "u").test(text);
118
- };
119
-
120
- function isPropertyKey(value) {
121
- const type = typeof value;
122
- return type === "string" || type === "number" || type === "symbol";
123
- }
124
-
125
- var doesKeyExist = (object, key) => {
126
- if (!isObjectOrArray(object)) return false;
127
- if (!isPropertyKey(key)) {
128
- throw new TypeError(
129
- `Second Parameter (\`key\`) must be of type \`string\`, \`number\` or \`symbol\`, but received: \`${getPreciseType(
130
- key
131
- )}\`.`
132
- );
133
- }
134
- if (Object.prototype.hasOwnProperty.call(object, key)) return true;
135
- if (isArray(object)) {
136
- return object.some((item) => doesKeyExist(item, key));
137
- }
138
- return Object.values(object).some(
139
- (value) => isObjectOrArray(value) && doesKeyExist(value, key)
140
- );
141
- };
142
-
143
- var arrayHasAnyMatch = (sourceArray, targetArray) => {
144
- if (!isArray(sourceArray) || !isArray(targetArray) || isEmptyArray(sourceArray) || isEmptyArray(targetArray)) {
145
- return false;
146
- }
147
- const sourceSet = new Set(sourceArray);
148
- return targetArray.some((item) => sourceSet.has(item));
149
- };
150
-
151
- var isArguments = (value) => {
152
- return Object.prototype.toString.call(value) === "[object Arguments]";
153
- };
154
-
155
- function isLength(value) {
156
- return typeof value === "number" && value > -1 && Number.isInteger(value) && value <= Number.MAX_SAFE_INTEGER;
157
- }
158
-
159
- function isArrayLike(value) {
160
- return !isFunction(value) && isObjectOrArray(value) && isLength(value?.length);
161
- }
162
-
163
- function isArrayLikeObject(value) {
164
- return isObjectOrArray(value) && isLength(value.length);
165
- }
166
-
167
- var isCurrencyLike = (input) => {
168
- if (!(isString(input) || isNumber(input))) return false;
169
- const parsed = parseCurrencyString(input.toString());
170
- if (parsed !== 0) return true;
171
- return input.toString().trim() === "0";
172
- };
173
-
174
- var isDeepEqual = (a, b) => {
175
- if (typeof a === "number" && typeof b === "number" && Number.isNaN(a) && Number.isNaN(b)) {
176
- return true;
177
- }
178
- if (a === b) return true;
179
- if (typeof a !== typeof b) return false;
180
- if (isDate(a) && isDate(b)) {
181
- return a.getTime() === b.getTime();
182
- }
183
- if (isRegExp(a) && isRegExp(b)) {
184
- return a.toString() === b.toString();
185
- }
186
- if (isSymbol(a) && isSymbol(b)) {
187
- return a.toString() === b.toString();
188
- }
189
- if (isSet(a) && isSet(b)) {
190
- if (a.size !== b.size) return false;
191
- const bValues = Array.from(b);
192
- const matched = /* @__PURE__ */ new Set();
193
- for (const aVal of a) {
194
- let found = false;
195
- for (let i = 0; i < bValues.length; i++) {
196
- if (matched.has(i)) continue;
197
- if (isDeepEqual(aVal, bValues[i])) {
198
- matched.add(i);
199
- found = true;
200
- break;
201
- }
202
- }
203
- if (!found) return false;
204
- }
205
- return true;
206
- }
207
- if (isMap(a) && isMap(b)) {
208
- if (a.size !== b.size) return false;
209
- const bEntries = Array.from(b);
210
- const matched = /* @__PURE__ */ new Set();
211
- for (const [aKey, aVal] of a) {
212
- let found = false;
213
- for (let i = 0; i < bEntries.length; i++) {
214
- if (matched.has(i)) continue;
215
- const [bKey, bVal] = bEntries[i];
216
- if (isDeepEqual(aKey, bKey) && isDeepEqual(aVal, bVal)) {
217
- matched.add(i);
218
- found = true;
219
- break;
220
- }
221
- }
222
- if (!found) return false;
223
- }
224
- return true;
225
- }
226
- if (isArray(a) && isArray(b)) {
227
- if (a.length !== b.length) return false;
228
- return a.every((item, i) => isDeepEqual(item, b[i]));
229
- }
230
- if (isObjectOrArray(a) && isObjectOrArray(b) && a && b) {
231
- if (isArray(a) !== isArray(b)) return false;
232
- const aKeys = Object.keys(a);
233
- const bKeys = Object.keys(b);
234
- if (aKeys.length !== bKeys.length) return false;
235
- return aKeys.every((key) => isDeepEqual(a[key], b[key]));
236
- }
237
- return false;
238
- };
239
-
240
- function isElement(value) {
241
- return !!value && typeof value === "object" && value?.nodeType === 1 && !isPlainObject(value);
242
- }
243
-
244
- function isEmpty(value) {
245
- if (isNil(value)) return true;
246
- if (isBoolean(value) || isNumber(value, { includeNaN: true }) || isSymbol(value))
247
- return true;
248
- if (isFunction(value)) {
249
- return Object.keys(value).length === 0;
250
- }
251
- if (isString(value) || isArray(value) || isArguments(value) || isTypedArray(value)) {
252
- return value.length === 0;
253
- }
254
- if (isMap(value) || isSet(value)) {
255
- return value.size === 0;
256
- }
257
- if (isBuffer(value)) {
258
- return value.length === 0;
259
- }
260
- if (isPlainObject(value)) {
261
- return Object.keys(value).length === 0;
262
- }
263
- return false;
264
- }
265
-
266
- var isEmptyDeep = (value) => {
267
- if (isString(value)) return isEmptyString(value);
268
- if (isNumber(value)) return isNaN(value);
269
- if (isArray(value)) {
270
- return isEmptyArray(value) || value.every(isEmptyDeep);
271
- }
272
- if (isObjectOrArray(value)) {
273
- const keys = Object.keys(value);
274
- const symbols = Object.getOwnPropertySymbols(value);
275
- if (keys.length === 0 && symbols.length === 0) return true;
276
- return [...keys, ...symbols].every((key) => isEmptyDeep(value[key]));
277
- }
278
- if (!value) return true;
279
- return false;
280
- };
281
-
282
- function isEqualWith(value, other, customizer) {
283
- return baseDeepEqual(value, other, customizer, /* @__PURE__ */ new WeakMap());
284
- }
285
-
286
- function isMatchWith(value, other, customizer) {
287
- return baseIsMatch(value, other, customizer);
288
- }
289
-
290
- function isSameValue(x, y) {
291
- return x === y || x === 0 && y === 0 || Number.isNaN(x) && Number.isNaN(y);
292
- }
293
- function baseIsMatch(object, source, customizer) {
294
- if (object === source) return true;
295
- if (!isObjectOrArray(source)) {
296
- return isSameValue(object, source);
297
- }
298
- if (!isObjectOrArray(object)) {
299
- return false;
300
- }
301
- const keys = Reflect.ownKeys(source).filter(
302
- (k) => !(isArray(source) && k === "length")
303
- );
304
- for (const key of keys) {
305
- if (!(key in object)) return false;
306
- const objValue = object[key];
307
- const srcValue = source[key];
308
- const result = customizer?.(objValue, srcValue, key, object, source);
309
- if (!isUndefined(result)) {
310
- if (!result) return false;
311
- continue;
312
- }
313
- if (isObjectOrArray(objValue) && isObjectOrArray(srcValue)) {
314
- if (!isMatchWith(objValue, srcValue, customizer)) return false;
315
- } else {
316
- if (!isSameValue(objValue, srcValue)) return false;
317
- }
318
- }
319
- return true;
320
- }
321
-
322
- function isMatch(object, source) {
323
- return baseIsMatch(object, source);
324
- }
325
-
326
- var funcToString = Function.prototype.toString;
327
- var reIsNative = /\{\s*\[native code\]\s*\}/;
328
- function isNative(value) {
329
- if (!isFunction(value)) return false;
330
- try {
331
- const source = funcToString.call(value);
332
- return reIsNative.test(source);
333
- } catch {
334
- return false;
335
- }
336
- }
337
-
338
- function isObjectLoose(value) {
339
- return !isNil(value) && (isObjectOrArray(value) || isFunction(value));
340
- }
341
-
342
- function isSafeInteger(value) {
343
- return typeof value === "number" && Number.isSafeInteger(value);
344
- }
345
-
346
- var isValidURL = (url) => {
347
- if (!isNonEmptyString(url)) return false;
348
- let decodedUrl;
349
- try {
350
- decodedUrl = decodeURIComponent(url);
351
- } catch {
352
- return false;
353
- }
354
- if (!decodedUrl.startsWith("http://") && !decodedUrl.startsWith("https://")) {
355
- return false;
356
- }
357
- const urlPattern = new RegExp(
358
- /^https?:\/\/(?:localhost(?::\d+)?(?:[\/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?::\d+)?(?:[\/?#][^\s]*)?)$/
359
- //! DEPRECATED
360
- // /^https?:\/\/(?:localhost(?::\d+)?(?:[/?#][^\s]*)?|(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6})(?:[/?#][^\s]*)?$/
361
- // /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/
362
- );
363
- return urlPattern.test(decodedUrl);
364
- };
365
-
366
- function isWeakMap(value) {
367
- return isObject(value) && !isNull(value) && value instanceof WeakMap;
368
- }
369
-
370
- export { areArraysEqual, areObjectsEqual, areURLsEqualPath, areURLsIdentical, arrayHasAnyMatch, doesKeyExist, isArguments, isArrayLike, isArrayLikeObject, isCurrencyLike, isDeepEqual, isElement, isEmpty, isEmptyDeep, isEqualWith, isLength, isMatch, isMatchWith, isNative, isObjectLoose, isPropertyKey, isSafeInteger, isValidURL, isWeakMap, textContainsAll, textContainsAny };
@@ -1,36 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- 'use strict';
11
-
12
- var chunkQ5IMYDFL_cjs = require('./chunk-Q5IMYDFL.cjs');
13
-
14
- var isNonEmptyValue = (value, options = {}) => {
15
- return !chunkQ5IMYDFL_cjs.isEmptyValue(value, options);
16
- };
17
-
18
- var typedArrayTags = /* @__PURE__ */ new Set([
19
- "[object Int8Array]",
20
- "[object Uint8Array]",
21
- "[object Uint8ClampedArray]",
22
- "[object Int16Array]",
23
- "[object Uint16Array]",
24
- "[object Int32Array]",
25
- "[object Uint32Array]",
26
- "[object Float32Array]",
27
- "[object Float64Array]",
28
- "[object BigInt64Array]",
29
- "[object BigUint64Array]"
30
- ]);
31
- function isTypedArray(value) {
32
- return value != null && typeof value === "object" && typedArrayTags.has(Object.prototype.toString.call(value));
33
- }
34
-
35
- exports.isNonEmptyValue = isNonEmptyValue;
36
- exports.isTypedArray = isTypedArray;
@@ -1,56 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- 'use strict';
11
-
12
- var chunkV3C4FYZL_cjs = require('./chunk-V3C4FYZL.cjs');
13
- var chunkKOLEURVT_cjs = require('./chunk-KOLEURVT.cjs');
14
- var chunkUDA26MCU_cjs = require('./chunk-UDA26MCU.cjs');
15
- var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
16
-
17
- function filterNilArray(input) {
18
- if (chunkGKC3UDMC_cjs.isNil(input)) return void 0;
19
- if (!chunkGKC3UDMC_cjs.isArray(input)) return [];
20
- const filtered = input.reduce((output, element) => {
21
- if (!chunkGKC3UDMC_cjs.isNil(element)) {
22
- if (chunkGKC3UDMC_cjs.isArray(element)) {
23
- const cleanedNested = filterNilArray(element);
24
- if (cleanedNested && !chunkKOLEURVT_cjs.isEmptyArray(cleanedNested)) {
25
- output.push(cleanedNested);
26
- }
27
- } else {
28
- output.push(element);
29
- }
30
- }
31
- return output;
32
- }, []);
33
- return filtered;
34
- }
35
-
36
- function toStringArrayUnRecursive(array, options = {}) {
37
- chunkGKC3UDMC_cjs.assertIsPlainObject(options, {
38
- message: ({ currentType, validType }) => `Second parameter (\`options\`) must be of type \`${validType}\`, but received: \`${currentType}\`.`
39
- });
40
- const riv = chunkGKC3UDMC_cjs.hasOwnProp(options, "removeInvalidValue") ? options.removeInvalidValue : true;
41
- chunkGKC3UDMC_cjs.assertIsBoolean(riv, {
42
- message: ({ currentType, validType }) => `Parameter \`removeInvalidValue\` property of the \`options\` (second parameter) must be of type \`${validType}\`, but received: \`${currentType}\`.`
43
- });
44
- if (chunkGKC3UDMC_cjs.isArray(array)) {
45
- const result = Array.from(array, (x) => {
46
- if (chunkGKC3UDMC_cjs.isString(x) || chunkV3C4FYZL_cjs.isFinite(x) || chunkGKC3UDMC_cjs.isBoolean(x) || chunkUDA26MCU_cjs.isBigInt(x)) return String(x);
47
- return chunkGKC3UDMC_cjs.isNull(x) ? null : void 0;
48
- });
49
- if (riv) return filterNilArray(result);
50
- return result;
51
- }
52
- return void 0;
53
- }
54
-
55
- exports.filterNilArray = filterNilArray;
56
- exports.toStringArrayUnRecursive = toStringArrayUnRecursive;
@@ -1,16 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- 'use strict';
11
-
12
- var isBigInt = (value) => {
13
- return typeof value === "bigint";
14
- };
15
-
16
- exports.isBigInt = isBigInt;
@@ -1,18 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- 'use strict';
11
-
12
- var chunkGKC3UDMC_cjs = require('./chunk-GKC3UDMC.cjs');
13
-
14
- function isFinite(value) {
15
- return chunkGKC3UDMC_cjs.isNumber(value) && Number.isFinite(value);
16
- }
17
-
18
- exports.isFinite = isFinite;
@@ -1,32 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- import { isBigInt } from './chunk-QNKGP5DY.js';
11
- import { resolveErrorMessageAssertions, hasOwnProp, isNumber } from './chunk-CSG4SCL3.js';
12
-
13
- var assertIsBigInt = (value, options = {}) => {
14
- if (isBigInt(value)) return;
15
- resolveErrorMessageAssertions({
16
- value,
17
- options,
18
- requiredValidType: "bigint"
19
- });
20
- };
21
-
22
- var assertIsNumber = (value, options = {}) => {
23
- const includeNaN = hasOwnProp(options, "includeNaN") ? options.includeNaN : void 0;
24
- if (isNumber(value, { includeNaN })) return;
25
- resolveErrorMessageAssertions({
26
- value,
27
- options,
28
- requiredValidType: "number"
29
- });
30
- };
31
-
32
- export { assertIsBigInt, assertIsNumber };
@@ -1,16 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- 'use strict';
11
-
12
- var isServer = () => {
13
- return typeof window === "undefined" || typeof document === "undefined";
14
- };
15
-
16
- exports.isServer = isServer;
@@ -1,14 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- function isInteger(value) {
11
- return typeof value === "number" && Number.isInteger(value);
12
- }
13
-
14
- export { isInteger };
@@ -1,101 +0,0 @@
1
- /*!
2
- * ====================================================
3
- * Rzl Utils-JS.
4
- * ----------------------------------------------------
5
- * Version: 3.12.0.
6
- * Author: Rizalvin Dwiky.
7
- * Repository: https://github.com/rzl-zone/utils-js.
8
- * ====================================================
9
- */
10
- import { isDate, isMap } from './chunk-6VUXD3CF.js';
11
- import { isObjectOrArray, isError, isSet, isArray, isUndefined } from './chunk-CSG4SCL3.js';
12
-
13
- var isRegExp = (value) => {
14
- return value instanceof RegExp;
15
- };
16
-
17
- function isArrayBuffer(value) {
18
- return value instanceof ArrayBuffer;
19
- }
20
-
21
- function baseDeepEqual(value, other, customizer, seen = /* @__PURE__ */ new WeakMap()) {
22
- if (value === other) return true;
23
- if (value !== value && other !== other) return true;
24
- if (!isObjectOrArray(value) || !isObjectOrArray(other)) {
25
- return false;
26
- }
27
- if (seen.get(value) === other) return true;
28
- seen.set(value, other);
29
- const callCustomizer = (v, o, key, valObj, othObj) => {
30
- if (customizer) {
31
- const result = customizer(v, o, key, valObj, othObj, seen);
32
- if (!isUndefined(result)) return result;
33
- }
34
- return baseDeepEqual(v, o, customizer, seen);
35
- };
36
- if (isDate(value) && isDate(other)) return value.getTime() === other.getTime();
37
- if (isRegExp(value) && isRegExp(other))
38
- return value.source === other.source && value.flags === other.flags;
39
- if (isError(value) && isError(other))
40
- return value.name === other.name && value.message === other.message;
41
- if (ArrayBuffer.isView(value) && ArrayBuffer.isView(other)) {
42
- const v = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
43
- const o = new Uint8Array(other.buffer, other.byteOffset, other.byteLength);
44
- if (v.length !== o.length) return false;
45
- for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
46
- return true;
47
- }
48
- if (isArrayBuffer(value) && isArrayBuffer(other)) {
49
- if (value.byteLength !== other.byteLength) return false;
50
- const v = new Uint8Array(value), o = new Uint8Array(other);
51
- for (let i = 0; i < v.length; i++) if (v[i] !== o[i]) return false;
52
- return true;
53
- }
54
- if (isMap(value) && isMap(other)) {
55
- if (value.size !== other.size) return false;
56
- for (const [k, v] of value) {
57
- if (!other.has(k)) return false;
58
- if (!baseDeepEqual(v, other.get(k), customizer, seen)) return false;
59
- }
60
- return true;
61
- }
62
- if (isSet(value) && isSet(other)) {
63
- if (value.size !== other.size) return false;
64
- for (const v of value) {
65
- let matched = false;
66
- for (const o of other) {
67
- if (baseDeepEqual(v, o, customizer, seen)) {
68
- matched = true;
69
- break;
70
- }
71
- }
72
- if (!matched) return false;
73
- }
74
- return true;
75
- }
76
- if (isArray(value) && isArray(other)) {
77
- if (value.length !== other.length) return false;
78
- for (let i = 0; i < value.length; i++) {
79
- if (!callCustomizer(value[i], other[i], i, value, other)) return false;
80
- }
81
- return true;
82
- }
83
- if (Object.getPrototypeOf(value) !== Object.getPrototypeOf(other)) {
84
- return false;
85
- }
86
- const vKeys = Reflect.ownKeys(value);
87
- const oKeys = Reflect.ownKeys(other);
88
- if (vKeys.length !== oKeys.length) return false;
89
- for (const key of vKeys) {
90
- const vVal = value[key];
91
- const oVal = other[key];
92
- if (!callCustomizer(vVal, oVal, key, value, other)) return false;
93
- }
94
- return true;
95
- }
96
-
97
- function isEqual(value, other) {
98
- return baseDeepEqual(value, other, void 0, /* @__PURE__ */ new WeakMap());
99
- }
100
-
101
- export { baseDeepEqual, isArrayBuffer, isEqual, isRegExp };