es-toolkit 1.6.1-dev.137 → 1.6.1-dev.139

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 (291) 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/fill.d.mts +29 -0
  22. package/dist/array/fill.d.ts +29 -0
  23. package/dist/array/fill.js +38 -0
  24. package/dist/array/fill.js.map +1 -0
  25. package/dist/array/fill.mjs +8 -0
  26. package/dist/array/groupBy.d.mts +2 -0
  27. package/dist/array/groupBy.d.ts +2 -0
  28. package/dist/array/groupBy.js.map +1 -1
  29. package/dist/array/groupBy.mjs +1 -1
  30. package/dist/array/index.d.mts +1 -0
  31. package/dist/array/index.d.ts +1 -0
  32. package/dist/array/index.js +12 -0
  33. package/dist/array/index.js.map +1 -1
  34. package/dist/array/index.mjs +71 -67
  35. package/dist/array/intersection.d.mts +1 -0
  36. package/dist/array/intersection.d.ts +1 -0
  37. package/dist/array/intersection.js.map +1 -1
  38. package/dist/array/intersection.mjs +1 -1
  39. package/dist/array/intersectionBy.d.mts +2 -0
  40. package/dist/array/intersectionBy.d.ts +2 -0
  41. package/dist/array/intersectionBy.js.map +1 -1
  42. package/dist/array/intersectionBy.mjs +1 -1
  43. package/dist/array/intersectionWith.d.mts +1 -0
  44. package/dist/array/intersectionWith.d.ts +1 -0
  45. package/dist/array/intersectionWith.js.map +1 -1
  46. package/dist/array/intersectionWith.mjs +1 -1
  47. package/dist/array/keyBy.d.mts +2 -0
  48. package/dist/array/keyBy.d.ts +2 -0
  49. package/dist/array/keyBy.js.map +1 -1
  50. package/dist/array/keyBy.mjs +1 -1
  51. package/dist/array/maxBy.d.mts +1 -0
  52. package/dist/array/maxBy.d.ts +1 -0
  53. package/dist/array/maxBy.js.map +1 -1
  54. package/dist/array/maxBy.mjs +1 -1
  55. package/dist/array/minBy.d.mts +1 -0
  56. package/dist/array/minBy.d.ts +1 -0
  57. package/dist/array/minBy.js.map +1 -1
  58. package/dist/array/minBy.mjs +1 -1
  59. package/dist/array/partition.d.mts +1 -0
  60. package/dist/array/partition.d.ts +1 -0
  61. package/dist/array/partition.js.map +1 -1
  62. package/dist/array/partition.mjs +1 -1
  63. package/dist/array/sample.d.mts +1 -0
  64. package/dist/array/sample.d.ts +1 -0
  65. package/dist/array/sample.js.map +1 -1
  66. package/dist/array/sample.mjs +1 -1
  67. package/dist/array/sampleSize.d.mts +1 -0
  68. package/dist/array/sampleSize.d.ts +1 -0
  69. package/dist/array/sampleSize.js.map +1 -1
  70. package/dist/array/sampleSize.mjs +3 -3
  71. package/dist/array/shuffle.d.mts +1 -0
  72. package/dist/array/shuffle.d.ts +1 -0
  73. package/dist/array/shuffle.js.map +1 -1
  74. package/dist/array/shuffle.mjs +1 -1
  75. package/dist/array/takeRight.d.mts +1 -0
  76. package/dist/array/takeRight.d.ts +1 -0
  77. package/dist/array/takeRight.js.map +1 -1
  78. package/dist/array/takeRight.mjs +1 -1
  79. package/dist/array/union.d.mts +1 -0
  80. package/dist/array/union.d.ts +1 -0
  81. package/dist/array/union.js.map +1 -1
  82. package/dist/array/union.mjs +2 -2
  83. package/dist/array/unionBy.d.mts +2 -0
  84. package/dist/array/unionBy.d.ts +2 -0
  85. package/dist/array/unionBy.js.map +1 -1
  86. package/dist/array/unionBy.mjs +1 -1
  87. package/dist/array/unionWith.d.mts +1 -0
  88. package/dist/array/unionWith.d.ts +1 -0
  89. package/dist/array/unionWith.js.map +1 -1
  90. package/dist/array/unionWith.mjs +2 -2
  91. package/dist/array/uniq.d.mts +1 -0
  92. package/dist/array/uniq.d.ts +1 -0
  93. package/dist/array/uniq.js.map +1 -1
  94. package/dist/array/uniq.mjs +1 -1
  95. package/dist/array/uniqBy.d.mts +2 -0
  96. package/dist/array/uniqBy.d.ts +2 -0
  97. package/dist/array/uniqBy.js.map +1 -1
  98. package/dist/array/uniqBy.mjs +1 -1
  99. package/dist/array/uniqWith.d.mts +1 -0
  100. package/dist/array/uniqWith.d.ts +1 -0
  101. package/dist/array/uniqWith.js.map +1 -1
  102. package/dist/array/uniqWith.mjs +1 -1
  103. package/dist/array/xor.d.mts +1 -0
  104. package/dist/array/xor.d.ts +1 -0
  105. package/dist/array/xor.js.map +1 -1
  106. package/dist/array/xor.mjs +4 -4
  107. package/dist/array/xorBy.js.map +1 -1
  108. package/dist/array/xorBy.mjs +3 -3
  109. package/dist/array/xorWith.js.map +1 -1
  110. package/dist/array/xorWith.mjs +4 -4
  111. package/dist/array/zipObject.d.mts +2 -0
  112. package/dist/array/zipObject.d.ts +2 -0
  113. package/dist/array/zipObject.js.map +1 -1
  114. package/dist/array/zipObject.mjs +1 -1
  115. package/dist/{chunk-2PFDLYQC.mjs → chunk-237HGSZS.mjs} +1 -1
  116. package/dist/chunk-237HGSZS.mjs.map +1 -0
  117. package/dist/chunk-23O4IK6D.mjs +1 -0
  118. package/dist/chunk-23O4IK6D.mjs.map +1 -0
  119. package/dist/{chunk-DOOIIHT3.mjs → chunk-2KNLZB7V.mjs} +1 -1
  120. package/dist/chunk-2KNLZB7V.mjs.map +1 -0
  121. package/dist/{chunk-OUTSP4VR.mjs → chunk-2ZCITDMK.mjs} +2 -2
  122. package/dist/chunk-2ZCITDMK.mjs.map +1 -0
  123. package/dist/{chunk-G42NUGNE.mjs → chunk-3IP4JVLL.mjs} +1 -1
  124. package/dist/chunk-3IP4JVLL.mjs.map +1 -0
  125. package/dist/{chunk-MQWVBKUT.mjs → chunk-6CLH5YZ2.mjs} +1 -1
  126. package/dist/chunk-6CLH5YZ2.mjs.map +1 -0
  127. package/dist/{chunk-DA7GSKQ5.mjs → chunk-6GWEY5EL.mjs} +1 -1
  128. package/dist/chunk-6GWEY5EL.mjs.map +1 -0
  129. package/dist/{chunk-KSXWREB5.mjs → chunk-AJKZMN2V.mjs} +1 -1
  130. package/dist/chunk-AJKZMN2V.mjs.map +1 -0
  131. package/dist/{chunk-A67NF2C7.mjs → chunk-BCTYOXT7.mjs} +1 -1
  132. package/dist/chunk-BCTYOXT7.mjs.map +1 -0
  133. package/dist/{chunk-ZQNAZPSK.mjs → chunk-BMRTZMRE.mjs} +1 -1
  134. package/dist/chunk-BMRTZMRE.mjs.map +1 -0
  135. package/dist/chunk-C4WE4GLC.mjs +14 -0
  136. package/dist/chunk-C4WE4GLC.mjs.map +1 -0
  137. package/dist/{chunk-UFAA5WKR.mjs → chunk-CMBC4MXG.mjs} +1 -1
  138. package/dist/chunk-CMBC4MXG.mjs.map +1 -0
  139. package/dist/{chunk-JGNFYNYU.mjs → chunk-CXGIXTSH.mjs} +1 -1
  140. package/dist/chunk-CXGIXTSH.mjs.map +1 -0
  141. package/dist/{chunk-5L2V7WD3.mjs → chunk-DN3NOZ3H.mjs} +1 -1
  142. package/dist/chunk-DN3NOZ3H.mjs.map +1 -0
  143. package/dist/{chunk-NKTBEEIT.mjs → chunk-DTJJIMKJ.mjs} +1 -1
  144. package/dist/chunk-DTJJIMKJ.mjs.map +1 -0
  145. package/dist/{chunk-XFCW7XJ4.mjs → chunk-DVK2N4KC.mjs} +1 -1
  146. package/dist/chunk-DVK2N4KC.mjs.map +1 -0
  147. package/dist/{chunk-Q5XXJXXQ.mjs → chunk-DXB7EZUQ.mjs} +1 -1
  148. package/dist/chunk-DXB7EZUQ.mjs.map +1 -0
  149. package/dist/{chunk-H5YR3ZV4.mjs → chunk-E6E4RZLN.mjs} +1 -1
  150. package/dist/chunk-E6E4RZLN.mjs.map +1 -0
  151. package/dist/{chunk-PYLGHB3F.mjs → chunk-FVVSE2F2.mjs} +1 -1
  152. package/dist/chunk-FVVSE2F2.mjs.map +1 -0
  153. package/dist/{chunk-DPLJQQFX.mjs → chunk-G7UQ5PUR.mjs} +1 -1
  154. package/dist/chunk-G7UQ5PUR.mjs.map +1 -0
  155. package/dist/{chunk-OFWKFUFZ.mjs → chunk-HPFDYUGP.mjs} +1 -1
  156. package/dist/chunk-HPFDYUGP.mjs.map +1 -0
  157. package/dist/{chunk-OIHARMNM.mjs → chunk-IJD7FE2Z.mjs} +1 -1
  158. package/dist/chunk-IJD7FE2Z.mjs.map +1 -0
  159. package/dist/{chunk-XDKEPIUV.mjs → chunk-IQLKIDXF.mjs} +1 -1
  160. package/dist/chunk-IQLKIDXF.mjs.map +1 -0
  161. package/dist/{chunk-GTVOVGGZ.mjs → chunk-JE6JKZU3.mjs} +2 -2
  162. package/dist/chunk-JE6JKZU3.mjs.map +1 -0
  163. package/dist/{chunk-Q75KEFW5.mjs → chunk-JEKUA56R.mjs} +1 -1
  164. package/dist/chunk-JEKUA56R.mjs.map +1 -0
  165. package/dist/{chunk-VKM3R5T5.mjs → chunk-L7FQX5MN.mjs} +3 -3
  166. package/dist/chunk-L7FQX5MN.mjs.map +1 -0
  167. package/dist/{chunk-K2BAFL2T.mjs → chunk-LJ2C6MVP.mjs} +1 -1
  168. package/dist/chunk-LJ2C6MVP.mjs.map +1 -0
  169. package/dist/{chunk-4MRXVNGG.mjs → chunk-LUIKU43M.mjs} +1 -1
  170. package/dist/chunk-LUIKU43M.mjs.map +1 -0
  171. package/dist/{chunk-NRNKP6JF.mjs → chunk-NFS7RWWE.mjs} +1 -1
  172. package/dist/chunk-NFS7RWWE.mjs.map +1 -0
  173. package/dist/{chunk-H2FV6Z5X.mjs → chunk-O64NE2P4.mjs} +2 -2
  174. package/dist/{chunk-GNSJP2AB.mjs → chunk-O6UXZR3U.mjs} +1 -1
  175. package/dist/chunk-O6UXZR3U.mjs.map +1 -0
  176. package/dist/{chunk-FXOABQRO.mjs → chunk-OOKNBU4V.mjs} +1 -1
  177. package/dist/chunk-OOKNBU4V.mjs.map +1 -0
  178. package/dist/{chunk-WPDDOUQT.mjs → chunk-OXAZEEGP.mjs} +1 -1
  179. package/dist/chunk-OXAZEEGP.mjs.map +1 -0
  180. package/dist/{chunk-E54CCWDL.mjs → chunk-Q47NGNXT.mjs} +3 -3
  181. package/dist/{chunk-OEOAJOLQ.mjs → chunk-QOJGMVVR.mjs} +1 -1
  182. package/dist/chunk-QOJGMVVR.mjs.map +1 -0
  183. package/dist/{chunk-JSS4FXUD.mjs → chunk-QRSJBBFY.mjs} +3 -3
  184. package/dist/{chunk-PLTO44KM.mjs → chunk-QZITBKWX.mjs} +1 -1
  185. package/dist/chunk-QZITBKWX.mjs.map +1 -0
  186. package/dist/{chunk-UPJXHWSJ.mjs → chunk-R6QA7PLZ.mjs} +2 -2
  187. package/dist/chunk-R6QA7PLZ.mjs.map +1 -0
  188. package/dist/{chunk-ACFP3XMB.mjs → chunk-S3CORED5.mjs} +1 -1
  189. package/dist/chunk-S3CORED5.mjs.map +1 -0
  190. package/dist/{chunk-2EFS3VA3.mjs → chunk-XI7KRD2C.mjs} +1 -1
  191. package/dist/chunk-XI7KRD2C.mjs.map +1 -0
  192. package/dist/error/AbortError.d.mts +1 -1
  193. package/dist/error/AbortError.d.ts +1 -1
  194. package/dist/error/AbortError.js.map +1 -1
  195. package/dist/error/AbortError.mjs +1 -1
  196. package/dist/error/index.js.map +1 -1
  197. package/dist/error/index.mjs +1 -1
  198. package/dist/function/debounce.d.mts +1 -0
  199. package/dist/function/debounce.d.ts +1 -0
  200. package/dist/function/debounce.js.map +1 -1
  201. package/dist/function/debounce.mjs +1 -1
  202. package/dist/function/index.js.map +1 -1
  203. package/dist/function/index.mjs +3 -3
  204. package/dist/function/once.d.mts +1 -0
  205. package/dist/function/once.d.ts +1 -0
  206. package/dist/function/once.js.map +1 -1
  207. package/dist/function/once.mjs +1 -1
  208. package/dist/function/throttle.d.mts +1 -0
  209. package/dist/function/throttle.d.ts +1 -0
  210. package/dist/function/throttle.js.map +1 -1
  211. package/dist/function/throttle.mjs +1 -1
  212. package/dist/index.d.mts +1 -0
  213. package/dist/index.d.ts +1 -0
  214. package/dist/index.js +12 -0
  215. package/dist/index.js.map +1 -1
  216. package/dist/index.mjs +106 -102
  217. package/dist/math/index.js.map +1 -1
  218. package/dist/math/index.mjs +6 -6
  219. package/dist/math/meanBy.d.mts +1 -0
  220. package/dist/math/meanBy.d.ts +1 -0
  221. package/dist/math/meanBy.js.map +1 -1
  222. package/dist/math/meanBy.mjs +1 -1
  223. package/dist/object/index.js.map +1 -1
  224. package/dist/object/index.mjs +6 -6
  225. package/dist/object/omit.d.mts +2 -0
  226. package/dist/object/omit.d.ts +2 -0
  227. package/dist/object/omit.js.map +1 -1
  228. package/dist/object/omit.mjs +1 -1
  229. package/dist/object/omitBy.d.mts +1 -0
  230. package/dist/object/omitBy.d.ts +1 -0
  231. package/dist/object/omitBy.js.map +1 -1
  232. package/dist/object/omitBy.mjs +1 -1
  233. package/dist/object/pick.d.mts +2 -0
  234. package/dist/object/pick.d.ts +2 -0
  235. package/dist/object/pick.js.map +1 -1
  236. package/dist/object/pick.mjs +1 -1
  237. package/dist/object/pickBy.d.mts +1 -0
  238. package/dist/object/pickBy.d.ts +1 -0
  239. package/dist/object/pickBy.js.map +1 -1
  240. package/dist/object/pickBy.mjs +1 -1
  241. package/dist/predicate/index.js.map +1 -1
  242. package/dist/predicate/index.mjs +4 -4
  243. package/dist/predicate/isNotNil.d.mts +1 -0
  244. package/dist/predicate/isNotNil.d.ts +1 -0
  245. package/dist/predicate/isNotNil.js.map +1 -1
  246. package/dist/predicate/isNotNil.mjs +1 -1
  247. package/dist/promise/delay.js.map +1 -1
  248. package/dist/promise/delay.mjs +2 -2
  249. package/dist/promise/index.js.map +1 -1
  250. package/dist/promise/index.mjs +2 -2
  251. package/package.json +2 -1
  252. package/dist/chunk-2EFS3VA3.mjs.map +0 -1
  253. package/dist/chunk-2PFDLYQC.mjs.map +0 -1
  254. package/dist/chunk-4MRXVNGG.mjs.map +0 -1
  255. package/dist/chunk-5L2V7WD3.mjs.map +0 -1
  256. package/dist/chunk-A67NF2C7.mjs.map +0 -1
  257. package/dist/chunk-ACFP3XMB.mjs.map +0 -1
  258. package/dist/chunk-D735JOLS.mjs +0 -1
  259. package/dist/chunk-DA7GSKQ5.mjs.map +0 -1
  260. package/dist/chunk-DOOIIHT3.mjs.map +0 -1
  261. package/dist/chunk-DPLJQQFX.mjs.map +0 -1
  262. package/dist/chunk-FXOABQRO.mjs.map +0 -1
  263. package/dist/chunk-G42NUGNE.mjs.map +0 -1
  264. package/dist/chunk-GNSJP2AB.mjs.map +0 -1
  265. package/dist/chunk-GTVOVGGZ.mjs.map +0 -1
  266. package/dist/chunk-H5YR3ZV4.mjs.map +0 -1
  267. package/dist/chunk-JGNFYNYU.mjs.map +0 -1
  268. package/dist/chunk-K2BAFL2T.mjs.map +0 -1
  269. package/dist/chunk-KSXWREB5.mjs.map +0 -1
  270. package/dist/chunk-MQWVBKUT.mjs.map +0 -1
  271. package/dist/chunk-NKTBEEIT.mjs.map +0 -1
  272. package/dist/chunk-NRNKP6JF.mjs.map +0 -1
  273. package/dist/chunk-OEOAJOLQ.mjs.map +0 -1
  274. package/dist/chunk-OFWKFUFZ.mjs.map +0 -1
  275. package/dist/chunk-OIHARMNM.mjs.map +0 -1
  276. package/dist/chunk-OUTSP4VR.mjs.map +0 -1
  277. package/dist/chunk-PLTO44KM.mjs.map +0 -1
  278. package/dist/chunk-PYLGHB3F.mjs.map +0 -1
  279. package/dist/chunk-Q5XXJXXQ.mjs.map +0 -1
  280. package/dist/chunk-Q75KEFW5.mjs.map +0 -1
  281. package/dist/chunk-UFAA5WKR.mjs.map +0 -1
  282. package/dist/chunk-UPJXHWSJ.mjs.map +0 -1
  283. package/dist/chunk-VKM3R5T5.mjs.map +0 -1
  284. package/dist/chunk-WPDDOUQT.mjs.map +0 -1
  285. package/dist/chunk-XDKEPIUV.mjs.map +0 -1
  286. package/dist/chunk-XFCW7XJ4.mjs.map +0 -1
  287. package/dist/chunk-ZQNAZPSK.mjs.map +0 -1
  288. /package/dist/{chunk-D735JOLS.mjs.map → array/fill.mjs.map} +0 -0
  289. /package/dist/{chunk-H2FV6Z5X.mjs.map → chunk-O64NE2P4.mjs.map} +0 -0
  290. /package/dist/{chunk-E54CCWDL.mjs.map → chunk-Q47NGNXT.mjs.map} +0 -0
  291. /package/dist/{chunk-JSS4FXUD.mjs.map → chunk-QRSJBBFY.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,184 +1,187 @@
1
1
  import "./chunk-ARZ5BDR6.mjs";
2
2
  import {
3
3
  delay
4
- } from "./chunk-H2FV6Z5X.mjs";
4
+ } from "./chunk-O64NE2P4.mjs";
5
5
  import "./chunk-MAJSPFA6.mjs";
