es-toolkit 1.6.1-dev.136 → 1.6.1-dev.138

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 (274) hide show
  1. package/dist/array/compact.d.mts +1 -0
  2. package/dist/array/compact.d.ts +1 -0
  3. package/dist/array/compact.js.map +1 -1
  4. package/dist/array/compact.mjs +1 -1
  5. package/dist/array/drop.d.mts +1 -0
  6. package/dist/array/drop.d.ts +1 -0
  7. package/dist/array/drop.js.map +1 -1
  8. package/dist/array/drop.mjs +1 -1
  9. package/dist/array/dropRight.d.mts +1 -0
  10. package/dist/array/dropRight.d.ts +1 -0
  11. package/dist/array/dropRight.js.map +1 -1
  12. package/dist/array/dropRight.mjs +1 -1
  13. package/dist/array/dropRightWhile.d.mts +1 -0
  14. package/dist/array/dropRightWhile.d.ts +1 -0
  15. package/dist/array/dropRightWhile.js.map +1 -1
  16. package/dist/array/dropRightWhile.mjs +2 -2
  17. package/dist/array/dropWhile.d.mts +1 -0
  18. package/dist/array/dropWhile.d.ts +1 -0
  19. package/dist/array/dropWhile.js.map +1 -1
  20. package/dist/array/dropWhile.mjs +1 -1
  21. package/dist/array/groupBy.d.mts +2 -0
  22. package/dist/array/groupBy.d.ts +2 -0
  23. package/dist/array/groupBy.js.map +1 -1
  24. package/dist/array/groupBy.mjs +1 -1
  25. package/dist/array/index.js.map +1 -1
  26. package/dist/array/index.mjs +28 -28
  27. package/dist/array/intersection.d.mts +1 -0
  28. package/dist/array/intersection.d.ts +1 -0
  29. package/dist/array/intersection.js.map +1 -1
  30. package/dist/array/intersection.mjs +1 -1
  31. package/dist/array/intersectionBy.d.mts +2 -0
  32. package/dist/array/intersectionBy.d.ts +2 -0
  33. package/dist/array/intersectionBy.js.map +1 -1
  34. package/dist/array/intersectionBy.mjs +1 -1
  35. package/dist/array/intersectionWith.d.mts +1 -0
  36. package/dist/array/intersectionWith.d.ts +1 -0
  37. package/dist/array/intersectionWith.js.map +1 -1
  38. package/dist/array/intersectionWith.mjs +1 -1
  39. package/dist/array/keyBy.d.mts +2 -0
  40. package/dist/array/keyBy.d.ts +2 -0
  41. package/dist/array/keyBy.js.map +1 -1
  42. package/dist/array/keyBy.mjs +1 -1
  43. package/dist/array/maxBy.d.mts +1 -0
  44. package/dist/array/maxBy.d.ts +1 -0
  45. package/dist/array/maxBy.js.map +1 -1
  46. package/dist/array/maxBy.mjs +1 -1
  47. package/dist/array/minBy.d.mts +1 -0
  48. package/dist/array/minBy.d.ts +1 -0
  49. package/dist/array/minBy.js.map +1 -1
  50. package/dist/array/minBy.mjs +1 -1
  51. package/dist/array/partition.d.mts +1 -0
  52. package/dist/array/partition.d.ts +1 -0
  53. package/dist/array/partition.js.map +1 -1
  54. package/dist/array/partition.mjs +1 -1
  55. package/dist/array/sample.d.mts +1 -0
  56. package/dist/array/sample.d.ts +1 -0
  57. package/dist/array/sample.js.map +1 -1
  58. package/dist/array/sample.mjs +1 -1
  59. package/dist/array/sampleSize.d.mts +1 -0
  60. package/dist/array/sampleSize.d.ts +1 -0
  61. package/dist/array/sampleSize.js.map +1 -1
  62. package/dist/array/sampleSize.mjs +2 -2
  63. package/dist/array/shuffle.d.mts +1 -0
  64. package/dist/array/shuffle.d.ts +1 -0
  65. package/dist/array/shuffle.js.map +1 -1
  66. package/dist/array/shuffle.mjs +1 -1
  67. package/dist/array/takeRight.d.mts +1 -0
  68. package/dist/array/takeRight.d.ts +1 -0
  69. package/dist/array/takeRight.js.map +1 -1
  70. package/dist/array/takeRight.mjs +1 -1
  71. package/dist/array/union.d.mts +1 -0
  72. package/dist/array/union.d.ts +1 -0
  73. package/dist/array/union.js.map +1 -1
  74. package/dist/array/union.mjs +2 -2
  75. package/dist/array/unionBy.d.mts +2 -0
  76. package/dist/array/unionBy.d.ts +2 -0
  77. package/dist/array/unionBy.js.map +1 -1
  78. package/dist/array/unionBy.mjs +1 -1
  79. package/dist/array/unionWith.d.mts +1 -0
  80. package/dist/array/unionWith.d.ts +1 -0
  81. package/dist/array/unionWith.js.map +1 -1
  82. package/dist/array/unionWith.mjs +2 -2
  83. package/dist/array/uniq.d.mts +1 -0
  84. package/dist/array/uniq.d.ts +1 -0
  85. package/dist/array/uniq.js.map +1 -1
  86. package/dist/array/uniq.mjs +1 -1
  87. package/dist/array/uniqBy.d.mts +2 -0
  88. package/dist/array/uniqBy.d.ts +2 -0
  89. package/dist/array/uniqBy.js.map +1 -1
  90. package/dist/array/uniqBy.mjs +1 -1
  91. package/dist/array/uniqWith.d.mts +1 -0
  92. package/dist/array/uniqWith.d.ts +1 -0
  93. package/dist/array/uniqWith.js.map +1 -1
  94. package/dist/array/uniqWith.mjs +1 -1
  95. package/dist/array/xor.d.mts +1 -0
  96. package/dist/array/xor.d.ts +1 -0
  97. package/dist/array/xor.js.map +1 -1
  98. package/dist/array/xor.mjs +4 -4
  99. package/dist/array/xorBy.js.map +1 -1
  100. package/dist/array/xorBy.mjs +3 -3
  101. package/dist/array/xorWith.js.map +1 -1
  102. package/dist/array/xorWith.mjs +4 -4
  103. package/dist/array/zipObject.d.mts +2 -0
  104. package/dist/array/zipObject.d.ts +2 -0
  105. package/dist/array/zipObject.js.map +1 -1
  106. package/dist/array/zipObject.mjs +1 -1
  107. package/dist/{chunk-2PFDLYQC.mjs → chunk-237HGSZS.mjs} +1 -1
  108. package/dist/chunk-237HGSZS.mjs.map +1 -0
  109. package/dist/{chunk-DOOIIHT3.mjs → chunk-2KNLZB7V.mjs} +1 -1
  110. package/dist/chunk-2KNLZB7V.mjs.map +1 -0
  111. package/dist/{chunk-OUTSP4VR.mjs → chunk-2ZCITDMK.mjs} +2 -2
  112. package/dist/chunk-2ZCITDMK.mjs.map +1 -0
  113. package/dist/{chunk-G42NUGNE.mjs → chunk-3IP4JVLL.mjs} +1 -1
  114. package/dist/chunk-3IP4JVLL.mjs.map +1 -0
  115. package/dist/{chunk-MQWVBKUT.mjs → chunk-6CLH5YZ2.mjs} +1 -1
  116. package/dist/chunk-6CLH5YZ2.mjs.map +1 -0
  117. package/dist/{chunk-DA7GSKQ5.mjs → chunk-6GWEY5EL.mjs} +1 -1
  118. package/dist/chunk-6GWEY5EL.mjs.map +1 -0
  119. package/dist/{chunk-KSXWREB5.mjs → chunk-AJKZMN2V.mjs} +1 -1
  120. package/dist/chunk-AJKZMN2V.mjs.map +1 -0
  121. package/dist/{chunk-A67NF2C7.mjs → chunk-BCTYOXT7.mjs} +1 -1
  122. package/dist/chunk-BCTYOXT7.mjs.map +1 -0
  123. package/dist/{chunk-ZQNAZPSK.mjs → chunk-BMRTZMRE.mjs} +1 -1
  124. package/dist/chunk-BMRTZMRE.mjs.map +1 -0
  125. package/dist/{chunk-UFAA5WKR.mjs → chunk-CMBC4MXG.mjs} +1 -1
  126. package/dist/chunk-CMBC4MXG.mjs.map +1 -0
  127. package/dist/{chunk-JGNFYNYU.mjs → chunk-CXGIXTSH.mjs} +1 -1
  128. package/dist/chunk-CXGIXTSH.mjs.map +1 -0
  129. package/dist/{chunk-5L2V7WD3.mjs → chunk-DN3NOZ3H.mjs} +1 -1
  130. package/dist/chunk-DN3NOZ3H.mjs.map +1 -0
  131. package/dist/{chunk-NKTBEEIT.mjs → chunk-DTJJIMKJ.mjs} +1 -1
  132. package/dist/chunk-DTJJIMKJ.mjs.map +1 -0
  133. package/dist/{chunk-XFCW7XJ4.mjs → chunk-DVK2N4KC.mjs} +1 -1
  134. package/dist/chunk-DVK2N4KC.mjs.map +1 -0
  135. package/dist/{chunk-Q5XXJXXQ.mjs → chunk-DXB7EZUQ.mjs} +1 -1
  136. package/dist/chunk-DXB7EZUQ.mjs.map +1 -0
  137. package/dist/{chunk-H5YR3ZV4.mjs → chunk-E6E4RZLN.mjs} +1 -1
  138. package/dist/chunk-E6E4RZLN.mjs.map +1 -0
  139. package/dist/{chunk-PYLGHB3F.mjs → chunk-FVVSE2F2.mjs} +1 -1
  140. package/dist/chunk-FVVSE2F2.mjs.map +1 -0
  141. package/dist/{chunk-DPLJQQFX.mjs → chunk-G7UQ5PUR.mjs} +1 -1
  142. package/dist/chunk-G7UQ5PUR.mjs.map +1 -0
  143. package/dist/{chunk-OFWKFUFZ.mjs → chunk-HPFDYUGP.mjs} +1 -1
  144. package/dist/chunk-HPFDYUGP.mjs.map +1 -0
  145. package/dist/{chunk-OIHARMNM.mjs → chunk-IJD7FE2Z.mjs} +1 -1
  146. package/dist/chunk-IJD7FE2Z.mjs.map +1 -0
  147. package/dist/{chunk-XDKEPIUV.mjs → chunk-IQLKIDXF.mjs} +1 -1
  148. package/dist/chunk-IQLKIDXF.mjs.map +1 -0
  149. package/dist/{chunk-GTVOVGGZ.mjs → chunk-JE6JKZU3.mjs} +2 -2
  150. package/dist/chunk-JE6JKZU3.mjs.map +1 -0
  151. package/dist/{chunk-Q75KEFW5.mjs → chunk-JEKUA56R.mjs} +1 -1
  152. package/dist/chunk-JEKUA56R.mjs.map +1 -0
  153. package/dist/{chunk-VKM3R5T5.mjs → chunk-L7FQX5MN.mjs} +3 -3
  154. package/dist/chunk-L7FQX5MN.mjs.map +1 -0
  155. package/dist/{chunk-K2BAFL2T.mjs → chunk-LJ2C6MVP.mjs} +1 -1
  156. package/dist/chunk-LJ2C6MVP.mjs.map +1 -0
  157. package/dist/{chunk-4MRXVNGG.mjs → chunk-LUIKU43M.mjs} +1 -1
  158. package/dist/chunk-LUIKU43M.mjs.map +1 -0
  159. package/dist/{chunk-NRNKP6JF.mjs → chunk-NFS7RWWE.mjs} +1 -1
  160. package/dist/chunk-NFS7RWWE.mjs.map +1 -0
  161. package/dist/{chunk-H2FV6Z5X.mjs → chunk-O64NE2P4.mjs} +2 -2
  162. package/dist/{chunk-GNSJP2AB.mjs → chunk-O6UXZR3U.mjs} +1 -1
  163. package/dist/chunk-O6UXZR3U.mjs.map +1 -0
  164. package/dist/{chunk-FXOABQRO.mjs → chunk-OOKNBU4V.mjs} +1 -1
  165. package/dist/chunk-OOKNBU4V.mjs.map +1 -0
  166. package/dist/{chunk-WPDDOUQT.mjs → chunk-OXAZEEGP.mjs} +1 -1
  167. package/dist/chunk-OXAZEEGP.mjs.map +1 -0
  168. package/dist/{chunk-E54CCWDL.mjs → chunk-Q47NGNXT.mjs} +3 -3
  169. package/dist/{chunk-OEOAJOLQ.mjs → chunk-QOJGMVVR.mjs} +1 -1
  170. package/dist/chunk-QOJGMVVR.mjs.map +1 -0
  171. package/dist/{chunk-JSS4FXUD.mjs → chunk-QRSJBBFY.mjs} +3 -3
  172. package/dist/{chunk-PLTO44KM.mjs → chunk-QZITBKWX.mjs} +1 -1
  173. package/dist/chunk-QZITBKWX.mjs.map +1 -0
  174. package/dist/{chunk-UPJXHWSJ.mjs → chunk-R6QA7PLZ.mjs} +2 -2
  175. package/dist/chunk-R6QA7PLZ.mjs.map +1 -0
  176. package/dist/{chunk-ACFP3XMB.mjs → chunk-S3CORED5.mjs} +1 -1
  177. package/dist/chunk-S3CORED5.mjs.map +1 -0
  178. package/dist/{chunk-2EFS3VA3.mjs → chunk-XI7KRD2C.mjs} +1 -1
  179. package/dist/chunk-XI7KRD2C.mjs.map +1 -0
  180. package/dist/error/AbortError.d.mts +1 -1
  181. package/dist/error/AbortError.d.ts +1 -1
  182. package/dist/error/AbortError.js.map +1 -1
  183. package/dist/error/AbortError.mjs +1 -1
  184. package/dist/error/index.js.map +1 -1
  185. package/dist/error/index.mjs +1 -1
  186. package/dist/function/debounce.d.mts +1 -0
  187. package/dist/function/debounce.d.ts +1 -0
  188. package/dist/function/debounce.js.map +1 -1
  189. package/dist/function/debounce.mjs +1 -1
  190. package/dist/function/index.js.map +1 -1
  191. package/dist/function/index.mjs +3 -3
  192. package/dist/function/once.d.mts +1 -0
  193. package/dist/function/once.d.ts +1 -0
  194. package/dist/function/once.js.map +1 -1
  195. package/dist/function/once.mjs +1 -1
  196. package/dist/function/throttle.d.mts +1 -0
  197. package/dist/function/throttle.d.ts +1 -0
  198. package/dist/function/throttle.js.map +1 -1
  199. package/dist/function/throttle.mjs +1 -1
  200. package/dist/index.js.map +1 -1
  201. package/dist/index.mjs +41 -41
  202. package/dist/math/index.js.map +1 -1
  203. package/dist/math/index.mjs +1 -1
  204. package/dist/math/meanBy.d.mts +1 -0
  205. package/dist/math/meanBy.d.ts +1 -0
  206. package/dist/math/meanBy.js.map +1 -1
  207. package/dist/math/meanBy.mjs +1 -1
  208. package/dist/object/index.js.map +1 -1
  209. package/dist/object/index.mjs +4 -4
  210. package/dist/object/omit.d.mts +2 -0
  211. package/dist/object/omit.d.ts +2 -0
  212. package/dist/object/omit.js.map +1 -1
  213. package/dist/object/omit.mjs +1 -1
  214. package/dist/object/omitBy.d.mts +1 -0
  215. package/dist/object/omitBy.d.ts +1 -0
  216. package/dist/object/omitBy.js.map +1 -1
  217. package/dist/object/omitBy.mjs +1 -1
  218. package/dist/object/pick.d.mts +2 -0
  219. package/dist/object/pick.d.ts +2 -0
  220. package/dist/object/pick.js.map +1 -1
  221. package/dist/object/pick.mjs +1 -1
  222. package/dist/object/pickBy.d.mts +1 -0
  223. package/dist/object/pickBy.d.ts +1 -0
  224. package/dist/object/pickBy.js.map +1 -1
  225. package/dist/object/pickBy.mjs +1 -1
  226. package/dist/predicate/index.js.map +1 -1
  227. package/dist/predicate/index.mjs +1 -1
  228. package/dist/predicate/isNotNil.d.mts +1 -0
  229. package/dist/predicate/isNotNil.d.ts +1 -0
  230. package/dist/predicate/isNotNil.js.map +1 -1
  231. package/dist/predicate/isNotNil.mjs +1 -1
  232. package/dist/promise/delay.js.map +1 -1
  233. package/dist/promise/delay.mjs +2 -2
  234. package/dist/promise/index.js.map +1 -1
  235. package/dist/promise/index.mjs +2 -2
  236. package/package.json +9 -1
  237. package/dist/chunk-2EFS3VA3.mjs.map +0 -1
  238. package/dist/chunk-2PFDLYQC.mjs.map +0 -1
  239. package/dist/chunk-4MRXVNGG.mjs.map +0 -1
  240. package/dist/chunk-5L2V7WD3.mjs.map +0 -1
  241. package/dist/chunk-A67NF2C7.mjs.map +0 -1
  242. package/dist/chunk-ACFP3XMB.mjs.map +0 -1
  243. package/dist/chunk-DA7GSKQ5.mjs.map +0 -1
  244. package/dist/chunk-DOOIIHT3.mjs.map +0 -1
  245. package/dist/chunk-DPLJQQFX.mjs.map +0 -1
  246. package/dist/chunk-FXOABQRO.mjs.map +0 -1
  247. package/dist/chunk-G42NUGNE.mjs.map +0 -1
  248. package/dist/chunk-GNSJP2AB.mjs.map +0 -1
  249. package/dist/chunk-GTVOVGGZ.mjs.map +0 -1
  250. package/dist/chunk-H5YR3ZV4.mjs.map +0 -1
  251. package/dist/chunk-JGNFYNYU.mjs.map +0 -1
  252. package/dist/chunk-K2BAFL2T.mjs.map +0 -1
  253. package/dist/chunk-KSXWREB5.mjs.map +0 -1
  254. package/dist/chunk-MQWVBKUT.mjs.map +0 -1
  255. package/dist/chunk-NKTBEEIT.mjs.map +0 -1
  256. package/dist/chunk-NRNKP6JF.mjs.map +0 -1
  257. package/dist/chunk-OEOAJOLQ.mjs.map +0 -1
  258. package/dist/chunk-OFWKFUFZ.mjs.map +0 -1
  259. package/dist/chunk-OIHARMNM.mjs.map +0 -1
  260. package/dist/chunk-OUTSP4VR.mjs.map +0 -1
  261. package/dist/chunk-PLTO44KM.mjs.map +0 -1
  262. package/dist/chunk-PYLGHB3F.mjs.map +0 -1
  263. package/dist/chunk-Q5XXJXXQ.mjs.map +0 -1
  264. package/dist/chunk-Q75KEFW5.mjs.map +0 -1
  265. package/dist/chunk-UFAA5WKR.mjs.map +0 -1
  266. package/dist/chunk-UPJXHWSJ.mjs.map +0 -1
  267. package/dist/chunk-VKM3R5T5.mjs.map +0 -1
  268. package/dist/chunk-WPDDOUQT.mjs.map +0 -1
  269. package/dist/chunk-XDKEPIUV.mjs.map +0 -1
  270. package/dist/chunk-XFCW7XJ4.mjs.map +0 -1
  271. package/dist/chunk-ZQNAZPSK.mjs.map +0 -1
  272. /package/dist/{chunk-H2FV6Z5X.mjs.map → chunk-O64NE2P4.mjs.map} +0 -0
  273. /package/dist/{chunk-E54CCWDL.mjs.map → chunk-Q47NGNXT.mjs.map} +0 -0
  274. /package/dist/{chunk-JSS4FXUD.mjs.map → chunk-QRSJBBFY.mjs.map} +0 -0
