es-toolkit 1.0.3 → 1.0.4-dev.41

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 (472) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +0 -1
  3. package/{esm/array/chunk.mjs → dist/array/chunk.d.mts} +1 -13
  4. package/dist/array/chunk.d.ts +3 -1
  5. package/dist/array/chunk.js +43 -0
  6. package/dist/array/chunk.js.map +1 -0
  7. package/dist/array/chunk.mjs +8 -0
  8. package/dist/array/chunk.mjs.map +1 -0
  9. package/{esm/array/difference.mjs → dist/array/difference.d.mts} +8 -12
  10. package/dist/array/difference.d.ts +3 -1
  11. package/dist/array/difference.js +35 -0
  12. package/dist/array/difference.js.map +1 -0
  13. package/dist/array/difference.mjs +8 -0
  14. package/dist/array/difference.mjs.map +1 -0
  15. package/{esm/array/differenceBy.mjs → dist/array/differenceBy.d.mts} +10 -17
  16. package/dist/array/differenceBy.d.ts +3 -1
  17. package/dist/array/differenceBy.js +36 -0
  18. package/dist/array/differenceBy.js.map +1 -0
  19. package/dist/array/differenceBy.mjs +8 -0
  20. package/dist/array/differenceBy.mjs.map +1 -0
  21. package/{esm/array/differenceWith.mjs → dist/array/differenceWith.d.mts} +6 -12
  22. package/dist/array/differenceWith.d.ts +3 -1
  23. package/dist/array/differenceWith.js +37 -0
  24. package/dist/array/differenceWith.js.map +1 -0
  25. package/dist/array/differenceWith.mjs +8 -0
  26. package/dist/array/differenceWith.mjs.map +1 -0
  27. package/{esm/array/drop.mjs → dist/array/drop.d.mts} +4 -6
  28. package/dist/array/drop.d.ts +3 -1
  29. package/dist/array/drop.js +33 -0
  30. package/dist/array/drop.js.map +1 -0
  31. package/dist/array/drop.mjs +8 -0
  32. package/dist/array/drop.mjs.map +1 -0
  33. package/{esm/array/dropRight.mjs → dist/array/dropRight.d.mts} +3 -5
  34. package/dist/array/dropRight.d.ts +3 -1
  35. package/dist/array/dropRight.js +33 -0
  36. package/dist/array/dropRight.js.map +1 -0
  37. package/dist/array/dropRight.mjs +8 -0
  38. package/dist/array/dropRight.mjs.map +1 -0
  39. package/{esm/array/dropRightWhile.mjs → dist/array/dropRightWhile.d.mts} +5 -11
  40. package/dist/array/dropRightWhile.d.ts +3 -1
  41. package/dist/array/dropRightWhile.js +43 -0
  42. package/dist/array/dropRightWhile.js.map +1 -0
  43. package/dist/array/dropRightWhile.mjs +9 -0
  44. package/dist/array/dropRightWhile.mjs.map +1 -0
  45. package/{esm/array/dropWhile.mjs → dist/array/dropWhile.d.mts} +5 -10
  46. package/dist/array/dropWhile.d.ts +3 -1
  47. package/dist/array/dropWhile.js +34 -0
  48. package/dist/array/dropWhile.js.map +1 -0
  49. package/dist/array/dropWhile.mjs +8 -0
  50. package/dist/array/dropWhile.mjs.map +1 -0
  51. package/{esm/array/groupBy.mjs → dist/array/groupBy.d.mts} +5 -26
  52. package/dist/array/groupBy.d.ts +3 -1
  53. package/dist/array/groupBy.js +41 -0
  54. package/dist/array/groupBy.js.map +1 -0
  55. package/dist/array/groupBy.mjs +8 -0
  56. package/dist/array/groupBy.mjs.map +1 -0
  57. package/dist/array/index.d.ts +30 -30
  58. package/dist/array/index.js +199 -842
  59. package/dist/array/index.js.map +1 -0
  60. package/dist/array/index.mjs +125 -0
  61. package/dist/array/index.mjs.map +1 -0
  62. package/{esm/array/intersection.mjs → dist/array/intersection.d.mts} +4 -8
  63. package/dist/array/intersection.d.ts +3 -1
  64. package/dist/array/intersection.js +35 -0
  65. package/dist/array/intersection.js.map +1 -0
  66. package/dist/array/intersection.mjs +8 -0
  67. package/dist/array/intersection.mjs.map +1 -0
  68. package/{esm/array/intersectionBy.mjs → dist/array/intersectionBy.d.mts} +5 -12
  69. package/dist/array/intersectionBy.d.ts +3 -1
  70. package/dist/array/intersectionBy.js +36 -0
  71. package/dist/array/intersectionBy.js.map +1 -0
  72. package/dist/array/intersectionBy.mjs +8 -0
  73. package/dist/array/intersectionBy.mjs.map +1 -0
  74. package/{esm/array/intersectionWith.mjs → dist/array/intersectionWith.d.mts} +6 -12
  75. package/dist/array/intersectionWith.d.ts +3 -1
  76. package/dist/array/intersectionWith.js +37 -0
  77. package/dist/array/intersectionWith.js.map +1 -0
  78. package/dist/array/intersectionWith.mjs +8 -0
  79. package/dist/array/intersectionWith.mjs.map +1 -0
  80. package/{esm/array/partition.mjs → dist/array/partition.d.mts} +8 -30
  81. package/dist/array/partition.d.ts +3 -1
  82. package/dist/array/partition.js +42 -0
  83. package/dist/array/partition.js.map +1 -0
  84. package/dist/array/partition.mjs +8 -0
  85. package/dist/array/partition.mjs.map +1 -0
  86. package/{esm/array/sample.mjs → dist/array/sample.d.mts} +2 -5
  87. package/dist/array/sample.d.ts +3 -1
  88. package/dist/array/sample.js +34 -0
  89. package/dist/array/sample.js.map +1 -0
  90. package/dist/array/sample.mjs +8 -0
  91. package/dist/array/sample.mjs.map +1 -0
  92. package/{esm/array/shuffle.mjs → dist/array/shuffle.d.mts} +2 -13
  93. package/dist/array/shuffle.d.ts +3 -1
  94. package/dist/array/shuffle.js +37 -0
  95. package/dist/array/shuffle.js.map +1 -0
  96. package/dist/array/shuffle.mjs +8 -0
  97. package/dist/array/shuffle.mjs.map +1 -0
  98. package/{esm/array/take.mjs → dist/array/take.d.mts} +5 -7
  99. package/dist/array/take.d.ts +3 -1
  100. package/dist/array/take.js +33 -0
  101. package/dist/array/take.js.map +1 -0
  102. package/dist/array/take.mjs +8 -0
  103. package/dist/array/take.mjs.map +1 -0
  104. package/{esm/array/takeRight.mjs → dist/array/takeRight.d.mts} +5 -10
  105. package/dist/array/takeRight.d.ts +3 -1
  106. package/dist/array/takeRight.js +36 -0
  107. package/dist/array/takeRight.js.map +1 -0
  108. package/dist/array/takeRight.mjs +8 -0
  109. package/dist/array/takeRight.mjs.map +1 -0
  110. package/{esm/array/takeRightWhile.mjs → dist/array/takeRightWhile.d.mts} +5 -12
  111. package/dist/array/takeRightWhile.d.ts +3 -1
  112. package/dist/array/takeRightWhile.js +38 -0
  113. package/dist/array/takeRightWhile.js.map +1 -0
  114. package/dist/array/takeRightWhile.mjs +8 -0
  115. package/dist/array/takeRightWhile.mjs.map +1 -0
  116. package/{esm/array/takeWhile.mjs → dist/array/takeWhile.d.mts} +1 -21
  117. package/dist/array/takeWhile.d.ts +3 -1
  118. package/dist/array/takeWhile.js +40 -0
  119. package/dist/array/takeWhile.js.map +1 -0
  120. package/dist/array/takeWhile.mjs +8 -0
  121. package/dist/array/takeWhile.mjs.map +1 -0
  122. package/{esm/array/union.mjs → dist/array/union.d.mts} +3 -7
  123. package/dist/array/union.d.ts +3 -1
  124. package/dist/array/union.js +47 -0
  125. package/dist/array/union.js.map +1 -0
  126. package/dist/array/union.mjs +9 -0
  127. package/dist/array/union.mjs.map +1 -0
  128. package/{esm/array/unionBy.mjs → dist/array/unionBy.d.mts} +4 -16
  129. package/dist/array/unionBy.d.ts +3 -1
  130. package/dist/array/unionBy.js +40 -0
  131. package/dist/array/unionBy.js.map +1 -0
  132. package/dist/array/unionBy.mjs +8 -0
  133. package/dist/array/unionBy.mjs.map +1 -0
  134. package/{esm/array/unionWith.mjs → dist/array/unionWith.d.mts} +4 -8
  135. package/dist/array/unionWith.d.ts +3 -1
  136. package/dist/array/unionWith.js +47 -0
  137. package/dist/array/unionWith.js.map +1 -0
  138. package/dist/array/unionWith.mjs +9 -0
  139. package/dist/array/unionWith.mjs.map +1 -0
  140. package/dist/array/uniq.d.mts +17 -0
  141. package/dist/array/uniq.d.ts +3 -1
  142. package/dist/array/uniq.js +40 -0
  143. package/dist/array/uniq.js.map +1 -0
  144. package/dist/array/uniq.mjs +8 -0
  145. package/dist/array/uniq.mjs.map +1 -0
  146. package/{esm/array/uniqBy.mjs → dist/array/uniqBy.d.mts} +1 -7
  147. package/dist/array/uniqBy.d.ts +3 -1
  148. package/dist/array/uniqBy.js +47 -0
  149. package/dist/array/uniqBy.js.map +1 -0
  150. package/dist/array/uniqBy.mjs +9 -0
  151. package/dist/array/uniqBy.mjs.map +1 -0
  152. package/dist/array/uniqWith.d.mts +14 -0
  153. package/dist/array/uniqWith.d.ts +3 -1
  154. package/dist/array/uniqWith.js +40 -0
  155. package/dist/array/uniqWith.js.map +1 -0
  156. package/dist/array/uniqWith.mjs +8 -0
  157. package/dist/array/uniqWith.mjs.map +1 -0
  158. package/{esm/array/xor.mjs → dist/array/xor.d.mts} +4 -10
  159. package/dist/array/xor.d.ts +3 -1
  160. package/dist/array/xor.js +66 -0
  161. package/dist/array/xor.js.map +1 -0
  162. package/dist/array/xor.mjs +12 -0
  163. package/dist/array/xor.mjs.map +1 -0
  164. package/{esm/array/xorBy.mjs → dist/array/xorBy.d.mts} +5 -13
  165. package/dist/array/xorBy.d.ts +3 -1
  166. package/dist/array/xorBy.js +65 -0
  167. package/dist/array/xorBy.js.map +1 -0
  168. package/dist/array/xorBy.mjs +11 -0
  169. package/dist/array/xorBy.mjs.map +1 -0
  170. package/{esm/array/xorWith.mjs → dist/array/xorWith.d.mts} +5 -13
  171. package/dist/array/xorWith.d.ts +3 -1
  172. package/dist/array/xorWith.js +72 -0
  173. package/dist/array/xorWith.js.map +1 -0
  174. package/dist/array/xorWith.mjs +12 -0
  175. package/dist/array/xorWith.mjs.map +1 -0
  176. package/dist/array/zip.d.mts +27 -0
  177. package/dist/array/zip.d.ts +6 -4
  178. package/dist/array/zip.js +42 -0
  179. package/dist/array/zip.js.map +1 -0
  180. package/dist/array/zip.mjs +8 -0
  181. package/dist/array/zip.mjs.map +1 -0
  182. package/{esm/array/zipWith.mjs → dist/array/zipWith.d.mts} +6 -26
  183. package/dist/array/zipWith.d.ts +6 -4
  184. package/dist/array/zipWith.js +41 -0
  185. package/dist/array/zipWith.js.map +1 -0
  186. package/dist/array/zipWith.mjs +8 -0
  187. package/dist/array/zipWith.mjs.map +1 -0
  188. package/dist/chunk-23DC774L.mjs +13 -0
  189. package/dist/chunk-23DC774L.mjs.map +1 -0
  190. package/dist/chunk-2MM5EJJX.mjs +21 -0
  191. package/dist/chunk-2MM5EJJX.mjs.map +1 -0
  192. package/dist/chunk-2PB2OCC6.mjs +11 -0
  193. package/dist/chunk-2PB2OCC6.mjs.map +1 -0
  194. package/dist/chunk-3PFYAKOD.mjs +10 -0
  195. package/dist/chunk-3PFYAKOD.mjs.map +1 -0
  196. package/dist/chunk-4USR24DP.mjs +23 -0
  197. package/dist/chunk-4USR24DP.mjs.map +1 -0
  198. package/dist/chunk-6BCRFIEW.mjs +9 -0
  199. package/dist/chunk-6BCRFIEW.mjs.map +1 -0
  200. package/dist/chunk-6GRNTXI3.mjs +9 -0
  201. package/dist/chunk-6GRNTXI3.mjs.map +1 -0
  202. package/dist/chunk-6LDIBBWQ.mjs +15 -0
  203. package/dist/chunk-6LDIBBWQ.mjs.map +1 -0
  204. package/dist/chunk-7LAOIS6P.mjs +13 -0
  205. package/dist/chunk-7LAOIS6P.mjs.map +1 -0
  206. package/dist/chunk-AFYV2UVZ.mjs +13 -0
  207. package/dist/chunk-AFYV2UVZ.mjs.map +1 -0
  208. package/dist/chunk-ANJSX6WH.mjs +12 -0
  209. package/dist/chunk-ANJSX6WH.mjs.map +1 -0
  210. package/dist/chunk-ARZ5BDR6.mjs +1 -0
  211. package/dist/chunk-ARZ5BDR6.mjs.map +1 -0
  212. package/dist/chunk-B5P232BA.mjs +13 -0
  213. package/dist/chunk-B5P232BA.mjs.map +1 -0
  214. package/dist/chunk-EJGAXTF7.mjs +1 -0
  215. package/dist/chunk-EJGAXTF7.mjs.map +1 -0
  216. package/dist/chunk-GLAZTR32.mjs +13 -0
  217. package/dist/chunk-GLAZTR32.mjs.map +1 -0
  218. package/dist/chunk-HOQRMBSB.mjs +9 -0
  219. package/dist/chunk-HOQRMBSB.mjs.map +1 -0
  220. package/dist/chunk-IFCX35BI.mjs +14 -0
  221. package/dist/chunk-IFCX35BI.mjs.map +1 -0
  222. package/dist/chunk-IJLQVGW4.mjs +1 -0
  223. package/dist/chunk-IJLQVGW4.mjs.map +1 -0
  224. package/dist/chunk-J6SWM4X6.mjs +17 -0
  225. package/dist/chunk-J6SWM4X6.mjs.map +1 -0
  226. package/dist/chunk-JDMFIUGM.mjs +16 -0
  227. package/dist/chunk-JDMFIUGM.mjs.map +1 -0
  228. package/dist/chunk-KBJTBR5T.mjs +9 -0
  229. package/dist/chunk-KBJTBR5T.mjs.map +1 -0
  230. package/dist/chunk-L25VRQ54.mjs +18 -0
  231. package/dist/chunk-L25VRQ54.mjs.map +1 -0
  232. package/dist/chunk-L3C6TG2V.mjs +12 -0
  233. package/dist/chunk-L3C6TG2V.mjs.map +1 -0
  234. package/dist/chunk-LLOAPSQ6.mjs +16 -0
  235. package/dist/chunk-LLOAPSQ6.mjs.map +1 -0
  236. package/dist/chunk-M3SHJ3LL.mjs +13 -0
  237. package/dist/chunk-M3SHJ3LL.mjs.map +1 -0
  238. package/dist/chunk-MAJSPFA6.mjs +1 -0
  239. package/dist/chunk-MAJSPFA6.mjs.map +1 -0
  240. package/dist/chunk-MQZ5D4IU.mjs +17 -0
  241. package/dist/chunk-MQZ5D4IU.mjs.map +1 -0
  242. package/dist/chunk-OLBUAFBX.mjs +9 -0
  243. package/dist/chunk-OLBUAFBX.mjs.map +1 -0
  244. package/dist/chunk-OS5PZ4B4.mjs +19 -0
  245. package/dist/chunk-OS5PZ4B4.mjs.map +1 -0
  246. package/dist/chunk-PHG5JCSW.mjs +10 -0
  247. package/dist/chunk-PHG5JCSW.mjs.map +1 -0
  248. package/dist/chunk-PRTIPC5X.mjs +17 -0
  249. package/dist/chunk-PRTIPC5X.mjs.map +1 -0
  250. package/dist/chunk-PUQLVKMB.mjs +12 -0
  251. package/dist/chunk-PUQLVKMB.mjs.map +1 -0
  252. package/dist/chunk-QC3SFAQJ.mjs +19 -0
  253. package/dist/chunk-QC3SFAQJ.mjs.map +1 -0
  254. package/dist/chunk-RK6PRCEJ.mjs +12 -0
  255. package/dist/chunk-RK6PRCEJ.mjs.map +1 -0
  256. package/dist/chunk-SF3V7XXM.mjs +16 -0
  257. package/dist/chunk-SF3V7XXM.mjs.map +1 -0
  258. package/dist/chunk-SPLO5OZW.mjs +16 -0
  259. package/dist/chunk-SPLO5OZW.mjs.map +1 -0
  260. package/dist/chunk-SQOYF647.mjs +16 -0
  261. package/dist/chunk-SQOYF647.mjs.map +1 -0
  262. package/dist/chunk-SYQTG4N4.mjs +1 -0
  263. package/dist/chunk-SYQTG4N4.mjs.map +1 -0
  264. package/dist/chunk-T2C2WVFL.mjs +16 -0
  265. package/dist/chunk-T2C2WVFL.mjs.map +1 -0
  266. package/dist/chunk-T5JCRGXA.mjs +1 -0
  267. package/dist/chunk-T5JCRGXA.mjs.map +1 -0
  268. package/dist/chunk-TCHT4HCP.mjs +21 -0
  269. package/dist/chunk-TCHT4HCP.mjs.map +1 -0
  270. package/dist/chunk-TF6N37OE.mjs +18 -0
  271. package/dist/chunk-TF6N37OE.mjs.map +1 -0
  272. package/dist/chunk-TK2EDHSP.mjs +13 -0
  273. package/dist/chunk-TK2EDHSP.mjs.map +1 -0
  274. package/dist/chunk-TULUUJ3E.mjs +21 -0
  275. package/dist/chunk-TULUUJ3E.mjs.map +1 -0
  276. package/dist/chunk-UFAA5WKR.mjs +19 -0
  277. package/dist/chunk-UFAA5WKR.mjs.map +1 -0
  278. package/dist/chunk-V6LXSPMF.mjs +17 -0
  279. package/dist/chunk-V6LXSPMF.mjs.map +1 -0
  280. package/dist/chunk-Y6ZRNII6.mjs +9 -0
  281. package/dist/chunk-Y6ZRNII6.mjs.map +1 -0
  282. package/dist/chunk-YEZIGQJG.mjs +13 -0
  283. package/dist/chunk-YEZIGQJG.mjs.map +1 -0
  284. package/dist/chunk-YHY2XTJW.mjs +10 -0
  285. package/dist/chunk-YHY2XTJW.mjs.map +1 -0
  286. package/dist/chunk-YNRYG5OB.mjs +11 -0
  287. package/dist/chunk-YNRYG5OB.mjs.map +1 -0
  288. package/dist/chunk-ZBG3EYM3.mjs +11 -0
  289. package/dist/chunk-ZBG3EYM3.mjs.map +1 -0
  290. package/dist/chunk-ZQNAZPSK.mjs +9 -0
  291. package/dist/chunk-ZQNAZPSK.mjs.map +1 -0
  292. package/{esm/function/debounce.mjs → dist/function/debounce.d.mts} +5 -18
  293. package/dist/function/debounce.d.ts +3 -1
  294. package/dist/function/debounce.js +47 -0
  295. package/dist/function/debounce.js.map +1 -0
  296. package/dist/function/debounce.mjs +8 -0
  297. package/dist/function/debounce.mjs.map +1 -0
  298. package/dist/function/index.d.ts +3 -3
  299. package/dist/function/index.js +47 -78
  300. package/dist/function/index.js.map +1 -0
  301. package/dist/function/index.mjs +17 -0
  302. package/dist/function/index.mjs.map +1 -0
  303. package/{esm/function/once.mjs → dist/function/once.d.mts} +2 -14
  304. package/dist/function/once.d.ts +3 -1
  305. package/dist/function/once.js +43 -0
  306. package/dist/function/once.js.map +1 -0
  307. package/dist/function/once.mjs +8 -0
  308. package/dist/function/once.mjs.map +1 -0
  309. package/{esm/function/throttle.mjs → dist/function/throttle.d.mts} +3 -13
  310. package/dist/function/throttle.d.ts +3 -1
  311. package/dist/function/throttle.js +41 -0
  312. package/dist/function/throttle.js.map +1 -0
  313. package/dist/function/throttle.mjs +8 -0
  314. package/dist/function/throttle.mjs.map +1 -0
  315. package/dist/index.d.ts +45 -6
  316. package/dist/index.js +288 -1271
  317. package/dist/index.js.map +1 -0
  318. package/dist/index.mjs +190 -0
  319. package/dist/index.mjs.map +1 -0
  320. package/{esm/math/clamp.mjs → dist/math/clamp.d.mts} +2 -7
  321. package/dist/math/clamp.d.ts +4 -2
  322. package/dist/math/clamp.js +36 -0
  323. package/dist/math/clamp.js.map +1 -0
  324. package/dist/math/clamp.mjs +8 -0
  325. package/dist/math/clamp.mjs.map +1 -0
  326. package/dist/math/index.d.ts +3 -3
  327. package/dist/math/index.js +41 -132
  328. package/dist/math/index.js.map +1 -0
  329. package/dist/math/index.mjs +17 -0
  330. package/dist/math/index.mjs.map +1 -0
  331. package/{esm/math/round.mjs → dist/math/round.d.mts} +3 -7
  332. package/dist/math/round.d.ts +3 -1
  333. package/dist/math/round.js +34 -0
  334. package/dist/math/round.js.map +1 -0
  335. package/dist/math/round.mjs +8 -0
  336. package/dist/math/round.mjs.map +1 -0
  337. package/dist/math/sum.d.mts +16 -0
  338. package/dist/math/sum.d.ts +3 -1
  339. package/dist/math/sum.js +37 -0
  340. package/dist/math/sum.js.map +1 -0
  341. package/dist/math/sum.mjs +8 -0
  342. package/dist/math/sum.mjs.map +1 -0
  343. package/dist/object/index.d.ts +4 -4
  344. package/dist/object/index.js +62 -256
  345. package/dist/object/index.js.map +1 -0
  346. package/dist/object/index.mjs +21 -0
  347. package/dist/object/index.mjs.map +1 -0
  348. package/{esm/object/omit.mjs → dist/object/omit.d.mts} +2 -19
  349. package/dist/object/omit.d.ts +3 -1
  350. package/dist/object/omit.js +51 -0
  351. package/dist/object/omit.js.map +1 -0
  352. package/dist/object/omit.mjs +8 -0
  353. package/dist/object/omit.mjs.map +1 -0
  354. package/{esm/object/omitBy.mjs → dist/object/omitBy.d.mts} +4 -18
  355. package/dist/object/omitBy.d.ts +3 -1
  356. package/dist/object/omitBy.js +40 -0
  357. package/dist/object/omitBy.js.map +1 -0
  358. package/dist/object/omitBy.mjs +8 -0
  359. package/dist/object/omitBy.mjs.map +1 -0
  360. package/{esm/object/pick.mjs → dist/object/pick.d.mts} +2 -19
  361. package/dist/object/pick.d.ts +3 -1
  362. package/dist/object/pick.js +37 -0
  363. package/dist/object/pick.js.map +1 -0
  364. package/dist/object/pick.mjs +8 -0
  365. package/dist/object/pick.mjs.map +1 -0
  366. package/{esm/object/pickBy.mjs → dist/object/pickBy.d.mts} +4 -18
  367. package/dist/object/pickBy.d.ts +3 -1
  368. package/dist/object/pickBy.js +40 -0
  369. package/dist/object/pickBy.js.map +1 -0
  370. package/dist/object/pickBy.mjs +8 -0
  371. package/dist/object/pickBy.mjs.map +1 -0
  372. package/dist/predicate/index.d.ts +4 -4
  373. package/dist/predicate/index.js +42 -84
  374. package/dist/predicate/index.js.map +1 -0
  375. package/dist/predicate/index.mjs +21 -0
  376. package/dist/predicate/index.mjs.map +1 -0
  377. package/{esm/predicate/isNil.mjs → dist/predicate/isNil.d.mts} +4 -6
  378. package/dist/predicate/isNil.d.ts +3 -1
  379. package/dist/predicate/isNil.js +33 -0
  380. package/dist/predicate/isNil.js.map +1 -0
  381. package/dist/predicate/isNil.mjs +8 -0
  382. package/dist/predicate/isNil.mjs.map +1 -0
  383. package/{esm/predicate/isNotNil.mjs → dist/predicate/isNotNil.d.mts} +2 -4
  384. package/dist/predicate/isNotNil.d.ts +3 -1
  385. package/dist/predicate/isNotNil.js +33 -0
  386. package/dist/predicate/isNotNil.js.map +1 -0
  387. package/dist/predicate/isNotNil.mjs +8 -0
  388. package/dist/predicate/isNotNil.mjs.map +1 -0
  389. package/{esm/predicate/isNull.mjs → dist/predicate/isNull.d.mts} +4 -6
  390. package/dist/predicate/isNull.d.ts +3 -1
  391. package/dist/predicate/isNull.js +33 -0
  392. package/dist/predicate/isNull.js.map +1 -0
  393. package/dist/predicate/isNull.mjs +8 -0
  394. package/dist/predicate/isNull.mjs.map +1 -0
  395. package/{esm/predicate/isUndefined.mjs → dist/predicate/isUndefined.d.mts} +4 -6
  396. package/dist/predicate/isUndefined.d.ts +3 -1
  397. package/dist/predicate/isUndefined.js +33 -0
  398. package/dist/predicate/isUndefined.js.map +1 -0
  399. package/dist/predicate/isUndefined.mjs +8 -0
  400. package/dist/predicate/isUndefined.mjs.map +1 -0
  401. package/{esm/promise/delay.mjs → dist/promise/delay.d.mts} +4 -8
  402. package/dist/promise/delay.d.ts +3 -1
  403. package/dist/promise/delay.js +35 -0
  404. package/dist/promise/delay.js.map +1 -0
  405. package/dist/promise/delay.mjs +8 -0
  406. package/dist/promise/delay.mjs.map +1 -0
  407. package/dist/promise/index.d.ts +1 -1
  408. package/dist/promise/index.js +31 -23
  409. package/dist/promise/index.js.map +1 -0
  410. package/dist/promise/index.mjs +9 -0
  411. package/dist/promise/index.mjs.map +1 -0
  412. package/package.json +121 -49
  413. package/dist/array/chunk.spec.d.ts +0 -1
  414. package/dist/array/difference.spec.d.ts +0 -1
  415. package/dist/array/differenceBy.spec.d.ts +0 -1
  416. package/dist/array/differenceWith.spec.d.ts +0 -1
  417. package/dist/array/drop.spec.d.ts +0 -1
  418. package/dist/array/dropRight.spec.d.ts +0 -1
  419. package/dist/array/dropRightWhile.spec.d.ts +0 -1
  420. package/dist/array/dropWhile.spec.d.ts +0 -1
  421. package/dist/array/groupBy.spec.d.ts +0 -1
  422. package/dist/array/intersection.spec.d.ts +0 -1
  423. package/dist/array/intersectionBy.spec.d.ts +0 -1
  424. package/dist/array/intersectionWith.spec.d.ts +0 -1
  425. package/dist/array/partition.spec.d.ts +0 -1
  426. package/dist/array/sample.spec.d.ts +0 -1
  427. package/dist/array/shuffle.spec.d.ts +0 -1
  428. package/dist/array/take.spec.d.ts +0 -1
  429. package/dist/array/takeRight.spec.d.ts +0 -1
  430. package/dist/array/takeRightWhile.spec.d.ts +0 -1
  431. package/dist/array/takeWhile.spec.d.ts +0 -1
  432. package/dist/array/union.spec.d.ts +0 -1
  433. package/dist/array/unionBy.spec.d.ts +0 -1
  434. package/dist/array/unionWith.spec.d.ts +0 -1
  435. package/dist/array/uniq.spec.d.ts +0 -1
  436. package/dist/array/uniqBy.spec.d.ts +0 -1
  437. package/dist/array/uniqWith.spec.d.ts +0 -1
  438. package/dist/array/xor.spec.d.ts +0 -1
  439. package/dist/array/xorBy.spec.d.ts +0 -1
  440. package/dist/array/xorWith.spec.d.ts +0 -1
  441. package/dist/array/zip.spec.d.ts +0 -1
  442. package/dist/array/zipWith.spec.d.ts +0 -1
  443. package/dist/function/debounce.spec.d.ts +0 -1
  444. package/dist/function/once.spec.d.ts +0 -1
  445. package/dist/function/throttle.spec.d.ts +0 -1
  446. package/dist/math/clamp.spec.d.ts +0 -1
  447. package/dist/math/round.spec.d.ts +0 -1
  448. package/dist/math/sum.spec.d.ts +0 -1
  449. package/dist/object/omit.spec.d.ts +0 -1
  450. package/dist/object/omitBy.spec.d.ts +0 -1
  451. package/dist/object/pick.spec.d.ts +0 -1
  452. package/dist/object/pickBy.spec.d.ts +0 -1
  453. package/dist/predicate/isNil.spec.d.ts +0 -1
  454. package/dist/predicate/isNotNil.spec.d.ts +0 -1
  455. package/dist/predicate/isNull.spec.d.ts +0 -1
  456. package/dist/predicate/isUndefined.spec.d.ts +0 -1
  457. package/dist/promise/delay.spec.d.ts +0 -1
  458. package/esm/_virtual/_rollupPluginBabelHelpers.mjs +0 -163
  459. package/esm/array/_virtual/_rollupPluginBabelHelpers.mjs +0 -78
  460. package/esm/array/uniq.mjs +0 -37
  461. package/esm/array/uniqWith.mjs +0 -39
  462. package/esm/array/zip.mjs +0 -52
  463. package/esm/math/_virtual/_rollupPluginBabelHelpers.mjs +0 -66
  464. package/esm/math/sum.mjs +0 -33
  465. package/esm/object/_virtual/_rollupPluginBabelHelpers.mjs +0 -151
  466. /package/{esm/array/index.mjs → dist/array/index.d.mts} +0 -0
  467. /package/{esm/function/index.mjs → dist/function/index.d.mts} +0 -0
  468. /package/{esm/index.mjs → dist/index.d.mts} +0 -0
  469. /package/{esm/math/index.mjs → dist/math/index.d.mts} +0 -0
  470. /package/{esm/object/index.mjs → dist/object/index.d.mts} +0 -0
  471. /package/{esm/predicate/index.mjs → dist/predicate/index.d.mts} +0 -0
  472. /package/{esm/promise/index.mjs → dist/promise/index.d.mts} +0 -0
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-SYQTG4N4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,16 @@
1
+ // src/object/pickBy.ts
2
+ function pickBy(obj, shouldPick) {
3
+ const result = {};
4
+ for (const [key, value] of Object.entries(obj)) {
5
+ if (!shouldPick(value, key)) {
6
+ continue;
7
+ }
8
+ result[key] = value;
9
+ }
10
+ return result;
11
+ }
12
+
13
+ export {
14
+ pickBy
15
+ };
16
+ //# sourceMappingURL=chunk-T2C2WVFL.mjs.map
@@ -0,0 +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: string) => 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: string) => 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":";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":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-T5JCRGXA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,21 @@
1
+ import {
2
+ unionWith
3
+ } from "./chunk-YEZIGQJG.mjs";
4
+ import {
5
+ intersectionWith
6
+ } from "./chunk-7LAOIS6P.mjs";
7
+ import {
8
+ differenceWith
9
+ } from "./chunk-M3SHJ3LL.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-TCHT4HCP.mjs.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,18 @@
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-TF6N37OE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into two groups based on a predicate function.\n *\n * This function takes an array and a predicate function. It returns a tuple of two arrays:\n * the first array contains elements for which the predicate function returns true, and\n * the second array contains elements for which the predicate function returns false.\n *\n * @param {T[]} arr - The array to partition.\n * @param {(value: T) => boolean} isInTruthy - A predicate function that determines\n * whether an element should be placed in the truthy array. The function is called with each\n * element of the array.\n * @returns {[T[], T[]]} A tuple containing two arrays: the first array contains elements for\n * which the predicate returned true, and the second array contains elements for which the\n * predicate returned false.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const isEven = x => x % 2 === 0;\n * const [even, odd] = partition(array, isEven);\n * // even will be [2, 4], and odd will be [1, 3, 5]\n */\nexport function partition<T>(arr: 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":[]}
@@ -0,0 +1,13 @@
1
+ import {
2
+ uniqWith
3
+ } from "./chunk-SQOYF647.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-TK2EDHSP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/uniqBy.ts"],"sourcesContent":["import { 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":";;;;;AAaO,SAAS,OAAa,KAAU,WAAgC;AACrE,SAAO,SAAS,KAAK,CAAC,OAAO,UAAU,UAAU,KAAK,MAAM,UAAU,KAAK,CAAC;AAC9E;","names":[]}
@@ -0,0 +1,21 @@
1
+ import {
2
+ unionBy
3
+ } from "./chunk-SPLO5OZW.mjs";
4
+ import {
5
+ intersectionBy
6
+ } from "./chunk-ANJSX6WH.mjs";
7
+ import {
8
+ differenceBy
9
+ } from "./chunk-PUQLVKMB.mjs";
10
+
11
+ // src/array/xorBy.ts
12
+ function xorBy(arr1, arr2, mapper) {
13
+ const union = unionBy(arr1, arr2, mapper);
14
+ const intersection = intersectionBy(arr1, arr2, mapper);
15
+ return differenceBy(union, intersection, mapper);
16
+ }
17
+
18
+ export {
19
+ xorBy
20
+ };
21
+ //# sourceMappingURL=chunk-TULUUJ3E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/xorBy.ts"],"sourcesContent":["import { differenceBy } from './differenceBy';\nimport { intersectionBy } from './intersectionBy';\nimport { unionBy } from './unionBy';\n\n/**\n * Computes the symmetric difference between two arrays using a custom mapping function.\n * The symmetric difference is the set of elements which are in either of the arrays,\n * but not in their intersection, determined by the result of the mapping function.\n *\n * @template T - Type of elements in the input arrays.\n * @template U - Type of the values returned by the mapping function.\n *\n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {function(item: T): U} mapper - The function to map array elements to comparison values.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function.\n *\n * @example\n * // Custom mapping function for objects with an 'id' property\n * const idMapper = obj => obj.id;\n * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);\n * // Returns [{ id: 1 }, { id: 3 }]\n */\nexport function xorBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[] {\n const union = unionBy(arr1, arr2, mapper);\n const intersection = intersectionBy(arr1, arr2, mapper);\n\n return differenceBy(union, intersection, mapper);\n}\n"],"mappings":";;;;;;;;;;;AAuBO,SAAS,MAAY,MAAW,MAAW,QAA6B;AAC7E,QAAM,QAAQ,QAAQ,MAAM,MAAM,MAAM;AACxC,QAAM,eAAe,eAAe,MAAM,MAAM,MAAM;AAEtD,SAAO,aAAa,OAAO,cAAc,MAAM;AACjD;","names":[]}
@@ -0,0 +1,19 @@
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-UFAA5WKR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/function/once.ts"],"sourcesContent":["/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n"],"mappings":";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":[]}
@@ -0,0 +1,17 @@
1
+ // src/array/groupBy.ts
2
+ function groupBy(arr, getKeyFromItem) {
3
+ const result = {};
4
+ for (const item of arr) {
5
+ const key = getKeyFromItem(item);
6
+ if (result[key] == null) {
7
+ result[key] = [];
8
+ }
9
+ result[key].push(item);
10
+ }
11
+ return result;
12
+ }
13
+
14
+ export {
15
+ groupBy
16
+ };
17
+ //# sourceMappingURL=chunk-V6LXSPMF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/groupBy.ts"],"sourcesContent":["/**\n * Groups the elements of an array based on a provided key-generating function.\n *\n * This function takes an array and a function that generates a key from each element. It returns\n * an object where the keys are the generated keys and the values are arrays of elements that share\n * the same key.\n *\n * @param {T[]} arr - The array to group.\n * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.\n * @returns {Record<K, T[]>} An object where each key is associated with an array of elements that\n * share that key.\n *\n * @example\n * const array = [\n * { category: 'fruit', name: 'apple' },\n * { category: 'fruit', name: 'banana' },\n * { category: 'vegetable', name: 'carrot' }\n * ];\n * const result = groupBy(array, item => item.category);\n * // result will be:\n * // {\n * // fruit: [\n * // { category: 'fruit', name: 'apple' },\n * // { category: 'fruit', name: 'banana' }\n * // ],\n * // vegetable: [\n * // { category: 'vegetable', name: 'carrot' }\n * // ]\n * // }\n */\nexport function groupBy<T, K extends string>(arr: T[], getKeyFromItem: (item: T) => K): Record<K, T[]> {\n const result = {} as Record<K, T[]>;\n\n for (const item of arr) {\n const key = getKeyFromItem(item);\n\n if (result[key] == null) {\n result[key] = [];\n }\n\n result[key].push(item);\n }\n\n return result;\n}\n"],"mappings":";AA8BO,SAAS,QAA6B,KAAU,gBAAgD;AACrG,QAAM,SAAS,CAAC;AAEhB,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,eAAe,IAAI;AAE/B,QAAI,OAAO,GAAG,KAAK,MAAM;AACvB,aAAO,GAAG,IAAI,CAAC;AAAA,IACjB;AAEA,WAAO,GAAG,EAAE,KAAK,IAAI;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,9 @@
1
+ // src/predicate/isNull.ts
2
+ function isNull(x) {
3
+ return x === null;
4
+ }
5
+
6
+ export {
7
+ isNull
8
+ };
9
+ //# sourceMappingURL=chunk-Y6ZRNII6.mjs.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,13 @@
1
+ import {
2
+ uniqWith
3
+ } from "./chunk-SQOYF647.mjs";
4
+
5
+ // src/array/unionWith.ts
6
+ function unionWith(arr1, arr2, areItemsEqual) {
7
+ return uniqWith(arr1.concat(arr2), areItemsEqual);
8
+ }
9
+
10
+ export {
11
+ unionWith
12
+ };
13
+ //# sourceMappingURL=chunk-YEZIGQJG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/unionWith.ts"],"sourcesContent":["import { uniqWith } from './uniqWith';\n\n/**\n * Creates an array of unique values from two given arrays based on a custom equality function.\n *\n * This function takes two arrays and a custom equality function, merges the arrays, and returns\n * a new array containing only the unique values as determined by the custom equality function.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.\n * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array of unique values based on the custom equality function.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }];\n * const array2 = [{ id: 2 }, { id: 3 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = unionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays\n */\nexport function unionWith<T>(arr1: T[], arr2: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[] {\n return uniqWith(arr1.concat(arr2), areItemsEqual);\n}\n"],"mappings":";;;;;AAqBO,SAAS,UAAa,MAAW,MAAW,eAAqD;AACtG,SAAO,SAAS,KAAK,OAAO,IAAI,GAAG,aAAa;AAClD;","names":[]}
@@ -0,0 +1,10 @@
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-YHY2XTJW.mjs.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,11 @@
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-YNRYG5OB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/array/intersection.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays.\n *\n * This function takes two arrays and returns a new array containing the elements that are\n * present in both arrays. It effectively filters out any elements from the first array that\n * are not found in the second array.\n *\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @returns {T[]} A new array containing the elements that are present in both arrays.\n *\n * @example\n * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [3, 4, 5, 6, 7];\n * const result = intersection(array1, array2);\n * // result will be [3, 4, 5] since these elements are in both arrays.\n */\nexport function intersection<T>(firstArr: 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":[]}
@@ -0,0 +1,11 @@
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-ZBG3EYM3.mjs.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,9 @@
1
+ // src/predicate/isNotNil.ts
2
+ function isNotNil(x) {
3
+ return x !== null && x !== void 0;
4
+ }
5
+
6
+ export {
7
+ isNotNil
8
+ };
9
+ //# sourceMappingURL=chunk-ZQNAZPSK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/predicate/isNotNil.ts"],"sourcesContent":["/**\n * Checks if the given value is not null nor undefined.\n *\n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n"],"mappings":";AAeO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
@@ -14,26 +14,13 @@
14
14
  *
