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
@@ -1,30 +1,22 @@
1
- import { differenceBy } from './differenceBy.mjs';
2
- import { intersectionBy } from './intersectionBy.mjs';
3
- import { unionBy } from './unionBy.mjs';
4
-
5
1
  /**
6
- * Computes the symmetric difference between two arrays using a custom mapping function.
7
- * The symmetric difference is the set of elements which are in either of the arrays,
2
+ * Computes the symmetric difference between two arrays using a custom mapping function.
3
+ * The symmetric difference is the set of elements which are in either of the arrays,
8
4
  * but not in their intersection, determined by the result of the mapping function.
9
5
  *
10
6
  * @template T - Type of elements in the input arrays.
11
7
  * @template U - Type of the values returned by the mapping function.
12
- *
8
+ *
13
9
  * @param {T[]} arr1 - The first array.
14
10
  * @param {T[]} arr2 - The second array.
15
11
  * @param {function(item: T): U} mapper - The function to map array elements to comparison values.
16
12
  * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function.
17
- *
13
+ *
18
14
  * @example
19
15
  * // Custom mapping function for objects with an 'id' property
20
16
  * const idMapper = obj => obj.id;
21
17
  * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
22
18
  * // Returns [{ id: 1 }, { id: 3 }]
23
19
  */
24
- function xorBy(arr1, arr2, mapper) {
25
- var union = unionBy(arr1, arr2, mapper);
26
- var intersection = intersectionBy(arr1, arr2, mapper);
27
- return differenceBy(union, intersection, mapper);
28
- }
20
+ declare function xorBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[];
29
21
 
30
22
  export { xorBy };
@@ -17,4 +17,6 @@
17
17
  * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
18
18
  * // Returns [{ id: 1 }, { id: 3 }]
19
19
  */
