es-toolkit 1.0.3 → 1.0.4-dev.39

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 (471) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/{esm/array/chunk.mjs → dist/array/chunk.d.mts} +1 -13
  3. package/dist/array/chunk.d.ts +3 -1
  4. package/dist/array/chunk.js +43 -0
  5. package/dist/array/chunk.js.map +1 -0
  6. package/dist/array/chunk.mjs +8 -0
  7. package/dist/array/chunk.mjs.map +1 -0
  8. package/{esm/array/difference.mjs → dist/array/difference.d.mts} +8 -12
  9. package/dist/array/difference.d.ts +3 -1
  10. package/dist/array/difference.js +35 -0
  11. package/dist/array/difference.js.map +1 -0
  12. package/dist/array/difference.mjs +8 -0
  13. package/dist/array/difference.mjs.map +1 -0
  14. package/{esm/array/differenceBy.mjs → dist/array/differenceBy.d.mts} +10 -17
  15. package/dist/array/differenceBy.d.ts +3 -1
  16. package/dist/array/differenceBy.js +36 -0
  17. package/dist/array/differenceBy.js.map +1 -0
  18. package/dist/array/differenceBy.mjs +8 -0
  19. package/dist/array/differenceBy.mjs.map +1 -0
  20. package/{esm/array/differenceWith.mjs → dist/array/differenceWith.d.mts} +6 -12
  21. package/dist/array/differenceWith.d.ts +3 -1
  22. package/dist/array/differenceWith.js +37 -0
  23. package/dist/array/differenceWith.js.map +1 -0
  24. package/dist/array/differenceWith.mjs +8 -0
  25. package/dist/array/differenceWith.mjs.map +1 -0
  26. package/{esm/array/drop.mjs → dist/array/drop.d.mts} +4 -6
  27. package/dist/array/drop.d.ts +3 -1
  28. package/dist/array/drop.js +33 -0
  29. package/dist/array/drop.js.map +1 -0
  30. package/dist/array/drop.mjs +8 -0
  31. package/dist/array/drop.mjs.map +1 -0
  32. package/{esm/array/dropRight.mjs → dist/array/dropRight.d.mts} +3 -5
  33. package/dist/array/dropRight.d.ts +3 -1
  34. package/dist/array/dropRight.js +33 -0
  35. package/dist/array/dropRight.js.map +1 -0
  36. package/dist/array/dropRight.mjs +8 -0
  37. package/dist/array/dropRight.mjs.map +1 -0
  38. package/{esm/array/dropRightWhile.mjs → dist/array/dropRightWhile.d.mts} +5 -11
  39. package/dist/array/dropRightWhile.d.ts +3 -1
  40. package/dist/array/dropRightWhile.js +43 -0
  41. package/dist/array/dropRightWhile.js.map +1 -0
  42. package/dist/array/dropRightWhile.mjs +9 -0
  43. package/dist/array/dropRightWhile.mjs.map +1 -0
  44. package/{esm/array/dropWhile.mjs → dist/array/dropWhile.d.mts} +5 -10
  45. package/dist/array/dropWhile.d.ts +3 -1
  46. package/dist/array/dropWhile.js +34 -0
  47. package/dist/array/dropWhile.js.map +1 -0
  48. package/dist/array/dropWhile.mjs +8 -0
  49. package/dist/array/dropWhile.mjs.map +1 -0
  50. package/{esm/array/groupBy.mjs → dist/array/groupBy.d.mts} +5 -26
  51. package/dist/array/groupBy.d.ts +3 -1
  52. package/dist/array/groupBy.js +41 -0
  53. package/dist/array/groupBy.js.map +1 -0
  54. package/dist/array/groupBy.mjs +8 -0
  55. package/dist/array/groupBy.mjs.map +1 -0
  56. package/dist/array/index.d.ts +30 -30
  57. package/dist/array/index.js +199 -842
  58. package/dist/array/index.js.map +1 -0
  59. package/dist/array/index.mjs +125 -0
  60. package/dist/array/index.mjs.map +1 -0
  61. package/{esm/array/intersection.mjs → dist/array/intersection.d.mts} +4 -8
  62. package/dist/array/intersection.d.ts +3 -1
  63. package/dist/array/intersection.js +35 -0
  64. package/dist/array/intersection.js.map +1 -0
  65. package/dist/array/intersection.mjs +8 -0
  66. package/dist/array/intersection.mjs.map +1 -0
  67. package/{esm/array/intersectionBy.mjs → dist/array/intersectionBy.d.mts} +5 -12
  68. package/dist/array/intersectionBy.d.ts +3 -1
  69. package/dist/array/intersectionBy.js +36 -0
  70. package/dist/array/intersectionBy.js.map +1 -0
  71. package/dist/array/intersectionBy.mjs +8 -0
  72. package/dist/array/intersectionBy.mjs.map +1 -0
  73. package/{esm/array/intersectionWith.mjs → dist/array/intersectionWith.d.mts} +6 -12
  74. package/dist/array/intersectionWith.d.ts +3 -1
  75. package/dist/array/intersectionWith.js +37 -0
  76. package/dist/array/intersectionWith.js.map +1 -0
  77. package/dist/array/intersectionWith.mjs +8 -0
  78. package/dist/array/intersectionWith.mjs.map +1 -0
  79. package/{esm/array/partition.mjs → dist/array/partition.d.mts} +8 -30
  80. package/dist/array/partition.d.ts +3 -1
  81. package/dist/array/partition.js +42 -0
  82. package/dist/array/partition.js.map +1 -0
  83. package/dist/array/partition.mjs +8 -0
  84. package/dist/array/partition.mjs.map +1 -0
  85. package/{esm/array/sample.mjs → dist/array/sample.d.mts} +2 -5
  86. package/dist/array/sample.d.ts +3 -1
  87. package/dist/array/sample.js +34 -0
  88. package/dist/array/sample.js.map +1 -0
  89. package/dist/array/sample.mjs +8 -0
  90. package/dist/array/sample.mjs.map +1 -0
  91. package/{esm/array/shuffle.mjs → dist/array/shuffle.d.mts} +2 -13
  92. package/dist/array/shuffle.d.ts +3 -1
  93. package/dist/array/shuffle.js +37 -0
  94. package/dist/array/shuffle.js.map +1 -0
  95. package/dist/array/shuffle.mjs +8 -0
  96. package/dist/array/shuffle.mjs.map +1 -0
  97. package/{esm/array/take.mjs → dist/array/take.d.mts} +5 -7
  98. package/dist/array/take.d.ts +3 -1
  99. package/dist/array/take.js +33 -0
  100. package/dist/array/take.js.map +1 -0
  101. package/dist/array/take.mjs +8 -0
  102. package/dist/array/take.mjs.map +1 -0
  103. package/{esm/array/takeRight.mjs → dist/array/takeRight.d.mts} +5 -10
  104. package/dist/array/takeRight.d.ts +3 -1
  105. package/dist/array/takeRight.js +36 -0
  106. package/dist/array/takeRight.js.map +1 -0
  107. package/dist/array/takeRight.mjs +8 -0
  108. package/dist/array/takeRight.mjs.map +1 -0
  109. package/{esm/array/takeRightWhile.mjs → dist/array/takeRightWhile.d.mts} +5 -12
  110. package/dist/array/takeRightWhile.d.ts +3 -1
  111. package/dist/array/takeRightWhile.js +38 -0
  112. package/dist/array/takeRightWhile.js.map +1 -0
  113. package/dist/array/takeRightWhile.mjs +8 -0
  114. package/dist/array/takeRightWhile.mjs.map +1 -0
  115. package/{esm/array/takeWhile.mjs → dist/array/takeWhile.d.mts} +1 -21
  116. package/dist/array/takeWhile.d.ts +3 -1
  117. package/dist/array/takeWhile.js +40 -0
  118. package/dist/array/takeWhile.js.map +1 -0
  119. package/dist/array/takeWhile.mjs +8 -0
  120. package/dist/array/takeWhile.mjs.map +1 -0
  121. package/{esm/array/union.mjs → dist/array/union.d.mts} +3 -7
  122. package/dist/array/union.d.ts +3 -1
  123. package/dist/array/union.js +47 -0
  124. package/dist/array/union.js.map +1 -0
  125. package/dist/array/union.mjs +9 -0
  126. package/dist/array/union.mjs.map +1 -0
  127. package/{esm/array/unionBy.mjs → dist/array/unionBy.d.mts} +4 -16
  128. package/dist/array/unionBy.d.ts +3 -1
  129. package/dist/array/unionBy.js +40 -0
  130. package/dist/array/unionBy.js.map +1 -0
  131. package/dist/array/unionBy.mjs +8 -0
  132. package/dist/array/unionBy.mjs.map +1 -0
  133. package/{esm/array/unionWith.mjs → dist/array/unionWith.d.mts} +4 -8
  134. package/dist/array/unionWith.d.ts +3 -1
  135. package/dist/array/unionWith.js +47 -0
  136. package/dist/array/unionWith.js.map +1 -0
  137. package/dist/array/unionWith.mjs +9 -0
  138. package/dist/array/unionWith.mjs.map +1 -0
  139. package/dist/array/uniq.d.mts +17 -0
  140. package/dist/array/uniq.d.ts +3 -1
  141. package/dist/array/uniq.js +40 -0
  142. package/dist/array/uniq.js.map +1 -0
  143. package/dist/array/uniq.mjs +8 -0
  144. package/dist/array/uniq.mjs.map +1 -0
  145. package/{esm/array/uniqBy.mjs → dist/array/uniqBy.d.mts} +1 -7
  146. package/dist/array/uniqBy.d.ts +3 -1
  147. package/dist/array/uniqBy.js +47 -0
  148. package/dist/array/uniqBy.js.map +1 -0
  149. package/dist/array/uniqBy.mjs +9 -0
  150. package/dist/array/uniqBy.mjs.map +1 -0
  151. package/dist/array/uniqWith.d.mts +14 -0
  152. package/dist/array/uniqWith.d.ts +3 -1
  153. package/dist/array/uniqWith.js +40 -0
  154. package/dist/array/uniqWith.js.map +1 -0
  155. package/dist/array/uniqWith.mjs +8 -0
  156. package/dist/array/uniqWith.mjs.map +1 -0
  157. package/{esm/array/xor.mjs → dist/array/xor.d.mts} +4 -10
  158. package/dist/array/xor.d.ts +3 -1
  159. package/dist/array/xor.js +66 -0
  160. package/dist/array/xor.js.map +1 -0
  161. package/dist/array/xor.mjs +12 -0
  162. package/dist/array/xor.mjs.map +1 -0
  163. package/{esm/array/xorBy.mjs → dist/array/xorBy.d.mts} +5 -13
  164. package/dist/array/xorBy.d.ts +3 -1
  165. package/dist/array/xorBy.js +65 -0
  166. package/dist/array/xorBy.js.map +1 -0
  167. package/dist/array/xorBy.mjs +11 -0
  168. package/dist/array/xorBy.mjs.map +1 -0
  169. package/{esm/array/xorWith.mjs → dist/array/xorWith.d.mts} +5 -13
  170. package/dist/array/xorWith.d.ts +3 -1
  171. package/dist/array/xorWith.js +72 -0
  172. package/dist/array/xorWith.js.map +1 -0
  173. package/dist/array/xorWith.mjs +12 -0
  174. package/dist/array/xorWith.mjs.map +1 -0
  175. package/dist/array/zip.d.mts +27 -0
  176. package/dist/array/zip.d.ts +6 -4
  177. package/dist/array/zip.js +42 -0
  178. package/dist/array/zip.js.map +1 -0
  179. package/dist/array/zip.mjs +8 -0
  180. package/dist/array/zip.mjs.map +1 -0
  181. package/{esm/array/zipWith.mjs → dist/array/zipWith.d.mts} +6 -26
  182. package/dist/array/zipWith.d.ts +6 -4
  183. package/dist/array/zipWith.js +41 -0
  184. package/dist/array/zipWith.js.map +1 -0
  185. package/dist/array/zipWith.mjs +8 -0
  186. package/dist/array/zipWith.mjs.map +1 -0
  187. package/dist/chunk-2KXLTAVK.mjs +16 -0
  188. package/dist/chunk-2KXLTAVK.mjs.map +1 -0
  189. package/dist/chunk-2MM5EJJX.mjs +21 -0
  190. package/dist/chunk-2MM5EJJX.mjs.map +1 -0
  191. package/dist/chunk-2VB6XU3I.mjs +12 -0
  192. package/dist/chunk-2VB6XU3I.mjs.map +1 -0
  193. package/dist/chunk-35TWSMYS.mjs +19 -0
  194. package/dist/chunk-35TWSMYS.mjs.map +1 -0
  195. package/dist/chunk-5JWSGT4R.mjs +18 -0
  196. package/dist/chunk-5JWSGT4R.mjs.map +1 -0
  197. package/dist/chunk-724PNXPR.mjs +13 -0
  198. package/dist/chunk-724PNXPR.mjs.map +1 -0
  199. package/dist/chunk-7GWOR247.mjs +11 -0
  200. package/dist/chunk-7GWOR247.mjs.map +1 -0
  201. package/dist/chunk-7OZZODAE.mjs +19 -0
  202. package/dist/chunk-7OZZODAE.mjs.map +1 -0
  203. package/dist/chunk-7PPND7QY.mjs +16 -0
  204. package/dist/chunk-7PPND7QY.mjs.map +1 -0
  205. package/dist/chunk-7SJHJHBN.mjs +11 -0
  206. package/dist/chunk-7SJHJHBN.mjs.map +1 -0
  207. package/dist/chunk-ARWKEQMQ.mjs +19 -0
  208. package/dist/chunk-ARWKEQMQ.mjs.map +1 -0
  209. package/dist/chunk-ARZ5BDR6.mjs +1 -0
  210. package/dist/chunk-ARZ5BDR6.mjs.map +1 -0
  211. package/dist/chunk-BAJC3BM7.mjs +12 -0
  212. package/dist/chunk-BAJC3BM7.mjs.map +1 -0
  213. package/dist/chunk-EAI4DDCQ.mjs +16 -0
  214. package/dist/chunk-EAI4DDCQ.mjs.map +1 -0
  215. package/dist/chunk-EAI6NLXI.mjs +12 -0
  216. package/dist/chunk-EAI6NLXI.mjs.map +1 -0
  217. package/dist/chunk-EJGAXTF7.mjs +1 -0
  218. package/dist/chunk-EJGAXTF7.mjs.map +1 -0
  219. package/dist/chunk-FUWEG5ZM.mjs +9 -0
  220. package/dist/chunk-FUWEG5ZM.mjs.map +1 -0
  221. package/dist/chunk-GJM7F3TH.mjs +13 -0
  222. package/dist/chunk-GJM7F3TH.mjs.map +1 -0
  223. package/dist/chunk-HQF6OFGM.mjs +9 -0
  224. package/dist/chunk-HQF6OFGM.mjs.map +1 -0
  225. package/dist/chunk-IJLQVGW4.mjs +1 -0
  226. package/dist/chunk-IJLQVGW4.mjs.map +1 -0
  227. package/dist/chunk-J3NTLMAE.mjs +10 -0
  228. package/dist/chunk-J3NTLMAE.mjs.map +1 -0
  229. package/dist/chunk-JMLFPGZ3.mjs +13 -0
  230. package/dist/chunk-JMLFPGZ3.mjs.map +1 -0
  231. package/dist/chunk-L4Y3G6AJ.mjs +23 -0
  232. package/dist/chunk-L4Y3G6AJ.mjs.map +1 -0
  233. package/dist/chunk-LAZNLIBJ.mjs +10 -0
  234. package/dist/chunk-LAZNLIBJ.mjs.map +1 -0
  235. package/dist/chunk-MAJSPFA6.mjs +1 -0
  236. package/dist/chunk-MAJSPFA6.mjs.map +1 -0
  237. package/dist/chunk-NEMQJ2GF.mjs +18 -0
  238. package/dist/chunk-NEMQJ2GF.mjs.map +1 -0
  239. package/dist/chunk-NK2262VG.mjs +9 -0
  240. package/dist/chunk-NK2262VG.mjs.map +1 -0
  241. package/dist/chunk-NSYWEYWT.mjs +13 -0
  242. package/dist/chunk-NSYWEYWT.mjs.map +1 -0
  243. package/dist/chunk-NYVT33DR.mjs +9 -0
  244. package/dist/chunk-NYVT33DR.mjs.map +1 -0
  245. package/dist/chunk-OBMK7JO2.mjs +13 -0
  246. package/dist/chunk-OBMK7JO2.mjs.map +1 -0
  247. package/dist/chunk-PTQLD7TG.mjs +11 -0
  248. package/dist/chunk-PTQLD7TG.mjs.map +1 -0
  249. package/dist/chunk-PWMHSN27.mjs +14 -0
  250. package/dist/chunk-PWMHSN27.mjs.map +1 -0
  251. package/dist/chunk-QRQPLMV4.mjs +16 -0
  252. package/dist/chunk-QRQPLMV4.mjs.map +1 -0
  253. package/dist/chunk-R5DNKXDI.mjs +21 -0
  254. package/dist/chunk-R5DNKXDI.mjs.map +1 -0
  255. package/dist/chunk-RK6PRCEJ.mjs +12 -0
  256. package/dist/chunk-RK6PRCEJ.mjs.map +1 -0
  257. package/dist/chunk-RLDY4N3Q.mjs +13 -0
  258. package/dist/chunk-RLDY4N3Q.mjs.map +1 -0
  259. package/dist/chunk-RU3RXBUC.mjs +17 -0
  260. package/dist/chunk-RU3RXBUC.mjs.map +1 -0
  261. package/dist/chunk-S767XFOS.mjs +10 -0
  262. package/dist/chunk-S767XFOS.mjs.map +1 -0
  263. package/dist/chunk-SGSQKXDO.mjs +15 -0
  264. package/dist/chunk-SGSQKXDO.mjs.map +1 -0
  265. package/dist/chunk-SYQTG4N4.mjs +1 -0
  266. package/dist/chunk-SYQTG4N4.mjs.map +1 -0
  267. package/dist/chunk-T5JCRGXA.mjs +1 -0
  268. package/dist/chunk-T5JCRGXA.mjs.map +1 -0
  269. package/dist/chunk-TOLR2FNF.mjs +13 -0
  270. package/dist/chunk-TOLR2FNF.mjs.map +1 -0
  271. package/dist/chunk-UNX3KZO2.mjs +17 -0
  272. package/dist/chunk-UNX3KZO2.mjs.map +1 -0
  273. package/dist/chunk-UZP4YX7I.mjs +17 -0
  274. package/dist/chunk-UZP4YX7I.mjs.map +1 -0
  275. package/dist/chunk-VACGGQOL.mjs +9 -0
  276. package/dist/chunk-VACGGQOL.mjs.map +1 -0
  277. package/dist/chunk-VAKCSKGR.mjs +17 -0
  278. package/dist/chunk-VAKCSKGR.mjs.map +1 -0
  279. package/dist/chunk-VJGGYY4Y.mjs +13 -0
  280. package/dist/chunk-VJGGYY4Y.mjs.map +1 -0
  281. package/dist/chunk-WFQ3LAHQ.mjs +9 -0
  282. package/dist/chunk-WFQ3LAHQ.mjs.map +1 -0
  283. package/dist/chunk-XS4ZPJMT.mjs +21 -0
  284. package/dist/chunk-XS4ZPJMT.mjs.map +1 -0
  285. package/dist/chunk-XW452I77.mjs +16 -0
  286. package/dist/chunk-XW452I77.mjs.map +1 -0
  287. package/dist/chunk-YMNXRH52.mjs +9 -0
  288. package/dist/chunk-YMNXRH52.mjs.map +1 -0
  289. package/dist/chunk-Z4IO7EIH.mjs +16 -0
  290. package/dist/chunk-Z4IO7EIH.mjs.map +1 -0
  291. package/{esm/function/debounce.mjs → dist/function/debounce.d.mts} +5 -18
  292. package/dist/function/debounce.d.ts +3 -1
  293. package/dist/function/debounce.js +47 -0
  294. package/dist/function/debounce.js.map +1 -0
  295. package/dist/function/debounce.mjs +8 -0
  296. package/dist/function/debounce.mjs.map +1 -0
  297. package/dist/function/index.d.ts +3 -3
  298. package/dist/function/index.js +47 -78
  299. package/dist/function/index.js.map +1 -0
  300. package/dist/function/index.mjs +17 -0
  301. package/dist/function/index.mjs.map +1 -0
  302. package/{esm/function/once.mjs → dist/function/once.d.mts} +2 -14
  303. package/dist/function/once.d.ts +3 -1
  304. package/dist/function/once.js +43 -0
  305. package/dist/function/once.js.map +1 -0
  306. package/dist/function/once.mjs +8 -0
  307. package/dist/function/once.mjs.map +1 -0
  308. package/{esm/function/throttle.mjs → dist/function/throttle.d.mts} +3 -13
  309. package/dist/function/throttle.d.ts +3 -1
  310. package/dist/function/throttle.js +41 -0
  311. package/dist/function/throttle.js.map +1 -0
  312. package/dist/function/throttle.mjs +8 -0
  313. package/dist/function/throttle.mjs.map +1 -0
  314. package/dist/index.d.ts +45 -6
  315. package/dist/index.js +288 -1271
  316. package/dist/index.js.map +1 -0
  317. package/dist/index.mjs +190 -0
  318. package/dist/index.mjs.map +1 -0
  319. package/{esm/math/clamp.mjs → dist/math/clamp.d.mts} +2 -7
  320. package/dist/math/clamp.d.ts +4 -2
  321. package/dist/math/clamp.js +36 -0
  322. package/dist/math/clamp.js.map +1 -0
  323. package/dist/math/clamp.mjs +8 -0
  324. package/dist/math/clamp.mjs.map +1 -0
  325. package/dist/math/index.d.ts +3 -3
  326. package/dist/math/index.js +41 -132
  327. package/dist/math/index.js.map +1 -0
  328. package/dist/math/index.mjs +17 -0
  329. package/dist/math/index.mjs.map +1 -0
  330. package/{esm/math/round.mjs → dist/math/round.d.mts} +3 -7
  331. package/dist/math/round.d.ts +3 -1
  332. package/dist/math/round.js +34 -0
  333. package/dist/math/round.js.map +1 -0
  334. package/dist/math/round.mjs +8 -0
  335. package/dist/math/round.mjs.map +1 -0
  336. package/dist/math/sum.d.mts +16 -0
  337. package/dist/math/sum.d.ts +3 -1
  338. package/dist/math/sum.js +37 -0
  339. package/dist/math/sum.js.map +1 -0
  340. package/dist/math/sum.mjs +8 -0
  341. package/dist/math/sum.mjs.map +1 -0
  342. package/dist/object/index.d.ts +4 -4
  343. package/dist/object/index.js +62 -256
  344. package/dist/object/index.js.map +1 -0
  345. package/dist/object/index.mjs +21 -0
  346. package/dist/object/index.mjs.map +1 -0
  347. package/{esm/object/omit.mjs → dist/object/omit.d.mts} +2 -19
  348. package/dist/object/omit.d.ts +3 -1
  349. package/dist/object/omit.js +51 -0
  350. package/dist/object/omit.js.map +1 -0
  351. package/dist/object/omit.mjs +8 -0
  352. package/dist/object/omit.mjs.map +1 -0
  353. package/{esm/object/omitBy.mjs → dist/object/omitBy.d.mts} +4 -18
  354. package/dist/object/omitBy.d.ts +3 -1
  355. package/dist/object/omitBy.js +40 -0
  356. package/dist/object/omitBy.js.map +1 -0
  357. package/dist/object/omitBy.mjs +8 -0
  358. package/dist/object/omitBy.mjs.map +1 -0
  359. package/{esm/object/pick.mjs → dist/object/pick.d.mts} +2 -19
  360. package/dist/object/pick.d.ts +3 -1
  361. package/dist/object/pick.js +37 -0
  362. package/dist/object/pick.js.map +1 -0
  363. package/dist/object/pick.mjs +8 -0
  364. package/dist/object/pick.mjs.map +1 -0
  365. package/{esm/object/pickBy.mjs → dist/object/pickBy.d.mts} +4 -18
  366. package/dist/object/pickBy.d.ts +3 -1
  367. package/dist/object/pickBy.js +40 -0
  368. package/dist/object/pickBy.js.map +1 -0
  369. package/dist/object/pickBy.mjs +8 -0
  370. package/dist/object/pickBy.mjs.map +1 -0
  371. package/dist/predicate/index.d.ts +4 -4
  372. package/dist/predicate/index.js +42 -84
  373. package/dist/predicate/index.js.map +1 -0
  374. package/dist/predicate/index.mjs +21 -0
  375. package/dist/predicate/index.mjs.map +1 -0
  376. package/{esm/predicate/isNil.mjs → dist/predicate/isNil.d.mts} +4 -6
  377. package/dist/predicate/isNil.d.ts +3 -1
  378. package/dist/predicate/isNil.js +33 -0
  379. package/dist/predicate/isNil.js.map +1 -0
  380. package/dist/predicate/isNil.mjs +8 -0
  381. package/dist/predicate/isNil.mjs.map +1 -0
  382. package/{esm/predicate/isNotNil.mjs → dist/predicate/isNotNil.d.mts} +2 -4
  383. package/dist/predicate/isNotNil.d.ts +3 -1
  384. package/dist/predicate/isNotNil.js +33 -0
  385. package/dist/predicate/isNotNil.js.map +1 -0
  386. package/dist/predicate/isNotNil.mjs +8 -0
  387. package/dist/predicate/isNotNil.mjs.map +1 -0
  388. package/{esm/predicate/isNull.mjs → dist/predicate/isNull.d.mts} +4 -6
  389. package/dist/predicate/isNull.d.ts +3 -1
  390. package/dist/predicate/isNull.js +33 -0
  391. package/dist/predicate/isNull.js.map +1 -0
  392. package/dist/predicate/isNull.mjs +8 -0
  393. package/dist/predicate/isNull.mjs.map +1 -0
  394. package/{esm/predicate/isUndefined.mjs → dist/predicate/isUndefined.d.mts} +4 -6
  395. package/dist/predicate/isUndefined.d.ts +3 -1
  396. package/dist/predicate/isUndefined.js +33 -0
  397. package/dist/predicate/isUndefined.js.map +1 -0
  398. package/dist/predicate/isUndefined.mjs +8 -0
  399. package/dist/predicate/isUndefined.mjs.map +1 -0
  400. package/{esm/promise/delay.mjs → dist/promise/delay.d.mts} +4 -8
  401. package/dist/promise/delay.d.ts +3 -1
  402. package/dist/promise/delay.js +35 -0
  403. package/dist/promise/delay.js.map +1 -0
  404. package/dist/promise/delay.mjs +8 -0
  405. package/dist/promise/delay.mjs.map +1 -0
  406. package/dist/promise/index.d.ts +1 -1
  407. package/dist/promise/index.js +31 -23
  408. package/dist/promise/index.js.map +1 -0
  409. package/dist/promise/index.mjs +9 -0
  410. package/dist/promise/index.mjs.map +1 -0
  411. package/package.json +120 -49
  412. package/dist/array/chunk.spec.d.ts +0 -1
  413. package/dist/array/difference.spec.d.ts +0 -1
  414. package/dist/array/differenceBy.spec.d.ts +0 -1
  415. package/dist/array/differenceWith.spec.d.ts +0 -1
  416. package/dist/array/drop.spec.d.ts +0 -1
  417. package/dist/array/dropRight.spec.d.ts +0 -1
  418. package/dist/array/dropRightWhile.spec.d.ts +0 -1
  419. package/dist/array/dropWhile.spec.d.ts +0 -1
  420. package/dist/array/groupBy.spec.d.ts +0 -1
  421. package/dist/array/intersection.spec.d.ts +0 -1
  422. package/dist/array/intersectionBy.spec.d.ts +0 -1
  423. package/dist/array/intersectionWith.spec.d.ts +0 -1
  424. package/dist/array/partition.spec.d.ts +0 -1
  425. package/dist/array/sample.spec.d.ts +0 -1
  426. package/dist/array/shuffle.spec.d.ts +0 -1
  427. package/dist/array/take.spec.d.ts +0 -1
  428. package/dist/array/takeRight.spec.d.ts +0 -1
  429. package/dist/array/takeRightWhile.spec.d.ts +0 -1
  430. package/dist/array/takeWhile.spec.d.ts +0 -1
  431. package/dist/array/union.spec.d.ts +0 -1
  432. package/dist/array/unionBy.spec.d.ts +0 -1
  433. package/dist/array/unionWith.spec.d.ts +0 -1
  434. package/dist/array/uniq.spec.d.ts +0 -1
  435. package/dist/array/uniqBy.spec.d.ts +0 -1
  436. package/dist/array/uniqWith.spec.d.ts +0 -1
  437. package/dist/array/xor.spec.d.ts +0 -1
  438. package/dist/array/xorBy.spec.d.ts +0 -1
  439. package/dist/array/xorWith.spec.d.ts +0 -1
  440. package/dist/array/zip.spec.d.ts +0 -1
  441. package/dist/array/zipWith.spec.d.ts +0 -1
  442. package/dist/function/debounce.spec.d.ts +0 -1
  443. package/dist/function/once.spec.d.ts +0 -1
  444. package/dist/function/throttle.spec.d.ts +0 -1
  445. package/dist/math/clamp.spec.d.ts +0 -1
  446. package/dist/math/round.spec.d.ts +0 -1
  447. package/dist/math/sum.spec.d.ts +0 -1
  448. package/dist/object/omit.spec.d.ts +0 -1
  449. package/dist/object/omitBy.spec.d.ts +0 -1
  450. package/dist/object/pick.spec.d.ts +0 -1
  451. package/dist/object/pickBy.spec.d.ts +0 -1
  452. package/dist/predicate/isNil.spec.d.ts +0 -1
  453. package/dist/predicate/isNotNil.spec.d.ts +0 -1
  454. package/dist/predicate/isNull.spec.d.ts +0 -1
  455. package/dist/predicate/isUndefined.spec.d.ts +0 -1
  456. package/dist/promise/delay.spec.d.ts +0 -1
  457. package/esm/_virtual/_rollupPluginBabelHelpers.mjs +0 -163
  458. package/esm/array/_virtual/_rollupPluginBabelHelpers.mjs +0 -78
  459. package/esm/array/uniq.mjs +0 -37
  460. package/esm/array/uniqWith.mjs +0 -39
  461. package/esm/array/zip.mjs +0 -52
  462. package/esm/math/_virtual/_rollupPluginBabelHelpers.mjs +0 -66
  463. package/esm/math/sum.mjs +0 -33
  464. package/esm/object/_virtual/_rollupPluginBabelHelpers.mjs +0 -151
  465. /package/{esm/array/index.mjs → dist/array/index.d.mts} +0 -0
  466. /package/{esm/function/index.mjs → dist/function/index.d.mts} +0 -0
  467. /package/{esm/index.mjs → dist/index.d.mts} +0 -0
  468. /package/{esm/math/index.mjs → dist/math/index.d.mts} +0 -0
  469. /package/{esm/object/index.mjs → dist/object/index.d.mts} +0 -0
  470. /package/{esm/predicate/index.mjs → dist/predicate/index.d.mts} +0 -0
  471. /package/{esm/promise/index.mjs → dist/promise/index.d.mts} +0 -0