15
15
  * // Will log 'Function executed' after 1 second if not called again in that time
16
16
  * debouncedFunction();
17
- *
17
+ *
18
18
  * // Will not log anything as the previous call is canceled
19
19
  * debouncedFunction.cancel();
20
20
  */
21
- function debounce(func, debounceMs) {
22
- var timeoutId = null;
23
- var debounced = function debounced() {
24
- if (timeoutId != null) {
25
- clearTimeout(timeoutId);
26
- }
27
- timeoutId = setTimeout(function () {
28
- func();
29
- }, debounceMs);
30
- };
31
- debounced.cancel = function () {
32
- if (timeoutId != null) {
33
- clearTimeout(timeoutId);
34
- }
35
- };
36
- return debounced;
37
- }
21
+ declare function debounce(func: () => void, debounceMs: number): {
22
+ (): void;
23
+ cancel: () => void;
24
+ };
38
25
 
39
26
  export { debounce };
@@ -18,7 +18,9 @@
18
18
  * // Will not log anything as the previous call is canceled
19
19
  * debouncedFunction.cancel();
20
20
  */
21
- export declare function debounce(func: () => void, debounceMs: number): {
21
+ declare function debounce(func: () => void, debounceMs: number): {
22
22
  (): void;
23
23
  cancel: () => void;
24
24
  };
25
+
26
+ export { debounce };
@@ -0,0 +1,47 @@
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/function/debounce.ts
21
+ var debounce_exports = {};
22
+ __export(debounce_exports, {
23
+ debounce: () => debounce
24
+ });
25
+ module.exports = __toCommonJS(debounce_exports);
26
+ function debounce(func, debounceMs) {
27
+ let timeoutId = null;
28
+ const debounced = function() {
29
+ if (timeoutId != null) {
30
+ clearTimeout(timeoutId);
31
+ }
32
+ timeoutId = setTimeout(() => {
33
+ func();
34
+ }, debounceMs);
35
+ };
36
+ debounced.cancel = function() {
37
+ if (timeoutId != null) {
38
+ clearTimeout(timeoutId);
39
+ }
40
+ };
41
+ return debounced;
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ debounce
46
+ });
47
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
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 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}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,SAAS,MAAkB,YAAsD;AAC/F,MAAI,YAA4C;AAEhD,QAAM,YAAY,WAAY;AAC5B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAEA,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":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ debounce
3
+ } from "../chunk-4USR24DP.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ debounce
7
+ };
8
+ //# sourceMappingURL=debounce.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,3 +1,3 @@
1
- export { debounce } from './debounce';
2
- export { once } from './once';
3
- export { throttle } from './throttle';
1
+ export { debounce } from './debounce.js';
2
+ export { once } from './once.js';
3
+ export { throttle } from './throttle.js';
@@ -1,38 +1,43 @@
1
- 'use strict';
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);
2
19
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
20
+ // src/function/index.ts
21
+ var function_exports = {};
22
+ __export(function_exports, {
23
+ debounce: () => debounce,
24
+ once: () => once,
25
+ throttle: () => throttle
26
+ });
27
+ module.exports = __toCommonJS(function_exports);
4
28
 
