es-toolkit 1.6.1 → 1.7.0-dev.146

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 (339) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/array/compact.d.mts +1 -0
  3. package/dist/array/compact.d.ts +1 -0
  4. package/dist/array/compact.js.map +1 -1
  5. package/dist/array/compact.mjs +1 -1
  6. package/dist/array/countBy.d.mts +20 -0
  7. package/dist/array/countBy.d.ts +20 -0
  8. package/dist/array/countBy.js +39 -0
  9. package/dist/array/countBy.js.map +1 -0
  10. package/dist/array/countBy.mjs +8 -0
  11. package/dist/array/drop.d.mts +1 -0
  12. package/dist/array/drop.d.ts +1 -0
  13. package/dist/array/drop.js.map +1 -1
  14. package/dist/array/drop.mjs +1 -1
  15. package/dist/array/dropRight.d.mts +1 -0
  16. package/dist/array/dropRight.d.ts +1 -0
  17. package/dist/array/dropRight.js.map +1 -1
  18. package/dist/array/dropRight.mjs +1 -1
  19. package/dist/array/dropRightWhile.d.mts +1 -0
  20. package/dist/array/dropRightWhile.d.ts +1 -0
  21. package/dist/array/dropRightWhile.js.map +1 -1
  22. package/dist/array/dropRightWhile.mjs +2 -2
  23. package/dist/array/dropWhile.d.mts +1 -0
  24. package/dist/array/dropWhile.d.ts +1 -0
  25. package/dist/array/dropWhile.js.map +1 -1
  26. package/dist/array/dropWhile.mjs +1 -1
  27. package/dist/array/fill.d.mts +29 -0
  28. package/dist/array/fill.d.ts +29 -0
  29. package/dist/array/fill.js +38 -0
  30. package/dist/array/fill.js.map +1 -0
  31. package/dist/array/fill.mjs +8 -0
  32. package/dist/array/forEachRight.d.mts +25 -0
  33. package/dist/array/forEachRight.d.ts +25 -0
  34. package/dist/array/forEachRight.js +36 -0
  35. package/dist/array/forEachRight.js.map +1 -0
  36. package/dist/array/forEachRight.mjs +8 -0
  37. package/dist/array/forEachRight.mjs.map +1 -0
  38. package/dist/array/groupBy.d.mts +3 -1
  39. package/dist/array/groupBy.d.ts +3 -1
  40. package/dist/array/groupBy.js.map +1 -1
  41. package/dist/array/groupBy.mjs +1 -1
  42. package/dist/array/index.d.mts +7 -1
  43. package/dist/array/index.d.ts +7 -1
  44. package/dist/array/index.js +103 -7
  45. package/dist/array/index.js.map +1 -1
  46. package/dist/array/index.mjs +78 -52
  47. package/dist/array/intersection.d.mts +1 -0
  48. package/dist/array/intersection.d.ts +1 -0
  49. package/dist/array/intersection.js.map +1 -1
  50. package/dist/array/intersection.mjs +1 -1
  51. package/dist/array/intersectionBy.d.mts +2 -0
  52. package/dist/array/intersectionBy.d.ts +2 -0
  53. package/dist/array/intersectionBy.js.map +1 -1
  54. package/dist/array/intersectionBy.mjs +1 -1
  55. package/dist/array/intersectionWith.d.mts +1 -0
  56. package/dist/array/intersectionWith.d.ts +1 -0
  57. package/dist/array/intersectionWith.js.map +1 -1
  58. package/dist/array/intersectionWith.mjs +1 -1
  59. package/dist/array/keyBy.d.mts +3 -1
  60. package/dist/array/keyBy.d.ts +3 -1
  61. package/dist/array/keyBy.js.map +1 -1
  62. package/dist/array/keyBy.mjs +1 -1
  63. package/dist/array/maxBy.d.mts +1 -0
  64. package/dist/array/maxBy.d.ts +1 -0
  65. package/dist/array/maxBy.js.map +1 -1
  66. package/dist/array/maxBy.mjs +1 -1
  67. package/dist/array/minBy.d.mts +1 -0
  68. package/dist/array/minBy.d.ts +1 -0
  69. package/dist/array/minBy.js.map +1 -1
  70. package/dist/array/minBy.mjs +1 -1
  71. package/dist/array/partition.d.mts +1 -0
  72. package/dist/array/partition.d.ts +1 -0
  73. package/dist/array/partition.js.map +1 -1
  74. package/dist/array/partition.mjs +1 -1
  75. package/dist/array/sample.d.mts +1 -0
  76. package/dist/array/sample.d.ts +1 -0
  77. package/dist/array/sample.js.map +1 -1
  78. package/dist/array/sample.mjs +1 -1
  79. package/dist/array/sampleSize.d.mts +21 -0
  80. package/dist/array/sampleSize.d.ts +21 -0
  81. package/dist/array/sampleSize.js +65 -0
  82. package/dist/array/sampleSize.js.map +1 -0
  83. package/dist/array/sampleSize.mjs +10 -0
  84. package/dist/array/sampleSize.mjs.map +1 -0
  85. package/dist/array/shuffle.d.mts +1 -0
  86. package/dist/array/shuffle.d.ts +1 -0
  87. package/dist/array/shuffle.js.map +1 -1
  88. package/dist/array/shuffle.mjs +1 -1
  89. package/dist/array/takeRight.d.mts +1 -0
  90. package/dist/array/takeRight.d.ts +1 -0
  91. package/dist/array/takeRight.js.map +1 -1
  92. package/dist/array/takeRight.mjs +1 -1
  93. package/dist/array/union.d.mts +1 -0
  94. package/dist/array/union.d.ts +1 -0
  95. package/dist/array/union.js.map +1 -1
  96. package/dist/array/union.mjs +2 -2
  97. package/dist/array/unionBy.d.mts +2 -0
  98. package/dist/array/unionBy.d.ts +2 -0
  99. package/dist/array/unionBy.js.map +1 -1
  100. package/dist/array/unionBy.mjs +1 -1
  101. package/dist/array/unionWith.d.mts +1 -0
  102. package/dist/array/unionWith.d.ts +1 -0
  103. package/dist/array/unionWith.js.map +1 -1
  104. package/dist/array/unionWith.mjs +2 -2
  105. package/dist/array/uniq.d.mts +1 -0
  106. package/dist/array/uniq.d.ts +1 -0
  107. package/dist/array/uniq.js.map +1 -1
  108. package/dist/array/uniq.mjs +1 -1
  109. package/dist/array/uniqBy.d.mts +2 -0
  110. package/dist/array/uniqBy.d.ts +2 -0
  111. package/dist/array/uniqBy.js.map +1 -1
  112. package/dist/array/uniqBy.mjs +1 -1
  113. package/dist/array/uniqWith.d.mts +1 -0
  114. package/dist/array/uniqWith.d.ts +1 -0
  115. package/dist/array/uniqWith.js.map +1 -1
  116. package/dist/array/uniqWith.mjs +1 -1
  117. package/dist/array/unzipWith.d.mts +17 -0
  118. package/dist/array/unzipWith.d.ts +17 -0
  119. package/dist/array/unzipWith.js +42 -0
  120. package/dist/array/unzipWith.js.map +1 -0
  121. package/dist/array/unzipWith.mjs +8 -0
  122. package/dist/array/unzipWith.mjs.map +1 -0
  123. package/dist/array/without.d.mts +23 -0
  124. package/dist/array/without.d.ts +23 -0
  125. package/dist/array/without.js +34 -0
  126. package/dist/array/without.js.map +1 -0
  127. package/dist/array/without.mjs +8 -0
  128. package/dist/array/without.mjs.map +1 -0
  129. package/dist/array/xor.d.mts +1 -0
  130. package/dist/array/xor.d.ts +1 -0
  131. package/dist/array/xor.js.map +1 -1
  132. package/dist/array/xor.mjs +4 -4
  133. package/dist/array/xorBy.js.map +1 -1
  134. package/dist/array/xorBy.mjs +3 -3
  135. package/dist/array/xorWith.js.map +1 -1
  136. package/dist/array/xorWith.mjs +4 -4
  137. package/dist/array/zipObject.d.mts +2 -0
  138. package/dist/array/zipObject.d.ts +2 -0
  139. package/dist/array/zipObject.js.map +1 -1
  140. package/dist/array/zipObject.mjs +1 -1
  141. package/dist/{chunk-2PFDLYQC.mjs → chunk-237HGSZS.mjs} +1 -1
  142. package/dist/chunk-237HGSZS.mjs.map +1 -0
  143. package/dist/{chunk-DOOIIHT3.mjs → chunk-2KNLZB7V.mjs} +1 -1
  144. package/dist/chunk-2KNLZB7V.mjs.map +1 -0
  145. package/dist/{chunk-OUTSP4VR.mjs → chunk-2ZCITDMK.mjs} +2 -2
  146. package/dist/chunk-2ZCITDMK.mjs.map +1 -0
  147. package/dist/{chunk-G42NUGNE.mjs → chunk-3IP4JVLL.mjs} +1 -1
  148. package/dist/chunk-3IP4JVLL.mjs.map +1 -0
  149. package/dist/{chunk-MQWVBKUT.mjs → chunk-6CLH5YZ2.mjs} +1 -1
  150. package/dist/chunk-6CLH5YZ2.mjs.map +1 -0
  151. package/dist/{chunk-DA7GSKQ5.mjs → chunk-6GWEY5EL.mjs} +1 -1
  152. package/dist/chunk-6GWEY5EL.mjs.map +1 -0
  153. package/dist/{chunk-ZOTAORG3.mjs → chunk-AJKZMN2V.mjs} +1 -1
  154. package/dist/chunk-AJKZMN2V.mjs.map +1 -0
  155. package/dist/{chunk-A67NF2C7.mjs → chunk-BCTYOXT7.mjs} +1 -1
  156. package/dist/chunk-BCTYOXT7.mjs.map +1 -0
  157. package/dist/{chunk-ZQNAZPSK.mjs → chunk-BMRTZMRE.mjs} +1 -1
  158. package/dist/chunk-BMRTZMRE.mjs.map +1 -0
  159. package/dist/chunk-C4WE4GLC.mjs +14 -0
  160. package/dist/chunk-C4WE4GLC.mjs.map +1 -0
  161. package/dist/{chunk-UFAA5WKR.mjs → chunk-CMBC4MXG.mjs} +1 -1
  162. package/dist/chunk-CMBC4MXG.mjs.map +1 -0
  163. package/dist/chunk-CRSKT4WW.mjs +15 -0
  164. package/dist/chunk-CRSKT4WW.mjs.map +1 -0
  165. package/dist/{chunk-5L2V7WD3.mjs → chunk-DN3NOZ3H.mjs} +1 -1
  166. package/dist/chunk-DN3NOZ3H.mjs.map +1 -0
  167. package/dist/{chunk-NKTBEEIT.mjs → chunk-DTJJIMKJ.mjs} +1 -1
  168. package/dist/chunk-DTJJIMKJ.mjs.map +1 -0
  169. package/dist/{chunk-XFCW7XJ4.mjs → chunk-DVK2N4KC.mjs} +1 -1
  170. package/dist/chunk-DVK2N4KC.mjs.map +1 -0
  171. package/dist/{chunk-VP2LXY75.mjs → chunk-DXB7EZUQ.mjs} +1 -1
  172. package/dist/chunk-DXB7EZUQ.mjs.map +1 -0
  173. package/dist/{chunk-LWXZFXY5.mjs → chunk-E6E4RZLN.mjs} +1 -1
  174. package/dist/chunk-E6E4RZLN.mjs.map +1 -0
  175. package/dist/chunk-EHSKB6DF.mjs +26 -0
  176. package/dist/chunk-EHSKB6DF.mjs.map +1 -0
  177. package/dist/{chunk-PYLGHB3F.mjs → chunk-FVVSE2F2.mjs} +1 -1
  178. package/dist/chunk-FVVSE2F2.mjs.map +1 -0
  179. package/dist/{chunk-DPLJQQFX.mjs → chunk-G7UQ5PUR.mjs} +1 -1
  180. package/dist/chunk-G7UQ5PUR.mjs.map +1 -0
  181. package/dist/{chunk-OFWKFUFZ.mjs → chunk-HPFDYUGP.mjs} +1 -1
  182. package/dist/chunk-HPFDYUGP.mjs.map +1 -0
  183. package/dist/chunk-IEA53J7P.mjs +12 -0
  184. package/dist/chunk-IEA53J7P.mjs.map +1 -0
  185. package/dist/chunk-IFNXROZR.mjs +18 -0
  186. package/dist/chunk-IFNXROZR.mjs.map +1 -0
  187. package/dist/{chunk-OIHARMNM.mjs → chunk-IJD7FE2Z.mjs} +1 -1
  188. package/dist/chunk-IJD7FE2Z.mjs.map +1 -0
  189. package/dist/{chunk-XDKEPIUV.mjs → chunk-IQLKIDXF.mjs} +1 -1
  190. package/dist/chunk-IQLKIDXF.mjs.map +1 -0
  191. package/dist/{chunk-GTVOVGGZ.mjs → chunk-JE6JKZU3.mjs} +2 -2
  192. package/dist/chunk-JE6JKZU3.mjs.map +1 -0
  193. package/dist/{chunk-Q75KEFW5.mjs → chunk-JEKUA56R.mjs} +1 -1
  194. package/dist/chunk-JEKUA56R.mjs.map +1 -0
  195. package/dist/{chunk-VKM3R5T5.mjs → chunk-L7FQX5MN.mjs} +3 -3
  196. package/dist/chunk-L7FQX5MN.mjs.map +1 -0
  197. package/dist/{chunk-K2BAFL2T.mjs → chunk-LJ2C6MVP.mjs} +1 -1
  198. package/dist/chunk-LJ2C6MVP.mjs.map +1 -0
  199. package/dist/{chunk-KHK7LKE5.mjs → chunk-LT6E4Y4Z.mjs} +1 -1
  200. package/dist/chunk-LT6E4Y4Z.mjs.map +1 -0
  201. package/dist/{chunk-NRNKP6JF.mjs → chunk-NFS7RWWE.mjs} +1 -1
  202. package/dist/chunk-NFS7RWWE.mjs.map +1 -0
  203. package/dist/{chunk-CDA4NK7J.mjs → chunk-O64NE2P4.mjs} +2 -2
  204. package/dist/{chunk-GNSJP2AB.mjs → chunk-O6UXZR3U.mjs} +1 -1
  205. package/dist/chunk-O6UXZR3U.mjs.map +1 -0
  206. package/dist/{chunk-FXOABQRO.mjs → chunk-OOKNBU4V.mjs} +1 -1
  207. package/dist/chunk-OOKNBU4V.mjs.map +1 -0
  208. package/dist/{chunk-WPDDOUQT.mjs → chunk-OXAZEEGP.mjs} +1 -1
  209. package/dist/chunk-OXAZEEGP.mjs.map +1 -0
  210. package/dist/chunk-PYEYV7BY.mjs +10 -0
  211. package/dist/chunk-PYEYV7BY.mjs.map +1 -0
  212. package/dist/{chunk-E54CCWDL.mjs → chunk-Q47NGNXT.mjs} +3 -3
  213. package/dist/{chunk-OEOAJOLQ.mjs → chunk-QOJGMVVR.mjs} +1 -1
  214. package/dist/chunk-QOJGMVVR.mjs.map +1 -0
  215. package/dist/{chunk-JSS4FXUD.mjs → chunk-QRSJBBFY.mjs} +3 -3
  216. package/dist/{chunk-PLTO44KM.mjs → chunk-QZITBKWX.mjs} +1 -1
  217. package/dist/chunk-QZITBKWX.mjs.map +1 -0
  218. package/dist/{chunk-UPJXHWSJ.mjs → chunk-R6QA7PLZ.mjs} +2 -2
  219. package/dist/chunk-R6QA7PLZ.mjs.map +1 -0
  220. package/dist/{chunk-ACFP3XMB.mjs → chunk-S3CORED5.mjs} +1 -1
  221. package/dist/chunk-S3CORED5.mjs.map +1 -0
  222. package/dist/chunk-SDIMTYZW.mjs +14 -0
  223. package/dist/chunk-SDIMTYZW.mjs.map +1 -0
  224. package/dist/chunk-TZE6EDCX.mjs +1 -0
  225. package/dist/chunk-TZE6EDCX.mjs.map +1 -0
  226. package/dist/{chunk-2EFS3VA3.mjs → chunk-XI7KRD2C.mjs} +1 -1
  227. package/dist/chunk-XI7KRD2C.mjs.map +1 -0
  228. package/dist/chunk-XJR5WV2Z.mjs +1 -0
  229. package/dist/chunk-XJR5WV2Z.mjs.map +1 -0
  230. package/dist/error/AbortError.d.mts +4 -0
  231. package/dist/error/AbortError.d.ts +4 -0
  232. package/dist/error/AbortError.js.map +1 -1
  233. package/dist/error/AbortError.mjs +1 -1
  234. package/dist/error/index.js.map +1 -1
  235. package/dist/error/index.mjs +1 -1
  236. package/dist/function/debounce.d.mts +1 -0
  237. package/dist/function/debounce.d.ts +1 -0
  238. package/dist/function/debounce.js.map +1 -1
  239. package/dist/function/debounce.mjs +1 -1
  240. package/dist/function/index.js.map +1 -1
  241. package/dist/function/index.mjs +7 -7
  242. package/dist/function/once.d.mts +1 -0
  243. package/dist/function/once.d.ts +1 -0
  244. package/dist/function/once.js.map +1 -1
  245. package/dist/function/once.mjs +1 -1
  246. package/dist/function/throttle.d.mts +1 -0
  247. package/dist/function/throttle.d.ts +1 -0
  248. package/dist/function/throttle.js.map +1 -1
  249. package/dist/function/throttle.mjs +1 -1
  250. package/dist/index.d.mts +8 -1
  251. package/dist/index.d.ts +8 -1
  252. package/dist/index.js +109 -22
  253. package/dist/index.js.map +1 -1
  254. package/dist/index.mjs +119 -91
  255. package/dist/math/index.d.mts +1 -0
  256. package/dist/math/index.d.ts +1 -0
  257. package/dist/math/index.js +8 -0
  258. package/dist/math/index.js.map +1 -1
  259. package/dist/math/index.mjs +15 -11
  260. package/dist/math/mean.d.mts +1 -1
  261. package/dist/math/mean.d.ts +1 -1
  262. package/dist/math/mean.js.map +1 -1
  263. package/dist/math/mean.mjs +1 -1
  264. package/dist/math/meanBy.d.mts +18 -0
  265. package/dist/math/meanBy.d.ts +18 -0
  266. package/dist/math/meanBy.js +50 -0
  267. package/dist/math/meanBy.js.map +1 -0
  268. package/dist/math/meanBy.mjs +10 -0
  269. package/dist/math/meanBy.mjs.map +1 -0
  270. package/dist/object/index.js.map +1 -1
  271. package/dist/object/index.mjs +6 -6
  272. package/dist/object/omit.d.mts +2 -0
  273. package/dist/object/omit.d.ts +2 -0
  274. package/dist/object/omit.js.map +1 -1
  275. package/dist/object/omit.mjs +1 -1
  276. package/dist/object/omitBy.d.mts +1 -0
  277. package/dist/object/omitBy.d.ts +1 -0
  278. package/dist/object/omitBy.js.map +1 -1
  279. package/dist/object/omitBy.mjs +1 -1
  280. package/dist/object/pick.d.mts +2 -0
  281. package/dist/object/pick.d.ts +2 -0
  282. package/dist/object/pick.js.map +1 -1
  283. package/dist/object/pick.mjs +1 -1
  284. package/dist/object/pickBy.d.mts +1 -0
  285. package/dist/object/pickBy.d.ts +1 -0
  286. package/dist/object/pickBy.js.map +1 -1
  287. package/dist/object/pickBy.mjs +1 -1
  288. package/dist/predicate/index.js.map +1 -1
  289. package/dist/predicate/index.mjs +1 -1
  290. package/dist/predicate/isNotNil.d.mts +1 -0
  291. package/dist/predicate/isNotNil.d.ts +1 -0
  292. package/dist/predicate/isNotNil.js.map +1 -1
  293. package/dist/predicate/isNotNil.mjs +1 -1
  294. package/dist/promise/delay.js.map +1 -1
  295. package/dist/promise/delay.mjs +2 -2
  296. package/dist/promise/index.js.map +1 -1
  297. package/dist/promise/index.mjs +2 -2
  298. package/package.json +9 -1
  299. package/dist/chunk-2EFS3VA3.mjs.map +0 -1
  300. package/dist/chunk-2PFDLYQC.mjs.map +0 -1
  301. package/dist/chunk-5L2V7WD3.mjs.map +0 -1
  302. package/dist/chunk-A67NF2C7.mjs.map +0 -1
  303. package/dist/chunk-ACFP3XMB.mjs.map +0 -1
  304. package/dist/chunk-DA7GSKQ5.mjs.map +0 -1
  305. package/dist/chunk-DOOIIHT3.mjs.map +0 -1
  306. package/dist/chunk-DPLJQQFX.mjs.map +0 -1
  307. package/dist/chunk-FXOABQRO.mjs.map +0 -1
  308. package/dist/chunk-G42NUGNE.mjs.map +0 -1
  309. package/dist/chunk-GNSJP2AB.mjs.map +0 -1
  310. package/dist/chunk-GTVOVGGZ.mjs.map +0 -1
  311. package/dist/chunk-K2BAFL2T.mjs.map +0 -1
  312. package/dist/chunk-KHK7LKE5.mjs.map +0 -1
  313. package/dist/chunk-LWXZFXY5.mjs.map +0 -1
  314. package/dist/chunk-MQWVBKUT.mjs.map +0 -1
  315. package/dist/chunk-NKTBEEIT.mjs.map +0 -1
  316. package/dist/chunk-NRNKP6JF.mjs.map +0 -1
  317. package/dist/chunk-OEOAJOLQ.mjs.map +0 -1
  318. package/dist/chunk-OFWKFUFZ.mjs.map +0 -1
  319. package/dist/chunk-OIHARMNM.mjs.map +0 -1
  320. package/dist/chunk-OUTSP4VR.mjs.map +0 -1
  321. package/dist/chunk-PLTO44KM.mjs.map +0 -1
  322. package/dist/chunk-PYLGHB3F.mjs.map +0 -1
  323. package/dist/chunk-Q75KEFW5.mjs.map +0 -1
  324. package/dist/chunk-QVHWSUEH.mjs +0 -1
  325. package/dist/chunk-UFAA5WKR.mjs.map +0 -1
  326. package/dist/chunk-UPJXHWSJ.mjs.map +0 -1
  327. package/dist/chunk-V6MDTRGS.mjs +0 -1
  328. package/dist/chunk-VKM3R5T5.mjs.map +0 -1
  329. package/dist/chunk-VP2LXY75.mjs.map +0 -1
  330. package/dist/chunk-WPDDOUQT.mjs.map +0 -1
  331. package/dist/chunk-XDKEPIUV.mjs.map +0 -1
  332. package/dist/chunk-XFCW7XJ4.mjs.map +0 -1
  333. package/dist/chunk-ZOTAORG3.mjs.map +0 -1
  334. package/dist/chunk-ZQNAZPSK.mjs.map +0 -1
  335. /package/dist/{chunk-QVHWSUEH.mjs.map → array/countBy.mjs.map} +0 -0
  336. /package/dist/{chunk-V6MDTRGS.mjs.map → array/fill.mjs.map} +0 -0
  337. /package/dist/{chunk-CDA4NK7J.mjs.map → chunk-O64NE2P4.mjs.map} +0 -0
  338. /package/dist/{chunk-E54CCWDL.mjs.map → chunk-Q47NGNXT.mjs.map} +0 -0
  339. /package/dist/{chunk-JSS4FXUD.mjs.map → chunk-QRSJBBFY.mjs.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  union
3
- } from "./chunk-UPJXHWSJ.mjs";
3
+ } from "./chunk-R6QA7PLZ.mjs";
4
4
  import {
5
5
  intersection
6
- } from "./chunk-PYLGHB3F.mjs";
6
+ } from "./chunk-FVVSE2F2.mjs";
7
7
  import {
8
8
  difference
9
9
  } from "./chunk-JPUKH67K.mjs";