@@ -0,0 +1,9 @@
1
+ import {
2
+ union
3
+ } from "../chunk-RLDY4N3Q.mjs";
4
+ import "../chunk-QRQPLMV4.mjs";
5
+ import "../chunk-2MM5EJJX.mjs";
6
+ export {
7
+ union
8
+ };
9
+ //# sourceMappingURL=union.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,35 +1,23 @@
1
- import { toConsumableArray as _toConsumableArray } from './_virtual/_rollupPluginBabelHelpers.mjs';
2
-
3
1
  /**
4
2
  * Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality.
5
- *
3
+ *
6
4
  * @param {T[]} arr1 - The first array.
7
5
  * @param {T[]} arr2 - The second array.
8
6
  * @param {function(item: T): U} mapper - The function to map array elements to comparison values.
9
7
  * @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function.
10
- *
8
+ *
11
9
  * @example
12
10
  * // Custom mapping function for numbers (modulo comparison)
13
11
  * const moduloMapper = (x) => x % 3;
14
12
  * unionBy([1, 2, 3], [4, 5, 6], moduloMapper);
15
13
  * // Returns [1, 2, 3]
16
- *
14
+ *
17
15
  * @example
18
16
  * // Custom mapping function for objects with an 'id' property
19
17
  * const idMapper = (obj) => obj.id;
20
18
  * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
21
19
  * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }]
22
20
  */