6
+ import {
7
+ isUndefined
8
+ } from "./chunk-VH2PV426.mjs";
6
9
  import {
7
10
  isNil
8
11
  } from "./chunk-OHQAR5AU.mjs";
9
12
  import {
10
13
  isNotNil
11
- } from "./chunk-ZQNAZPSK.mjs";
14
+ } from "./chunk-BMRTZMRE.mjs";
12
15
  import {
13
16
  isNull
14
17
  } from "./chunk-AIRSKN47.mjs";
18
+ import "./chunk-N6EM6ETS.mjs";
15
19
  import {
16
- isUndefined
17
- } from "./chunk-VH2PV426.mjs";
18
- import "./chunk-T5JCRGXA.mjs";
20
+ debounce
21
+ } from "./chunk-3IP4JVLL.mjs";
19
22
  import {
20
- omitBy
21
- } from "./chunk-A67NF2C7.mjs";
23
+ noop
24
+ } from "./chunk-LKXCOLNY.mjs";
22
25
  import {
23
- pick
24
- } from "./chunk-OFWKFUFZ.mjs";
26
+ once
27
+ } from "./chunk-CMBC4MXG.mjs";
25
28
  import {
26
- pickBy
27
- } from "./chunk-MQWVBKUT.mjs";
29
+ throttle
30
+ } from "./chunk-QOJGMVVR.mjs";
31
+ import "./chunk-T5JCRGXA.mjs";
28
32
  import {
29
33
  omit
30
- } from "./chunk-PLTO44KM.mjs";
31
- import "./chunk-D735JOLS.mjs";
34
+ } from "./chunk-QZITBKWX.mjs";
32
35
  import {
33
- xorBy
34
- } from "./chunk-E54CCWDL.mjs";
36
+ omitBy
37
+ } from "./chunk-BCTYOXT7.mjs";
35
38
  import {
36
- xorWith
37
- } from "./chunk-JSS4FXUD.mjs";
39
+ pick
40
+ } from "./chunk-HPFDYUGP.mjs";
38
41
  import {
39
- zip
40
- } from "./chunk-IDCUZVJL.mjs";
42
+ pickBy
43
+ } from "./chunk-6CLH5YZ2.mjs";
44
+ import "./chunk-23O4IK6D.mjs";
41
45
  import {
42
46
  zipObject
43
- } from "./chunk-DA7GSKQ5.mjs";
47
+ } from "./chunk-6GWEY5EL.mjs";
44
48
  import {
45
49
  zipWith
46
50
  } from "./chunk-4KYXHZ4R.mjs";