@@ -16,4 +16,4 @@ function xor(arr1, arr2) {
16
16
  export {
17
17
  xor
18
18
  };
19
- //# sourceMappingURL=chunk-VKM3R5T5.mjs.map
19
+ //# sourceMappingURL=chunk-L7FQX5MN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/xor.ts"],"sourcesContent":["import { difference } from './difference.ts';\nimport { intersection } from './intersection.ts';\nimport { union } from './union.ts';\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 * @template T - The type of elements in the array.\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: readonly T[], arr2: readonly T[]): T[] {\n return difference(union(arr1, arr2), intersection(arr1, arr2));\n}\n"],"mappings":";;;;;;;;;;;AAqBO,SAAS,IAAO,MAAoB,MAAyB;AAClE,SAAO,WAAW,MAAM,MAAM,IAAI,GAAG,aAAa,MAAM,IAAI,CAAC;AAC/D;","names":[]}
@@ -10,4 +10,4 @@ function dropWhile(arr, canContinueDropping) {
10
10
  export {
11
11
  dropWhile
12
12
  };
13
- //# sourceMappingURL=chunk-K2BAFL2T.mjs.map
13
+ //# sourceMappingURL=chunk-LJ2C6MVP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/dropWhile.ts"],"sourcesContent":["/**\n * Removes elements from the beginning of an array until the predicate returns false.\n *\n * This function iterates over an array and drops elements from the start until the provided\n * predicate function returns false. It then returns a new array with the remaining elements.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array from which to drop elements.\n * @param {(item: T) => boolean} canContinueDropping - A predicate function that determines\n * whether to continue dropping elements. The function is called with each element, and dropping\n * continues as long as it returns true.\n * @returns {T[]} A new array with the elements remaining after the predicate returns false.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const result = dropWhile(array, x => x < 3);\n * // result will be [3, 4, 5] since elements less than 3 are dropped.\n */\nexport function dropWhile<T>(arr: readonly T[], canContinueDropping: (item: T) => boolean): T[] {\n const dropEndIndex = arr.findIndex(item => !canContinueDropping(item));\n if (dropEndIndex === -1) {\n return [];\n }\n\n return arr.slice(dropEndIndex);\n}\n"],"mappings":";AAkBO,SAAS,UAAa,KAAmB,qBAAgD;AAC9F,QAAM,eAAe,IAAI,UAAU,UAAQ,CAAC,oBAAoB,IAAI,CAAC;AACrE,MAAI,iBAAiB,IAAI;AACvB,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,YAAY;AAC/B;","names":[]}
@@ -10,4 +10,4 @@ function mean(nums) {
10
10
  export {
11
11
  mean
12
12
  };
13
- //# sourceMappingURL=chunk-KHK7LKE5.mjs.map
13
+ //# sourceMappingURL=chunk-LT6E4Y4Z.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/math/mean.ts"],"sourcesContent":["import { sum } from './sum.ts';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * If the array is empty, this function returns `NaN`.\n *\n * @param {number[]} nums - An array of numbers to calculate the average.\n * @returns {number} The average of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = average(numbers);\n * // result will be 3\n */\nexport function mean(nums: readonly number[]): number {\n return sum(nums) / nums.length;\n}\n"],"mappings":";;;;;AAeO,SAAS,KAAK,MAAiC;AACpD,SAAO,IAAI,IAAI,IAAI,KAAK;AAC1B;","names":[]}
@@ -13,4 +13,4 @@ function unionBy(arr1, arr2, mapper) {
13
13
  export {
14
14
  unionBy
15
15
  };
16
- //# sourceMappingURL=chunk-NRNKP6JF.mjs.map
16
+ //# sourceMappingURL=chunk-NFS7RWWE.mjs.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 * @template T - The type of elements in the array.\n * @template U - The type of mapped elements.\n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {(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: readonly T[], arr2: readonly 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\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return Array.from(map.values());\n}\n"],"mappings":";AAsBO,SAAS,QAAc,MAAoB,MAAoB,QAA6B;AACjG,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG;AACrC,UAAM,MAAM,OAAO,IAAI;AAEvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AbortError
3
- } from "./chunk-VP2LXY75.mjs";
3
+ } from "./chunk-DXB7EZUQ.mjs";
4
4
 
5
5
  // src/promise/delay.ts
6
6
  function delay(ms, { signal } = {}) {
@@ -23,4 +23,4 @@ function delay(ms, { signal } = {}) {
23
23
  export {
24
24
  delay
25
25
  };
26
- //# sourceMappingURL=chunk-CDA4NK7J.mjs.map
26
+ //# sourceMappingURL=chunk-O64NE2P4.mjs.map
@@ -7,4 +7,4 @@ function intersectionBy(firstArr, secondArr, mapper) {
7
7
  export {
8
8
  intersectionBy
9
9
  };
10
- //# sourceMappingURL=chunk-GNSJP2AB.mjs.map
10
+ //# sourceMappingURL=chunk-O6UXZR3U.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 * @template T - The type of elements in the array.\n * @template U - The type of mapped elements.\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: readonly T[], secondArr: readonly T[], mapper: (item: T) => U): T[] {\n const mappedSecondSet = new Set(secondArr.map(mapper));\n return firstArr.filter(item => mappedSecondSet.has(mapper(item)));\n}\n"],"mappings":";AAsBO,SAAS,eAAqB,UAAwB,WAAyB,QAA6B;AACjH,QAAM,kBAAkB,IAAI,IAAI,UAAU,IAAI,MAAM,CAAC;AACrD,SAAO,SAAS,OAAO,UAAQ,gBAAgB,IAAI,OAAO,IAAI,CAAC,CAAC;AAClE;","names":[]}
@@ -15,4 +15,4 @@ function maxBy(items, getValue) {
15
15
  export {
16
16
  maxBy
17
17
  };
18
- //# sourceMappingURL=chunk-FXOABQRO.mjs.map
18
+ //# sourceMappingURL=chunk-OOKNBU4V.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/maxBy.ts"],"sourcesContent":["/**\n * Finds the element in an array that has the maximum value when applying\n * the `getValue` function to each element.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @param {(element: T) => number} getValue A function that selects a numeric value from each element.\n * @returns {T} The element with the maximum value as determined by the `getValue` function.\n * @example\n * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 }\n * maxBy([], x => x.a); // Returns: undefined\n */\nexport function maxBy<T>(items: T[], getValue: (element: T) => number): T {\n let maxElement = items[0];\n let max = -Infinity;\n\n for (const element of items) {\n const value = getValue(element);\n if (value > max) {\n max = value;\n maxElement = element;\n }\n }\n\n return maxElement;\n}\n"],"mappings":";AAYO,SAAS,MAAS,OAAY,UAAqC;AACxE,MAAI,aAAa,MAAM,CAAC;AACxB,MAAI,MAAM;AAEV,aAAW,WAAW,OAAO;AAC3B,UAAM,QAAQ,SAAS,OAAO;AAC9B,QAAI,QAAQ,KAAK;AACf,YAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -13,4 +13,4 @@ function uniqBy(arr, mapper) {
13
13
  export {
14
14
  uniqBy
15
15
  };
16
- //# sourceMappingURL=chunk-WPDDOUQT.mjs.map
16
+ //# sourceMappingURL=chunk-OXAZEEGP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/uniqBy.ts"],"sourcesContent":["/**\n * Returns a new array containing only the unique elements from the original array,\n * based on the values returned by the mapper function.\n *\n * @template T - The type of elements in the array.\n * @template U - The type of mapped elements.\n * @param {T[]} arr - The array to process.\n * @param {(item: T) => U} mapper - The function used to convert the array elements.\n * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function.\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: readonly T[], mapper: (item: T) => U): T[] {\n const map = new Map<U, T>();\n\n for (const item of arr) {\n const key = mapper(item);\n\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return Array.from(map.values());\n}\n"],"mappings":";AAgBO,SAAS,OAAa,KAAmB,QAA6B;AAC3E,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,OAAO,IAAI;AAEvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;","names":[]}
@@ -0,0 +1,10 @@
1
+ // src/array/without.ts
2
+ function without(array, ...values) {
3
+ const valuesSet = new Set(values);
4
+ return array.filter((item) => !valuesSet.has(item));
5
+ }
6
+
7
+ export {
8
+ without
9
+ };
10
+ //# sourceMappingURL=chunk-PYEYV7BY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/without.ts"],"sourcesContent":["/**\n * Creates an array that excludes all specified values.\n *\n * It correctly excludes `NaN`, as it compares values using [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero).\n *\n * @template T The type of elements in the array.\n * @param {T[]} array - The array to filter.\n * @param {...T[]} values - The values to exclude.\n * @returns {T[]} A new array without the specified values.\n *\n * @example\n * // Removes the specified values from the array\n * without([1, 2, 3, 4, 5], 2, 4);\n * // Returns: [1, 3, 5]\n *\n * @example\n * // Removes specified string values from the array\n * without(['a', 'b', 'c', 'a'], 'a');\n * // Returns: ['b', 'c']\n */\nexport function without<T>(array: readonly T[], ...values: T[]): T[] {\n const valuesSet = new Set(values);\n return array.filter(item => !valuesSet.has(item));\n}\n"],"mappings":";AAoBO,SAAS,QAAW,UAAwB,QAAkB;AACnE,QAAM,YAAY,IAAI,IAAI,MAAM;AAChC,SAAO,MAAM,OAAO,UAAQ,CAAC,UAAU,IAAI,IAAI,CAAC;AAClD;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  unionBy
3
- } from "./chunk-NRNKP6JF.mjs";
3
+ } from "./chunk-NFS7RWWE.mjs";
4
4
  import {
5
5
  intersectionBy
6
- } from "./chunk-GNSJP2AB.mjs";
6
+ } from "./chunk-O6UXZR3U.mjs";
7
7
  import {
8
8
  differenceBy
9
9
  } from "./chunk-LVWX5B43.mjs";
@@ -18,4 +18,4 @@ function xorBy(arr1, arr2, mapper) {
18
18
  export {
19
19
  xorBy
20
20
  };
21
- //# sourceMappingURL=chunk-E54CCWDL.mjs.map
21
+ //# sourceMappingURL=chunk-Q47NGNXT.mjs.map
@@ -14,4 +14,4 @@ function throttle(func, throttleMs) {
14
14
  export {
15
15
  throttle
16
16
  };
17
- //# sourceMappingURL=chunk-OEOAJOLQ.mjs.map
17
+ //# sourceMappingURL=chunk-QOJGMVVR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/function/throttle.ts"],"sourcesContent":["/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @template F - The type of function.\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n"],"mappings":";AA0BO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  unionWith
3
- } from "./chunk-OUTSP4VR.mjs";
3
+ } from "./chunk-2ZCITDMK.mjs";
4
4
  import {
5
5
  intersectionWith
6
- } from "./chunk-2EFS3VA3.mjs";
6
+ } from "./chunk-XI7KRD2C.mjs";
7
7
  import {
8
8
  differenceWith
9
9
  } from "./chunk-6NVQAHXP.mjs";
@@ -18,4 +18,4 @@ function xorWith(arr1, arr2, areElementsEqual) {
18
18
  export {
19
19
  xorWith
20
20
  };
21
- //# sourceMappingURL=chunk-JSS4FXUD.mjs.map
21
+ //# sourceMappingURL=chunk-QRSJBBFY.mjs.map
@@ -14,4 +14,4 @@ function omit(obj, keys) {
14
14
  export {
15
15
  omit
16
16
  };
17
- //# sourceMappingURL=chunk-PLTO44KM.mjs.map
17
+ //# sourceMappingURL=chunk-QZITBKWX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/object/omit.ts"],"sourcesContent":["/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n"],"mappings":";;;;;AAiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  uniq
3
- } from "./chunk-XFCW7XJ4.mjs";
3
+ } from "./chunk-DVK2N4KC.mjs";
4
4
 
5
5
  // src/array/union.ts
6
6
  function union(arr1, arr2) {
@@ -10,4 +10,4 @@ function union(arr1, arr2) {
10
10
  export {
11
11
  union
12
12
  };
13
- //# sourceMappingURL=chunk-UPJXHWSJ.mjs.map
13
+ //# sourceMappingURL=chunk-R6QA7PLZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/union.ts"],"sourcesContent":["import { uniq } from './uniq.ts';\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 * @template T - The type of elements in the array.\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: readonly T[], arr2: readonly T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n"],"mappings":";;;;;AAmBO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;","names":[]}
@@ -6,4 +6,4 @@ function drop(arr, itemsCount) {
6
6
  export {
7
7
  drop
8
8
  };
9
- //# sourceMappingURL=chunk-ACFP3XMB.mjs.map
9
+ //# sourceMappingURL=chunk-S3CORED5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/drop.ts"],"sourcesContent":["/**\n * Removes a specified number of elements from the beginning of an array and returns the rest.\n *\n * This function takes an array and a number, and returns a new array with the specified number\n * of elements removed from the start.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array from which to drop elements.\n * @param {number} itemsCount - The number of elements to drop from the beginning of the array.\n * @returns {T[]} A new array with the specified number of elements removed from the start.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const result = drop(array, 2);\n * // result will be [3, 4, 5] since the first two elements are dropped.\n */\nexport function drop<T>(arr: readonly T[], itemsCount: number): T[] {\n return arr.slice(itemsCount);\n}\n"],"mappings":";AAgBO,SAAS,KAAQ,KAAmB,YAAyB;AAClE,SAAO,IAAI,MAAM,UAAU;AAC7B;","names":[]}
@@ -0,0 +1,14 @@
1
+ import {
2
+ mean
3
+ } from "./chunk-LT6E4Y4Z.mjs";
4
+
5
+ // src/math/meanBy.ts
6
+ function meanBy(items, getValue) {
7
+ const nums = items.map((x) => getValue(x));
8
+ return mean(nums);
9
+ }
10
+
11
+ export {
12
+ meanBy
13
+ };
14
+ //# sourceMappingURL=chunk-SDIMTYZW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/math/meanBy.ts"],"sourcesContent":["import { mean } from './mean.ts';\n\n/**\n * Calculates the average of an array of numbers when applying\n * the `getValue` function to each element.\n *\n * If the array is empty, this function returns `NaN`.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items An array to calculate the average.\n * @param {(element: T) => number} getValue A function that selects a numeric value from each element.\n * @returns {number} The average of all the numbers as determined by the `getValue` function.\n *\n * @example\n * meanBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: 2\n * meanBy([], x => x.a); // Returns: NaN\n */\nexport function meanBy<T>(items: readonly T[], getValue: (element: T) => number): number {\n const nums = items.map(x => getValue(x));\n\n return mean(nums);\n}\n"],"mappings":";;;;;AAiBO,SAAS,OAAU,OAAqB,UAA0C;AACvF,QAAM,OAAO,MAAM,IAAI,OAAK,SAAS,CAAC,CAAC;AAEvC,SAAO,KAAK,IAAI;AAClB;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-TZE6EDCX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -10,4 +10,4 @@ function intersectionWith(firstArr, secondArr, areItemsEqual) {
10
10
  export {
11
11
  intersectionWith
12
12
  };
13
- //# sourceMappingURL=chunk-2EFS3VA3.mjs.map
13
+ //# sourceMappingURL=chunk-XI7KRD2C.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/intersectionWith.ts"],"sourcesContent":["/**\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 * @template T - The type of elements in the array.\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>(\n firstArr: readonly T[],\n secondArr: readonly T[],\n areItemsEqual: (x: T, y: T) => boolean\n): T[] {\n return firstArr.filter(firstItem => {\n return secondArr.some(secondItem => {\n return areItemsEqual(firstItem, secondItem);\n });\n });\n}\n"],"mappings":";AAsBO,SAAS,iBACd,UACA,WACA,eACK;AACL,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,KAAK,gBAAc;AAClC,aAAO,cAAc,WAAW,UAAU;AAAA,IAC5C,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-XJR5WV2Z.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * An error class representing an aborted operation.
3
+ * @augments Error
4
+ */
1
5
  declare class AbortError extends Error {
2
6
  constructor(message?: string);
3
7
  }
@@ -1,3 +1,7 @@
1
+ /**
2
+ * An error class representing an aborted operation.
3
+ * @augments Error
4
+ */
1
5
  declare class AbortError extends Error {
2
6
  constructor(message?: string);
3
7
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/error/AbortError.ts"],"sourcesContent":["export class AbortError extends Error {\n constructor(message = 'The operation was aborted') {\n super(message);\n this.name = 'AbortError';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,aAAN,cAAyB,MAAM;AAAA,EACpC,YAAY,UAAU,6BAA6B;AACjD,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/error/AbortError.ts"],"sourcesContent":["/**\n * An error class representing an aborted operation.\n * @augments Error\n */\nexport class AbortError extends Error {\n constructor(message = 'The operation was aborted') {\n super(message);\n this.name = 'AbortError';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,aAAN,cAAyB,MAAM;AAAA,EACpC,YAAY,UAAU,6BAA6B;AACjD,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AbortError
3
- } from "../chunk-VP2LXY75.mjs";
3
+ } from "../chunk-DXB7EZUQ.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  AbortError
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/error/index.ts","../../src/error/AbortError.ts"],"sourcesContent":["export { AbortError } from './AbortError.ts';\n","export class AbortError extends Error {\n constructor(message = 'The operation was aborted') {\n super(message);\n this.name = 'AbortError';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,aAAN,cAAyB,MAAM;AAAA,EACpC,YAAY,UAAU,6BAA6B;AACjD,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/error/index.ts","../../src/error/AbortError.ts"],"sourcesContent":["export { AbortError } from './AbortError.ts';\n","/**\n * An error class representing an aborted operation.\n * @augments Error\n */\nexport class AbortError extends Error {\n constructor(message = 'The operation was aborted') {\n super(message);\n this.name = 'AbortError';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,aAAN,cAAyB,MAAM;AAAA,EACpC,YAAY,UAAU,6BAA6B;AACjD,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import "../chunk-FZEZH22H.mjs";
2
2
  import {
3
3
  AbortError
4
- } from "../chunk-VP2LXY75.mjs";
4
+ } from "../chunk-DXB7EZUQ.mjs";
5
5
  import "../chunk-2MM5EJJX.mjs";
6
6
  export {
7
7
  AbortError
@@ -6,6 +6,7 @@ interface DebounceOptions {
6
6
  * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
7
7
  * method to cancel any pending execution.
8
8
  *
9
+ * @template F - The type of function.
9
10
  * @param {F} func - The function to debounce.
10
11
  * @param {number} debounceMs - The number of milliseconds to delay.
11
12
  * @param {DebounceOptions} options - The options object.
@@ -6,6 +6,7 @@ interface DebounceOptions {
6
6
  * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
7
7
  * method to cancel any pending execution.
8
8
  *
9
+ * @template F - The type of function.
9
10
  * @param {F} func - The function to debounce.
10
11
  * @param {number} debounceMs - The number of milliseconds to delay.
11
12
  * @param {DebounceOptions} options - The options object.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/function/debounce.ts"],"sourcesContent":["interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,iCAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,mCAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK;AAExD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/function/debounce.ts"],"sourcesContent":["interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @template F - The type of function.\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,iCAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,mCAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK;AAExD,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  debounce
3
- } from "../chunk-G42NUGNE.mjs";
3
+ } from "../chunk-3IP4JVLL.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  debounce
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/function/index.ts","../../src/function/debounce.ts","../../src/function/noop.ts","../../src/function/once.ts","../../src/function/throttle.ts"],"sourcesContent":["export { debounce } from './debounce.ts';\nexport { noop } from './noop.ts';\nexport { once } from './once.ts';\nexport { throttle } from './throttle.ts';\n","interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n","/**\n * A no-operation function that does nothing.\n * This can be used as a placeholder or default function.\n *\n * @example\n * noop(); // Does nothing\n *\n * @returns {void} This function does not return anything.\n */\nexport function noop(): void {}\n","/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n","/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,iCAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,mCAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK;AAExD,SAAO;AACT;;;ACjEO,SAAS,OAAa;AAAC;;;ACOvB,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;;;ACPO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/function/index.ts","../../src/function/debounce.ts","../../src/function/noop.ts","../../src/function/once.ts","../../src/function/throttle.ts"],"sourcesContent":["export { debounce } from './debounce.ts';\nexport { noop } from './noop.ts';\nexport { once } from './once.ts';\nexport { throttle } from './throttle.ts';\n","interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @template F - The type of function.\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n","/**\n * A no-operation function that does nothing.\n * This can be used as a placeholder or default function.\n *\n * @example\n * noop(); // Does nothing\n *\n * @returns {void} This function does not return anything.\n */\nexport function noop(): void {}\n","/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @template F - The type of function.\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n","/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @template F - The type of function.\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,iCAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,mCAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK;AAExD,SAAO;AACT;;;AClEO,SAAS,OAAa;AAAC;;;ACQvB,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;;;ACPO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1,16 +1,16 @@
1
1
  import "../chunk-N6EM6ETS.mjs";
2
- import {
3
- once
4
- } from "../chunk-UFAA5WKR.mjs";
5
- import {
6
- throttle
7
- } from "../chunk-OEOAJOLQ.mjs";
8
2
  import {
9
3
  debounce
10
- } from "../chunk-G42NUGNE.mjs";
4
+ } from "../chunk-3IP4JVLL.mjs";
11
5
  import {
12
6
  noop
13
7
  } from "../chunk-LKXCOLNY.mjs";
8
+ import {
9
+ once
10
+ } from "../chunk-CMBC4MXG.mjs";
11
+ import {
12
+ throttle
13
+ } from "../chunk-QOJGMVVR.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  debounce,
@@ -2,6 +2,7 @@
2
2
  * Creates a function that is restricted to invoking the provided function `func` once.
3
3
  * Repeated calls to the function will return the value from the first invocation.
4
4
  *
5
+ * @template F - The type of function.
5
6
  * @param {F} func - The function to restrict.
6
7
  * @returns {F} A new function that invokes `func` once and caches the result.
7
8
  *
@@ -2,6 +2,7 @@
2
2
  * Creates a function that is restricted to invoking the provided function `func` once.
3
3
  * Repeated calls to the function will return the value from the first invocation.
4
4
  *
5
+ * @template F - The type of function.
5
6
  * @param {F} func - The function to restrict.
6
7
  * @returns {F} A new function that invokes `func` once and caches the result.
7
8
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/function/once.ts"],"sourcesContent":["/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/function/once.ts"],"sourcesContent":["/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @template F - The type of function.\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  once
3
- } from "../chunk-UFAA5WKR.mjs";
3
+ } from "../chunk-CMBC4MXG.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  once
@@ -3,6 +3,7 @@
3
3
  * per every `throttleMs` milliseconds. Subsequent calls to the throttled function
4
4
  * within the wait time will not trigger the execution of the original function.
5
5
  *
6
+ * @template F - The type of function.
6
7
  * @param {F} func - The function to throttle.
7
8
  * @param {number} throttleMs - The number of milliseconds to throttle executions to.
8
9
  * @returns {F} A new throttled function that accepts the same parameters as the original function.
@@ -3,6 +3,7 @@
3
3
  * per every `throttleMs` milliseconds. Subsequent calls to the throttled function
4
4
  * within the wait time will not trigger the execution of the original function.
5
5
  *
6
+ * @template F - The type of function.
6
7
  * @param {F} func - The function to throttle.
7
8
  * @param {number} throttleMs - The number of milliseconds to throttle executions to.
8
9
  * @returns {F} A new throttled function that accepts the same parameters as the original function.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/function/throttle.ts"],"sourcesContent":["/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/function/throttle.ts"],"sourcesContent":["/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @template F - The type of function.\n * @param {F} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {F} A new throttled function that accepts the same parameters as the original function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle<F extends (...args: any[]) => void>(func: F, throttleMs: number): F {\n let lastCallTime: number | null;\n\n const throttledFunction = function (...args: Parameters<F>) {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func(...args);\n }\n } as F;\n\n return throttledFunction;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BO,SAAS,SAA6C,MAAS,YAAuB;AAC3F,MAAI;AAEJ,QAAM,oBAAoB,YAAa,MAAqB;AAC1D,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  throttle
3
- } from "../chunk-OEOAJOLQ.mjs";
3
+ } from "../chunk-QOJGMVVR.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  throttle
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { chunk } from './array/chunk.mjs';
2
2
  export { compact } from './array/compact.mjs';
3
+ export { countBy } from './array/countBy.mjs';
3
4
  export { difference } from './array/difference.mjs';
4
5
  export { differenceBy } from './array/differenceBy.mjs';
5
6
  export { differenceWith } from './array/differenceWith.mjs';
@@ -7,6 +8,8 @@ export { drop } from './array/drop.mjs';
7
8
  export { dropRight } from './array/dropRight.mjs';
8
9
  export { dropRightWhile } from './array/dropRightWhile.mjs';
9
10
  export { dropWhile } from './array/dropWhile.mjs';
11
+ export { fill } from './array/fill.mjs';
12
+ export { forEachRight } from './array/forEachRight.mjs';
10
13
  export { groupBy } from './array/groupBy.mjs';
11
14
  export { intersection } from './array/intersection.mjs';
12
15
  export { intersectionBy } from './array/intersectionBy.mjs';
@@ -16,6 +19,7 @@ export { maxBy } from './array/maxBy.mjs';
16
19
  export { minBy } from './array/minBy.mjs';
17
20
  export { partition } from './array/partition.mjs';
18
21
  export { sample } from './array/sample.mjs';
22
+ export { sampleSize } from './array/sampleSize.mjs';
19
23
  export { shuffle } from './array/shuffle.mjs';
20
24
  export { take } from './array/take.mjs';
21
25
  export { takeRight } from './array/takeRight.mjs';
@@ -27,12 +31,14 @@ export { unionWith } from './array/unionWith.mjs';
27
31
  export { uniq } from './array/uniq.mjs';
28
32
  export { uniqBy } from './array/uniqBy.mjs';
29
33
  export { uniqWith } from './array/uniqWith.mjs';
34
+ export { unzipWith } from './array/unzipWith.mjs';
30
35
  export { xor } from './array/xor.mjs';
31
36
  export { xorBy } from './array/xorBy.mjs';
32
37
  export { xorWith } from './array/xorWith.mjs';
33
38
  export { zip } from './array/zip.mjs';
34
- export { zipWith } from './array/zipWith.mjs';
35
39
  export { zipObject } from './array/zipObject.mjs';
40
+ export { zipWith } from './array/zipWith.mjs';
41
+ export { without } from './array/without.mjs';
36
42
  export { AbortError } from './error/AbortError.mjs';
37
43
  export { debounce } from './function/debounce.mjs';
38
44
  export { noop } from './function/noop.mjs';
@@ -40,6 +46,7 @@ export { once } from './function/once.mjs';
40
46
  export { throttle } from './function/throttle.mjs';
41
47
  export { clamp } from './math/clamp.mjs';
42
48
  export { mean } from './math/mean.mjs';
49
+ export { meanBy } from './math/meanBy.mjs';
43
50
  export { random } from './math/random.mjs';
44
51
  export { randomInt } from './math/randomInt.mjs';
45
52
  export { round } from './math/round.mjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { chunk } from './array/chunk.js';
2
2
  export { compact } from './array/compact.js';
3
+ export { countBy } from './array/countBy.js';
3
4
  export { difference } from './array/difference.js';
4
5
  export { differenceBy } from './array/differenceBy.js';
5
6
  export { differenceWith } from './array/differenceWith.js';
@@ -7,6 +8,8 @@ export { drop } from './array/drop.js';
7
8
  export { dropRight } from './array/dropRight.js';
8
9
  export { dropRightWhile } from './array/dropRightWhile.js';
9
10
  export { dropWhile } from './array/dropWhile.js';
11
+ export { fill } from './array/fill.js';
12
+ export { forEachRight } from './array/forEachRight.js';
10
13
  export { groupBy } from './array/groupBy.js';
11
14
  export { intersection } from './array/intersection.js';
12
15
  export { intersectionBy } from './array/intersectionBy.js';
@@ -16,6 +19,7 @@ export { maxBy } from './array/maxBy.js';
16
19
  export { minBy } from './array/minBy.js';
17
20
  export { partition } from './array/partition.js';
18
21
  export { sample } from './array/sample.js';
22
+ export { sampleSize } from './array/sampleSize.js';
19
23
  export { shuffle } from './array/shuffle.js';
20
24
  export { take } from './array/take.js';
21
25
  export { takeRight } from './array/takeRight.js';
@@ -27,12 +31,14 @@ export { unionWith } from './array/unionWith.js';
27
31
  export { uniq } from './array/uniq.js';
28
32
  export { uniqBy } from './array/uniqBy.js';
29
33
  export { uniqWith } from './array/uniqWith.js';
34
+ export { unzipWith } from './array/unzipWith.js';
30
35
  export { xor } from './array/xor.js';
31
36
  export { xorBy } from './array/xorBy.js';
32
37
  export { xorWith } from './array/xorWith.js';
33
38
  export { zip } from './array/zip.js';
34
- export { zipWith } from './array/zipWith.js';
35
39
  export { zipObject } from './array/zipObject.js';
40
+ export { zipWith } from './array/zipWith.js';
41
+ export { without } from './array/without.js';
36
42
  export { AbortError } from './error/AbortError.js';
37
43
  export { debounce } from './function/debounce.js';
38
44
  export { noop } from './function/noop.js';
@@ -40,6 +46,7 @@ export { once } from './function/once.js';
40
46
  export { throttle } from './function/throttle.js';
41
47
  export { clamp } from './math/clamp.js';
42
48
  export { mean } from './math/mean.js';
49
+ export { meanBy } from './math/meanBy.js';
43
50
  export { random } from './math/random.js';
44
51
  export { randomInt } from './math/randomInt.js';
45
52
  export { round } from './math/round.js';