@@ -1,16 +1,16 @@
1
1
  import "../chunk-D735JOLS.mjs";
2
2
  import {
3
3
  xorBy
4
- } from "../chunk-E54CCWDL.mjs";
4
+ } from "../chunk-Q47NGNXT.mjs";
5
5
  import {
6
6
  xorWith
7
- } from "../chunk-JSS4FXUD.mjs";
7
+ } from "../chunk-QRSJBBFY.mjs";
8
8
  import {
9
9
  zip
10
10
  } from "../chunk-IDCUZVJL.mjs";
11
11
  import {
12
12
  zipObject
13
- } from "../chunk-DA7GSKQ5.mjs";
13
+ } from "../chunk-6GWEY5EL.mjs";
14
14
  import {
15
15
  zipWith
16
16
  } from "../chunk-4KYXHZ4R.mjs";
@@ -19,39 +19,39 @@ import {
19
19
  } from "../chunk-2IXFGSUA.mjs";
20
20
  import {
21
21
  unionBy
22
- } from "../chunk-NRNKP6JF.mjs";
22
+ } from "../chunk-NFS7RWWE.mjs";
23
23
  import {
24
24
  unionWith
25
- } from "../chunk-OUTSP4VR.mjs";
25
+ } from "../chunk-2ZCITDMK.mjs";
26
26
  import {
27
27
  uniqBy
28
- } from "../chunk-WPDDOUQT.mjs";
28
+ } from "../chunk-OXAZEEGP.mjs";
29
29
  import {
30
30
  uniqWith
31
- } from "../chunk-2PFDLYQC.mjs";
31
+ } from "../chunk-237HGSZS.mjs";
32
32
  import {
33
33
  xor
34
- } from "../chunk-VKM3R5T5.mjs";
34
+ } from "../chunk-L7FQX5MN.mjs";
35
35
  import {
36
36
  union
37
- } from "../chunk-UPJXHWSJ.mjs";
37
+ } from "../chunk-R6QA7PLZ.mjs";
38
38
  import {
39
39
  uniq
40
- } from "../chunk-XFCW7XJ4.mjs";
40
+ } from "../chunk-DVK2N4KC.mjs";
41
41
  import {
42
42
  minBy
43
- } from "../chunk-OIHARMNM.mjs";
43
+ } from "../chunk-IJD7FE2Z.mjs";
44
44
  import {
45
45
  partition
46
- } from "../chunk-5L2V7WD3.mjs";
46
+ } from "../chunk-DN3NOZ3H.mjs";
47
47
  import {
48
48
  sample
49
- } from "../chunk-DOOIIHT3.mjs";
49
+ } from "../chunk-2KNLZB7V.mjs";
50
50
  import {
51
51
  sampleSize
52
- } from "../chunk-4MRXVNGG.mjs";
52
+ } from "../chunk-LUIKU43M.mjs";
53
53
  import "../chunk-TZE6EDCX.mjs";