20
- export declare function xorBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[];
20
+ declare function xorBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[];
21
+
22
+ export { xorBy };
@@ -0,0 +1,65 @@
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/xorBy.ts
21
+ var xorBy_exports = {};
22
+ __export(xorBy_exports, {
23
+ xorBy: () => xorBy
24
+ });
25
+ module.exports = __toCommonJS(xorBy_exports);
26
+
27
+ // src/array/differenceBy.ts
28
+ function differenceBy(firstArr, secondArr, mapper) {
29
+ const mappedSecondArr = secondArr.map((item) => mapper(item));
30
+ return firstArr.filter((item) => {
31
+ return !mappedSecondArr.includes(mapper(item));
32
+ });
33
+ }
34
+
35
+ // src/array/intersectionBy.ts
36
+ function intersectionBy(firstArr, secondArr, mapper) {
37
+ const mappedSecondArr = secondArr.map((x) => mapper(x));
38
+ return firstArr.filter((item) => {
39
+ return mappedSecondArr.includes(mapper(item));
40
+ });
41
+ }
42
+
43
+ // src/array/unionBy.ts
44
+ function unionBy(arr1, arr2, mapper) {
45
+ const map = /* @__PURE__ */ new Map();
46
+ for (const item of [...arr1, ...arr2]) {
47
+ const key = mapper(item);
48
+ if (!map.has(key)) {
49
+ map.set(key, item);
50
+ }
51
+ }
52
+ return [...map.values()];
53
+ }
54
+
55
+ // src/array/xorBy.ts
56
+ function xorBy(arr1, arr2, mapper) {
57
+ const union = unionBy(arr1, arr2, mapper);
58
+ const intersection = intersectionBy(arr1, arr2, mapper);
59
+ return differenceBy(union, intersection, mapper);
60
+ }
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ xorBy
64
+ });
65
+ //# sourceMappingURL=xorBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/xorBy.ts","../../src/array/differenceBy.ts","../../src/array/intersectionBy.ts","../../src/array/unionBy.ts"],"sourcesContent":["import { differenceBy } from \"./differenceBy\";\nimport { intersectionBy } from \"./intersectionBy\";\nimport { unionBy } from \"./unionBy\";\n\n/**\n * Computes the symmetric difference between two arrays using a custom mapping function. \n * The symmetric difference is the set of elements which are in either of the arrays, \n * but not in their intersection, determined by the result of the mapping function.\n *\n * @template T - Type of elements in the input arrays.\n * @template U - Type of the values returned by the mapping function.\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[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function.\n * \n * @example\n * // Custom mapping function for objects with an 'id' property\n * const idMapper = obj => obj.id;\n * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);\n * // Returns [{ id: 1 }, { id: 3 }]\n */\nexport function xorBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[] {\n const union = unionBy(arr1, arr2, mapper);\n const intersection = intersectionBy(arr1, arr2, mapper);\n \n return differenceBy(union, intersection, mapper);\n}\n","/**\n * Computes the difference between two arrays after mapping their elements through a provided function.\n * \n * This function takes two arrays and a mapper function. It returns a new array containing the elements \n * that are present in the first array but not in the second array, based on the identity calculated \n * by the mapper function. \n * \n * Essentially, it filters out any elements from the first array that, when \n * mapped, match an element in the mapped version of the second array.\n *\n * @template T, U\n * @param {T[]} firstArr - The primary array from which to derive the difference. \n * @param {T[]} secondArr - The array containing elements to be excluded from the first array.\n * @param {(value: T) => U} mapper - The function to map the elements of both arrays. This function \n * is applied to each element in both arrays, and the comparison is made based on the mapped values.\n * @returns {T[]} A new array containing the elements from the first array that do not have a corresponding \n * mapped identity in the second array.\n *\n * @example\n * * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = differenceBy(array1, array2, mapper);\n * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.\n */\nexport function differenceBy<T, U>(firstArr: T[], secondArr: T[], mapper: (value: T) => U): T[] {\n const mappedSecondArr = secondArr.map(item => mapper(item));\n \n return firstArr.filter(item => {\n return !mappedSecondArr.includes(mapper(item));\n });\n}","/**\n * Returns the intersection of two arrays based on a mapping function.\n * \n * This function takes two arrays and a mapping function. It returns a new array containing \n * the elements from the first array that, when mapped using the provided function, have matching \n * mapped elements in the second array. It effectively filters out any elements from the first array \n * that do not have corresponding mapped values in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @param {(item: T) => U} mapper - A function to map the elements of both arrays for comparison.\n * @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = intersectionBy(array1, array2, mapper);\n * // result will be [{ id: 2 }] since only this element has a matching id in both arrays.\n */\nexport function intersectionBy<T, U>(firstArr: T[], secondArr: T[], mapper: (item: T) => U): T[] {\n const mappedSecondArr = secondArr.map(x => mapper(x));\n \n return firstArr.filter(item => {\n return mappedSecondArr.includes(mapper(item));\n })\n}","/**\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;;;ACyBO,SAAS,aAAmB,UAAe,WAAgB,QAA8B;AAC9F,QAAM,kBAAkB,UAAU,IAAI,UAAQ,OAAO,IAAI,CAAC;AAE1D,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC/C,CAAC;AACH;;;ACXO,SAAS,eAAqB,UAAe,WAAgB,QAA6B;AAC/F,QAAM,kBAAkB,UAAU,IAAI,OAAK,OAAO,CAAC,CAAC;AAEpD,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC9C,CAAC;AACH;;;ACNO,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;;;AHRO,SAAS,MAAY,MAAW,MAAW,QAA6B;AAC7E,QAAM,QAAQ,QAAQ,MAAM,MAAM,MAAM;AACxC,QAAM,eAAe,eAAe,MAAM,MAAM,MAAM;AAEtD,SAAO,aAAa,OAAO,cAAc,MAAM;AACjD;","names":[]}
@@ -0,0 +1,11 @@
1
+ import {
2
+ xorBy
3
+ } from "../chunk-R5DNKXDI.mjs";
4
+ import "../chunk-7PPND7QY.mjs";
5
+ import "../chunk-2VB6XU3I.mjs";
6
+ import "../chunk-EAI6NLXI.mjs";
7
+ import "../chunk-2MM5EJJX.mjs";
8
+ export {
9
+ xorBy
10
+ };
11
+ //# sourceMappingURL=xorBy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,29 +1,21 @@
1
- import { differenceWith } from './differenceWith.mjs';
2
- import { intersectionWith } from './intersectionWith.mjs';
3
- import { unionWith } from './unionWith.mjs';
4
-
5
1
  /**
6
- * Computes the symmetric difference between two arrays using a custom equality function.
7
- * The symmetric difference is the set of elements which are in either of the arrays,
2
+ * Computes the symmetric difference between two arrays using a custom equality function.
3
+ * The symmetric difference is the set of elements which are in either of the arrays,
8
4
  * but not in their intersection.
9
5
  *
10
6
  * @template T - Type of elements in the input arrays.
11
- *
7
+ *
12
8
  * @param {T[]} arr1 - The first array.
13
9
  * @param {T[]} arr2 - The second array.
14
10
  * @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements.
15
11
  * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function.
16
- *
12
+ *
17
13
  * @example
18
14
  * // Custom equality function for objects with an 'id' property
19
15
  * const areObjectsEqual = (a, b) => a.id === b.id;
20
16
  * xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual);
21
17
  * // Returns [{ id: 1 }, { id: 3 }]
22
18
  */