23
- function unionBy(arr1, arr2, mapper) {
24
- var map = new Map();
25
- for (var _i = 0, _arr = [].concat(_toConsumableArray(arr1), _toConsumableArray(arr2)); _i < _arr.length; _i++) {
26
- var item = _arr[_i];
27
- var key = mapper(item);
28
- if (!map.has(key)) {
29
- map.set(key, item);
30
- }
31
- }
32
- return _toConsumableArray(map.values());
33
- }
21
+ declare function unionBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[];
34
22
 
35
23
  export { unionBy };
@@ -18,4 +18,6 @@
18
18
  * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
19
19
  * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }]
20
20
  */
21
- export declare function unionBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[];
21
+ declare function unionBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[];
22
+
23
+ export { unionBy };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/unionBy.ts
21
+ var unionBy_exports = {};
22
+ __export(unionBy_exports, {
23
+ unionBy: () => unionBy
24
+ });
25
+ module.exports = __toCommonJS(unionBy_exports);
26
+ function unionBy(arr1, arr2, mapper) {
27
+ const map = /* @__PURE__ */ new Map();
28
+ for (const item of [...arr1, ...arr2]) {
29
+ const key = mapper(item);
30
+ if (!map.has(key)) {
31
+ map.set(key, item);
32
+ }
33
+ }
34
+ return [...map.values()];
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ unionBy
39
+ });
40
+ //# sourceMappingURL=unionBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/unionBy.ts"],"sourcesContent":["/**\n * Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {function(item: T): U} mapper - The function to map array elements to comparison values.\n * @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function.\n * \n * @example\n * // Custom mapping function for numbers (modulo comparison)\n * const moduloMapper = (x) => x % 3;\n * unionBy([1, 2, 3], [4, 5, 6], moduloMapper);\n * // Returns [1, 2, 3]\n * \n * @example\n * // Custom mapping function for objects with an 'id' property\n * const idMapper = (obj) => obj.id;\n * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);\n * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }]\n */\nexport function unionBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[] {\n const map = new Map<U, T>();\n\n for (const item of [...arr1, ...arr2]) {\n const key = mapper(item);\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return [...map.values()];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,QAAc,MAAW,MAAW,QAA6B;AAC/E,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG;AACrC,UAAM,MAAM,OAAO,IAAI;AACvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,IAAI,OAAO,CAAC;AACzB;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ unionBy
3
+ } from "../chunk-7PPND7QY.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ unionBy
7
+ };
8
+ //# sourceMappingURL=unionBy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,14 +1,12 @@
1
- import { uniqWith } from './uniqWith.mjs';
2
-
3
1
  /**
4
2
  * Creates an array of unique values from two given arrays based on a custom equality function.
5
- *
6
- * This function takes two arrays and a custom equality function, merges the arrays, and returns
3
+ *
4
+ * This function takes two arrays and a custom equality function, merges the arrays, and returns
7
5
  * a new array containing only the unique values as determined by the custom equality function.
8
6
  *
9
7
  * @param {T[]} arr1 - The first array to merge and filter for unique values.
10
8
  * @param {T[]} arr2 - The second array to merge and filter for unique values.
11
- * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
9
+ * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
12
10
  * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise.
13
11
  * @returns {T[]} A new array of unique values based on the custom equality function.
14
12
  *
@@ -19,8 +17,6 @@ import { uniqWith } from './uniqWith.mjs';
19
17
  * const result = unionWith(array1, array2, areItemsEqual);
20
18
  * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays
21
19
  */