47
- import {
48
- takeWhile
49
- } from "./chunk-2IXFGSUA.mjs";
50
- import {
51
- unionBy
52
- } from "./chunk-NRNKP6JF.mjs";
53
- import {
54
- unionWith
55
- } from "./chunk-OUTSP4VR.mjs";
56
51
  import {
57
52
  uniqBy
58
- } from "./chunk-WPDDOUQT.mjs";
59
- import {
60
- uniqWith
61
- } from "./chunk-2PFDLYQC.mjs";
53
+ } from "./chunk-OXAZEEGP.mjs";
62
54
  import {
63
55
  xor
64
- } from "./chunk-VKM3R5T5.mjs";
56
+ } from "./chunk-L7FQX5MN.mjs";
65
57
  import {
66
- union
67
- } from "./chunk-UPJXHWSJ.mjs";
58
+ xorBy
59
+ } from "./chunk-Q47NGNXT.mjs";
68
60
  import {
69
- uniq
70
- } from "./chunk-XFCW7XJ4.mjs";
61
+ xorWith
62
+ } from "./chunk-QRSJBBFY.mjs";
71
63
  import {
72
- minBy
73
- } from "./chunk-OIHARMNM.mjs";
64
+ unionWith
65
+ } from "./chunk-2ZCITDMK.mjs";
74
66
  import {
75
- partition
76
- } from "./chunk-5L2V7WD3.mjs";
67
+ uniqWith
68
+ } from "./chunk-237HGSZS.mjs";
77
69
  import {
78
- sample
79
- } from "./chunk-DOOIIHT3.mjs";
70
+ zip
71
+ } from "./chunk-IDCUZVJL.mjs";
80
72
  import {
81
73
  sampleSize
82
- } from "./chunk-4MRXVNGG.mjs";
83
- import "./chunk-TZE6EDCX.mjs";
84
- import {
85
- meanBy
86
- } from "./chunk-JGNFYNYU.mjs";
87
- import {
88
- randomInt
89
- } from "./chunk-GIWAOOFY.mjs";
90
- import {
91
- random
92
- } from "./chunk-SYWMYQYJ.mjs";
93
- import {
94
- range
95
- } from "./chunk-UNLX2F2Y.mjs";
96
- import {
97
- round
98
- } from "./chunk-5PMKOZ2F.mjs";
99
- import {
100
- clamp
101
- } from "./chunk-MLCL773E.mjs";
102
- import {
103
- mean
104
- } from "./chunk-LT6E4Y4Z.mjs";
105
- import {
106
- sum
107
- } from "./chunk-NOFHNJ5C.mjs";
74
+ } from "./chunk-LUIKU43M.mjs";
108
75
  import {
109
76
  shuffle
110
- } from "./chunk-DPLJQQFX.mjs";
77
+ } from "./chunk-G7UQ5PUR.mjs";
111
78
  import {
112
79
  take
113
80
  } from "./chunk-ME352XO7.mjs";
