es-toolkit 1.0.3-dev.37 → 1.0.3

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 (470) hide show
  1. package/dist/array/chunk.d.ts +1 -3
  2. package/dist/array/chunk.spec.d.ts +1 -0
  3. package/dist/array/difference.d.ts +1 -3
  4. package/dist/array/difference.spec.d.ts +1 -0
  5. package/dist/array/differenceBy.d.ts +1 -3
  6. package/dist/array/differenceBy.spec.d.ts +1 -0
  7. package/dist/array/differenceWith.d.ts +1 -3
  8. package/dist/array/differenceWith.spec.d.ts +1 -0
  9. package/dist/array/drop.d.ts +1 -3
  10. package/dist/array/drop.spec.d.ts +1 -0
  11. package/dist/array/dropRight.d.ts +1 -3
  12. package/dist/array/dropRight.spec.d.ts +1 -0
  13. package/dist/array/dropRightWhile.d.ts +1 -3
  14. package/dist/array/dropRightWhile.spec.d.ts +1 -0
  15. package/dist/array/dropWhile.d.ts +1 -3
  16. package/dist/array/dropWhile.spec.d.ts +1 -0
  17. package/dist/array/groupBy.d.ts +1 -3
  18. package/dist/array/groupBy.spec.d.ts +1 -0
  19. package/dist/array/index.d.ts +30 -30
  20. package/dist/array/index.js +842 -199
  21. package/dist/array/intersection.d.ts +1 -3
  22. package/dist/array/intersection.spec.d.ts +1 -0
  23. package/dist/array/intersectionBy.d.ts +1 -3
  24. package/dist/array/intersectionBy.spec.d.ts +1 -0
  25. package/dist/array/intersectionWith.d.ts +1 -3
  26. package/dist/array/intersectionWith.spec.d.ts +1 -0
  27. package/dist/array/partition.d.ts +1 -3
  28. package/dist/array/partition.spec.d.ts +1 -0
  29. package/dist/array/sample.d.ts +1 -3
  30. package/dist/array/sample.spec.d.ts +1 -0
  31. package/dist/array/shuffle.d.ts +1 -3
  32. package/dist/array/shuffle.spec.d.ts +1 -0
  33. package/dist/array/take.d.ts +1 -3
  34. package/dist/array/take.spec.d.ts +1 -0
  35. package/dist/array/takeRight.d.ts +1 -3
  36. package/dist/array/takeRight.spec.d.ts +1 -0
  37. package/dist/array/takeRightWhile.d.ts +1 -3
  38. package/dist/array/takeRightWhile.spec.d.ts +1 -0
  39. package/dist/array/takeWhile.d.ts +1 -3
  40. package/dist/array/takeWhile.spec.d.ts +1 -0
  41. package/dist/array/union.d.ts +1 -3
  42. package/dist/array/union.spec.d.ts +1 -0
  43. package/dist/array/unionBy.d.ts +1 -3
  44. package/dist/array/unionBy.spec.d.ts +1 -0
  45. package/dist/array/unionWith.d.ts +1 -3
  46. package/dist/array/unionWith.spec.d.ts +1 -0
  47. package/dist/array/uniq.d.ts +1 -3
  48. package/dist/array/uniq.spec.d.ts +1 -0
  49. package/dist/array/uniqBy.d.ts +1 -3
  50. package/dist/array/uniqBy.spec.d.ts +1 -0
  51. package/dist/array/uniqWith.d.ts +1 -3
  52. package/dist/array/uniqWith.spec.d.ts +1 -0
  53. package/dist/array/xor.d.ts +1 -3
  54. package/dist/array/xor.spec.d.ts +1 -0
  55. package/dist/array/xorBy.d.ts +1 -3
  56. package/dist/array/xorBy.spec.d.ts +1 -0
  57. package/dist/array/xorWith.d.ts +1 -3
  58. package/dist/array/xorWith.spec.d.ts +1 -0
  59. package/dist/array/zip.d.ts +4 -6
  60. package/dist/array/zip.spec.d.ts +1 -0
  61. package/dist/array/zipWith.d.ts +4 -6
  62. package/dist/array/zipWith.spec.d.ts +1 -0
  63. package/dist/function/debounce.d.ts +1 -3
  64. package/dist/function/debounce.spec.d.ts +1 -0
  65. package/dist/function/index.d.ts +3 -3
  66. package/dist/function/index.js +78 -47
  67. package/dist/function/once.d.ts +1 -3
  68. package/dist/function/once.spec.d.ts +1 -0
  69. package/dist/function/throttle.d.ts +1 -3
  70. package/dist/function/throttle.spec.d.ts +1 -0
  71. package/dist/index.d.ts +6 -45
  72. package/dist/index.js +1271 -288
  73. package/dist/math/clamp.d.ts +2 -4
  74. package/dist/math/clamp.spec.d.ts +1 -0
  75. package/dist/math/index.d.ts +3 -3
  76. package/dist/math/index.js +132 -41
  77. package/dist/math/round.d.ts +1 -3
  78. package/dist/math/round.spec.d.ts +1 -0
  79. package/dist/math/sum.d.ts +1 -3
  80. package/dist/math/sum.spec.d.ts +1 -0
  81. package/dist/object/index.d.ts +4 -4
  82. package/dist/object/index.js +256 -62
  83. package/dist/object/omit.d.ts +1 -3
  84. package/dist/object/omit.spec.d.ts +1 -0
  85. package/dist/object/omitBy.d.ts +1 -3
  86. package/dist/object/omitBy.spec.d.ts +1 -0
  87. package/dist/object/pick.d.ts +1 -3
  88. package/dist/object/pick.spec.d.ts +1 -0
  89. package/dist/object/pickBy.d.ts +1 -3
  90. package/dist/object/pickBy.spec.d.ts +1 -0
  91. package/dist/predicate/index.d.ts +4 -4
  92. package/dist/predicate/index.js +84 -42
  93. package/dist/predicate/isNil.d.ts +1 -3
  94. package/dist/predicate/isNil.spec.d.ts +1 -0
  95. package/dist/predicate/isNotNil.d.ts +1 -3
  96. package/dist/predicate/isNotNil.spec.d.ts +1 -0
  97. package/dist/predicate/isNull.d.ts +1 -3
  98. package/dist/predicate/isNull.spec.d.ts +1 -0
  99. package/dist/predicate/isUndefined.d.ts +1 -3
  100. package/dist/predicate/isUndefined.spec.d.ts +1 -0
  101. package/dist/promise/delay.d.ts +1 -3
  102. package/dist/promise/delay.spec.d.ts +1 -0
  103. package/dist/promise/index.d.ts +1 -1
  104. package/dist/promise/index.js +23 -31
  105. package/esm/_virtual/_rollupPluginBabelHelpers.mjs +163 -0
  106. package/esm/array/_virtual/_rollupPluginBabelHelpers.mjs +78 -0
  107. package/{dist/array/chunk.d.mts → esm/array/chunk.mjs} +13 -1
  108. package/{dist/array/difference.d.mts → esm/array/difference.mjs} +12 -8
  109. package/{dist/array/differenceBy.d.mts → esm/array/differenceBy.mjs} +17 -10
  110. package/{dist/array/differenceWith.d.mts → esm/array/differenceWith.mjs} +12 -6
  111. package/{dist/array/drop.d.mts → esm/array/drop.mjs} +6 -4
  112. package/{dist/array/dropRight.d.mts → esm/array/dropRight.mjs} +5 -3
  113. package/{dist/array/dropRightWhile.d.mts → esm/array/dropRightWhile.mjs} +11 -5
  114. package/{dist/array/dropWhile.d.mts → esm/array/dropWhile.mjs} +10 -5
  115. package/{dist/array/groupBy.d.mts → esm/array/groupBy.mjs} +26 -5
  116. package/{dist/array/intersection.d.mts → esm/array/intersection.mjs} +8 -4
  117. package/{dist/array/intersectionBy.d.mts → esm/array/intersectionBy.mjs} +12 -5
  118. package/{dist/array/intersectionWith.d.mts → esm/array/intersectionWith.mjs} +12 -6
  119. package/{dist/array/partition.d.mts → esm/array/partition.mjs} +30 -8
  120. package/{dist/array/sample.d.mts → esm/array/sample.mjs} +5 -2
  121. package/{dist/array/shuffle.d.mts → esm/array/shuffle.mjs} +13 -2
  122. package/{dist/array/take.d.mts → esm/array/take.mjs} +7 -5
  123. package/{dist/array/takeRight.d.mts → esm/array/takeRight.mjs} +10 -5
  124. package/{dist/array/takeRightWhile.d.mts → esm/array/takeRightWhile.mjs} +12 -5
  125. package/{dist/array/takeWhile.d.mts → esm/array/takeWhile.mjs} +21 -1
  126. package/{dist/array/union.d.mts → esm/array/union.mjs} +7 -3
  127. package/{dist/array/unionBy.d.mts → esm/array/unionBy.mjs} +16 -4
  128. package/{dist/array/unionWith.d.mts → esm/array/unionWith.mjs} +8 -4
  129. package/esm/array/uniq.mjs +37 -0
  130. package/{dist/array/uniqBy.d.mts → esm/array/uniqBy.mjs} +7 -1
  131. package/esm/array/uniqWith.mjs +39 -0
  132. package/{dist/array/xor.d.mts → esm/array/xor.mjs} +10 -4
  133. package/{dist/array/xorBy.d.mts → esm/array/xorBy.mjs} +13 -5
  134. package/{dist/array/xorWith.d.mts → esm/array/xorWith.mjs} +13 -5
  135. package/esm/array/zip.mjs +52 -0
  136. package/{dist/array/zipWith.d.mts → esm/array/zipWith.mjs} +26 -6
  137. package/{dist/function/debounce.d.mts → esm/function/debounce.mjs} +18 -5
  138. package/{dist/function/once.d.mts → esm/function/once.mjs} +14 -2
  139. package/{dist/function/throttle.d.mts → esm/function/throttle.mjs} +13 -3
  140. package/esm/math/_virtual/_rollupPluginBabelHelpers.mjs +66 -0
  141. package/{dist/math/clamp.d.mts → esm/math/clamp.mjs} +7 -2
  142. package/{dist/math/round.d.mts → esm/math/round.mjs} +7 -3
  143. package/esm/math/sum.mjs +33 -0
  144. package/esm/object/_virtual/_rollupPluginBabelHelpers.mjs +151 -0
  145. package/{dist/object/omit.d.mts → esm/object/omit.mjs} +19 -2
  146. package/{dist/object/omitBy.d.mts → esm/object/omitBy.mjs} +18 -4
  147. package/{dist/object/pick.d.mts → esm/object/pick.mjs} +19 -2
  148. package/{dist/object/pickBy.d.mts → esm/object/pickBy.mjs} +18 -4
  149. package/{dist/predicate/isNil.d.mts → esm/predicate/isNil.mjs} +6 -4
  150. package/{dist/predicate/isNotNil.d.mts → esm/predicate/isNotNil.mjs} +4 -2
  151. package/{dist/predicate/isNull.d.mts → esm/predicate/isNull.mjs} +6 -4
  152. package/{dist/predicate/isUndefined.d.mts → esm/predicate/isUndefined.mjs} +6 -4
  153. package/{dist/promise/delay.d.mts → esm/promise/delay.mjs} +8 -4
  154. package/package.json +48 -118
  155. package/dist/array/chunk.js +0 -43
  156. package/dist/array/chunk.js.map +0 -1
  157. package/dist/array/chunk.mjs +0 -8
  158. package/dist/array/chunk.mjs.map +0 -1
  159. package/dist/array/difference.js +0 -35
  160. package/dist/array/difference.js.map +0 -1
  161. package/dist/array/difference.mjs +0 -8
  162. package/dist/array/difference.mjs.map +0 -1
  163. package/dist/array/differenceBy.js +0 -36
  164. package/dist/array/differenceBy.js.map +0 -1
  165. package/dist/array/differenceBy.mjs +0 -8
  166. package/dist/array/differenceBy.mjs.map +0 -1
  167. package/dist/array/differenceWith.js +0 -37
  168. package/dist/array/differenceWith.js.map +0 -1
  169. package/dist/array/differenceWith.mjs +0 -8
  170. package/dist/array/differenceWith.mjs.map +0 -1
  171. package/dist/array/drop.js +0 -33
  172. package/dist/array/drop.js.map +0 -1
  173. package/dist/array/drop.mjs +0 -8
  174. package/dist/array/drop.mjs.map +0 -1
  175. package/dist/array/dropRight.js +0 -33
  176. package/dist/array/dropRight.js.map +0 -1
  177. package/dist/array/dropRight.mjs +0 -8
  178. package/dist/array/dropRight.mjs.map +0 -1
  179. package/dist/array/dropRightWhile.js +0 -43
  180. package/dist/array/dropRightWhile.js.map +0 -1
  181. package/dist/array/dropRightWhile.mjs +0 -9
  182. package/dist/array/dropRightWhile.mjs.map +0 -1
  183. package/dist/array/dropWhile.js +0 -34
  184. package/dist/array/dropWhile.js.map +0 -1
  185. package/dist/array/dropWhile.mjs +0 -8
  186. package/dist/array/dropWhile.mjs.map +0 -1
  187. package/dist/array/groupBy.js +0 -41
  188. package/dist/array/groupBy.js.map +0 -1
  189. package/dist/array/groupBy.mjs +0 -8
  190. package/dist/array/groupBy.mjs.map +0 -1
  191. package/dist/array/index.js.map +0 -1
  192. package/dist/array/index.mjs +0 -125
  193. package/dist/array/index.mjs.map +0 -1
  194. package/dist/array/intersection.js +0 -35
  195. package/dist/array/intersection.js.map +0 -1
  196. package/dist/array/intersection.mjs +0 -8
  197. package/dist/array/intersection.mjs.map +0 -1
  198. package/dist/array/intersectionBy.js +0 -36
  199. package/dist/array/intersectionBy.js.map +0 -1
  200. package/dist/array/intersectionBy.mjs +0 -8
  201. package/dist/array/intersectionBy.mjs.map +0 -1
  202. package/dist/array/intersectionWith.js +0 -37
  203. package/dist/array/intersectionWith.js.map +0 -1
  204. package/dist/array/intersectionWith.mjs +0 -8
  205. package/dist/array/intersectionWith.mjs.map +0 -1
  206. package/dist/array/partition.js +0 -42
  207. package/dist/array/partition.js.map +0 -1
  208. package/dist/array/partition.mjs +0 -8
  209. package/dist/array/partition.mjs.map +0 -1
  210. package/dist/array/sample.js +0 -34
  211. package/dist/array/sample.js.map +0 -1
  212. package/dist/array/sample.mjs +0 -8
  213. package/dist/array/sample.mjs.map +0 -1
  214. package/dist/array/shuffle.js +0 -37
  215. package/dist/array/shuffle.js.map +0 -1
  216. package/dist/array/shuffle.mjs +0 -8
  217. package/dist/array/shuffle.mjs.map +0 -1
  218. package/dist/array/take.js +0 -33
  219. package/dist/array/take.js.map +0 -1
  220. package/dist/array/take.mjs +0 -8
  221. package/dist/array/take.mjs.map +0 -1
  222. package/dist/array/takeRight.js +0 -36
  223. package/dist/array/takeRight.js.map +0 -1
  224. package/dist/array/takeRight.mjs +0 -8
  225. package/dist/array/takeRight.mjs.map +0 -1
  226. package/dist/array/takeRightWhile.js +0 -38
  227. package/dist/array/takeRightWhile.js.map +0 -1
  228. package/dist/array/takeRightWhile.mjs +0 -8
  229. package/dist/array/takeRightWhile.mjs.map +0 -1
  230. package/dist/array/takeWhile.js +0 -40
  231. package/dist/array/takeWhile.js.map +0 -1
  232. package/dist/array/takeWhile.mjs +0 -8
  233. package/dist/array/takeWhile.mjs.map +0 -1
  234. package/dist/array/union.js +0 -47
  235. package/dist/array/union.js.map +0 -1
  236. package/dist/array/union.mjs +0 -9
  237. package/dist/array/union.mjs.map +0 -1
  238. package/dist/array/unionBy.js +0 -40
  239. package/dist/array/unionBy.js.map +0 -1
  240. package/dist/array/unionBy.mjs +0 -8
  241. package/dist/array/unionBy.mjs.map +0 -1
  242. package/dist/array/unionWith.js +0 -47
  243. package/dist/array/unionWith.js.map +0 -1
  244. package/dist/array/unionWith.mjs +0 -9
  245. package/dist/array/unionWith.mjs.map +0 -1
  246. package/dist/array/uniq.d.mts +0 -17
  247. package/dist/array/uniq.js +0 -40
  248. package/dist/array/uniq.js.map +0 -1
  249. package/dist/array/uniq.mjs +0 -8
  250. package/dist/array/uniq.mjs.map +0 -1
  251. package/dist/array/uniqBy.js +0 -47
  252. package/dist/array/uniqBy.js.map +0 -1
  253. package/dist/array/uniqBy.mjs +0 -9
  254. package/dist/array/uniqBy.mjs.map +0 -1
  255. package/dist/array/uniqWith.d.mts +0 -14
  256. package/dist/array/uniqWith.js +0 -40
  257. package/dist/array/uniqWith.js.map +0 -1
  258. package/dist/array/uniqWith.mjs +0 -8
  259. package/dist/array/uniqWith.mjs.map +0 -1
  260. package/dist/array/xor.js +0 -66
  261. package/dist/array/xor.js.map +0 -1
  262. package/dist/array/xor.mjs +0 -12
  263. package/dist/array/xor.mjs.map +0 -1
  264. package/dist/array/xorBy.js +0 -65
  265. package/dist/array/xorBy.js.map +0 -1
  266. package/dist/array/xorBy.mjs +0 -11
  267. package/dist/array/xorBy.mjs.map +0 -1
  268. package/dist/array/xorWith.js +0 -72
  269. package/dist/array/xorWith.js.map +0 -1
  270. package/dist/array/xorWith.mjs +0 -12
  271. package/dist/array/xorWith.mjs.map +0 -1
  272. package/dist/array/zip.d.mts +0 -27
  273. package/dist/array/zip.js +0 -42
  274. package/dist/array/zip.js.map +0 -1
  275. package/dist/array/zip.mjs +0 -8
  276. package/dist/array/zip.mjs.map +0 -1
  277. package/dist/array/zipWith.js +0 -41
  278. package/dist/array/zipWith.js.map +0 -1
  279. package/dist/array/zipWith.mjs +0 -8
  280. package/dist/array/zipWith.mjs.map +0 -1
  281. package/dist/chunk-2KXLTAVK.mjs +0 -16
  282. package/dist/chunk-2KXLTAVK.mjs.map +0 -1
  283. package/dist/chunk-2MM5EJJX.mjs +0 -21
  284. package/dist/chunk-2MM5EJJX.mjs.map +0 -1
  285. package/dist/chunk-2VB6XU3I.mjs +0 -12
  286. package/dist/chunk-2VB6XU3I.mjs.map +0 -1
  287. package/dist/chunk-35TWSMYS.mjs +0 -19
  288. package/dist/chunk-35TWSMYS.mjs.map +0 -1
  289. package/dist/chunk-6ZCQ5ZMB.mjs +0 -13
  290. package/dist/chunk-6ZCQ5ZMB.mjs.map +0 -1
  291. package/dist/chunk-724PNXPR.mjs +0 -13
  292. package/dist/chunk-724PNXPR.mjs.map +0 -1
  293. package/dist/chunk-7GWOR247.mjs +0 -11
  294. package/dist/chunk-7GWOR247.mjs.map +0 -1
  295. package/dist/chunk-7KIXZNXS.mjs +0 -21
  296. package/dist/chunk-7KIXZNXS.mjs.map +0 -1
  297. package/dist/chunk-7OZZODAE.mjs +0 -19
  298. package/dist/chunk-7OZZODAE.mjs.map +0 -1
  299. package/dist/chunk-7PPND7QY.mjs +0 -16
  300. package/dist/chunk-7PPND7QY.mjs.map +0 -1
  301. package/dist/chunk-7SJHJHBN.mjs +0 -11
  302. package/dist/chunk-7SJHJHBN.mjs.map +0 -1
  303. package/dist/chunk-ARWKEQMQ.mjs +0 -19
  304. package/dist/chunk-ARWKEQMQ.mjs.map +0 -1
  305. package/dist/chunk-ARZ5BDR6.mjs +0 -1
  306. package/dist/chunk-ARZ5BDR6.mjs.map +0 -1
  307. package/dist/chunk-BAJC3BM7.mjs +0 -12
  308. package/dist/chunk-BAJC3BM7.mjs.map +0 -1
  309. package/dist/chunk-EAI6NLXI.mjs +0 -12
  310. package/dist/chunk-EAI6NLXI.mjs.map +0 -1
  311. package/dist/chunk-EJGAXTF7.mjs +0 -1
  312. package/dist/chunk-EJGAXTF7.mjs.map +0 -1
  313. package/dist/chunk-FUWEG5ZM.mjs +0 -9
  314. package/dist/chunk-FUWEG5ZM.mjs.map +0 -1
  315. package/dist/chunk-GJM7F3TH.mjs +0 -13
  316. package/dist/chunk-GJM7F3TH.mjs.map +0 -1
  317. package/dist/chunk-HQF6OFGM.mjs +0 -9
  318. package/dist/chunk-HQF6OFGM.mjs.map +0 -1
  319. package/dist/chunk-IJLQVGW4.mjs +0 -1
  320. package/dist/chunk-IJLQVGW4.mjs.map +0 -1
  321. package/dist/chunk-J3NTLMAE.mjs +0 -10
  322. package/dist/chunk-J3NTLMAE.mjs.map +0 -1
  323. package/dist/chunk-L4Y3G6AJ.mjs +0 -23
  324. package/dist/chunk-L4Y3G6AJ.mjs.map +0 -1
  325. package/dist/chunk-LAZNLIBJ.mjs +0 -10
  326. package/dist/chunk-LAZNLIBJ.mjs.map +0 -1
  327. package/dist/chunk-MAJSPFA6.mjs +0 -1
  328. package/dist/chunk-MAJSPFA6.mjs.map +0 -1
  329. package/dist/chunk-NEMQJ2GF.mjs +0 -18
  330. package/dist/chunk-NEMQJ2GF.mjs.map +0 -1
  331. package/dist/chunk-NK2262VG.mjs +0 -9
  332. package/dist/chunk-NK2262VG.mjs.map +0 -1
  333. package/dist/chunk-NSYWEYWT.mjs +0 -13
  334. package/dist/chunk-NSYWEYWT.mjs.map +0 -1
  335. package/dist/chunk-NYVT33DR.mjs +0 -9
  336. package/dist/chunk-NYVT33DR.mjs.map +0 -1
  337. package/dist/chunk-O3DWW7O5.mjs +0 -18
  338. package/dist/chunk-O3DWW7O5.mjs.map +0 -1
  339. package/dist/chunk-O5YJUO7P.mjs +0 -13
  340. package/dist/chunk-O5YJUO7P.mjs.map +0 -1
  341. package/dist/chunk-OBMK7JO2.mjs +0 -13
  342. package/dist/chunk-OBMK7JO2.mjs.map +0 -1
  343. package/dist/chunk-OF7HQYH4.mjs +0 -9
  344. package/dist/chunk-OF7HQYH4.mjs.map +0 -1
  345. package/dist/chunk-PTQLD7TG.mjs +0 -11
  346. package/dist/chunk-PTQLD7TG.mjs.map +0 -1
  347. package/dist/chunk-PWMHSN27.mjs +0 -14
  348. package/dist/chunk-PWMHSN27.mjs.map +0 -1
  349. package/dist/chunk-QRQPLMV4.mjs +0 -16
  350. package/dist/chunk-QRQPLMV4.mjs.map +0 -1
  351. package/dist/chunk-R5DNKXDI.mjs +0 -21
  352. package/dist/chunk-R5DNKXDI.mjs.map +0 -1
  353. package/dist/chunk-RK6PRCEJ.mjs +0 -12
  354. package/dist/chunk-RK6PRCEJ.mjs.map +0 -1
  355. package/dist/chunk-RLDY4N3Q.mjs +0 -13
  356. package/dist/chunk-RLDY4N3Q.mjs.map +0 -1
  357. package/dist/chunk-RU3RXBUC.mjs +0 -17
  358. package/dist/chunk-RU3RXBUC.mjs.map +0 -1
  359. package/dist/chunk-S767XFOS.mjs +0 -10
  360. package/dist/chunk-S767XFOS.mjs.map +0 -1
  361. package/dist/chunk-SGSQKXDO.mjs +0 -15
  362. package/dist/chunk-SGSQKXDO.mjs.map +0 -1
  363. package/dist/chunk-SYQTG4N4.mjs +0 -1
  364. package/dist/chunk-SYQTG4N4.mjs.map +0 -1
  365. package/dist/chunk-T5JCRGXA.mjs +0 -1
  366. package/dist/chunk-T5JCRGXA.mjs.map +0 -1
  367. package/dist/chunk-TOLR2FNF.mjs +0 -13
  368. package/dist/chunk-TOLR2FNF.mjs.map +0 -1
  369. package/dist/chunk-U42V7PZH.mjs +0 -9
  370. package/dist/chunk-U42V7PZH.mjs.map +0 -1
  371. package/dist/chunk-UNX3KZO2.mjs +0 -17
  372. package/dist/chunk-UNX3KZO2.mjs.map +0 -1
  373. package/dist/chunk-UZP4YX7I.mjs +0 -17
  374. package/dist/chunk-UZP4YX7I.mjs.map +0 -1
  375. package/dist/chunk-VACGGQOL.mjs +0 -9
  376. package/dist/chunk-VACGGQOL.mjs.map +0 -1
  377. package/dist/chunk-VAKCSKGR.mjs +0 -17
  378. package/dist/chunk-VAKCSKGR.mjs.map +0 -1
  379. package/dist/chunk-XAJYDHCM.mjs +0 -16
  380. package/dist/chunk-XAJYDHCM.mjs.map +0 -1
  381. package/dist/chunk-XW452I77.mjs +0 -16
  382. package/dist/chunk-XW452I77.mjs.map +0 -1
  383. package/dist/chunk-Z4IO7EIH.mjs +0 -16
  384. package/dist/chunk-Z4IO7EIH.mjs.map +0 -1
  385. package/dist/function/debounce.js +0 -47
  386. package/dist/function/debounce.js.map +0 -1
  387. package/dist/function/debounce.mjs +0 -8
  388. package/dist/function/debounce.mjs.map +0 -1
  389. package/dist/function/index.js.map +0 -1
  390. package/dist/function/index.mjs +0 -17
  391. package/dist/function/index.mjs.map +0 -1
  392. package/dist/function/once.js +0 -43
  393. package/dist/function/once.js.map +0 -1
  394. package/dist/function/once.mjs +0 -8
  395. package/dist/function/once.mjs.map +0 -1
  396. package/dist/function/throttle.js +0 -41
  397. package/dist/function/throttle.js.map +0 -1
  398. package/dist/function/throttle.mjs +0 -8
  399. package/dist/function/throttle.mjs.map +0 -1
  400. package/dist/index.js.map +0 -1
  401. package/dist/index.mjs +0 -190
  402. package/dist/index.mjs.map +0 -1
  403. package/dist/math/clamp.js +0 -36
  404. package/dist/math/clamp.js.map +0 -1
  405. package/dist/math/clamp.mjs +0 -8
  406. package/dist/math/clamp.mjs.map +0 -1
  407. package/dist/math/index.js.map +0 -1
  408. package/dist/math/index.mjs +0 -17
  409. package/dist/math/index.mjs.map +0 -1
  410. package/dist/math/round.js +0 -34
  411. package/dist/math/round.js.map +0 -1
  412. package/dist/math/round.mjs +0 -8
  413. package/dist/math/round.mjs.map +0 -1
  414. package/dist/math/sum.d.mts +0 -16
  415. package/dist/math/sum.js +0 -37
  416. package/dist/math/sum.js.map +0 -1
  417. package/dist/math/sum.mjs +0 -8
  418. package/dist/math/sum.mjs.map +0 -1
  419. package/dist/object/index.js.map +0 -1
  420. package/dist/object/index.mjs +0 -21
  421. package/dist/object/index.mjs.map +0 -1
  422. package/dist/object/omit.js +0 -51
  423. package/dist/object/omit.js.map +0 -1
  424. package/dist/object/omit.mjs +0 -8
  425. package/dist/object/omit.mjs.map +0 -1
  426. package/dist/object/omitBy.js +0 -40
  427. package/dist/object/omitBy.js.map +0 -1
  428. package/dist/object/omitBy.mjs +0 -8
  429. package/dist/object/omitBy.mjs.map +0 -1
  430. package/dist/object/pick.js +0 -37
  431. package/dist/object/pick.js.map +0 -1
  432. package/dist/object/pick.mjs +0 -8
  433. package/dist/object/pick.mjs.map +0 -1
  434. package/dist/object/pickBy.js +0 -40
  435. package/dist/object/pickBy.js.map +0 -1
  436. package/dist/object/pickBy.mjs +0 -8
  437. package/dist/object/pickBy.mjs.map +0 -1
  438. package/dist/predicate/index.js.map +0 -1
  439. package/dist/predicate/index.mjs +0 -21
  440. package/dist/predicate/index.mjs.map +0 -1
  441. package/dist/predicate/isNil.js +0 -33
  442. package/dist/predicate/isNil.js.map +0 -1
  443. package/dist/predicate/isNil.mjs +0 -8
  444. package/dist/predicate/isNil.mjs.map +0 -1
  445. package/dist/predicate/isNotNil.js +0 -33
  446. package/dist/predicate/isNotNil.js.map +0 -1
  447. package/dist/predicate/isNotNil.mjs +0 -8
  448. package/dist/predicate/isNotNil.mjs.map +0 -1
  449. package/dist/predicate/isNull.js +0 -33
  450. package/dist/predicate/isNull.js.map +0 -1
  451. package/dist/predicate/isNull.mjs +0 -8
  452. package/dist/predicate/isNull.mjs.map +0 -1
  453. package/dist/predicate/isUndefined.js +0 -33
  454. package/dist/predicate/isUndefined.js.map +0 -1
  455. package/dist/predicate/isUndefined.mjs +0 -8
  456. package/dist/predicate/isUndefined.mjs.map +0 -1
  457. package/dist/promise/delay.js +0 -35
  458. package/dist/promise/delay.js.map +0 -1
  459. package/dist/promise/delay.mjs +0 -8
  460. package/dist/promise/delay.mjs.map +0 -1
  461. package/dist/promise/index.js.map +0 -1
  462. package/dist/promise/index.mjs +0 -9
  463. package/dist/promise/index.mjs.map +0 -1
  464. /package/{dist/array/index.d.mts → esm/array/index.mjs} +0 -0
  465. /package/{dist/function/index.d.mts → esm/function/index.mjs} +0 -0
  466. /package/{dist/index.d.mts → esm/index.mjs} +0 -0
  467. /package/{dist/math/index.d.mts → esm/math/index.mjs} +0 -0
  468. /package/{dist/object/index.d.mts → esm/object/index.mjs} +0 -0
  469. /package/{dist/predicate/index.d.mts → esm/predicate/index.mjs} +0 -0
  470. /package/{dist/promise/index.d.mts → esm/promise/index.mjs} +0 -0
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/array/zipWith.ts
21
- var zipWith_exports = {};
22
- __export(zipWith_exports, {
23
- zipWith: () => zipWith
24
- });
25
- module.exports = __toCommonJS(zipWith_exports);
26
- function zipWith(arr1, ...rest) {
27
- const arrs = [arr1, ...rest.slice(0, -1)];
28
- const combine = rest[rest.length - 1];
29
- const result = [];
30
- const maxIndex = Math.max(...arrs.map((arr) => arr.length));
31
- for (let i = 0; i < maxIndex; i++) {
32
- const elements = arrs.map((arr) => arr[i]);
33
- result.push(combine(...elements));
34
- }
35
- return result;
36
- }
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- zipWith
40
- });
41
- //# sourceMappingURL=zipWith.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/array/zipWith.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array using a custom combiner function.\n * \n * This function takes multiple arrays and a combiner function, and returns a new array where each element \n * is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @param {T[]} arr1 - The first array to zip.\n * @param {U[]} [arr2] - The second array to zip (optional).\n * @param {V[]} [arr3] - The third array to zip (optional).\n * @param {W[]} [arr4] - The fourth array to zip (optional).\n * @param {function} combine - The combiner function that takes corresponding elements from each array and returns a single value.\n * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @example\n * // Example usage with two arrays:\n * const arr1 = [1, 2, 3];\n * const arr2 = [4, 5, 6];\n * const result = zipWith(arr1, arr2, (a, b) => a + b);\n * // result will be [5, 7, 9]\n *\n * @example\n * // Example usage with three arrays:\n * const arr1 = [1, 2];\n * const arr2 = [3, 4];\n * const arr3 = [5, 6];\n * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);\n * // result will be [`135`, `246`]\n */\nexport function zipWith<T, R>(arr1: T[], combine: (item: T) => R): R[];\nexport function zipWith<T, U, R>(arr1: T[], arr2: U[], combine: (item1: T, item2: U) => R): R[];\nexport function zipWith<T, U, V, R>(arr1: T[], arr2: U[], arr3: V[], combine: (item1: T, item2: U, item3: V) => R): R[];\nexport function zipWith<T, U, V, W, R>(arr1: T[], arr2: U[], arr3: V[], arr4: W[], combine: (item1: T, item2: U, item3: V, item4: W) => R): R[];\nexport function zipWith<T, R>(arr1: T[], ...rest: any[]): R[] {\n const arrs = [arr1, ...rest.slice(0, -1)];\n const combine = rest[rest.length - 1] as (...items: T[]) => R;\n\n const result: R[] = [];\n const maxIndex = Math.max(...arrs.map(arr => arr.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const elements: T[] = arrs.map(arr => arr[i]);\n result.push(combine(...elements));\n }\n\n return result;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCO,SAAS,QAAc,SAAc,MAAkB;AAC5D,QAAM,OAAO,CAAC,MAAM,GAAG,KAAK,MAAM,GAAG,EAAE,CAAC;AACxC,QAAM,UAAU,KAAK,KAAK,SAAS,CAAC;AAEpC,QAAM,SAAc,CAAC;AACrB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,SAAO,IAAI,MAAM,CAAC;AAExD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,WAAgB,KAAK,IAAI,SAAO,IAAI,CAAC,CAAC;AAC5C,WAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC;AAAA,EAClC;AAEA,SAAO;AACT;","names":[]}
@@ -1,8 +0,0 @@
1
- import {
2
- zipWith
3
- } from "../chunk-RU3RXBUC.mjs";
4
- import "../chunk-2MM5EJJX.mjs";
5
- export {
6
- zipWith
7
- };
8
- //# sourceMappingURL=zipWith.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,16 +0,0 @@
1
- // src/array/takeWhile.ts
2
- function takeWhile(arr, shouldContinueTaking) {
3
- const result = [];
4
- for (const item of arr) {
5
- if (!shouldContinueTaking(item)) {
6
- break;
7
- }
8
- result.push(item);
9
- }
10
- return result;
11
- }
12
-
13
- export {
14
- takeWhile
15
- };
16
- //# sourceMappingURL=chunk-2KXLTAVK.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/takeWhile.ts"],"sourcesContent":["/**\n * Returns a new array containing the leading elements of the provided array\n * that satisfy the provided predicate function. It stops taking elements as soon\n * as an element does not satisfy the predicate.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @param {(element: T) => boolean} shouldContinueTaking - The predicate function that is called with each element. Elements are included in the result as long as this function returns true.\n * @returns {T[]} A new array containing the leading elements that satisfy the predicate.\n *\n * @example\n * // Returns [1, 2]\n * takeWhile([1, 2, 3, 4], x => x < 3);\n *\n * @example\n * // Returns []\n * takeWhile([1, 2, 3, 4], x => x > 3);\n */\nexport function takeWhile<T>(arr: T[], shouldContinueTaking: (element: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n if (!shouldContinueTaking(item)) {\n break;\n }\n\n result.push(item);\n }\n\n return result;\n}"],"mappings":";AAkBO,SAAS,UAAa,KAAU,sBAAoD;AACzF,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,QAAI,CAAC,qBAAqB,IAAI,GAAG;AAC/B;AAAA,IACF;AAEA,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
@@ -1,21 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
-
18
- export {
19
- __spreadValues
20
- };
21
- //# sourceMappingURL=chunk-2MM5EJJX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,12 +0,0 @@
1
- // src/array/intersectionBy.ts
2
- function intersectionBy(firstArr, secondArr, mapper) {
3
- const mappedSecondArr = secondArr.map((x) => mapper(x));
4
- return firstArr.filter((item) => {
5
- return mappedSecondArr.includes(mapper(item));
6
- });
7
- }
8
-
9
- export {
10
- intersectionBy
11
- };
12
- //# sourceMappingURL=chunk-2VB6XU3I.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/intersectionBy.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays based on a mapping function.\n * \n * This function takes two arrays and a mapping function. It returns a new array containing \n * the elements from the first array that, when mapped using the provided function, have matching \n * mapped elements in the second array. It effectively filters out any elements from the first array \n * that do not have corresponding mapped values in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @param {(item: T) => U} mapper - A function to map the elements of both arrays for comparison.\n * @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = intersectionBy(array1, array2, mapper);\n * // result will be [{ id: 2 }] since only this element has a matching id in both arrays.\n */\nexport function intersectionBy<T, U>(firstArr: T[], secondArr: T[], mapper: (item: T) => U): T[] {\n const mappedSecondArr = secondArr.map(x => mapper(x));\n \n return firstArr.filter(item => {\n return mappedSecondArr.includes(mapper(item));\n })\n}"],"mappings":";AAoBO,SAAS,eAAqB,UAAe,WAAgB,QAA6B;AAC/F,QAAM,kBAAkB,UAAU,IAAI,OAAK,OAAO,CAAC,CAAC;AAEpD,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC9C,CAAC;AACH;","names":[]}
@@ -1,19 +0,0 @@
1
- // src/array/chunk.ts
2
- function chunk(arr, size) {
3
- if (!Number.isInteger(size) || size <= 0) {
4
- throw new Error("Size must be an integer greater than zero.");
5
- }
6
- const chunkLength = Math.ceil(arr.length / size);
7
- const result = Array(chunkLength);
8
- for (let index = 0; index < chunkLength; index++) {
9
- const start = index * size;
10
- const end = start + size;
11
- result[index] = arr.slice(start, end);
12
- }
13
- return result;
14
- }
15
-
16
- export {
17
- chunk
18
- };
19
- //# sourceMappingURL=chunk-35TWSMYS.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: T[], size: number): T[][] {\n if (!Number.isInteger(size) || size <= 0) {\n throw new Error('Size must be an integer greater than zero.');\n }\n\n const chunkLength = Math.ceil(arr.length / size);\n const result: T[][] = Array(chunkLength);\n\n for (let index = 0; index < chunkLength; index++) {\n const start = index * size;\n const end = start + size;\n \n result[index] = arr.slice(start, end);\n }\n\n return result;\n}\n"],"mappings":";AAuBO,SAAS,MAAS,KAAU,MAAqB;AACtD,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,QAAQ,GAAG;AACxC,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AAEA,QAAM,cAAc,KAAK,KAAK,IAAI,SAAS,IAAI;AAC/C,QAAM,SAAgB,MAAM,WAAW;AAEvC,WAAS,QAAQ,GAAG,QAAQ,aAAa,SAAS;AAChD,UAAM,QAAQ,QAAQ;AACtB,UAAM,MAAM,QAAQ;AAEpB,WAAO,KAAK,IAAI,IAAI,MAAM,OAAO,GAAG;AAAA,EACtC;AAEA,SAAO;AACT;","names":[]}
@@ -1,13 +0,0 @@
1
- import {
2
- uniqWith
3
- } from "./chunk-XAJYDHCM.mjs";
4
-
5
- // src/array/uniqBy.ts
6
- function uniqBy(arr, converter) {
7
- return uniqWith(arr, (item1, item2) => converter(item1) === converter(item2));
8
- }
9
-
10
- export {
11
- uniqBy
12
- };
13
- //# sourceMappingURL=chunk-6ZCQ5ZMB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/uniqBy.ts"],"sourcesContent":["import { uniq } from \"./uniq\";\nimport { uniqWith } from \"./uniqWith\";\n\n/**\n * The `uniqBy` function takes an array as its first argument and a 'converter' function as the second. It maps the array elements using the converter function, then removes any duplicates.\n *\n * It filters out elements with the same value, meaning it does not check for duplicates in data types like Objects.\n *\n * @example\n * ```ts\n * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);\n * // [1.2, 2.1, 3.3, 5.7, 7.19]\n * ```\n */\nexport function uniqBy<T, U>(arr: T[], converter: (item: T) => U): T[] {\n return uniqWith(arr, (item1, item2) => converter(item1) === converter(item2));\n}\n"],"mappings":";;;;;AAcO,SAAS,OAAa,KAAU,WAAgC;AACrE,SAAO,SAAS,KAAK,CAAC,OAAO,UAAU,UAAU,KAAK,MAAM,UAAU,KAAK,CAAC;AAC9E;","names":[]}
@@ -1,13 +0,0 @@
1
- // src/object/pick.ts
2
- function pick(obj, keys) {
3
- const result = {};
4
- for (const key of keys) {
5
- result[key] = obj[key];
6
- }
7
- return result;
8
- }
9
-
10
- export {
11
- pick
12
- };
13
- //# sourceMappingURL=chunk-724PNXPR.mjs.map
@@ -1 +0,0 @@
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, 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":";AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
@@ -1,11 +0,0 @@
1
- // src/array/intersection.ts
2
- function intersection(firstArr, secondArr) {
3
- return firstArr.filter((item) => {
4
- return secondArr.includes(item);
5
- });
6
- }
7
-
8
- export {
9
- intersection
10
- };
11
- //# sourceMappingURL=chunk-7GWOR247.mjs.map
@@ -1 +0,0 @@
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: T[], secondArr: T[]): T[] {\n return firstArr.filter(item => {\n return secondArr.includes(item);\n });\n}\n"],"mappings":";AAiBO,SAAS,aAAgB,UAAe,WAAqB;AAClE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,UAAU,SAAS,IAAI;AAAA,EAChC,CAAC;AACH;","names":[]}
@@ -1,21 +0,0 @@
1
- import {
2
- unionWith
3
- } from "./chunk-O5YJUO7P.mjs";
4
- import {
5
- intersectionWith
6
- } from "./chunk-GJM7F3TH.mjs";
7
- import {
8
- differenceWith
9
- } from "./chunk-NSYWEYWT.mjs";
10
-
11
- // src/array/xorWith.ts
12
- function xorWith(arr1, arr2, areElementsEqual) {
13
- const union = unionWith(arr1, arr2, areElementsEqual);
14
- const intersection = intersectionWith(arr1, arr2, areElementsEqual);
15
- return differenceWith(union, intersection, areElementsEqual);
16
- }
17
-
18
- export {
19
- xorWith
20
- };
21
- //# sourceMappingURL=chunk-7KIXZNXS.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/xorWith.ts"],"sourcesContent":["import { differenceWith } from \"./differenceWith\";\nimport { intersectionWith } from \"./intersectionWith\";\nimport { unionWith } from \"./unionWith\";\n\n/**\n * Computes the symmetric difference between two arrays using a custom equality function. \n * The symmetric difference is the set of elements which are in either of the arrays, \n * but not in their intersection.\n *\n * @template T - Type of elements in the input arrays.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function.\n * \n * @example\n * // Custom equality function for objects with an 'id' property\n * const areObjectsEqual = (a, b) => a.id === b.id;\n * xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual);\n * // Returns [{ id: 1 }, { id: 3 }]\n */\nexport function xorWith<T>(arr1: T[], arr2: T[], areElementsEqual: (item1: T, item2: T) => boolean): T[] {\n const union = unionWith(arr1, arr2, areElementsEqual);\n const intersection = intersectionWith(arr1, arr2, areElementsEqual);\n \n return differenceWith(union, intersection, areElementsEqual);\n}\n"],"mappings":";;;;;;;;;;;AAsBO,SAAS,QAAW,MAAW,MAAW,kBAAwD;AACvG,QAAM,QAAQ,UAAU,MAAM,MAAM,gBAAgB;AACpD,QAAM,eAAe,iBAAiB,MAAM,MAAM,gBAAgB;AAElE,SAAO,eAAe,OAAO,cAAc,gBAAgB;AAC7D;","names":[]}
@@ -1,19 +0,0 @@
1
- import {
2
- union
3
- } from "./chunk-RLDY4N3Q.mjs";
4
- import {
5
- intersection
6
- } from "./chunk-7GWOR247.mjs";
7
- import {
8
- difference
9
- } from "./chunk-PTQLD7TG.mjs";
10
-
11
- // src/array/xor.ts
12
- function xor(arr1, arr2) {
13
- return difference(union(arr1, arr2), intersection(arr1, arr2));
14
- }
15
-
16
- export {
17
- xor
18
- };
19
- //# sourceMappingURL=chunk-7OZZODAE.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/xor.ts"],"sourcesContent":["import { difference } from \"./difference\";\nimport { intersection } from \"./intersection\";\nimport { union } from \"./union\";\n\n/**\n * Computes the symmetric difference between two arrays. The symmetric difference is the set of elements\n * which are in either of the arrays, but not in their intersection.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both.\n * \n * @example\n * // Returns [1, 2, 5, 6]\n * xor([1, 2, 3, 4], [3, 4, 5, 6]);\n * \n * @example\n * // Returns ['a', 'c']\n * xor(['a', 'b'], ['b', 'c']);\n */\nexport function xor<T>(arr1: T[], arr2: T[]): T[] {\n return difference(union(arr1, arr2), intersection(arr1, arr2));\n}"],"mappings":";;;;;;;;;;;AAoBO,SAAS,IAAO,MAAW,MAAgB;AAChD,SAAO,WAAW,MAAM,MAAM,IAAI,GAAG,aAAa,MAAM,IAAI,CAAC;AAC/D;","names":[]}
@@ -1,16 +0,0 @@
1
- // src/array/unionBy.ts
2
- function unionBy(arr1, arr2, mapper) {
3
- const map = /* @__PURE__ */ new Map();
4
- for (const item of [...arr1, ...arr2]) {
5
- const key = mapper(item);
6
- if (!map.has(key)) {
7
- map.set(key, item);
8
- }
9
- }
10
- return [...map.values()];
11
- }
12
-
13
- export {
14
- unionBy
15
- };
16
- //# sourceMappingURL=chunk-7PPND7QY.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/unionBy.ts"],"sourcesContent":["/**\n * Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {function(item: T): U} mapper - The function to map array elements to comparison values.\n * @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function.\n * \n * @example\n * // Custom mapping function for numbers (modulo comparison)\n * const moduloMapper = (x) => x % 3;\n * unionBy([1, 2, 3], [4, 5, 6], moduloMapper);\n * // Returns [1, 2, 3]\n * \n * @example\n * // Custom mapping function for objects with an 'id' property\n * const idMapper = (obj) => obj.id;\n * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);\n * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }]\n */\nexport function unionBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[] {\n const map = new Map<U, T>();\n\n for (const item of [...arr1, ...arr2]) {\n const key = mapper(item);\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return [...map.values()];\n}\n"],"mappings":";AAoBO,SAAS,QAAc,MAAW,MAAW,QAA6B;AAC/E,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG;AACrC,UAAM,MAAM,OAAO,IAAI;AACvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,IAAI,OAAO,CAAC;AACzB;","names":[]}
@@ -1,11 +0,0 @@
1
- // src/promise/delay.ts
2
- function delay(ms) {
3
- return new Promise((resolve) => {
4
- setTimeout(resolve, ms);
5
- });
6
- }
7
-
8
- export {
9
- delay
10
- };
11
- //# sourceMappingURL=chunk-7SJHJHBN.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/promise/delay.ts"],"sourcesContent":["/**\n * Delays the execution of code for a specified number of milliseconds.\n * \n * This function returns a Promise that resolves after the specified delay, allowing you to use it \n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n * \n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";AAkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
@@ -1,19 +0,0 @@
1
- // src/function/once.ts
2
- function once(func) {
3
- let called = false;
4
- let cache;
5
- return function() {
6
- if (called) {
7
- return cache;
8
- }
9
- const result = func();
10
- called = true;
11
- cache = result;
12
- return result;
13
- };
14
- }
15
-
16
- export {
17
- once
18
- };
19
- //# sourceMappingURL=chunk-ARWKEQMQ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/function/once.ts"],"sourcesContent":["/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n * \n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n"],"mappings":";AAgBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-ARZ5BDR6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,12 +0,0 @@
1
- // src/array/takeRight.ts
2
- function takeRight(arr, count) {
3
- if (count === 0) {
4
- return [];
5
- }
6
- return arr.slice(-count);
7
- }
8
-
9
- export {
10
- takeRight
11
- };
12
- //# sourceMappingURL=chunk-BAJC3BM7.mjs.map
@@ -1 +0,0 @@
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: T[], count: number): T[] {\n if (count === 0) {\n return [];\n }\n\n return arr.slice(-count);\n}"],"mappings":";AAoBO,SAAS,UAAa,KAAU,OAAoB;AACzD,MAAI,UAAU,GAAG;AACf,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,IAAI,MAAM,CAAC,KAAK;AACzB;","names":[]}
@@ -1,12 +0,0 @@
1
- // src/array/differenceBy.ts
2
- function differenceBy(firstArr, secondArr, mapper) {
3
- const mappedSecondArr = secondArr.map((item) => mapper(item));
4
- return firstArr.filter((item) => {
5
- return !mappedSecondArr.includes(mapper(item));
6
- });
7
- }
8
-
9
- export {
10
- differenceBy
11
- };
12
- //# sourceMappingURL=chunk-EAI6NLXI.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/differenceBy.ts"],"sourcesContent":["/**\n * Computes the difference between two arrays after mapping their elements through a provided function.\n * \n * This function takes two arrays and a mapper function. It returns a new array containing the elements \n * that are present in the first array but not in the second array, based on the identity calculated \n * by the mapper function. \n * \n * Essentially, it filters out any elements from the first array that, when \n * mapped, match an element in the mapped version of the second array.\n *\n * @template T, U\n * @param {T[]} firstArr - The primary array from which to derive the difference. \n * @param {T[]} secondArr - The array containing elements to be excluded from the first array.\n * @param {(value: T) => U} mapper - The function to map the elements of both arrays. This function \n * is applied to each element in both arrays, and the comparison is made based on the mapped values.\n * @returns {T[]} A new array containing the elements from the first array that do not have a corresponding \n * mapped identity in the second array.\n *\n * @example\n * * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = differenceBy(array1, array2, mapper);\n * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.\n */\nexport function differenceBy<T, U>(firstArr: T[], secondArr: T[], mapper: (value: T) => U): T[] {\n const mappedSecondArr = secondArr.map(item => mapper(item));\n \n return firstArr.filter(item => {\n return !mappedSecondArr.includes(mapper(item));\n });\n}"],"mappings":";AAyBO,SAAS,aAAmB,UAAe,WAAgB,QAA8B;AAC9F,QAAM,kBAAkB,UAAU,IAAI,UAAQ,OAAO,IAAI,CAAC;AAE1D,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC/C,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-EJGAXTF7.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,9 +0,0 @@
1
- // src/predicate/isNull.ts
2
- function isNull(x) {
3
- return x === null;
4
- }
5
-
6
- export {
7
- isNull
8
- };
9
- //# sourceMappingURL=chunk-FUWEG5ZM.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/predicate/isNull.ts"],"sourcesContent":["/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`. \n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n * \n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * \n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n"],"mappings":";AAoBO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;","names":[]}
@@ -1,13 +0,0 @@
1
- // src/array/intersectionWith.ts
2
- function intersectionWith(firstArr, secondArr, areItemsEqual) {
3
- return firstArr.filter((firstItem) => {
4
- return secondArr.some((secondItem) => {
5
- return areItemsEqual(firstItem, secondItem);
6
- });
7
- });
8
- }
9
-
10
- export {
11
- intersectionWith
12
- };
13
- //# sourceMappingURL=chunk-GJM7F3TH.mjs.map
@@ -1 +0,0 @@
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>(firstArr: T[], secondArr: T[], areItemsEqual: (x: T, y: T) => boolean): T[] {\n return firstArr.filter(firstItem => {\n return secondArr.some(secondItem => {\n return areItemsEqual(firstItem, secondItem);\n });\n });\n}\n"],"mappings":";AAqBO,SAAS,iBAAoB,UAAe,WAAgB,eAA6C;AAC9G,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,KAAK,gBAAc;AAClC,aAAO,cAAc,WAAW,UAAU;AAAA,IAC5C,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
@@ -1,9 +0,0 @@
1
- // src/array/take.ts
2
- function take(arr, count) {
3
- return arr.slice(0, count);
4
- }
5
-
6
- export {
7
- take
8
- };
9
- //# sourceMappingURL=chunk-HQF6OFGM.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/take.ts"],"sourcesContent":["/**\n * Returns a new array containing the first `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 - Type of elements in the input array.\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 first `count` elements from `arr`.\n * \n * @example\n * // Returns [1, 2, 3]\n * take([1, 2, 3, 4, 5], 3);\n * \n * @example\n * // Returns ['a', 'b']\n * take(['a', 'b', 'c'], 2);\n * \n * @example\n * // Returns [1, 2, 3]\n * take([1, 2, 3], 5);\n */\nexport function take<T>(arr: T[], count: number) {\n return arr.slice(0, count);\n}"],"mappings":";AAsBO,SAAS,KAAQ,KAAU,OAAe;AAC/C,SAAO,IAAI,MAAM,GAAG,KAAK;AAC3B;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-IJLQVGW4.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,10 +0,0 @@
1
- // src/array/sample.ts
2
- function sample(arr) {
3
- const randomIndex = Math.floor(Math.random() * arr.length);
4
- return arr[randomIndex];
5
- }
6
-
7
- export {
8
- sample
9
- };
10
- //# sourceMappingURL=chunk-J3NTLMAE.mjs.map
@@ -1 +0,0 @@
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: T[]): T {\n const randomIndex = Math.floor(Math.random() * arr.length);\n return arr[randomIndex];\n}\n"],"mappings":";AAaO,SAAS,OAAU,KAAa;AACrC,QAAM,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,MAAM;AACzD,SAAO,IAAI,WAAW;AACxB;","names":[]}
@@ -1,23 +0,0 @@
1
- // src/function/debounce.ts
2
- function debounce(func, debounceMs) {
3
- let timeoutId = null;
4
- const debounced = function() {
5
- if (timeoutId != null) {
6
- clearTimeout(timeoutId);
7
- }
8
- timeoutId = setTimeout(() => {
9
- func();
10
- }, debounceMs);
11
- };
12
- debounced.cancel = function() {
13
- if (timeoutId != null) {
14
- clearTimeout(timeoutId);
15
- }
16
- };
17
- return debounced;
18
- }
19
-
20
- export {
21
- debounce
22
- };
23
- //# sourceMappingURL=chunk-L4Y3G6AJ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/function/debounce.ts"],"sourcesContent":["/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @param {() => void} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @returns {{ (): void; cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n * \n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n */\nexport function debounce(func: () => void, debounceMs: number): { (): void; cancel: () => void } {\n let timeoutId: number | NodeJS.Timeout | null = null;\n\n const debounced = function () {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n \n \n timeoutId = setTimeout(() => {\n func();\n }, debounceMs);\n };\n\n debounced.cancel = function () {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n } \n\n return debounced;\n}"],"mappings":";AAoBO,SAAS,SAAS,MAAkB,YAAsD;AAC/F,MAAI,YAA4C;AAEhD,QAAM,YAAY,WAAY;AAC5B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAGA,gBAAY,WAAW,MAAM;AAC3B,WAAK;AAAA,IACP,GAAG,UAAU;AAAA,EACf;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1,10 +0,0 @@
1
- // src/math/round.ts
2
- function round(value, precision = 0) {
3
- const multiplier = Math.pow(10, precision);
4
- return Math.round(value * multiplier) / multiplier;
5
- }
6
-
7
- export {
8
- round
9
- };
10
- //# sourceMappingURL=chunk-LAZNLIBJ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/math/round.ts"],"sourcesContent":["/**\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 *\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 */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";AAeO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-MAJSPFA6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,18 +0,0 @@
1
- // src/array/partition.ts
2
- function partition(arr, isInTruthy) {
3
- const truthy = [];
4
- const falsy = [];
5
- for (const item of arr) {
6
- if (isInTruthy(item)) {
7
- truthy.push(item);
8
- } else {
9
- falsy.push(item);
10
- }
11
- }
12
- return [truthy, falsy];
13
- }
14
-
15
- export {
16
- partition
17
- };
18
- //# sourceMappingURL=chunk-NEMQJ2GF.mjs.map
@@ -1 +0,0 @@
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: 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":";AAqBO,SAAS,UAAa,KAAU,YAA8D;AACnG,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,9 +0,0 @@
1
- // src/predicate/isUndefined.ts
2
- function isUndefined(x) {
3
- return x === void 0;
4
- }
5
-
6
- export {
7
- isUndefined
8
- };
9
- //# sourceMappingURL=chunk-NK2262VG.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/predicate/isUndefined.ts"],"sourcesContent":["/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`. \n * It returns `true` if the value is `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n * \n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";AAoBO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
@@ -1,13 +0,0 @@
1
- // src/array/differenceWith.ts
2
- function differenceWith(firstArr, secondArr, areItemsEqual) {
3
- return firstArr.filter((firstItem) => {
4
- return secondArr.every((secondItem) => {
5
- return !areItemsEqual(firstItem, secondItem);
6
- });
7
- });
8
- }
9
-
10
- export {
11
- differenceWith
12
- };
13
- //# sourceMappingURL=chunk-NSYWEYWT.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/differenceWith.ts"],"sourcesContent":["/**\n * Computes the difference between two arrays based on a custom equality function.\n * \n * This function takes two arrays and a custom comparison function. It returns a new array containing \n * the elements that are present in the first array but not in the second array. The comparison to determine \n * if elements are equal is made using the provided custom function.\n *\n * @template T\n * @param {T[]} firstArr - The array from which to get the difference.\n * @param {T[]} secondArr - The array containing elements to exclude from the first array. \n * @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal.\n * @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array \n * according to the custom equality function.\n *\n * @example\n * * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = differenceWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.\n */\nexport function differenceWith<T>(firstArr: T[], secondArr: T[], areItemsEqual: (x: T, y: T) => boolean): T[] {\n return firstArr.filter(firstItem => {\n return secondArr.every(secondItem => {\n return !areItemsEqual(firstItem, secondItem);\n });\n });\n}\n"],"mappings":";AAqBO,SAAS,eAAkB,UAAe,WAAgB,eAA6C;AAC5G,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,MAAM,gBAAc;AACnC,aAAO,CAAC,cAAc,WAAW,UAAU;AAAA,IAC7C,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
@@ -1,9 +0,0 @@
1
- // src/array/drop.ts
2
- function drop(arr, itemsCount) {
3
- return arr.slice(itemsCount);
4
- }
5
-
6
- export {
7
- drop
8
- };
9
- //# sourceMappingURL=chunk-NYVT33DR.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/drop.ts"],"sourcesContent":["/**\n * Removes a specified number of elements from the beginning of an array and returns the rest.\n * \n * This function takes an array and a number, and returns a new array with the specified number \n * of elements removed from the start.\n *\n * @param {T[]} arr - The array from which to drop elements.\n * @param {number} itemsCount - The number of elements to drop from the beginning of the array.\n * @returns {T[]} A new array with the specified number of elements removed from the start.\n * \n * @example\n * * const array = [1, 2, 3, 4, 5];\n * const result = drop(array, 2);\n * // result will be [3, 4, 5] since the first two elements are dropped.\n */\nexport function drop<T>(arr: T[], itemsCount: number): T[] {\n return arr.slice(itemsCount);\n}"],"mappings":";AAeO,SAAS,KAAQ,KAAU,YAAyB;AACzD,SAAO,IAAI,MAAM,UAAU;AAC7B;","names":[]}
@@ -1,18 +0,0 @@
1
- // src/array/zip.ts
2
- function zip(...arrs) {
3
- const result = [];
4
- const maxIndex = Math.max(...arrs.map((x) => x.length));
5
- for (let i = 0; i < maxIndex; i++) {
6
- const element = [];
7
- for (const arr of arrs) {
8
- element.push(arr[i]);
9
- }
10
- result.push(element);
11
- }
12
- return result;
13
- }
14
-
15
- export {
16
- zip
17
- };
18
- //# sourceMappingURL=chunk-O3DWW7O5.mjs.map