23
- function xorWith(arr1, arr2, areElementsEqual) {
24
- var union = unionWith(arr1, arr2, areElementsEqual);
25
- var intersection = intersectionWith(arr1, arr2, areElementsEqual);
26
- return differenceWith(union, intersection, areElementsEqual);
27
- }
19
+ declare function xorWith<T>(arr1: T[], arr2: T[], areElementsEqual: (item1: T, item2: T) => boolean): T[];
28
20
 
29
21
  export { xorWith };
@@ -16,4 +16,6 @@
16
16
  * xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual);
17
17
  * // Returns [{ id: 1 }, { id: 3 }]
18
18
  */
19
- export declare function xorWith<T>(arr1: T[], arr2: T[], areElementsEqual: (item1: T, item2: T) => boolean): T[];
19
+ declare function xorWith<T>(arr1: T[], arr2: T[], areElementsEqual: (item1: T, item2: T) => boolean): T[];
20
+
21
+ export { xorWith };
@@ -0,0 +1,72 @@
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/xorWith.ts
21
+ var xorWith_exports = {};
22
+ __export(xorWith_exports, {
23
+ xorWith: () => xorWith
24
+ });
25
+ module.exports = __toCommonJS(xorWith_exports);
26
+
27
+ // src/array/differenceWith.ts
28
+ function differenceWith(firstArr, secondArr, areItemsEqual) {
29
+ return firstArr.filter((firstItem) => {
30
+ return secondArr.every((secondItem) => {
31
+ return !areItemsEqual(firstItem, secondItem);
32
+ });
33
+ });
34
+ }
35
+
36
+ // src/array/intersectionWith.ts
37
+ function intersectionWith(firstArr, secondArr, areItemsEqual) {
38
+ return firstArr.filter((firstItem) => {
39
+ return secondArr.some((secondItem) => {
40
+ return areItemsEqual(firstItem, secondItem);
41
+ });
42
+ });
43
+ }
44
+
45
+ // src/array/uniqWith.ts
46
+ function uniqWith(arr, areItemsEqual) {
47
+ const result = [];
48
+ for (const item of arr) {
49
+ const isUniq = result.every((v) => !areItemsEqual(v, item));
50
+ if (isUniq) {
51
+ result.push(item);
52
+ }
53
+ }
54
+ return result;
55
+ }
56
+
57
+ // src/array/unionWith.ts
58
+ function unionWith(arr1, arr2, areItemsEqual) {
59
+ return uniqWith(arr1.concat(arr2), areItemsEqual);
60
+ }
61
+
62
+ // src/array/xorWith.ts
63
+ function xorWith(arr1, arr2, areElementsEqual) {
64
+ const union = unionWith(arr1, arr2, areElementsEqual);
65
+ const intersection = intersectionWith(arr1, arr2, areElementsEqual);
66
+ return differenceWith(union, intersection, areElementsEqual);
67
+ }
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ xorWith
71
+ });
72
+ //# sourceMappingURL=xorWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/xorWith.ts","../../src/array/differenceWith.ts","../../src/array/intersectionWith.ts","../../src/array/uniqWith.ts","../../src/array/unionWith.ts"],"sourcesContent":["import { differenceWith } from \"./differenceWith\";\nimport { intersectionWith } from \"./intersectionWith\";\nimport { unionWith } from \"./unionWith\";\n\n/**\n * Computes the symmetric difference between two arrays using a custom equality function. \n * The symmetric difference is the set of elements which are in either of the arrays, \n * but not in their intersection.\n *\n * @template T - Type of elements in the input arrays.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function.\n * \n * @example\n * // Custom equality function for objects with an 'id' property\n * const areObjectsEqual = (a, b) => a.id === b.id;\n * xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual);\n * // Returns [{ id: 1 }, { id: 3 }]\n */\nexport function xorWith<T>(arr1: T[], arr2: T[], areElementsEqual: (item1: T, item2: T) => boolean): T[] {\n const union = unionWith(arr1, arr2, areElementsEqual);\n const intersection = intersectionWith(arr1, arr2, areElementsEqual);\n \n return differenceWith(union, intersection, areElementsEqual);\n}\n","/**\n * Computes the difference between two arrays based on a custom equality function.\n * \n * This function takes two arrays and a custom comparison function. It returns a new array containing \n * the elements that are present in the first array but not in the second array. The comparison to determine \n * if elements are equal is made using the provided custom function.\n *\n * @template T\n * @param {T[]} firstArr - The array from which to get the difference.\n * @param {T[]} secondArr - The array containing elements to exclude from the first array. \n * @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal.\n * @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array \n * according to the custom equality function.\n *\n * @example\n * * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = differenceWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.\n */\nexport function differenceWith<T>(firstArr: T[], secondArr: T[], areItemsEqual: (x: T, y: T) => boolean): T[] {\n return firstArr.filter(firstItem => {\n return secondArr.every(secondItem => {\n return !areItemsEqual(firstItem, secondItem);\n });\n });\n}\n","/**\n * Returns the intersection of two arrays based on a custom equality function.\n * \n * This function takes two arrays and a custom equality function. It returns a new array containing \n * the elements from the first array that have matching elements in the second array, as determined \n * by the custom equality function. It effectively filters out any elements from the first array that \n * do not have corresponding matches in the second array according to the equality function.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @param {(x: T, y: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. \n * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function.\n *\n * @example\n * * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = intersectionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 2 }] since this element has a matching id in both arrays.\n */\nexport function intersectionWith<T>(firstArr: T[], secondArr: T[], areItemsEqual: (x: T, y: T) => boolean): T[] {\n return firstArr.filter(firstItem => {\n return secondArr.some(secondItem => {\n return areItemsEqual(firstItem, secondItem);\n });\n });\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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBO,SAAS,eAAkB,UAAe,WAAgB,eAA6C;AAC5G,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,MAAM,gBAAc;AACnC,aAAO,CAAC,cAAc,WAAW,UAAU;AAAA,IAC7C,CAAC;AAAA,EACH,CAAC;AACH;;;ACNO,SAAS,iBAAoB,UAAe,WAAgB,eAA6C;AAC9G,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,KAAK,gBAAc;AAClC,aAAO,cAAc,WAAW,UAAU;AAAA,IAC5C,CAAC;AAAA,EACH,CAAC;AACH;;;AChBO,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;;;ACLO,SAAS,UAAa,MAAW,MAAW,eAAqD;AACtG,SAAO,SAAS,KAAK,OAAO,IAAI,GAAG,aAAa;AAClD;;;AJDO,SAAS,QAAW,MAAW,MAAW,kBAAwD;AACvG,QAAM,QAAQ,UAAU,MAAM,MAAM,gBAAgB;AACpD,QAAM,eAAe,iBAAiB,MAAM,MAAM,gBAAgB;AAElE,SAAO,eAAe,OAAO,cAAc,gBAAgB;AAC7D;","names":[]}
@@ -0,0 +1,12 @@
1
+ import {
2
+ xorWith
3
+ } from "../chunk-XS4ZPJMT.mjs";
4
+ import "../chunk-VJGGYY4Y.mjs";
5
+ import "../chunk-EAI4DDCQ.mjs";
6
+ import "../chunk-GJM7F3TH.mjs";
7
+ import "../chunk-NSYWEYWT.mjs";
8
+ import "../chunk-2MM5EJJX.mjs";
9
+ export {
10
+ xorWith
11
+ };
12
+ //# sourceMappingURL=xorWith.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Combines multiple arrays into a single array of tuples.
3
+ *
4
+ * This function takes multiple arrays and returns a new array where each element is a tuple
5
+ * containing the corresponding elements from the input arrays. If the input arrays are of
6
+ * different lengths, the resulting array will have the length of the longest input array,
7
+ * with undefined values for missing elements.
8
+ *
9
+ * @param {...T[][]} arrs - The arrays to zip together.
10
+ * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays.
11
+ *
12
+ * @example
13
+ * const arr1 = [1, 2, 3];
14
+ * const arr2 = ['a', 'b', 'c'];
15
+ * const result = zip(arr1, arr2);
16
+ * // result will be [[1, 'a'], [2, 'b'], [3, 'c']]
17
+ *
18
+ * const arr3 = [true, false];
19
+ * const result2 = zip(arr1, arr2, arr3);
20
+ * // result2 will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]
21
+ */
22
+ declare function zip<T>(arr1: T[]): Array<[T]>;
23
+ declare function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]>;
24
+ declare function zip<T, U, V>(arr1: T[], arr2: U[], arr3: V[]): Array<[T, U, V]>;
25
+ declare function zip<T, U, V, W>(arr1: T[], arr2: U[], arr3: V[], arr4: W[]): Array<[T, U, V, W]>;
26
+
27
+ export { zip };
@@ -19,7 +19,9 @@
19
19
  * const result2 = zip(arr1, arr2, arr3);