114
81
  import {
115
82
  takeRight
116
- } from "./chunk-XDKEPIUV.mjs";
83
+ } from "./chunk-IQLKIDXF.mjs";
117
84
  import {
118
85
  takeRightWhile
119
86
  } from "./chunk-NTLX2MPV.mjs";
120
87
  import {
121
- groupBy
122
- } from "./chunk-H5YR3ZV4.mjs";
88
+ takeWhile
89
+ } from "./chunk-2IXFGSUA.mjs";
90
+ import {
91
+ union
92
+ } from "./chunk-R6QA7PLZ.mjs";
93
+ import {
94
+ uniq
95
+ } from "./chunk-DVK2N4KC.mjs";
96
+ import {
97
+ unionBy
98
+ } from "./chunk-NFS7RWWE.mjs";
123
99
  import {
124
100
  intersection
125
- } from "./chunk-PYLGHB3F.mjs";
101
+ } from "./chunk-FVVSE2F2.mjs";
126
102
  import {
127
103
  intersectionBy
128
- } from "./chunk-GNSJP2AB.mjs";
104
+ } from "./chunk-O6UXZR3U.mjs";
129
105
  import {
130
106
  intersectionWith
131
- } from "./chunk-2EFS3VA3.mjs";
107
+ } from "./chunk-XI7KRD2C.mjs";
132
108
  import {
133
109
  keyBy
134
- } from "./chunk-KSXWREB5.mjs";
110
+ } from "./chunk-AJKZMN2V.mjs";
135
111
  import {
136
112
  maxBy
137
- } from "./chunk-FXOABQRO.mjs";
113
+ } from "./chunk-OOKNBU4V.mjs";
138
114
  import {
139
- chunk
140
- } from "./chunk-E6C5EZQA.mjs";
141
- import {
142
- compact
143
- } from "./chunk-NKTBEEIT.mjs";
115
+ minBy
116
+ } from "./chunk-IJD7FE2Z.mjs";
144
117
  import {
145
- difference
146
- } from "./chunk-JPUKH67K.mjs";
118
+ partition
119
+ } from "./chunk-DN3NOZ3H.mjs";
147
120
  import {
148
- differenceBy
149
- } from "./chunk-LVWX5B43.mjs";
121
+ sample
122
+ } from "./chunk-2KNLZB7V.mjs";
150
123
  import {
151
124
  differenceWith
152
125
  } from "./chunk-6NVQAHXP.mjs";