54
- import "../chunk-JGNFYNYU.mjs";
54
+ import "../chunk-CXGIXTSH.mjs";
55
55
  import "../chunk-GIWAOOFY.mjs";
56
56
  import "../chunk-SYWMYQYJ.mjs";
57
57
  import "../chunk-UNLX2F2Y.mjs";
@@ -61,40 +61,40 @@ import "../chunk-LT6E4Y4Z.mjs";
61
61
  import "../chunk-NOFHNJ5C.mjs";
62
62
  import {
63
63
  shuffle
64
- } from "../chunk-DPLJQQFX.mjs";
64
+ } from "../chunk-G7UQ5PUR.mjs";
65
65
  import {
66
66
  take
67
67
  } from "../chunk-ME352XO7.mjs";
68
68
  import {
69
69
  takeRight
70
- } from "../chunk-XDKEPIUV.mjs";
70
+ } from "../chunk-IQLKIDXF.mjs";
71
71
  import {
72
72
  takeRightWhile
73
73
  } from "../chunk-NTLX2MPV.mjs";
74
74
  import {
75
75
  groupBy
76
- } from "../chunk-H5YR3ZV4.mjs";
76
+ } from "../chunk-E6E4RZLN.mjs";
77
77
  import {
78
78
  intersection
79
- } from "../chunk-PYLGHB3F.mjs";
79
+ } from "../chunk-FVVSE2F2.mjs";
80
80
  import {
81
81
  intersectionBy
82
- } from "../chunk-GNSJP2AB.mjs";
82
+ } from "../chunk-O6UXZR3U.mjs";
83
83
  import {
84
84
  intersectionWith
85
- } from "../chunk-2EFS3VA3.mjs";
85
+ } from "../chunk-XI7KRD2C.mjs";
86
86
  import {
87
87
  keyBy
88
- } from "../chunk-KSXWREB5.mjs";
88
+ } from "../chunk-AJKZMN2V.mjs";
89
89
  import {
90
90
  maxBy
91
- } from "../chunk-FXOABQRO.mjs";
91
+ } from "../chunk-OOKNBU4V.mjs";
92
92
  import {
93
93
  chunk
94
94
  } from "../chunk-E6C5EZQA.mjs";