20
20
  * // result2 will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]
21
21
  */
22
- export declare function zip<T>(arr1: T[]): [T][];
23
- export declare function zip<T, U>(arr1: T[], arr2: U[]): [T, U][];
24
- export declare function zip<T, U, V>(arr1: T[], arr2: U[], arr3: V[]): [T, U, V][];
25
- export declare function zip<T, U, V, W>(arr1: T[], arr2: U[], arr3: V[], arr4: W[]): [T, U, V, W][];
22
+ declare function zip<T>(arr1: T[]): Array<[T]>;
23
+ declare function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]>;
24
+ declare function zip<T, U, V>(arr1: T[], arr2: U[], arr3: V[]): Array<[T, U, V]>;
25
+ declare function zip<T, U, V, W>(arr1: T[], arr2: U[], arr3: V[], arr4: W[]): Array<[T, U, V, W]>;
26
+
27
+ export { zip };
@@ -0,0 +1,42 @@
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/zip.ts
21
+ var zip_exports = {};
22
+ __export(zip_exports, {
23
+ zip: () => zip
24
+ });
25
+ module.exports = __toCommonJS(zip_exports);
26
+ function zip(...arrs) {
27
+ const result = [];
28
+ const maxIndex = Math.max(...arrs.map((x) => x.length));
29
+ for (let i = 0; i < maxIndex; i++) {
30
+ const element = [];
31
+ for (const arr of arrs) {
32
+ element.push(arr[i]);
33
+ }
34
+ result.push(element);
35
+ }
36
+ return result;
37
+ }
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ zip
41
+ });
42
+ //# sourceMappingURL=zip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/zip.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array of tuples.\n * \n * This function takes multiple arrays and returns a new array where each element is a tuple \n * containing the corresponding elements from the input arrays. If the input arrays are of \n * different lengths, the resulting array will have the length of the longest input array, \n * with undefined values for missing elements.\n *\n * @param {...T[][]} arrs - The arrays to zip together.\n * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays.\n *\n * @example\n * const arr1 = [1, 2, 3];\n * const arr2 = ['a', 'b', 'c'];\n * const result = zip(arr1, arr2);\n * // result will be [[1, 'a'], [2, 'b'], [3, 'c']]\n *\n * const arr3 = [true, false];\n * const result2 = zip(arr1, arr2, arr3);\n * // result2 will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]\n */\nexport function zip<T>(arr1: T[]): Array<[T]>;\nexport function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]>;\nexport function zip<T, U, V>(arr1: T[], arr2: U[], arr3: V[]): Array<[T, U, V]>;\nexport function zip<T, U, V, W>(arr1: T[], arr2: U[], arr3: V[], arr4: W[]): Array<[T, U, V, W]>;\nexport function zip<T>(...arrs: T[][]): T[][] {\n const result: T[][] = [];\n\n const maxIndex = Math.max(...arrs.map(x => x.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const element: T[] = [];\n\n for (const arr of arrs) {\n element.push(arr[i]);\n }\n\n result.push(element);\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBO,SAAS,OAAU,MAAoB;AAC5C,QAAM,SAAgB,CAAC;AAEvB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,OAAK,EAAE,MAAM,CAAC;AAEpD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,UAAe,CAAC;AAEtB,eAAW,OAAO,MAAM;AACtB,cAAQ,KAAK,IAAI,CAAC,CAAC;AAAA,IACrB;AAEA,WAAO,KAAK,OAAO;AAAA,EACrB;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ zip
3
+ } from "../chunk-5JWSGT4R.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ zip
7
+ };
8
+ //# sourceMappingURL=zip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,9 +1,7 @@
1
- import { toConsumableArray as _toConsumableArray } from './_virtual/_rollupPluginBabelHelpers.mjs';
2
-
3
1
  /**
4
2
  * Combines multiple arrays into a single array using a custom combiner function.
5
- *
6
- * This function takes multiple arrays and a combiner function, and returns a new array where each element
3
+ *
4
+ * This function takes multiple arrays and a combiner function, and returns a new array where each element
7
5
  * is the result of applying the combiner function to the corresponding elements of the input arrays.
8
6
  *
9
7
  * @param {T[]} arr1 - The first array to zip.
@@ -28,27 +26,9 @@ import { toConsumableArray as _toConsumableArray } from './_virtual/_rollupPlugi
28
26
  * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);
29
27
  * // result will be [`135`, `246`]
30
28
  */