153
126
  import {
154
127
  drop
155
- } from "./chunk-ACFP3XMB.mjs";
128
+ } from "./chunk-S3CORED5.mjs";
156
129
  import {
157
130
  dropRight
158
- } from "./chunk-Q75KEFW5.mjs";
131
+ } from "./chunk-JEKUA56R.mjs";
159
132
  import {
160
133
  dropRightWhile
161
- } from "./chunk-GTVOVGGZ.mjs";
134
+ } from "./chunk-JE6JKZU3.mjs";
162
135
  import {
163
136
  dropWhile
164
- } from "./chunk-K2BAFL2T.mjs";
165
- import "./chunk-N6EM6ETS.mjs";
137
+ } from "./chunk-LJ2C6MVP.mjs";
166
138
  import {
167
- debounce
168
- } from "./chunk-G42NUGNE.mjs";
139
+ fill
140
+ } from "./chunk-C4WE4GLC.mjs";
169
141
  import {
170
- noop
171
- } from "./chunk-LKXCOLNY.mjs";
142
+ groupBy
143
+ } from "./chunk-E6E4RZLN.mjs";
172
144
  import {
173
- once
174
- } from "./chunk-UFAA5WKR.mjs";
145
+ chunk
146
+ } from "./chunk-E6C5EZQA.mjs";
175
147
  import {
176
- throttle
177
- } from "./chunk-OEOAJOLQ.mjs";
148
+ compact
149
+ } from "./chunk-DTJJIMKJ.mjs";
150
+ import {
151
+ difference
152
+ } from "./chunk-JPUKH67K.mjs";
153
+ import {
154
+ differenceBy
155
+ } from "./chunk-LVWX5B43.mjs";
178
156
  import "./chunk-FZEZH22H.mjs";
179
157
  import {
180
158
  AbortError
181
- } from "./chunk-Q5XXJXXQ.mjs";
159
+ } from "./chunk-DXB7EZUQ.mjs";
160
+ import "./chunk-TZE6EDCX.mjs";
161
+ import {
162
+ randomInt
163
+ } from "./chunk-GIWAOOFY.mjs";
164
+ import {
165
+ range
166
+ } from "./chunk-UNLX2F2Y.mjs";
167
+ import {
168
+ round
169
+ } from "./chunk-5PMKOZ2F.mjs";
170
+ import {
171
+ clamp
172
+ } from "./chunk-MLCL773E.mjs";
173
+ import {
174
+ meanBy
175
+ } from "./chunk-CXGIXTSH.mjs";
176
+ import {
177
+ mean
178
+ } from "./chunk-LT6E4Y4Z.mjs";
179
+ import {
180
+ sum
181
+ } from "./chunk-NOFHNJ5C.mjs";
182
+ import {
183
+ random
184
+ } from "./chunk-SYWMYQYJ.mjs";
182
185
  import "./chunk-2MM5EJJX.mjs";