95
95
  import {
96
96
  compact
97
- } from "../chunk-NKTBEEIT.mjs";
97
+ } from "../chunk-DTJJIMKJ.mjs";
98
98
  import {
99
99
  difference
100
100
  } from "../chunk-JPUKH67K.mjs";
@@ -106,16 +106,16 @@ import {
106
106
  } from "../chunk-6NVQAHXP.mjs";
107
107
  import {
108
108
  drop
109
- } from "../chunk-ACFP3XMB.mjs";
109
+ } from "../chunk-S3CORED5.mjs";
110
110
  import {
111
111
  dropRight
112
- } from "../chunk-Q75KEFW5.mjs";
112
+ } from "../chunk-JEKUA56R.mjs";
113
113
  import {
114
114
  dropRightWhile
115
- } from "../chunk-GTVOVGGZ.mjs";
115
+ } from "../chunk-JE6JKZU3.mjs";
116
116
  import {
117
117
  dropWhile
118
- } from "../chunk-K2BAFL2T.mjs";
118
+ } from "../chunk-LJ2C6MVP.mjs";
119
119
  import "../chunk-2MM5EJJX.mjs";
120
120
  export {
121
121
  chunk,
@@ -5,6 +5,7 @@
5
5
  * present in both arrays. It effectively filters out any elements from the first array that
6
6
  * are not found in the second array.
7
7
  *
8
+ * @template T - The type of elements in the array.
8
9
  * @param {T[]} firstArr - The first array to compare.
9
10
  * @param {T[]} secondArr - The second array to compare.
10
11
  * @returns {T[]} A new array containing the elements that are present in both arrays.
@@ -5,6 +5,7 @@
5
5
  * present in both arrays. It effectively filters out any elements from the first array that
6
6
  * are not found in the second array.
7
7
  *
8
+ * @template T - The type of elements in the array.
8
9
  * @param {T[]} firstArr - The first array to compare.
9
10
  * @param {T[]} secondArr - The second array to compare.
10
11
  * @returns {T[]} A new array containing the elements that are present in both arrays.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/intersection.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays.\n *\n * This function takes two arrays and returns a new array containing the elements that are\n * present in both arrays. It effectively filters out any elements from the first array that\n * are not found in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @returns {T[]} A new array containing the elements that are present in both arrays.\n *\n * @example\n * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [3, 4, 5, 6, 7];\n * const result = intersection(array1, array2);\n * // result will be [3, 4, 5] since these elements are in both arrays.\n */\nexport function intersection<T>(firstArr: readonly T[], secondArr: readonly T[]): T[] {\n const secondSet = new Set(secondArr);\n\n return firstArr.filter(item => {\n return secondSet.has(item);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,SAAS,aAAgB,UAAwB,WAA8B;AACpF,QAAM,YAAY,IAAI,IAAI,SAAS;AAEnC,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,UAAU,IAAI,IAAI;AAAA,EAC3B,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/array/intersection.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays.\n *\n * This function takes two arrays and returns a new array containing the elements that are\n * present in both arrays. It effectively filters out any elements from the first array that\n * are not found in the second array.\n *\n * @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 * @returns {T[]} A new array containing the elements that are present in both arrays.\n *\n * @example\n * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [3, 4, 5, 6, 7];\n * const result = intersection(array1, array2);\n * // result will be [3, 4, 5] since these elements are in both arrays.\n */\nexport function intersection<T>(firstArr: readonly T[], secondArr: readonly T[]): T[] {\n const secondSet = new Set(secondArr);\n\n return firstArr.filter(item => {\n return secondSet.has(item);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,aAAgB,UAAwB,WAA8B;AACpF,QAAM,YAAY,IAAI,IAAI,SAAS;AAEnC,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,UAAU,IAAI,IAAI;AAAA,EAC3B,CAAC;AACH;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  intersection
3
- } from "../chunk-PYLGHB3F.mjs";
3
+ } from "../chunk-FVVSE2F2.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  intersection
@@ -6,6 +6,8 @@
6
6
  * mapped elements in the second array. It effectively filters out any elements from the first array
7
7
  * that do not have corresponding mapped values in the second array.
8
8
  *
9
+ * @template T - The type of elements in the array.
10
+ * @template U - The type of mapped elements.
9
11
  * @param {T[]} firstArr - The first array to compare.
10
12
  * @param {T[]} secondArr - The second array to compare.
11
13
  * @param {(item: T) => U} mapper - A function to map the elements of both arrays for comparison.
@@ -6,6 +6,8 @@
6
6
  * mapped elements in the second array. It effectively filters out any elements from the first array
7
7
  * that do not have corresponding mapped values in the second array.
8
8
  *
9
+ * @template T - The type of elements in the array.
10
+ * @template U - The type of mapped elements.
9
11
  * @param {T[]} firstArr - The first array to compare.
10
12
  * @param {T[]} secondArr - The second array to compare.
11
13
  * @param {(item: T) => U} mapper - A function to map the elements of both arrays for comparison.
@@ -1 +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: 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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,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":[]}
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  intersectionBy
3
- } from "../chunk-GNSJP2AB.mjs";
3
+ } from "../chunk-O6UXZR3U.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  intersectionBy
@@ -6,6 +6,7 @@
6
6
  * by the custom equality function. It effectively filters out any elements from the first array that
7
7
  * do not have corresponding matches in the second array according to the equality function.
8
8
  *
9
+ * @template T - The type of elements in the array.
9
10
  * @param {T[]} firstArr - The first array to compare.
10
11
  * @param {T[]} secondArr - The second array to compare.