22
- function unionWith(arr1, arr2, areItemsEqual) {
23
- return uniqWith(arr1.concat(arr2), areItemsEqual);
24
- }
20
+ declare function unionWith<T>(arr1: T[], arr2: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[];
25
21
 
26
22
  export { unionWith };
@@ -17,4 +17,6 @@
17
17
  * const result = unionWith(array1, array2, areItemsEqual);
18
18
  * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays
19
19
  */
20
- export declare function unionWith<T>(arr1: T[], arr2: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[];
20
+ declare function unionWith<T>(arr1: T[], arr2: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[];
21
+
22
+ export { unionWith };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/unionWith.ts
21
+ var unionWith_exports = {};
22
+ __export(unionWith_exports, {
23
+ unionWith: () => unionWith
24
+ });
25
+ module.exports = __toCommonJS(unionWith_exports);
26
+
27
+ // src/array/uniqWith.ts
28
+ function uniqWith(arr, areItemsEqual) {
29
+ const result = [];
30
+ for (const item of arr) {
31
+ const isUniq = result.every((v) => !areItemsEqual(v, item));
32
+ if (isUniq) {
33
+ result.push(item);
34
+ }
35
+ }
36
+ return result;
37
+ }
38
+
39
+ // src/array/unionWith.ts
40
+ function unionWith(arr1, arr2, areItemsEqual) {
41
+ return uniqWith(arr1.concat(arr2), areItemsEqual);
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ unionWith
46
+ });
47
+ //# sourceMappingURL=unionWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/unionWith.ts","../../src/array/uniqWith.ts"],"sourcesContent":["import { uniqWith } from \"./uniqWith\";\n\n/**\n * Creates an array of unique values from two given arrays based on a custom equality function.\n * \n * This function takes two arrays and a custom equality function, merges the arrays, and returns \n * a new array containing only the unique values as determined by the custom equality function.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. \n * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array of unique values based on the custom equality function.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }];\n * const array2 = [{ id: 2 }, { id: 3 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = unionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays\n */\nexport function unionWith<T>(arr1: T[], arr2: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[] {\n return uniqWith(arr1.concat(arr2), areItemsEqual);\n}\n","/**\n * The `uniqWith` function takes an array as its first argument and a 'comparator' function as the second.\n *\n * It evaluates the elements of the array using the comparator function, and if true is returned, it considers those elements as duplicates and removes them.\n *\n * @example\n * ```ts\n * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1);\n * // [1, 2, 3, 5, 7]\n * ```\n */\nexport function uniqWith<T>(\n arr: T[],\n areItemsEqual: (item1: T, item2: T) => boolean\n): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n const isUniq = result.every((v) => !areItemsEqual(v, item));\n\n if (isUniq) {\n result.push(item);\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,SAAS,SACd,KACA,eACK;AACL,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,UAAM,SAAS,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;AAE1D,QAAI,QAAQ;AACV,aAAO,KAAK,IAAI;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AACT;;;ADLO,SAAS,UAAa,MAAW,MAAW,eAAqD;AACtG,SAAO,SAAS,KAAK,OAAO,IAAI,GAAG,aAAa;AAClD;","names":[]}
@@ -0,0 +1,9 @@
1
+ import {
2
+ unionWith
3
+ } from "../chunk-VJGGYY4Y.mjs";
4
+ import "../chunk-EAI4DDCQ.mjs";
5
+ import "../chunk-2MM5EJJX.mjs";
6
+ export {
7
+ unionWith
8
+ };
9
+ //# sourceMappingURL=unionWith.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Creates a duplicate-free version of an array.
3
+ *
4
+ * This function takes an array and returns a new array containing only the unique values
5
+ * from the original array, preserving the order of first occurrence.
6
+ *
7
+ * @param {T[]} arr - The array to process.
8
+ * @returns {T[]} A new array with only unique values from the original array.
9
+ *
10
+ * @example
11
+ * * const array = [1, 2, 2, 3, 4, 4, 5];
12
+ * const result = uniq(array);
13
+ * // result will be [1, 2, 3, 4, 5]
14
+ */
15
+ declare function uniq<T>(arr: T[]): T[];
16
+
17
+ export { uniq };
@@ -12,4 +12,6 @@
12
12
  * const result = uniq(array);
13
13
  * // result will be [1, 2, 3, 4, 5]
14
14
  */
15
- export declare function uniq<T>(arr: T[]): T[];
15
+ declare function uniq<T>(arr: T[]): T[];
16
+
17
+ export { uniq };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/uniq.ts
21
+ var uniq_exports = {};
22
+ __export(uniq_exports, {
23
+ uniq: () => uniq
24
+ });
25
+ module.exports = __toCommonJS(uniq_exports);
26
+ function uniq(arr) {
27
+ const result = [];
28
+ for (const item of arr) {
29
+ if (result.includes(item)) {
30
+ continue;
31
+ }
32
+ result.push(item);
33
+ }
34
+ return result;
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ uniq
39
+ });
40
+ //# sourceMappingURL=uniq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/uniq.ts"],"sourcesContent":["/**\n * Creates a duplicate-free version of an array.\n * \n * This function takes an array and returns a new array containing only the unique values \n * from the original array, preserving the order of first occurrence.\n *\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: T[]): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n if (result.includes(item)) {\n continue;\n }\n\n result.push(item);\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,SAAS,KAAQ,KAAe;AACrC,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,QAAI,OAAO,SAAS,IAAI,GAAG;AACzB;AAAA,IACF;AAEA,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ uniq
3
+ } from "../chunk-QRQPLMV4.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ uniq
7
+ };
8
+ //# sourceMappingURL=uniq.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,5 +1,3 @@
1
- import { uniqWith } from './uniqWith.mjs';
2
-
3
1
  /**
4
2
  * The `uniqBy` function takes an array as its first argument and a 'converter' function as the second. It maps the array elements using the converter function, then removes any duplicates.
5
3
  *
@@ -11,10 +9,6 @@ import { uniqWith } from './uniqWith.mjs';
11
9
  * // [1.2, 2.1, 3.3, 5.7, 7.19]
12
10
  * ```
13
11
  */