31
-
32
- function zipWith(arr1) {
33
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
34
- rest[_key - 1] = arguments[_key];
35
- }
36
- var arrs = [arr1].concat(_toConsumableArray(rest.slice(0, -1)));
37
- var combine = rest[rest.length - 1];
38
- var result = [];
39
- var maxIndex = Math.max.apply(Math, _toConsumableArray(arrs.map(function (arr) {
40
- return arr.length;
41
- })));
42
- var _loop = function _loop(i) {
43
- var elements = arrs.map(function (arr) {
44
- return arr[i];
45
- });
46
- result.push(combine.apply(void 0, _toConsumableArray(elements)));
47
- };
48
- for (var i = 0; i < maxIndex; i++) {
49
- _loop(i);
50
- }
51
- return result;
52
- }
29
+ declare function zipWith<T, R>(arr1: T[], combine: (item: T) => R): R[];
30
+ declare function zipWith<T, U, R>(arr1: T[], arr2: U[], combine: (item1: T, item2: U) => R): R[];
31
+ declare function zipWith<T, U, V, R>(arr1: T[], arr2: U[], arr3: V[], combine: (item1: T, item2: U, item3: V) => R): R[];
32
+ declare function zipWith<T, U, V, W, R>(arr1: T[], arr2: U[], arr3: V[], arr4: W[], combine: (item1: T, item2: U, item3: V, item4: W) => R): R[];
53
33
 