11
12
  * @param {(x: T, y: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
@@ -6,6 +6,7 @@
6
6
  * by the custom equality function. It effectively filters out any elements from the first array that
7
7
  * do not have corresponding matches in the second array according to the equality function.
8
8
  *
9
+ * @template T - The type of elements in the array.
9
10
  * @param {T[]} firstArr - The first array to compare.
10
11
  * @param {T[]} secondArr - The second array to compare.
11
12
  * @param {(x: T, y: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.
@@ -1 +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 * @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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBO,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":[]}
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  intersectionWith
3
- } from "../chunk-2EFS3VA3.mjs";
3
+ } from "../chunk-XI7KRD2C.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  intersectionWith
@@ -6,6 +6,8 @@
6
6
  * If there are multiple elements generating the same key, the last element among them is used
7
7
  * as the value.
8
8
  *
9
+ * @template T - The type of elements in the array.
10
+ * @template K - The type of keys.
9
11
  * @param {T[]} arr - The array of elements to be mapped.
10
12
  * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.
11
13
  * @returns {Record<K, T>} An object where keys are mapped to each element of an array.
@@ -6,6 +6,8 @@
6
6
  * If there are multiple elements generating the same key, the last element among them is used
7
7
  * as the value.
8
8
  *
9
+ * @template T - The type of elements in the array.
10
+ * @template K - The type of keys.
9
11
  * @param {T[]} arr - The array of elements to be mapped.
10
12
  * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.
11
13
  * @returns {Record<K, T>} An object where keys are mapped to each element of an array.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/keyBy.ts"],"sourcesContent":["/**\n * Maps each element of an array based on a provided key-generating function.\n *\n * This function takes an array and a function that generates a key from each element. It returns\n * an object where the keys are the generated keys and the values are the corresponding elements.\n * If there are multiple elements generating the same key, the last element among them is used\n * as the value.\n *\n * @param {T[]} arr - The array of elements to be mapped.\n * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.\n * @returns {Record<K, T>} An object where keys are mapped to each element of an array.\n *\n * @example\n * const array = [\n * { category: 'fruit', name: 'apple' },\n * { category: 'fruit', name: 'banana' },\n * { category: 'vegetable', name: 'carrot' }\n * ];\n * const result = keyBy(array, item => item.category);\n * // result will be:\n * // {\n * // fruit: { category: 'fruit', name: 'banana' },\n * // vegetable: { category: 'vegetable', name: 'carrot' }\n * // }\n */\nexport function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T> {\n const result = {} as Record<K, T>;\n\n for (const item of arr) {\n const key = getKeyFromItem(item);\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBO,SAAS,MAAgC,KAAmB,gBAA8C;AAC/G,QAAM,SAAS,CAAC;AAEhB,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,eAAe,IAAI;AAC/B,WAAO,GAAG,IAAI;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/array/keyBy.ts"],"sourcesContent":["/**\n * Maps each element of an array based on a provided key-generating function.\n *\n * This function takes an array and a function that generates a key from each element. It returns\n * an object where the keys are the generated keys and the values are the corresponding elements.\n * If there are multiple elements generating the same key, the last element among them is used\n * as the value.\n *\n * @template T - The type of elements in the array.\n * @template K - The type of keys.\n * @param {T[]} arr - The array of elements to be mapped.\n * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.\n * @returns {Record<K, T>} An object where keys are mapped to each element of an array.\n *\n * @example\n * const array = [\n * { category: 'fruit', name: 'apple' },\n * { category: 'fruit', name: 'banana' },\n * { category: 'vegetable', name: 'carrot' }\n * ];\n * const result = keyBy(array, item => item.category);\n * // result will be:\n * // {\n * // fruit: { category: 'fruit', name: 'banana' },\n * // vegetable: { category: 'vegetable', name: 'carrot' }\n * // }\n */\nexport function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T> {\n const result = {} as Record<K, T>;\n\n for (const item of arr) {\n const key = getKeyFromItem(item);\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BO,SAAS,MAAgC,KAAmB,gBAA8C;AAC/G,QAAM,SAAS,CAAC;AAEhB,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,eAAe,IAAI;AAC/B,WAAO,GAAG,IAAI;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  keyBy
3
- } from "../chunk-KSXWREB5.mjs";
3
+ } from "../chunk-AJKZMN2V.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  keyBy
@@ -2,6 +2,7 @@
2
2
  * Finds the element in an array that has the maximum value when applying
3
3
  * the `getValue` function to each element.
4
4
  *
5
+ * @template T - The type of elements in the array.
5
6
  * @param {T[]} items The array of elements to search.
6
7
  * @param {(element: T) => number} getValue A function that selects a numeric value from each element.
7
8
  * @returns {T} The element with the maximum value as determined by the `getValue` function.
@@ -2,6 +2,7 @@
2
2
  * Finds the element in an array that has the maximum value when applying
3
3
  * the `getValue` function to each element.
4
4
  *
5
+ * @template T - The type of elements in the array.
5
6
  * @param {T[]} items The array of elements to search.
6
7
  * @param {(element: T) => number} getValue A function that selects a numeric value from each element.
7
8
  * @returns {T} The element with the maximum value as determined by the `getValue` function.
@@ -1 +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 * @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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,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":[]}
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  maxBy
3
- } from "../chunk-FXOABQRO.mjs";
3
+ } from "../chunk-OOKNBU4V.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  maxBy
@@ -2,6 +2,7 @@
2
2
  * Finds the element in an array that has the minimum value when applying
3
3
  * the `getValue` function to each element.
4
4
  *
5
+ * @template T - The type of elements in the array.
5
6
  * @param {T[]} items The array of elements to search.
6
7
  * @param {(element: T) => number} getValue A function that selects a numeric value from each element.
7
8
  * @returns {T} The element with the minimum value as determined by the `getValue` function.
@@ -2,6 +2,7 @@
2
2
  * Finds the element in an array that has the minimum value when applying
3
3
  * the `getValue` function to each element.
4
4
  *
5
+ * @template T - The type of elements in the array.
5
6
  * @param {T[]} items The array of elements to search.
6
7
  * @param {(element: T) => number} getValue A function that selects a numeric value from each element.
7
8
  * @returns {T} The element with the minimum value as determined by the `getValue` function.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/minBy.ts"],"sourcesContent":["/**\n * Finds the element in an array that has the minimum value when applying\n * the `getValue` function to each element.\n *\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 minimum value as determined by the `getValue` function.\n * @example\n * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }\n * minBy([], x => x.a); // Returns: undefined\n */\nexport function minBy<T>(items: T[], getValue: (element: T) => number): T {\n let minElement = items[0];\n let min = Infinity;\n\n for (const element of items) {\n const value = getValue(element);\n if (value < min) {\n min = value;\n minElement = element;\n }\n }\n\n return minElement;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,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":[]}
1
+ {"version":3,"sources":["../../src/array/minBy.ts"],"sourcesContent":["/**\n * Finds the element in an array that has the minimum 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 minimum value as determined by the `getValue` function.\n * @example\n * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 }\n * minBy([], x => x.a); // Returns: undefined\n */\nexport function minBy<T>(items: T[], getValue: (element: T) => number): T {\n let minElement = items[0];\n let min = Infinity;\n\n for (const element of items) {\n const value = getValue(element);\n if (value < min) {\n min = value;\n minElement = element;\n }\n }\n\n return minElement;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  minBy
3
- } from "../chunk-OIHARMNM.mjs";
3
+ } from "../chunk-IJD7FE2Z.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  minBy
@@ -5,6 +5,7 @@
5
5
  * the first array contains elements for which the predicate function returns true, and
6
6
  * the second array contains elements for which the predicate function returns false.
7
7
  *
8
+ * @template T - The type of elements in the array.
8
9
  * @param {T[]} arr - The array to partition.
9
10
  * @param {(value: T) => boolean} isInTruthy - A predicate function that determines
10
11
  * whether an element should be placed in the truthy array. The function is called with each
@@ -5,6 +5,7 @@
5
5
  * the first array contains elements for which the predicate function returns true, and
6
6
  * the second array contains elements for which the predicate function returns false.
7
7
  *
8
+ * @template T - The type of elements in the array.
8
9
  * @param {T[]} arr - The array to partition.
9
10
  * @param {(value: T) => boolean} isInTruthy - A predicate function that determines
10
11
  * whether an element should be placed in the truthy array. The function is called with each
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into two groups based on a predicate function.\n *\n * This function takes an array and a predicate function. It returns a tuple of two arrays:\n * the first array contains elements for which the predicate function returns true, and\n * the second array contains elements for which the predicate function returns false.\n *\n * @param {T[]} arr - The array to partition.\n * @param {(value: T) => boolean} isInTruthy - A predicate function that determines\n * whether an element should be placed in the truthy array. The function is called with each\n * element of the array.\n * @returns {[T[], T[]]} A tuple containing two arrays: the first array contains elements for\n * which the predicate returned true, and the second array contains elements for which the\n * predicate returned false.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const isEven = x => x % 2 === 0;\n * const [even, odd] = partition(array, isEven);\n * // even will be [2, 4], and odd will be [1, 3, 5]\n */\nexport function partition<T>(arr: readonly T[], isInTruthy: (value: T) => boolean): [truthy: T[], falsy: T[]] {\n const truthy: T[] = [];\n const falsy: T[] = [];\n\n for (const item of arr) {\n if (isInTruthy(item)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n }\n\n return [truthy, falsy];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBO,SAAS,UAAa,KAAmB,YAA8D;AAC5G,QAAM,SAAc,CAAC;AACrB,QAAM,QAAa,CAAC;AAEpB,aAAW,QAAQ,KAAK;AACtB,QAAI,WAAW,IAAI,GAAG;AACpB,aAAO,KAAK,IAAI;AAAA,IAClB,OAAO;AACL,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AAEA,SAAO,CAAC,QAAQ,KAAK;AACvB;","names":[]}
1
+ {"version":3,"sources":["../../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into two groups based on a predicate function.\n *\n * This function takes an array and a predicate function. It returns a tuple of two arrays:\n * the first array contains elements for which the predicate function returns true, and\n * the second array contains elements for which the predicate function returns false.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to partition.\n * @param {(value: T) => boolean} isInTruthy - A predicate function that determines\n * whether an element should be placed in the truthy array. The function is called with each\n * element of the array.\n * @returns {[T[], T[]]} A tuple containing two arrays: the first array contains elements for\n * which the predicate returned true, and the second array contains elements for which the\n * predicate returned false.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const isEven = x => x % 2 === 0;\n * const [even, odd] = partition(array, isEven);\n * // even will be [2, 4], and odd will be [1, 3, 5]\n */\nexport function partition<T>(arr: readonly T[], isInTruthy: (value: T) => boolean): [truthy: T[], falsy: T[]] {\n const truthy: T[] = [];\n const falsy: T[] = [];\n\n for (const item of arr) {\n if (isInTruthy(item)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n }\n\n return [truthy, falsy];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBO,SAAS,UAAa,KAAmB,YAA8D;AAC5G,QAAM,SAAc,CAAC;AACrB,QAAM,QAAa,CAAC;AAEpB,aAAW,QAAQ,KAAK;AACtB,QAAI,WAAW,IAAI,GAAG;AACpB,aAAO,KAAK,IAAI;AAAA,IAClB,OAAO;AACL,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AAEA,SAAO,CAAC,QAAQ,KAAK;AACvB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  partition
3
- } from "../chunk-5L2V7WD3.mjs";
3
+ } from "../chunk-DN3NOZ3H.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  partition
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * This function takes an array and returns a single element selected randomly from the array.
5
5
  *
6
+ * @template T - The type of elements in the array.
6
7
  * @param {T[]} arr - The array to sample from.
7
8
  * @returns {T} A random element from the array.
8
9
  *
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * This function takes an array and returns a single element selected randomly from the array.
5
5
  *
6
+ * @template T - The type of elements in the array.
6
7
  * @param {T[]} arr - The array to sample from.
7
8
  * @returns {T} A random element from the array.
8
9
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/sample.ts"],"sourcesContent":["/**\n * Returns a random element from an array.\n *\n * This function takes an array and returns a single element selected randomly from the array.\n *\n * @param {T[]} arr - The array to sample from.\n * @returns {T} A random element from the array.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const randomElement = sample(array);\n * // randomElement will be one of the elements from the array, selected randomly.\n */\nexport function sample<T>(arr: readonly T[]): T {\n const randomIndex = Math.floor(Math.random() * arr.length);\n return arr[randomIndex];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,OAAU,KAAsB;AAC9C,QAAM,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,MAAM;AACzD,SAAO,IAAI,WAAW;AACxB;","names":[]}
1
+ {"version":3,"sources":["../../src/array/sample.ts"],"sourcesContent":["/**\n * Returns a random element from an array.\n *\n * This function takes an array and returns a single element selected randomly from the array.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to sample from.\n * @returns {T} A random element from the array.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const randomElement = sample(array);\n * // randomElement will be one of the elements from the array, selected randomly.\n */\nexport function sample<T>(arr: readonly T[]): T {\n const randomIndex = Math.floor(Math.random() * arr.length);\n return arr[randomIndex];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,SAAS,OAAU,KAAsB;AAC9C,QAAM,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,MAAM;AACzD,SAAO,IAAI,WAAW;AACxB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sample
3
- } from "../chunk-DOOIIHT3.mjs";
3
+ } from "../chunk-2KNLZB7V.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  sample
@@ -5,6 +5,7 @@
5
5
  *
6
6
  * {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algoritm}
7
7
  *
8
+ * @template T - The type of elements in the array.
8
9
  * @param {T[]} array - The array to sample from.
9
10
  * @param {number} size - The size of sample.
10
11
  * @returns {T[]} A new array with sample size applied.
@@ -5,6 +5,7 @@
5
5
  *
6
6
  * {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algoritm}
7
7
  *
8
+ * @template T - The type of elements in the array.
8
9
  * @param {T[]} array - The array to sample from.
9
10
  * @param {number} size - The size of sample.
10
11
  * @returns {T[]} A new array with sample size applied.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/sampleSize.ts","../../src/math/random.ts","../../src/math/randomInt.ts"],"sourcesContent":["import { randomInt } from '../math';\n\n/**\n * Returns a sample element array of a specified `size`.\n *\n * This function takes an array and a number, and returns an array containing the sampled elements using Floyd's algorithm.\n *\n * {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algoritm}\n *\n * @param {T[]} array - The array to sample from.\n * @param {number} size - The size of sample.\n * @returns {T[]} A new array with sample size applied.\n * @throws {Error} Throws an error if `size` is greater than the length of `array`.\n *\n * @example\n * const result = sampleSize([1, 2, 3], 2)\n * // result will be an array containing two of the elements from the array.\n * // [1, 2] or [1, 3] or [2, 3]\n */\nexport function sampleSize<T>(array: readonly T[], size: number): T[] {\n if (size > array.length) {\n throw new Error('Size must be less than or equal to the length of array.');\n }\n\n const result = new Array(size);\n const selected = new Set();\n\n for (let step = array.length - size, resultIndex = 0; step < array.length; step++, resultIndex++) {\n let index = randomInt(0, step + 1);\n\n if (selected.has(index)) {\n index = step;\n }\n\n selected.add(index);\n\n result[resultIndex] = array[index];\n }\n\n return result;\n}\n","/**\n * Generate a random number within the given range.\n *\n * If only one argument is provided, a number between `0` and the given number is returned.\n *\n * @param {number} minimum - The lower bound (inclusive).\n * @param {number} maximum - The upper bound (exclusive).\n * @returns {number} A random number between minimum (inclusive) and maximum (exclusive). The number can be an integer or a decimal.\n * @throws {Error} Throws an error if `maximum` is not greater than `minimum`.\n *\n * @example\n * const result1 = random(0, 5); // Returns a random number between 0 and 5.\n * const result2 = random(5, 0); // If the minimum is greater than the maximum, an error is thrown\n * const result3 = random(5, 5); // If the minimum is equal to the maximum, an error is thrown.\n */\nexport function random(maximum: number): number;\nexport function random(minimum: number, maximum: number): number;\nexport function random(minimum: number, maximum?: number): number {\n if (maximum == null) {\n maximum = minimum;\n minimum = 0;\n }\n\n if (minimum >= maximum) {\n throw new Error('Invalid input: The maximum value must be greater than the minimum value.');\n }\n\n return Math.random() * (maximum - minimum) + minimum;\n}\n","import { random } from './random.ts';\n\n/**\n * Generates a random integer between minimum (inclusive) and maximum (exclusive).\n *\n * If only one argument is provided, a number between `0` and the given number is returned.\n *\n * @param {number} minimum - The lower bound (inclusive).\n * @param {number} maximum - The upper bound (exclusive).\n * @returns {number} A random integer between minimum (inclusive) and maximum (exclusive).\n * @throws {Error} Throws an error if `maximum` is not greater than `minimum`.\n *\n * @example\n * const result = randomInt(0, 5); // result will be a random integer between 0 (inclusive) and 5 (exclusive)\n * const result2 = randomInt(5, 0); // This will throw an error\n */\nexport function randomInt(maximum: number): number;\nexport function randomInt(minimum: number, maximum: number): number;\nexport function randomInt(minimum: number, maximum?: number): number {\n return Math.floor(random(minimum, maximum!));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,OAAO,SAAiB,SAA0B;AAChE,MAAI,WAAW,MAAM;AACnB,cAAU;AACV,cAAU;AAAA,EACZ;AAEA,MAAI,WAAW,SAAS;AACtB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AAEA,SAAO,KAAK,OAAO,KAAK,UAAU,WAAW;AAC/C;;;ACVO,SAAS,UAAU,SAAiB,SAA0B;AACnE,SAAO,KAAK,MAAM,OAAO,SAAS,OAAQ,CAAC;AAC7C;;;AFDO,SAAS,WAAc,OAAqB,MAAmB;AACpE,MAAI,OAAO,MAAM,QAAQ;AACvB,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AAEA,QAAM,SAAS,IAAI,MAAM,IAAI;AAC7B,QAAM,WAAW,oBAAI,IAAI;AAEzB,WAAS,OAAO,MAAM,SAAS,MAAM,cAAc,GAAG,OAAO,MAAM,QAAQ,QAAQ,eAAe;AAChG,QAAI,QAAQ,UAAU,GAAG,OAAO,CAAC;AAEjC,QAAI,SAAS,IAAI,KAAK,GAAG;AACvB,cAAQ;AAAA,IACV;AAEA,aAAS,IAAI,KAAK;AAElB,WAAO,WAAW,IAAI,MAAM,KAAK;AAAA,EACnC;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/array/sampleSize.ts","../../src/math/random.ts","../../src/math/randomInt.ts"],"sourcesContent":["import { randomInt } from '../math';\n\n/**\n * Returns a sample element array of a specified `size`.\n *\n * This function takes an array and a number, and returns an array containing the sampled elements using Floyd's algorithm.\n *\n * {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algoritm}\n *\n * @template T - The type of elements in the array.\n * @param {T[]} array - The array to sample from.\n * @param {number} size - The size of sample.\n * @returns {T[]} A new array with sample size applied.\n * @throws {Error} Throws an error if `size` is greater than the length of `array`.\n *\n * @example\n * const result = sampleSize([1, 2, 3], 2)\n * // result will be an array containing two of the elements from the array.\n * // [1, 2] or [1, 3] or [2, 3]\n */\nexport function sampleSize<T>(array: readonly T[], size: number): T[] {\n if (size > array.length) {\n throw new Error('Size must be less than or equal to the length of array.');\n }\n\n const result = new Array(size);\n const selected = new Set();\n\n for (let step = array.length - size, resultIndex = 0; step < array.length; step++, resultIndex++) {\n let index = randomInt(0, step + 1);\n\n if (selected.has(index)) {\n index = step;\n }\n\n selected.add(index);\n\n result[resultIndex] = array[index];\n }\n\n return result;\n}\n","/**\n * Generate a random number within the given range.\n *\n * If only one argument is provided, a number between `0` and the given number is returned.\n *\n * @param {number} minimum - The lower bound (inclusive).\n * @param {number} maximum - The upper bound (exclusive).\n * @returns {number} A random number between minimum (inclusive) and maximum (exclusive). The number can be an integer or a decimal.\n * @throws {Error} Throws an error if `maximum` is not greater than `minimum`.\n *\n * @example\n * const result1 = random(0, 5); // Returns a random number between 0 and 5.\n * const result2 = random(5, 0); // If the minimum is greater than the maximum, an error is thrown\n * const result3 = random(5, 5); // If the minimum is equal to the maximum, an error is thrown.\n */\nexport function random(maximum: number): number;\nexport function random(minimum: number, maximum: number): number;\nexport function random(minimum: number, maximum?: number): number {\n if (maximum == null) {\n maximum = minimum;\n minimum = 0;\n }\n\n if (minimum >= maximum) {\n throw new Error('Invalid input: The maximum value must be greater than the minimum value.');\n }\n\n return Math.random() * (maximum - minimum) + minimum;\n}\n","import { random } from './random.ts';\n\n/**\n * Generates a random integer between minimum (inclusive) and maximum (exclusive).\n *\n * If only one argument is provided, a number between `0` and the given number is returned.\n *\n * @param {number} minimum - The lower bound (inclusive).\n * @param {number} maximum - The upper bound (exclusive).\n * @returns {number} A random integer between minimum (inclusive) and maximum (exclusive).\n * @throws {Error} Throws an error if `maximum` is not greater than `minimum`.\n *\n * @example\n * const result = randomInt(0, 5); // result will be a random integer between 0 (inclusive) and 5 (exclusive)\n * const result2 = randomInt(5, 0); // This will throw an error\n */\nexport function randomInt(maximum: number): number;\nexport function randomInt(minimum: number, maximum: number): number;\nexport function randomInt(minimum: number, maximum?: number): number {\n return Math.floor(random(minimum, maximum!));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,OAAO,SAAiB,SAA0B;AAChE,MAAI,WAAW,MAAM;AACnB,cAAU;AACV,cAAU;AAAA,EACZ;AAEA,MAAI,WAAW,SAAS;AACtB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AAEA,SAAO,KAAK,OAAO,KAAK,UAAU,WAAW;AAC/C;;;ACVO,SAAS,UAAU,SAAiB,SAA0B;AACnE,SAAO,KAAK,MAAM,OAAO,SAAS,OAAQ,CAAC;AAC7C;;;AFAO,SAAS,WAAc,OAAqB,MAAmB;AACpE,MAAI,OAAO,MAAM,QAAQ;AACvB,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AAEA,QAAM,SAAS,IAAI,MAAM,IAAI;AAC7B,QAAM,WAAW,oBAAI,IAAI;AAEzB,WAAS,OAAO,MAAM,SAAS,MAAM,cAAc,GAAG,OAAO,MAAM,QAAQ,QAAQ,eAAe;AAChG,QAAI,QAAQ,UAAU,GAAG,OAAO,CAAC;AAEjC,QAAI,SAAS,IAAI,KAAK,GAAG;AACvB,cAAQ;AAAA,IACV;AAEA,aAAS,IAAI,KAAK;AAElB,WAAO,WAAW,IAAI,MAAM,KAAK;AAAA,EACnC;AAEA,SAAO;AACT;","names":[]}
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  sampleSize
3
- } from "../chunk-4MRXVNGG.mjs";
3
+ } from "../chunk-LUIKU43M.mjs";
4
4
  import "../chunk-TZE6EDCX.mjs";
5
- import "../chunk-JGNFYNYU.mjs";
5
+ import "../chunk-CXGIXTSH.mjs";
6
6
  import "../chunk-GIWAOOFY.mjs";
7
7
  import "../chunk-SYWMYQYJ.mjs";
8
8
  import "../chunk-UNLX2F2Y.mjs";
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * This function takes an array and returns a new array with its elements shuffled in a random order.
5
5
  *
6
+ * @template T - The type of elements in the array.
6
7
  * @param {T[]} arr - The array to shuffle.
7
8
  * @returns {T[]} A new array with its elements shuffled in random order.
8
9
  *
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * This function takes an array and returns a new array with its elements shuffled in a random order.
5
5
  *
6
+ * @template T - The type of elements in the array.
6
7
  * @param {T[]} arr - The array to shuffle.
7
8
  * @returns {T[]} A new array with its elements shuffled in random order.
8
9
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/shuffle.ts"],"sourcesContent":["/**\n * Randomizes the order of elements in an array using the Fisher-Yates algorithm.\n *\n * This function takes an array and returns a new array with its elements shuffled in a random order.\n *\n * @param {T[]} arr - The array to shuffle.\n * @returns {T[]} A new array with its elements shuffled in random order.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const shuffledArray = shuffle(array);\n * // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2]\n */\nexport function shuffle<T>(arr: readonly T[]): T[] {\n const result = arr.slice();\n\n /**\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n for (let i = result.length - 1; i >= 1; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,QAAW,KAAwB;AACjD,QAAM,SAAS,IAAI,MAAM;AAKzB,WAAS,IAAI,OAAO,SAAS,GAAG,KAAK,GAAG,KAAK;AAC3C,UAAM,IAAI,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,EAAE;AAC5C,KAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AAAA,EAChD;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/array/shuffle.ts"],"sourcesContent":["/**\n * Randomizes the order of elements in an array using the Fisher-Yates algorithm.\n *\n * This function takes an array and returns a new array with its elements shuffled in a random order.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to shuffle.\n * @returns {T[]} A new array with its elements shuffled in random order.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const shuffledArray = shuffle(array);\n * // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2]\n */\nexport function shuffle<T>(arr: readonly T[]): T[] {\n const result = arr.slice();\n\n /**\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n for (let i = result.length - 1; i >= 1; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,SAAS,QAAW,KAAwB;AACjD,QAAM,SAAS,IAAI,MAAM;AAKzB,WAAS,IAAI,OAAO,SAAS,GAAG,KAAK,GAAG,KAAK;AAC3C,UAAM,IAAI,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,EAAE;AAC5C,KAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AAAA,EAChD;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shuffle
3
- } from "../chunk-DPLJQQFX.mjs";
3
+ } from "../chunk-G7UQ5PUR.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  shuffle
@@ -2,6 +2,7 @@
2
2
  * Returns a new array containing the last `count` elements from the input array `arr`.
3
3
  * If `count` is greater than the length of `arr`, the entire array is returned.
4
4
  *
5
+ * @template T - The type of elements in the array.
5
6
  * @param {T[]} arr - The array to take elements from.
6
7
  * @param {number} count - The number of elements to take.
7
8
  * @returns {T[]} A new array containing the last `count` elements from `arr`.
@@ -2,6 +2,7 @@
2
2
  * Returns a new array containing the last `count` elements from the input array `arr`.
3
3
  * If `count` is greater than the length of `arr`, the entire array is returned.
4
4
  *
5
+ * @template T - The type of elements in the array.
5
6
  * @param {T[]} arr - The array to take elements from.
6
7
  * @param {number} count - The number of elements to take.
7
8
  * @returns {T[]} A new array containing the last `count` elements from `arr`.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/takeRight.ts"],"sourcesContent":["/**\n * Returns a new array containing the last `count` elements from the input array `arr`.\n * If `count` is greater than the length of `arr`, the entire array is returned.\n *\n * @param {T[]} arr - The array to take elements from.\n * @param {number} count - The number of elements to take.\n * @returns {T[]} A new array containing the last `count` elements from `arr`.\n *\n * @example\n * // Returns [4, 5]\n * takeRight([1, 2, 3, 4, 5], 2);\n *\n * @example\n * // Returns ['b', 'c']\n * takeRight(['a', 'b', 'c'], 2);\n *\n * @example\n * // Returns [1, 2, 3]\n * takeRight([1, 2, 3], 5);\n */\nexport function takeRight<T>(arr: readonly T[], count: number): T[] {\n if (count === 0) {\n return [];\n }\n\n return arr.slice(-count);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,UAAa,KAAmB,OAAoB;AAClE,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,CAAC,KAAK;AACzB;","names":[]}
1
+ {"version":3,"sources":["../../src/array/takeRight.ts"],"sourcesContent":["/**\n * Returns a new array containing the last `count` elements from the input array `arr`.\n * If `count` is greater than the length of `arr`, the entire array is returned.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to take elements from.\n * @param {number} count - The number of elements to take.\n * @returns {T[]} A new array containing the last `count` elements from `arr`.\n *\n * @example\n * // Returns [4, 5]\n * takeRight([1, 2, 3, 4, 5], 2);\n *\n * @example\n * // Returns ['b', 'c']\n * takeRight(['a', 'b', 'c'], 2);\n *\n * @example\n * // Returns [1, 2, 3]\n * takeRight([1, 2, 3], 5);\n */\nexport function takeRight<T>(arr: readonly T[], count: number): T[] {\n if (count === 0) {\n return [];\n }\n\n return arr.slice(-count);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBO,SAAS,UAAa,KAAmB,OAAoB;AAClE,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,CAAC,KAAK;AACzB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  takeRight
3
- } from "../chunk-XDKEPIUV.mjs";
3
+ } from "../chunk-IQLKIDXF.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  takeRight
@@ -4,6 +4,7 @@
4
4
  * This function takes two arrays, merges them into a single array, and returns a new array
5
5
  * containing only the unique values from the merged array.
6
6
  *
7
+ * @template T - The type of elements in the array.
7
8
  * @param {T[]} arr1 - The first array to merge and filter for unique values.
8
9
  * @param {T[]} arr2 - The second array to merge and filter for unique values.
9
10
  * @returns {T[]} A new array of unique values.
@@ -4,6 +4,7 @@
4
4
  * This function takes two arrays, merges them into a single array, and returns a new array
5
5
  * containing only the unique values from the merged array.
6
6
  *
7
+ * @template T - The type of elements in the array.
7
8
  * @param {T[]} arr1 - The first array to merge and filter for unique values.
8
9
  * @param {T[]} arr2 - The second array to merge and filter for unique values.
9
10
  * @returns {T[]} A new array of unique values.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/array/union.ts","../../src/array/uniq.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 * @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","/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n return Array.from(new Set(arr));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,SAAS,KAAQ,KAAwB;AAC9C,SAAO,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC;AAChC;;;ADEO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/array/union.ts","../../src/array/uniq.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","/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n return Array.from(new Set(arr));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAAQ,KAAwB;AAC9C,SAAO,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC;AAChC;;;ADEO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  union
3
- } from "../chunk-UPJXHWSJ.mjs";
4
- import "../chunk-XFCW7XJ4.mjs";
3
+ } from "../chunk-R6QA7PLZ.mjs";
4
+ import "../chunk-DVK2N4KC.mjs";
5
5
  import "../chunk-2MM5EJJX.mjs";
6
6
  export {
7
7
  union