14
- function uniqBy(arr, converter) {
15
- return uniqWith(arr, function (item1, item2) {
16
- return converter(item1) === converter(item2);
17
- });
18
- }
12
+ declare function uniqBy<T, U>(arr: T[], converter: (item: T) => U): T[];
19
13
 
20
14
  export { uniqBy };
@@ -9,4 +9,6 @@
9
9
  * // [1.2, 2.1, 3.3, 5.7, 7.19]
10
10
  * ```
11
11
  */
12
- export declare function uniqBy<T, U>(arr: T[], converter: (item: T) => U): T[];
12
+ declare function uniqBy<T, U>(arr: T[], converter: (item: T) => U): T[];
13
+
14
+ export { uniqBy };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/uniqBy.ts
21
+ var uniqBy_exports = {};
22
+ __export(uniqBy_exports, {
23
+ uniqBy: () => uniqBy
24
+ });
25
+ module.exports = __toCommonJS(uniqBy_exports);
26
+
27
+ // src/array/uniqWith.ts
28
+ function uniqWith(arr, areItemsEqual) {
29
+ const result = [];
30
+ for (const item of arr) {
31
+ const isUniq = result.every((v) => !areItemsEqual(v, item));
32
+ if (isUniq) {
33
+ result.push(item);
34
+ }
35
+ }
36
+ return result;
37
+ }
38
+
39
+ // src/array/uniqBy.ts
40
+ function uniqBy(arr, converter) {
41
+ return uniqWith(arr, (item1, item2) => converter(item1) === converter(item2));
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ uniqBy
46
+ });
47
+ //# sourceMappingURL=uniqBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/uniqBy.ts","../../src/array/uniqWith.ts"],"sourcesContent":["import { uniqWith } from \"./uniqWith\";\n\n/**\n * The `uniqBy` function takes an array as its first argument and a 'converter' function as the second. It maps the array elements using the converter function, then removes any duplicates.\n *\n * It filters out elements with the same value, meaning it does not check for duplicates in data types like Objects.\n *\n * @example\n * ```ts\n * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);\n * // [1.2, 2.1, 3.3, 5.7, 7.19]\n * ```\n */\nexport function uniqBy<T, U>(arr: T[], converter: (item: T) => U): T[] {\n return uniqWith(arr, (item1, item2) => converter(item1) === converter(item2));\n}\n","/**\n * The `uniqWith` function takes an array as its first argument and a 'comparator' function as the second.\n *\n * It evaluates the elements of the array using the comparator function, and if true is returned, it considers those elements as duplicates and removes them.\n *\n * @example\n * ```ts\n * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1);\n * // [1, 2, 3, 5, 7]\n * ```\n */\nexport function uniqWith<T>(\n arr: T[],\n areItemsEqual: (item1: T, item2: T) => boolean\n): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n const isUniq = result.every((v) => !areItemsEqual(v, item));\n\n if (isUniq) {\n result.push(item);\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,SAAS,SACd,KACA,eACK;AACL,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,UAAM,SAAS,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;AAE1D,QAAI,QAAQ;AACV,aAAO,KAAK,IAAI;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AACT;;;ADbO,SAAS,OAAa,KAAU,WAAgC;AACrE,SAAO,SAAS,KAAK,CAAC,OAAO,UAAU,UAAU,KAAK,MAAM,UAAU,KAAK,CAAC;AAC9E;","names":[]}
@@ -0,0 +1,9 @@
1
+ import {
2
+ uniqBy
3
+ } from "../chunk-JMLFPGZ3.mjs";
4
+ import "../chunk-EAI4DDCQ.mjs";
5
+ import "../chunk-2MM5EJJX.mjs";
6
+ export {
7
+ uniqBy
8
+ };
9
+ //# sourceMappingURL=uniqBy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The `uniqWith` function takes an array as its first argument and a 'comparator' function as the second.
3
+ *
4
+ * It evaluates the elements of the array using the comparator function, and if true is returned, it considers those elements as duplicates and removes them.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1);
9
+ * // [1, 2, 3, 5, 7]
10
+ * ```
11
+ */
12
+ declare function uniqWith<T>(arr: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[];
13
+
14
+ export { uniqWith };
@@ -9,4 +9,6 @@
9
9
  * // [1, 2, 3, 5, 7]
10
10
  * ```