54
34
  export { zipWith };
@@ -26,7 +26,9 @@
26
26
  * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);
27
27
  * // result will be [`135`, `246`]
28
28
  */
29
- export declare function zipWith<T, R>(arr1: T[], combine: (item: T) => R): R[];
30
- export declare function zipWith<T, U, R>(arr1: T[], arr2: U[], combine: (item1: T, item2: U) => R): R[];
31
- export declare function zipWith<T, U, V, R>(arr1: T[], arr2: U[], arr3: V[], combine: (item1: T, item2: U, item3: V) => R): R[];
32
- export declare function zipWith<T, U, V, W, R>(arr1: T[], arr2: U[], arr3: V[], arr4: W[], combine: (item1: T, item2: U, item3: V, item4: W) => R): R[];
29
+ declare function zipWith<T, R>(arr1: T[], combine: (item: T) => R): R[];
30
+ declare function zipWith<T, U, R>(arr1: T[], arr2: U[], combine: (item1: T, item2: U) => R): R[];
31
+ declare function zipWith<T, U, V, R>(arr1: T[], arr2: U[], arr3: V[], combine: (item1: T, item2: U, item3: V) => R): R[];
32
+ declare function zipWith<T, U, V, W, R>(arr1: T[], arr2: U[], arr3: V[], arr4: W[], combine: (item1: T, item2: U, item3: V, item4: W) => R): R[];
33
+
34
+ export { zipWith };
@@ -0,0 +1,41 @@
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/zipWith.ts
21
+ var zipWith_exports = {};
22
+ __export(zipWith_exports, {
23
+ zipWith: () => zipWith
24
+ });
25
+ module.exports = __toCommonJS(zipWith_exports);
26
+ function zipWith(arr1, ...rest) {
27
+ const arrs = [arr1, ...rest.slice(0, -1)];
28
+ const combine = rest[rest.length - 1];
29
+ const result = [];
30
+ const maxIndex = Math.max(...arrs.map((arr) => arr.length));
31
+ for (let i = 0; i < maxIndex; i++) {
32
+ const elements = arrs.map((arr) => arr[i]);
33
+ result.push(combine(...elements));
34
+ }
35
+ return result;
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ zipWith
40
+ });
41
+ //# sourceMappingURL=zipWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/array/zipWith.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array using a custom combiner function.\n * \n * This function takes multiple arrays and a combiner function, and returns a new array where each element \n * is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @param {T[]} arr1 - The first array to zip.\n * @param {U[]} [arr2] - The second array to zip (optional).\n * @param {V[]} [arr3] - The third array to zip (optional).\n * @param {W[]} [arr4] - The fourth array to zip (optional).\n * @param {function} combine - The combiner function that takes corresponding elements from each array and returns a single value.\n * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @example\n * // Example usage with two arrays:\n * const arr1 = [1, 2, 3];\n * const arr2 = [4, 5, 6];\n * const result = zipWith(arr1, arr2, (a, b) => a + b);\n * // result will be [5, 7, 9]\n *\n * @example\n * // Example usage with three arrays:\n * const arr1 = [1, 2];\n * const arr2 = [3, 4];\n * const arr3 = [5, 6];\n * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);\n * // result will be [`135`, `246`]\n */\nexport function zipWith<T, R>(arr1: T[], combine: (item: T) => R): R[];\nexport function zipWith<T, U, R>(arr1: T[], arr2: U[], combine: (item1: T, item2: U) => R): R[];\nexport function zipWith<T, U, V, R>(arr1: T[], arr2: U[], arr3: V[], combine: (item1: T, item2: U, item3: V) => R): R[];\nexport function zipWith<T, U, V, W, R>(arr1: T[], arr2: U[], arr3: V[], arr4: W[], combine: (item1: T, item2: U, item3: V, item4: W) => R): R[];\nexport function zipWith<T, R>(arr1: T[], ...rest: any[]): R[] {\n const arrs = [arr1, ...rest.slice(0, -1)];\n const combine = rest[rest.length - 1] as (...items: T[]) => R;\n\n const result: R[] = [];\n const maxIndex = Math.max(...arrs.map(arr => arr.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const elements: T[] = arrs.map(arr => arr[i]);\n result.push(combine(...elements));\n }\n\n return result;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCO,SAAS,QAAc,SAAc,MAAkB;AAC5D,QAAM,OAAO,CAAC,MAAM,GAAG,KAAK,MAAM,GAAG,EAAE,CAAC;AACxC,QAAM,UAAU,KAAK,KAAK,SAAS,CAAC;AAEpC,QAAM,SAAc,CAAC;AACrB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,SAAO,IAAI,MAAM,CAAC;AAExD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,WAAgB,KAAK,IAAI,SAAO,IAAI,CAAC,CAAC;AAC5C,WAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC;AAAA,EAClC;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ zipWith
3
+ } from "../chunk-RU3RXBUC.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ zipWith
7
+ };
8
+ //# sourceMappingURL=zipWith.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,16 @@
1
+ // src/array/takeWhile.ts
2
+ function takeWhile(arr, shouldContinueTaking) {
3
+ const result = [];
4
+ for (const item of arr) {
5
+ if (!shouldContinueTaking(item)) {
6
+ break;
7
+ }
8
+ result.push(item);
9
+ }
10
+ return result;
11
+ }
12
+
13
+ export {
14
+ takeWhile
15
+ };
16
+ //# sourceMappingURL=chunk-2KXLTAVK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/takeWhile.ts"],"sourcesContent":["/**\n * Returns a new array containing the leading elements of the provided array\n * that satisfy the provided predicate function. It stops taking elements as soon\n * as an element does not satisfy the predicate.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @param {(element: T) => boolean} shouldContinueTaking - The predicate function that is called with each element. Elements are included in the result as long as this function returns true.\n * @returns {T[]} A new array containing the leading elements that satisfy the predicate.\n *\n * @example\n * // Returns [1, 2]\n * takeWhile([1, 2, 3, 4], x => x < 3);\n *\n * @example\n * // Returns []\n * takeWhile([1, 2, 3, 4], x => x > 3);\n */\nexport function takeWhile<T>(arr: T[], shouldContinueTaking: (element: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n if (!shouldContinueTaking(item)) {\n break;\n }\n\n result.push(item);\n }\n\n return result;\n}"],"mappings":";AAkBO,SAAS,UAAa,KAAU,sBAAoD;AACzF,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,QAAI,CAAC,qBAAqB,IAAI,GAAG;AAC/B;AAAA,IACF;AAEA,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,21 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+
18
+ export {
19
+ __spreadValues
20
+ };
21
+ //# sourceMappingURL=chunk-2MM5EJJX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,12 @@
1
+ // src/array/intersectionBy.ts
2
+ function intersectionBy(firstArr, secondArr, mapper) {
3
+ const mappedSecondArr = secondArr.map((x) => mapper(x));
4
+ return firstArr.filter((item) => {
5
+ return mappedSecondArr.includes(mapper(item));
6
+ });
7
+ }
8
+
9
+ export {
10
+ intersectionBy
11
+ };
12
+ //# sourceMappingURL=chunk-2VB6XU3I.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/intersectionBy.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays based on a mapping function.\n * \n * This function takes two arrays and a mapping function. It returns a new array containing \n * the elements from the first array that, when mapped using the provided function, have matching \n * mapped elements in the second array. It effectively filters out any elements from the first array \n * that do not have corresponding mapped values in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @param {(item: T) => U} mapper - A function to map the elements of both arrays for comparison.\n * @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = intersectionBy(array1, array2, mapper);\n * // result will be [{ id: 2 }] since only this element has a matching id in both arrays.\n */\nexport function intersectionBy<T, U>(firstArr: T[], secondArr: T[], mapper: (item: T) => U): T[] {\n const mappedSecondArr = secondArr.map(x => mapper(x));\n \n return firstArr.filter(item => {\n return mappedSecondArr.includes(mapper(item));\n })\n}"],"mappings":";AAoBO,SAAS,eAAqB,UAAe,WAAgB,QAA6B;AAC/F,QAAM,kBAAkB,UAAU,IAAI,OAAK,OAAO,CAAC,CAAC;AAEpD,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC9C,CAAC;AACH;","names":[]}
@@ -0,0 +1,19 @@
1
+ // src/array/chunk.ts
2
+ function chunk(arr, size) {
3
+ if (!Number.isInteger(size) || size <= 0) {
4
+ throw new Error("Size must be an integer greater than zero.");
5
+ }
6
+ const chunkLength = Math.ceil(arr.length / size);
7
+ const result = Array(chunkLength);
8
+ for (let index = 0; index < chunkLength; index++) {
9
+ const start = index * size;
10
+ const end = start + size;
11
+ result[index] = arr.slice(start, end);
12
+ }
13
+ return result;
14
+ }
15
+
16
+ export {
17
+ chunk
18
+ };
19
+ //# sourceMappingURL=chunk-35TWSMYS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: T[], size: number): T[][] {\n if (!Number.isInteger(size) || size <= 0) {\n throw new Error('Size must be an integer greater than zero.');\n }\n\n const chunkLength = Math.ceil(arr.length / size);\n const result: T[][] = Array(chunkLength);\n\n for (let index = 0; index < chunkLength; index++) {\n const start = index * size;\n const end = start + size;\n \n result[index] = arr.slice(start, end);\n }\n\n return result;\n}\n"],"mappings":";AAuBO,SAAS,MAAS,KAAU,MAAqB;AACtD,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,QAAQ,GAAG;AACxC,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AAEA,QAAM,cAAc,KAAK,KAAK,IAAI,SAAS,IAAI;AAC/C,QAAM,SAAgB,MAAM,WAAW;AAEvC,WAAS,QAAQ,GAAG,QAAQ,aAAa,SAAS;AAChD,UAAM,QAAQ,QAAQ;AACtB,UAAM,MAAM,QAAQ;AAEpB,WAAO,KAAK,IAAI,IAAI,MAAM,OAAO,GAAG;AAAA,EACtC;AAEA,SAAO;AACT;","names":[]}