183
186
  export {
184
187
  AbortError,
@@ -194,6 +197,7 @@ export {
194
197
  dropRight,
195
198
  dropRightWhile,
196
199
  dropWhile,
200
+ fill,
197
201
  groupBy,
198
202
  intersection,
199
203
  intersectionBy,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/math/index.ts","../../src/math/clamp.ts","../../src/math/sum.ts","../../src/math/mean.ts","../../src/math/meanBy.ts","../../src/math/random.ts","../../src/math/randomInt.ts","../../src/math/round.ts","../../src/math/range.ts"],"sourcesContent":["export { clamp } from './clamp.ts';\nexport { mean } from './mean.ts';\nexport { meanBy } from './meanBy.ts';\nexport { random } from './random.ts';\nexport { randomInt } from './randomInt.ts';\nexport { round } from './round.ts';\nexport { sum } from './sum.ts';\nexport { range } from './range.ts';\n","/**\n * Clamps a number within the inclusive lower and upper bounds.\n *\n * This function takes a number and two bounds, and returns the number clamped within the specified bounds.\n * If only one bound is provided, it returns the minimum of the value and the bound.\n *\n * @param {number} value - The number to clamp.\n * @param {number} minimum - The minimum bound to clamp the number.\n * @param {number} maximum - The maximum bound to clamp the number.\n * @returns {number} The clamped number within the specified bounds.\n *\n * @example\n * const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5\n * const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15\n * const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5\n * const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15\n */\nexport function clamp(value: number, maximum: number): number;\nexport function clamp(value: number, minimum: number, maximum: number): number;\nexport function clamp(value: number, bound1: number, bound2?: number): number {\n if (bound2 == null) {\n return Math.min(value, bound1);\n }\n\n return Math.min(Math.max(value, bound1), bound2);\n}\n","/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n","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","import { mean } from './mean';\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 * @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 */\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","/**\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","/**\n * Rounds a number to a specified precision.\n *\n * This function takes a number and an optional precision value, and returns the number rounded\n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n * @throws {Error} Throws an error if `Precision` is not integer.\n *\n * @example\n * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n * const result4 = round(1.2345, 3.1); // This will throw an error\n */\nexport function round(value: number, precision = 0): number {\n if (!Number.isInteger(precision)) {\n throw new Error('Precision must be an integer.');\n }\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n","/**\n * Returns an array of numbers from `start` to `end`, incrementing by `step`.\n *\n * If `step` is not provided, it defaults to `1` for an\n * ascending range and `-1` for a descending range.\n *\n * @param {number} start - The starting number of the range.\n * @param {number} [end] - The end number of the range.\n * @param {number} [step] - The step value for the range.\n * @returns {number[]} An array of numbers from `start` to `end` with the specified `step`.\n *\n * @example\n * // Returns [0, 1, 2, 3]\n * range(4);\n *\n * @example\n * // Returns [0, 5, 10, 15]\n * range(0, 20, 5);\n *\n * @example\n * // Returns []\n * range(0, -4, -1);\n *\n * @example\n * // Throws an error: The step value must be a non-zero integer.\n * range(1, 4, 0);\n */\nexport function range(end: number): number[];\nexport function range(start: number, end: number): number[];\nexport function range(start: number, end: number, step: number): number[];\nexport function range(start: number, end?: number, step?: number): number[] {\n if (end == null) {\n end = start;\n start = 0;\n }\n\n if (step == null) {\n step = 1;\n }\n\n if (!Number.isInteger(step) || step === 0) {\n throw new Error(`The step value must be a non-zero integer.`);\n }\n\n const length = Math.max(Math.ceil((end - start) / step), 0);\n const result = new Array(length);\n\n for (let i = 0; i < length; i++) {\n result[i] = start + i * step;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,OAAe,QAAgB,QAAyB;AAC5E,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK,IAAI,OAAO,MAAM;AAAA,EAC/B;AAEA,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,MAAM,GAAG,MAAM;AACjD;;;ACZO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;;;ACNO,SAAS,KAAK,MAAiC;AACpD,SAAO,IAAI,IAAI,IAAI,KAAK;AAC1B;;;ACAO,SAAS,OAAU,OAAqB,UAA0C;AACvF,QAAM,OAAO,MAAM,IAAI,OAAK,SAAS,CAAC,CAAC;AAEvC,SAAO,KAAK,IAAI;AAClB;;;ACJO,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;;;ACHO,SAAS,MAAM,OAAe,YAAY,GAAW;AAC1D,MAAI,CAAC,OAAO,UAAU,SAAS,GAAG;AAChC,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AACA,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;;;ACOO,SAAS,MAAM,OAAe,KAAc,MAAyB;AAC1E,MAAI,OAAO,MAAM;AACf,UAAM;AACN,YAAQ;AAAA,EACV;AAEA,MAAI,QAAQ,MAAM;AAChB,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,SAAS,GAAG;AACzC,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AAEA,QAAM,SAAS,KAAK,IAAI,KAAK,MAAM,MAAM,SAAS,IAAI,GAAG,CAAC;AAC1D,QAAM,SAAS,IAAI,MAAM,MAAM;AAE/B,WAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC/B,WAAO,CAAC,IAAI,QAAQ,IAAI;AAAA,EAC1B;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/math/index.ts","../../src/math/clamp.ts","../../src/math/sum.ts","../../src/math/mean.ts","../../src/math/meanBy.ts","../../src/math/random.ts","../../src/math/randomInt.ts","../../src/math/round.ts","../../src/math/range.ts"],"sourcesContent":["export { clamp } from './clamp.ts';\nexport { mean } from './mean.ts';\nexport { meanBy } from './meanBy.ts';\nexport { random } from './random.ts';\nexport { randomInt } from './randomInt.ts';\nexport { round } from './round.ts';\nexport { sum } from './sum.ts';\nexport { range } from './range.ts';\n","/**\n * Clamps a number within the inclusive lower and upper bounds.\n *\n * This function takes a number and two bounds, and returns the number clamped within the specified bounds.\n * If only one bound is provided, it returns the minimum of the value and the bound.\n *\n * @param {number} value - The number to clamp.\n * @param {number} minimum - The minimum bound to clamp the number.\n * @param {number} maximum - The maximum bound to clamp the number.\n * @returns {number} The clamped number within the specified bounds.\n *\n * @example\n * const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5\n * const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15\n * const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5\n * const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15\n */\nexport function clamp(value: number, maximum: number): number;\nexport function clamp(value: number, minimum: number, maximum: number): number;\nexport function clamp(value: number, bound1: number, bound2?: number): number {\n if (bound2 == null) {\n return Math.min(value, bound1);\n }\n\n return Math.min(Math.max(value, bound1), bound2);\n}\n","/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n","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","import { mean } from './mean';\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","/**\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","/**\n * Rounds a number to a specified precision.\n *\n * This function takes a number and an optional precision value, and returns the number rounded\n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n * @throws {Error} Throws an error if `Precision` is not integer.\n *\n * @example\n * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n * const result4 = round(1.2345, 3.1); // This will throw an error\n */\nexport function round(value: number, precision = 0): number {\n if (!Number.isInteger(precision)) {\n throw new Error('Precision must be an integer.');\n }\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n","/**\n * Returns an array of numbers from `start` to `end`, incrementing by `step`.\n *\n * If `step` is not provided, it defaults to `1` for an\n * ascending range and `-1` for a descending range.\n *\n * @param {number} start - The starting number of the range.\n * @param {number} [end] - The end number of the range.\n * @param {number} [step] - The step value for the range.\n * @returns {number[]} An array of numbers from `start` to `end` with the specified `step`.\n *\n * @example\n * // Returns [0, 1, 2, 3]\n * range(4);\n *\n * @example\n * // Returns [0, 5, 10, 15]\n * range(0, 20, 5);\n *\n * @example\n * // Returns []\n * range(0, -4, -1);\n *\n * @example\n * // Throws an error: The step value must be a non-zero integer.\n * range(1, 4, 0);\n */\nexport function range(end: number): number[];\nexport function range(start: number, end: number): number[];\nexport function range(start: number, end: number, step: number): number[];\nexport function range(start: number, end?: number, step?: number): number[] {\n if (end == null) {\n end = start;\n start = 0;\n }\n\n if (step == null) {\n step = 1;\n }\n\n if (!Number.isInteger(step) || step === 0) {\n throw new Error(`The step value must be a non-zero integer.`);\n }\n\n const length = Math.max(Math.ceil((end - start) / step), 0);\n const result = new Array(length);\n\n for (let i = 0; i < length; i++) {\n result[i] = start + i * step;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,OAAe,QAAgB,QAAyB;AAC5E,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK,IAAI,OAAO,MAAM;AAAA,EAC/B;AAEA,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,MAAM,GAAG,MAAM;AACjD;;;ACZO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;;;ACNO,SAAS,KAAK,MAAiC;AACpD,SAAO,IAAI,IAAI,IAAI,KAAK;AAC1B;;;ACAO,SAAS,OAAU,OAAqB,UAA0C;AACvF,QAAM,OAAO,MAAM,IAAI,OAAK,SAAS,CAAC,CAAC;AAEvC,SAAO,KAAK,IAAI;AAClB;;;ACJO,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;;;ACHO,SAAS,MAAM,OAAe,YAAY,GAAW;AAC1D,MAAI,CAAC,OAAO,UAAU,SAAS,GAAG;AAChC,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AACA,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;;;ACOO,SAAS,MAAM,OAAe,KAAc,MAAyB;AAC1E,MAAI,OAAO,MAAM;AACf,UAAM;AACN,YAAQ;AAAA,EACV;AAEA,MAAI,QAAQ,MAAM;AAChB,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,SAAS,GAAG;AACzC,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AAEA,QAAM,SAAS,KAAK,IAAI,KAAK,MAAM,MAAM,SAAS,IAAI,GAAG,CAAC;AAC1D,QAAM,SAAS,IAAI,MAAM,MAAM;AAE/B,WAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC/B,WAAO,CAAC,IAAI,QAAQ,IAAI;AAAA,EAC1B;AAEA,SAAO;AACT;","names":[]}
@@ -1,13 +1,7 @@
1
1
  import "../chunk-TZE6EDCX.mjs";
2
- import {
3
- meanBy
4
- } from "../chunk-JGNFYNYU.mjs";
5
2
  import {
6
3
  randomInt
7
4
  } from "../chunk-GIWAOOFY.mjs";
8
- import {
9
- random
10
- } from "../chunk-SYWMYQYJ.mjs";
11
5
  import {
12
6
  range
13
7
  } from "../chunk-UNLX2F2Y.mjs";
@@ -17,12 +11,18 @@ import {
17
11
  import {
18
12
  clamp
19
13
  } from "../chunk-MLCL773E.mjs";
14
+ import {
15
+ meanBy
16
+ } from "../chunk-CXGIXTSH.mjs";
20
17
  import {
21
18
  mean
22
19
  } from "../chunk-LT6E4Y4Z.mjs";
23
20
  import {
24
21
  sum
25
22
  } from "../chunk-NOFHNJ5C.mjs";
23
+ import {
24
+ random
25
+ } from "../chunk-SYWMYQYJ.mjs";
26
26
  import "../chunk-2MM5EJJX.mjs";
27
27
  export {
28
28
  clamp,
@@ -4,6 +4,7 @@
4
4
  *
5
5
  * If the array is empty, this function returns `NaN`.
6
6
  *
7
+ * @template T - The type of elements in the array.
7
8
  * @param {T[]} items An array to calculate the average.
8
9
  * @param {(element: T) => number} getValue A function that selects a numeric value from each element.
9
10
  * @returns {number} The average of all the numbers as determined by the `getValue` function.
@@ -4,6 +4,7 @@
4
4
  *
5
5
  * If the array is empty, this function returns `NaN`.
6
6
  *
7
+ * @template T - The type of elements in the array.
7
8
  * @param {T[]} items An array to calculate the average.
8
9
  * @param {(element: T) => number} getValue A function that selects a numeric value from each element.
9
10
  * @returns {number} The average of all the numbers as determined by the `getValue` function.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/math/meanBy.ts","../../src/math/sum.ts","../../src/math/mean.ts"],"sourcesContent":["import { mean } from './mean';\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 * @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 */\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","/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n","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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;;;ACNO,SAAS,KAAK,MAAiC;AACpD,SAAO,IAAI,IAAI,IAAI,KAAK;AAC1B;;;AFAO,SAAS,OAAU,OAAqB,UAA0C;AACvF,QAAM,OAAO,MAAM,IAAI,OAAK,SAAS,CAAC,CAAC;AAEvC,SAAO,KAAK,IAAI;AAClB;","names":[]}
1
+ {"version":3,"sources":["../../src/math/meanBy.ts","../../src/math/sum.ts","../../src/math/mean.ts"],"sourcesContent":["import { mean } from './mean';\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","/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n","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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;;;ACNO,SAAS,KAAK,MAAiC;AACpD,SAAO,IAAI,IAAI,IAAI,KAAK;AAC1B;;;AFAO,SAAS,OAAU,OAAqB,UAA0C;AACvF,QAAM,OAAO,MAAM,IAAI,OAAK,SAAS,CAAC,CAAC;AAEvC,SAAO,KAAK,IAAI;AAClB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  meanBy
3
- } from "../chunk-JGNFYNYU.mjs";
3
+ } from "../chunk-CXGIXTSH.mjs";
4
4
  import "../chunk-LT6E4Y4Z.mjs";
5
5
  import "../chunk-NOFHNJ5C.mjs";
6
6
  import "../chunk-2MM5EJJX.mjs";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts"],"sourcesContent":["export { omit } from './omit.ts';\nexport { omitBy } from './omitBy.ts';\nexport { pick } from './pick.ts';\nexport { pickBy } from './pickBy.ts';\n","/**\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 * @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","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACLO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;AClBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACLO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts"],"sourcesContent":["export { omit } from './omit.ts';\nexport { omitBy } from './omitBy.ts';\nexport { pick } from './pick.ts';\nexport { pickBy } from './pickBy.ts';\n","/**\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","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only 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 pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;ACjBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -1,16 +1,16 @@
1
1
  import "../chunk-T5JCRGXA.mjs";
2
+ import {
3
+ omit
4
+ } from "../chunk-QZITBKWX.mjs";
2
5
  import {
3
6
  omitBy
4
- } from "../chunk-A67NF2C7.mjs";
7
+ } from "../chunk-BCTYOXT7.mjs";
5
8
  import {
6
9
  pick
7
- } from "../chunk-OFWKFUFZ.mjs";
10
+ } from "../chunk-HPFDYUGP.mjs";
8
11
  import {
9
12
  pickBy
10
- } from "../chunk-MQWVBKUT.mjs";
11
- import {
12
- omit
13
- } from "../chunk-PLTO44KM.mjs";
13
+ } from "../chunk-6CLH5YZ2.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  omit,
@@ -4,6 +4,8 @@
4
4
  * This function takes an object and an array of keys, and returns a new object that
5
5
  * excludes the properties corresponding to the specified keys.
6
6
  *
7
+ * @template T - The type of object.
8
+ * @template K - The type of keys in object.
7
9
  * @param {T} obj - The object to omit keys from.
8
10
  * @param {K[]} keys - An array of keys to be omitted from the object.
9
11
  * @returns {Omit<T, K>} A new object with the specified keys omitted.
@@ -4,6 +4,8 @@
4
4
  * This function takes an object and an array of keys, and returns a new object that
5
5
  * excludes the properties corresponding to the specified keys.
6
6
  *
7
+ * @template T - The type of object.
8
+ * @template K - The type of keys in object.
7
9
  * @param {T} obj - The object to omit keys from.
8
10
  * @param {K[]} keys - An array of keys to be omitted from the object.
9
11
  * @returns {Omit<T, K>} A new object with the specified keys omitted.
@@ -1 +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 * @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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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
  omit
3
- } from "../chunk-PLTO44KM.mjs";
3
+ } from "../chunk-QZITBKWX.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  omit
@@ -4,6 +4,7 @@
4
4
  * This function takes an object and a predicate function, and returns a new object that
5
5
  * includes only the properties for which the predicate function returns false.
6
6
  *
7
+ * @template T - The type of object.
7
8
  * @param {T} obj - The object to omit properties from.
8
9
  * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines
9
10
  * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
@@ -4,6 +4,7 @@
4
4
  * This function takes an object and a predicate function, and returns a new object that
5
5
  * includes only the properties for which the predicate function returns false.
6
6
  *
7
+ * @template T - The type of object.
7
8
  * @param {T} obj - The object to omit properties from.
8
9
  * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines
9
10
  * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/omitBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/omitBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  omitBy
3
- } from "../chunk-A67NF2C7.mjs";
3
+ } from "../chunk-BCTYOXT7.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  omitBy
@@ -4,6 +4,8 @@
4
4
  * This function takes an object and an array of keys, and returns a new object that
5
5
  * includes only the properties corresponding to the specified keys.
6
6
  *
7
+ * @template T - The type of object.
8
+ * @template K - The type of keys in object.
7
9
  * @param {T} obj - The object to pick keys from.
8
10
  * @param {K[]} keys - An array of keys to be picked from the object.
9
11
  * @returns {Pick<T, K>} A new object with the specified keys picked.
@@ -4,6 +4,8 @@
4
4
  * This function takes an object and an array of keys, and returns a new object that
5
5
  * includes only the properties corresponding to the specified keys.
6
6
  *
7
+ * @template T - The type of object.
8
+ * @template K - The type of keys in object.
7
9
  * @param {T} obj - The object to pick keys from.
8
10
  * @param {K[]} keys - An array of keys to be picked from the object.
9
11
  * @returns {Pick<T, K>} A new object with the specified keys picked.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only 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 pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pick
3
- } from "../chunk-OFWKFUFZ.mjs";
3
+ } from "../chunk-HPFDYUGP.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  pick
@@ -4,6 +4,7 @@
4
4
  * This function takes an object and a predicate function, and returns a new object that
5
5
  * includes only the properties for which the predicate function returns true.
6
6
  *
7
+ * @template T - The type of object.
7
8
  * @param {T} obj - The object to pick properties from.
8
9
  * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines
9
10
  * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
@@ -4,6 +4,7 @@
4
4
  * This function takes an object and a predicate function, and returns a new object that
5
5
  * includes only the properties for which the predicate function returns true.
6
6
  *
7
+ * @template T - The type of object.
7
8
  * @param {T} obj - The object to pick properties from.
8
9
  * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines
9
10
  * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/pickBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/pickBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pickBy
3
- } from "../chunk-MQWVBKUT.mjs";
3
+ } from "../chunk-6CLH5YZ2.mjs";
4
4
  import "../chunk-2MM5EJJX.mjs";
5
5
  export {
6
6
  pickBy