11
11
  */
12
- export declare function uniqWith<T>(arr: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[];
12
+ declare function uniqWith<T>(arr: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[];
13
+
14
+ export { uniqWith };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/uniqWith.ts
21
+ var uniqWith_exports = {};
22
+ __export(uniqWith_exports, {
23
+ uniqWith: () => uniqWith
24
+ });
25
+ module.exports = __toCommonJS(uniqWith_exports);
26
+ function uniqWith(arr, areItemsEqual) {
27
+ const result = [];
28
+ for (const item of arr) {
29
+ const isUniq = result.every((v) => !areItemsEqual(v, item));
30
+ if (isUniq) {
31
+ result.push(item);
32
+ }
33
+ }
34
+ return result;
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ uniqWith
39
+ });
40
+ //# sourceMappingURL=uniqWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/uniqWith.ts"],"sourcesContent":["/**\n * The `uniqWith` function takes an array as its first argument and a 'comparator' function as the second.\n *\n * It evaluates the elements of the array using the comparator function, and if true is returned, it considers those elements as duplicates and removes them.\n *\n * @example\n * ```ts\n * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1);\n * // [1, 2, 3, 5, 7]\n * ```\n */\nexport function uniqWith<T>(\n arr: T[],\n areItemsEqual: (item1: T, item2: T) => boolean\n): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n const isUniq = result.every((v) => !areItemsEqual(v, item));\n\n if (isUniq) {\n result.push(item);\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,SAAS,SACd,KACA,eACK;AACL,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,UAAM,SAAS,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;AAE1D,QAAI,QAAQ;AACV,aAAO,KAAK,IAAI;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ uniqWith
3
+ } from "../chunk-EAI4DDCQ.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ uniqWith
7
+ };
8
+ //# sourceMappingURL=uniqWith.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,25 +1,19 @@
1
- import { difference } from './difference.mjs';
2
- import { intersection } from './intersection.mjs';
3
- import { union } from './union.mjs';
4
-
5
1
  /**
6
2
  * Computes the symmetric difference between two arrays. The symmetric difference is the set of elements
7
3
  * which are in either of the arrays, but not in their intersection.
8
- *
4
+ *
9
5
  * @param {T[]} arr1 - The first array.
10
6
  * @param {T[]} arr2 - The second array.
11
7
  * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both.
12
- *
8
+ *
13
9
  * @example
14
10
  * // Returns [1, 2, 5, 6]
15
11
  * xor([1, 2, 3, 4], [3, 4, 5, 6]);
16
- *
12
+ *
17
13
  * @example
18
14
  * // Returns ['a', 'c']
19
15
  * xor(['a', 'b'], ['b', 'c']);
20
16
  */