5
- /**
6
- * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds
7
- * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
8
- * method to cancel any pending execution.
9
- *
10
- * @param {() => void} func - The function to debounce.
11
- * @param {number} debounceMs - The number of milliseconds to delay.
12
- * @returns {{ (): void; cancel: () => void }} A new debounced function with a `cancel` method.
13
- *
14
- * @example
15
- * const debouncedFunction = debounce(() => {
16
- * console.log('Function executed');
17
- * }, 1000);
18
- *
19
- * // Will log 'Function executed' after 1 second if not called again in that time
20
- * debouncedFunction();
21
- *
22
- * // Will not log anything as the previous call is canceled
23
- * debouncedFunction.cancel();
24
- */
29
+ // src/function/debounce.ts
25
30
  function debounce(func, debounceMs) {
26
- var timeoutId = null;
27
- var debounced = function debounced() {
31
+ let timeoutId = null;
32
+ const debounced = function() {
28
33
  if (timeoutId != null) {
29
34
  clearTimeout(timeoutId);
30
35
  }
31
- timeoutId = setTimeout(function () {
36
+ timeoutId = setTimeout(() => {
32
37
  func();
33
38
  }, debounceMs);
34
39
  };
35
- debounced.cancel = function () {
40
+ debounced.cancel = function() {
36
41
  if (timeoutId != null) {
37
42
  clearTimeout(timeoutId);
38
43
  }
@@ -40,65 +45,26 @@ function debounce(func, debounceMs) {
40
45
  return debounced;
41
46
  }
42
47
 
43
- /**
44
- * Creates a function that is restricted to invoking the provided function `func` once.
45
- * Repeated calls to the function will return the value from the first invocation.
46
- *
47
- * @param {F} func - The function to restrict.
48
- * @returns {F} A new function that invokes `func` once and caches the result.
49
- *
50
- * @example
51
- * const initialize = once(() => {
52
- * console.log('Initialized!');
53
- * return true;
54
- * });
55
- *
56
- * initialize(); // Logs: 'Initialized!' and returns true
57
- * initialize(); // Returns true without logging
58
- */
48
+ // src/function/once.ts
59
49
  function once(func) {
60
- var called = false;
61
- var cache;
62
- return function () {
50
+ let called = false;
51
+ let cache;
52
+ return function() {
63
53
  if (called) {
64
54
  return cache;
65
55
  }
66
- var result = func();
56
+ const result = func();
67
57
  called = true;
68
58
  cache = result;
69
59
  return result;
70
60
  };
71
61
  }
72
62
 
73
- /**
74
- * Creates a throttled function that only invokes the provided function at most once
75
- * per every `throttleMs` milliseconds. Subsequent calls to the throttled function
76
- * within the wait time will not trigger the execution of the original function.
77
- *
78
- * @param {() => void} func - The function to throttle.
79
- * @param {number} throttleMs - The number of milliseconds to throttle executions to.
80
- * @returns {() => void} A new throttled function.
81
- *
82
- * @example
83
- * const throttledFunction = throttle(() => {
84
- * console.log('Function executed');
85
- * }, 1000);
86
- *
87
- * // Will log 'Function executed' immediately
88
- * throttledFunction();
89
- *
90
- * // Will not log anything as it is within the throttle time
91
- * throttledFunction();
92
- *
93
- * // After 1 second
94
- * setTimeout(() => {
95
- * throttledFunction(); // Will log 'Function executed'
96
- * }, 1000);
97
- */
63
+ // src/function/throttle.ts
98
64
  function throttle(func, throttleMs) {
99
- var lastCallTime;
100
- var throttledFunction = function throttledFunction() {
101
- var now = Date.now();
65
+ let lastCallTime;
66
+ const throttledFunction = function() {
67
+ const now = Date.now();
102
68
  if (lastCallTime == null || now - lastCallTime >= throttleMs) {
103
69
  lastCallTime = now;
104
70
  func();
@@ -106,7 +72,10 @@ function throttle(func, throttleMs) {
106
72
  };
107
73
  return throttledFunction;
108
74
  }
109
-
110
- exports.debounce = debounce;
111
- exports.once = once;
112
- exports.throttle = throttle;
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ debounce,
78
+ once,
79
+ throttle
80
+ });
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/function/index.ts","../../src/function/debounce.ts","../../src/function/once.ts","../../src/function/throttle.ts"],"sourcesContent":["export { debounce } from './debounce';\nexport { once } from './once';\nexport { throttle } from './throttle';\n","/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @param {() => 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 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}\n","/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n *\n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n","/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @param {() => void} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {() => void} A new throttled function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n *\n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n *\n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle(func: () => void, throttleMs: number) {\n let lastCallTime: number | null;\n\n const throttledFunction = function () {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func();\n }\n };\n\n return throttledFunction;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACoBO,SAAS,SAAS,MAAkB,YAAsD;AAC/F,MAAI,YAA4C;AAEhD,QAAM,YAAY,WAAY;AAC5B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAEA,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;;;ACxBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;;;ACPO,SAAS,SAAS,MAAkB,YAAoB;AAC7D,MAAI;AAEJ,QAAM,oBAAoB,WAAY;AACpC,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK;AAAA,IACP;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,17 @@
1
+ import "../chunk-SYQTG4N4.mjs";
2
+ import {
3
+ debounce
4
+ } from "../chunk-4USR24DP.mjs";
5
+ import {
6
+ once
7
+ } from "../chunk-UFAA5WKR.mjs";
8
+ import {
9
+ throttle
10
+ } from "../chunk-MQZ5D4IU.mjs";
11
+ import "../chunk-2MM5EJJX.mjs";
12
+ export {
13
+ debounce,
14
+ once,
15
+ throttle
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -10,22 +10,10 @@
10
10
  * console.log('Initialized!');
11
11
  * return true;
12
12
  * });
13
- *
13
+ *
14
14
  * initialize(); // Logs: 'Initialized!' and returns true
15
15
  * initialize(); // Returns true without logging
16
16
  */
17
- function once(func) {
18
- var called = false;
19
- var cache;
20
- return function () {
21
- if (called) {
22
- return cache;
23
- }
24
- var result = func();
25
- called = true;
26
- cache = result;
27
- return result;
28
- };
29
- }
17
+ declare function once<F extends () => any>(func: F): F;
30
18
 
31
19
  export { once };
@@ -14,4 +14,6 @@
14
14
  * initialize(); // Logs: 'Initialized!' and returns true
15
15
  * initialize(); // Returns true without logging
16
16
  */
17
- export declare function once<F extends () => any>(func: F): F;
17
+ declare function once<F extends () => any>(func: F): F;
18
+
19
+ export { once };