21
- function xor(arr1, arr2) {
22
- return difference(union(arr1, arr2), intersection(arr1, arr2));
23
- }
17
+ declare function xor<T>(arr1: T[], arr2: T[]): T[];
24
18
 
25
19
  export { xor };
@@ -14,4 +14,6 @@
14
14
  * // Returns ['a', 'c']
15
15
  * xor(['a', 'b'], ['b', 'c']);
16
16
  */
17
- export declare function xor<T>(arr1: T[], arr2: T[]): T[];
17
+ declare function xor<T>(arr1: T[], arr2: T[]): T[];
18
+
19
+ export { xor };
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/array/xor.ts
21
+ var xor_exports = {};
22
+ __export(xor_exports, {
23
+ xor: () => xor
24
+ });
25
+ module.exports = __toCommonJS(xor_exports);
26
+
27
+ // src/array/difference.ts
28
+ function difference(firstArr, secondArr) {
29
+ return firstArr.filter((item) => {
30
+ return !secondArr.includes(item);
31
+ });
32
+ }
33
+
34
+ // src/array/intersection.ts
35
+ function intersection(firstArr, secondArr) {
36
+ return firstArr.filter((item) => {
37
+ return secondArr.includes(item);
38
+ });
39
+ }
40
+
41
+ // src/array/uniq.ts
42
+ function uniq(arr) {
43
+ const result = [];
44
+ for (const item of arr) {
45
+ if (result.includes(item)) {
46
+ continue;
47
+ }
48
+ result.push(item);
49
+ }
50
+ return result;
51
+ }
52
+
53
+ // src/array/union.ts
54
+ function union(arr1, arr2) {
55
+ return uniq(arr1.concat(arr2));
56
+ }
57
+
58
+ // src/array/xor.ts
59
+ function xor(arr1, arr2) {
60
+ return difference(union(arr1, arr2), intersection(arr1, arr2));
61
+ }
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ xor
65
+ });
66
+ //# sourceMappingURL=xor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/xor.ts","../../src/array/difference.ts","../../src/array/intersection.ts","../../src/array/uniq.ts","../../src/array/union.ts"],"sourcesContent":["import { difference } from \"./difference\";\nimport { intersection } from \"./intersection\";\nimport { union } from \"./union\";\n\n/**\n * Computes the symmetric difference between two arrays. The symmetric difference is the set of elements\n * which are in either of the arrays, but not in their intersection.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both.\n * \n * @example\n * // Returns [1, 2, 5, 6]\n * xor([1, 2, 3, 4], [3, 4, 5, 6]);\n * \n * @example\n * // Returns ['a', 'c']\n * xor(['a', 'b'], ['b', 'c']);\n */\nexport function xor<T>(arr1: T[], arr2: T[]): T[] {\n return difference(union(arr1, arr2), intersection(arr1, arr2));\n}","/**\n * Computes the difference between two arrays.\n * \n * This function takes two arrays and returns a new array containing the elements \n * that are present in the first array but not in the second array. It effectively \n * filters out any elements from the first array that also appear in the second array.\n *\n * @template T\n * @param {T[]} firstArr - The array from which to derive the difference. This is the primary array \n * from which elements will be compared and filtered.\n * @param {T[]} secondArr - The array containing elements to be excluded from the first array. \n * Each element in this array will be checked against the first array, and if a match is found, \n * that element will be excluded from the result.\n * @returns {T[]} A new array containing the elements that are present in the first array but not \n * in the second array.\n *\n * @example\n * * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [2, 4];\n * const result = difference(array1, array2);\n * // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.\n */\nexport function difference<T>(firstArr: T[], secondArr: T[]): T[] {\n return firstArr.filter(item => {\n return !secondArr.includes(item)\n });\n}","/**\n * Returns the intersection of two arrays.\n * \n * This function takes two arrays and returns a new array containing the elements that are \n * present in both arrays. It effectively filters out any elements from the first array that \n * are not found in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @returns {T[]} A new array containing the elements that are present in both arrays.\n *\n * @example\n * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [3, 4, 5, 6, 7];\n * const result = intersection(array1, array2);\n * // result will be [3, 4, 5] since these elements are in both arrays.\n */\nexport function intersection<T>(firstArr: T[], secondArr: T[]): T[] {\n return firstArr.filter(item => {\n return secondArr.includes(item);\n });\n}\n","/**\n * Creates a duplicate-free version of an array.\n * \n * This function takes an array and returns a new array containing only the unique values \n * from the original array, preserving the order of first occurrence.\n *\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: T[]): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n if (result.includes(item)) {\n continue;\n }\n\n result.push(item);\n }\n\n return result;\n}\n","import { uniq } from \"./uniq\";\n\n/**\n * Creates an array of unique values from all given arrays.\n * \n * This function takes two arrays, merges them into a single array, and returns a new array \n * containing only the unique values from the merged array.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: T[], arr2: T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsBO,SAAS,WAAc,UAAe,WAAqB;AAChE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,UAAU,SAAS,IAAI;AAAA,EACjC,CAAC;AACH;;;ACTO,SAAS,aAAgB,UAAe,WAAqB;AAClE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,UAAU,SAAS,IAAI;AAAA,EAChC,CAAC;AACH;;;ACPO,SAAS,KAAQ,KAAe;AACrC,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,QAAI,OAAO,SAAS,IAAI,GAAG;AACzB;AAAA,IACF;AAEA,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;;;ACRO,SAAS,MAAS,MAAW,MAAgB;AAClD,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;;;AJAO,SAAS,IAAO,MAAW,MAAgB;AAChD,SAAO,WAAW,MAAM,MAAM,IAAI,GAAG,aAAa,MAAM,IAAI,CAAC;AAC/D;","names":[]}
@@ -0,0 +1,12 @@
1
+ import {
2
+ xor
3
+ } from "../chunk-7OZZODAE.mjs";
4
+ import "../chunk-RLDY4N3Q.mjs";
5
+ import "../chunk-QRQPLMV4.mjs";
6
+ import "../chunk-7GWOR247.mjs";
7
+ import "../chunk-PTQLD7TG.mjs";
8
+ import "../chunk-2MM5EJJX.mjs";
9
+ export {
10
+ xor
11
+ };
12
+ //# sourceMappingURL=xor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}