@vinicunca/perkakas 1.8.0 → 1.12.0

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 (2549) hide show
  1. package/dist/add-prop.cjs +1 -1
  2. package/dist/add-prop.d.cts +46 -4
  3. package/dist/add-prop.d.cts.map +1 -0
  4. package/dist/add-prop.d.ts +46 -4
  5. package/dist/add-prop.d.ts.map +1 -0
  6. package/dist/add-prop.js +2 -1
  7. package/dist/add-prop.js.map +1 -0
  8. package/dist/add.cjs +1 -1
  9. package/dist/add.d.cts +34 -2
  10. package/dist/add.d.cts.map +1 -0
  11. package/dist/add.d.ts +34 -2
  12. package/dist/add.d.ts.map +1 -0
  13. package/dist/add.js +2 -1
  14. package/dist/add.js.map +1 -0
  15. package/dist/all-pass.cjs +1 -1
  16. package/dist/all-pass.d.cts +37 -2
  17. package/dist/all-pass.d.cts.map +1 -0
  18. package/dist/all-pass.d.ts +37 -2
  19. package/dist/all-pass.d.ts.map +1 -0
  20. package/dist/all-pass.js +2 -1
  21. package/dist/all-pass.js.map +1 -0
  22. package/dist/any-pass.cjs +1 -1
  23. package/dist/any-pass.d.cts +37 -2
  24. package/dist/any-pass.d.cts.map +1 -0
  25. package/dist/any-pass.d.ts +37 -2
  26. package/dist/any-pass.d.ts.map +1 -0
  27. package/dist/any-pass.js +2 -1
  28. package/dist/any-pass.js.map +1 -0
  29. package/dist/array-required-prefix-CefHtaKs.d.ts +26 -0
  30. package/dist/array-required-prefix-CefHtaKs.d.ts.map +1 -0
  31. package/dist/array-required-prefix-DxzEAAwi.d.cts +26 -0
  32. package/dist/array-required-prefix-DxzEAAwi.d.cts.map +1 -0
  33. package/dist/binary-search-cutoff-index-ClkmTCR5.cjs +1 -0
  34. package/dist/binary-search-cutoff-index-yQ2qcJHb.js +2 -0
  35. package/dist/binary-search-cutoff-index-yQ2qcJHb.js.map +1 -0
  36. package/dist/bounded-partial-D6ouPlXl.d.cts +17 -0
  37. package/dist/bounded-partial-D6ouPlXl.d.cts.map +1 -0
  38. package/dist/bounded-partial-DBIIClPU.d.ts +17 -0
  39. package/dist/bounded-partial-DBIIClPU.d.ts.map +1 -0
  40. package/dist/case.transform-CCMWrBmz.js +2 -0
  41. package/dist/case.transform-CCMWrBmz.js.map +1 -0
  42. package/dist/case.transform-FNx2XsC3.cjs +1 -0
  43. package/dist/case.types-BxuWJgN1.d.cts +19 -0
  44. package/dist/case.types-BxuWJgN1.d.cts.map +1 -0
  45. package/dist/case.types-CVfGg990.d.ts +19 -0
  46. package/dist/case.types-CVfGg990.d.ts.map +1 -0
  47. package/dist/ceil.cjs +1 -1
  48. package/dist/ceil.d.cts +39 -2
  49. package/dist/ceil.d.cts.map +1 -0
  50. package/dist/ceil.d.ts +39 -2
  51. package/dist/ceil.d.ts.map +1 -0
  52. package/dist/ceil.js +2 -1
  53. package/dist/ceil.js.map +1 -0
  54. package/dist/chunk.cjs +1 -1
  55. package/dist/chunk.d.cts +76 -9
  56. package/dist/chunk.d.cts.map +1 -0
  57. package/dist/chunk.d.ts +76 -9
  58. package/dist/chunk.d.ts.map +1 -0
  59. package/dist/chunk.js +2 -1
  60. package/dist/chunk.js.map +1 -0
  61. package/dist/clamp.cjs +1 -1
  62. package/dist/clamp.d.cts +37 -2
  63. package/dist/clamp.d.cts.map +1 -0
  64. package/dist/clamp.d.ts +37 -2
  65. package/dist/clamp.d.ts.map +1 -0
  66. package/dist/clamp.js +2 -1
  67. package/dist/clamp.js.map +1 -0
  68. package/dist/clamped-integer-subtract-oLs8msYu.d.cts +11 -0
  69. package/dist/clamped-integer-subtract-oLs8msYu.d.cts.map +1 -0
  70. package/dist/clamped-integer-subtract-sK2BlhSm.d.ts +11 -0
  71. package/dist/clamped-integer-subtract-sK2BlhSm.d.ts.map +1 -0
  72. package/dist/clone.cjs +1 -1
  73. package/dist/clone.d.cts +35 -2
  74. package/dist/clone.d.cts.map +1 -0
  75. package/dist/clone.d.ts +35 -2
  76. package/dist/clone.d.ts.map +1 -0
  77. package/dist/clone.js +2 -1
  78. package/dist/clone.js.map +1 -0
  79. package/dist/coerced-array-1Xs4p4iF.d.ts +17 -0
  80. package/dist/coerced-array-1Xs4p4iF.d.ts.map +1 -0
  81. package/dist/coerced-array-DS7cKtbA.d.cts +17 -0
  82. package/dist/coerced-array-DS7cKtbA.d.cts.map +1 -0
  83. package/dist/concat.cjs +1 -1
  84. package/dist/concat.d.cts +41 -3
  85. package/dist/concat.d.cts.map +1 -0
  86. package/dist/concat.d.ts +41 -3
  87. package/dist/concat.d.ts.map +1 -0
  88. package/dist/concat.js +2 -1
  89. package/dist/concat.js.map +1 -0
  90. package/dist/conditional-6ff4g8Sy.cjs +1 -0
  91. package/dist/conditional-F_nq8vtA.d.ts +221 -0
  92. package/dist/conditional-F_nq8vtA.d.ts.map +1 -0
  93. package/dist/conditional-lp8ZHACd.js +2 -0
  94. package/dist/conditional-lp8ZHACd.js.map +1 -0
  95. package/dist/conditional-tssGt6Vy.d.cts +221 -0
  96. package/dist/conditional-tssGt6Vy.d.cts.map +1 -0
  97. package/dist/conditional.cjs +1 -1
  98. package/dist/conditional.d.cts +1 -1
  99. package/dist/conditional.d.ts +1 -1
  100. package/dist/conditional.js +1 -1
  101. package/dist/constant.cjs +1 -1
  102. package/dist/constant.d.cts +32 -2
  103. package/dist/constant.d.cts.map +1 -0
  104. package/dist/constant.d.ts +32 -2
  105. package/dist/constant.d.ts.map +1 -0
  106. package/dist/constant.js +2 -1
  107. package/dist/constant.js.map +1 -0
  108. package/dist/count-by.cjs +1 -1
  109. package/dist/count-by.d.cts +42 -4
  110. package/dist/count-by.d.cts.map +1 -0
  111. package/dist/count-by.d.ts +42 -4
  112. package/dist/count-by.d.ts.map +1 -0
  113. package/dist/count-by.js +2 -1
  114. package/dist/count-by.js.map +1 -0
  115. package/dist/curry-B20xQM_9.d.cts +68 -0
  116. package/dist/curry-B20xQM_9.d.cts.map +1 -0
  117. package/dist/curry-BcQ8Up1_.js +2 -0
  118. package/dist/curry-BcQ8Up1_.js.map +1 -0
  119. package/dist/curry-BsY0Z8jH.cjs +1 -0
  120. package/dist/curry-d8_p_Jzt.d.ts +68 -0
  121. package/dist/curry-d8_p_Jzt.d.ts.map +1 -0
  122. package/dist/curry-from-lazy-BCGvmhyS.cjs +1 -0
  123. package/dist/curry-from-lazy-CYtJvyas.js +2 -0
  124. package/dist/curry-from-lazy-CYtJvyas.js.map +1 -0
  125. package/dist/curry-order-rules-BCcwbNxd.d.ts +48 -0
  126. package/dist/curry-order-rules-BCcwbNxd.d.ts.map +1 -0
  127. package/dist/curry-order-rules-C6bwcUwC.js +2 -0
  128. package/dist/curry-order-rules-C6bwcUwC.js.map +1 -0
  129. package/dist/curry-order-rules-ClqHrs8_.cjs +1 -0
  130. package/dist/curry-order-rules-cezUWcSx.d.cts +48 -0
  131. package/dist/curry-order-rules-cezUWcSx.d.cts.map +1 -0
  132. package/dist/curry.cjs +1 -1
  133. package/dist/curry.d.cts +1 -1
  134. package/dist/curry.d.ts +1 -1
  135. package/dist/curry.js +1 -1
  136. package/dist/debounce.cjs +1 -1
  137. package/dist/debounce.d.cts +96 -2
  138. package/dist/debounce.d.cts.map +1 -0
  139. package/dist/debounce.d.ts +96 -2
  140. package/dist/debounce.d.ts.map +1 -0
  141. package/dist/debounce.js +2 -1
  142. package/dist/debounce.js.map +1 -0
  143. package/dist/deduped-CL5-bmYU.d.ts +23 -0
  144. package/dist/deduped-CL5-bmYU.d.ts.map +1 -0
  145. package/dist/deduped-CXeQa-0F.d.cts +23 -0
  146. package/dist/deduped-CXeQa-0F.d.cts.map +1 -0
  147. package/dist/difference-with.cjs +1 -1
  148. package/dist/difference-with.d.cts +48 -2
  149. package/dist/difference-with.d.cts.map +1 -0
  150. package/dist/difference-with.d.ts +48 -2
  151. package/dist/difference-with.d.ts.map +1 -0
  152. package/dist/difference-with.js +2 -1
  153. package/dist/difference-with.js.map +1 -0
  154. package/dist/difference.cjs +1 -1
  155. package/dist/difference.d.cts +37 -2
  156. package/dist/difference.d.cts.map +1 -0
  157. package/dist/difference.d.ts +37 -2
  158. package/dist/difference.d.ts.map +1 -0
  159. package/dist/difference.js +2 -1
  160. package/dist/difference.js.map +1 -0
  161. package/dist/dist-CUT1dnRU.js +343 -0
  162. package/dist/dist-CUT1dnRU.js.map +1 -0
  163. package/dist/dist-CiyBKPT6.cjs +343 -0
  164. package/dist/divide.cjs +1 -1
  165. package/dist/divide.d.cts +33 -2
  166. package/dist/divide.d.cts.map +1 -0
  167. package/dist/divide.d.ts +33 -2
  168. package/dist/divide.d.ts.map +1 -0
  169. package/dist/divide.js +2 -1
  170. package/dist/divide.js.map +1 -0
  171. package/dist/do-nothing.cjs +1 -1
  172. package/dist/do-nothing.d.cts +28 -2
  173. package/dist/do-nothing.d.cts.map +1 -0
  174. package/dist/do-nothing.d.ts +28 -2
  175. package/dist/do-nothing.d.ts.map +1 -0
  176. package/dist/do-nothing.js +2 -1
  177. package/dist/do-nothing.js.map +1 -0
  178. package/dist/drop-first-by.cjs +1 -1
  179. package/dist/drop-first-by.d.cts +41 -4
  180. package/dist/drop-first-by.d.cts.map +1 -0
  181. package/dist/drop-first-by.d.ts +41 -4
  182. package/dist/drop-first-by.d.ts.map +1 -0
  183. package/dist/drop-first-by.js +2 -1
  184. package/dist/drop-first-by.js.map +1 -0
  185. package/dist/drop-last-while.cjs +1 -1
  186. package/dist/drop-last-while.d.cts +36 -3
  187. package/dist/drop-last-while.d.cts.map +1 -0
  188. package/dist/drop-last-while.d.ts +36 -3
  189. package/dist/drop-last-while.d.ts.map +1 -0
  190. package/dist/drop-last-while.js +2 -1
  191. package/dist/drop-last-while.js.map +1 -0
  192. package/dist/drop-last.cjs +1 -1
  193. package/dist/drop-last.d.cts +32 -3
  194. package/dist/drop-last.d.cts.map +1 -0
  195. package/dist/drop-last.d.ts +32 -3
  196. package/dist/drop-last.d.ts.map +1 -0
  197. package/dist/drop-last.js +2 -1
  198. package/dist/drop-last.js.map +1 -0
  199. package/dist/drop-while.cjs +1 -1
  200. package/dist/drop-while.d.cts +36 -3
  201. package/dist/drop-while.d.cts.map +1 -0
  202. package/dist/drop-while.d.ts +36 -3
  203. package/dist/drop-while.d.ts.map +1 -0
  204. package/dist/drop-while.js +2 -1
  205. package/dist/drop-while.js.map +1 -0
  206. package/dist/drop.cjs +1 -1
  207. package/dist/drop.d.cts +40 -8
  208. package/dist/drop.d.cts.map +1 -0
  209. package/dist/drop.d.ts +40 -8
  210. package/dist/drop.d.ts.map +1 -0
  211. package/dist/drop.js +2 -1
  212. package/dist/drop.js.map +1 -0
  213. package/dist/entries.cjs +1 -1
  214. package/dist/entries.d.cts +31 -3
  215. package/dist/entries.d.cts.map +1 -0
  216. package/dist/entries.d.ts +31 -3
  217. package/dist/entries.d.ts.map +1 -0
  218. package/dist/entries.js +2 -1
  219. package/dist/entries.js.map +1 -0
  220. package/dist/enumerable-string-key-of-DMAkBhMk.d.ts +17 -0
  221. package/dist/enumerable-string-key-of-DMAkBhMk.d.ts.map +1 -0
  222. package/dist/enumerable-string-key-of-FUg082M_.d.cts +17 -0
  223. package/dist/enumerable-string-key-of-FUg082M_.d.cts.map +1 -0
  224. package/dist/enumerable-string-keyed-value-of-B2F2aTB7.d.ts +12 -0
  225. package/dist/enumerable-string-keyed-value-of-B2F2aTB7.d.ts.map +1 -0
  226. package/dist/enumerable-string-keyed-value-of-CEclDoqe.d.cts +12 -0
  227. package/dist/enumerable-string-keyed-value-of-CEclDoqe.d.cts.map +1 -0
  228. package/dist/evolve.cjs +1 -1
  229. package/dist/evolve.d.cts +101 -3
  230. package/dist/evolve.d.cts.map +1 -0
  231. package/dist/evolve.d.ts +101 -3
  232. package/dist/evolve.d.ts.map +1 -0
  233. package/dist/evolve.js +2 -1
  234. package/dist/evolve.js.map +1 -0
  235. package/dist/filter.cjs +1 -1
  236. package/dist/filter.d.cts +50 -7
  237. package/dist/filter.d.cts.map +1 -0
  238. package/dist/filter.d.ts +50 -7
  239. package/dist/filter.d.ts.map +1 -0
  240. package/dist/filter.js +2 -1
  241. package/dist/filter.js.map +1 -0
  242. package/dist/filtered-array-D_RqQ8tX.d.cts +13 -0
  243. package/dist/filtered-array-D_RqQ8tX.d.cts.map +1 -0
  244. package/dist/filtered-array-Yij-X3T4.d.ts +13 -0
  245. package/dist/filtered-array-Yij-X3T4.d.ts.map +1 -0
  246. package/dist/find-index.cjs +1 -1
  247. package/dist/find-index.d.cts +50 -2
  248. package/dist/find-index.d.cts.map +1 -0
  249. package/dist/find-index.d.ts +50 -2
  250. package/dist/find-index.d.ts.map +1 -0
  251. package/dist/find-index.js +2 -1
  252. package/dist/find-index.js.map +1 -0
  253. package/dist/find-last-index.cjs +1 -1
  254. package/dist/find-last-index.d.cts +50 -2
  255. package/dist/find-last-index.d.cts.map +1 -0
  256. package/dist/find-last-index.d.ts +50 -2
  257. package/dist/find-last-index.d.ts.map +1 -0
  258. package/dist/find-last-index.js +2 -1
  259. package/dist/find-last-index.js.map +1 -0
  260. package/dist/find-last.cjs +1 -1
  261. package/dist/find-last.d.cts +62 -2
  262. package/dist/find-last.d.cts.map +1 -0
  263. package/dist/find-last.d.ts +62 -2
  264. package/dist/find-last.d.ts.map +1 -0
  265. package/dist/find-last.js +2 -1
  266. package/dist/find-last.js.map +1 -0
  267. package/dist/find.cjs +1 -1
  268. package/dist/find.d.cts +64 -2
  269. package/dist/find.d.cts.map +1 -0
  270. package/dist/find.d.ts +64 -2
  271. package/dist/find.d.ts.map +1 -0
  272. package/dist/find.js +2 -1
  273. package/dist/find.js.map +1 -0
  274. package/dist/first-by.cjs +1 -1
  275. package/dist/first-by.d.cts +60 -5
  276. package/dist/first-by.d.cts.map +1 -0
  277. package/dist/first-by.d.ts +60 -5
  278. package/dist/first-by.d.ts.map +1 -0
  279. package/dist/first-by.js +2 -1
  280. package/dist/first-by.js.map +1 -0
  281. package/dist/first.cjs +1 -1
  282. package/dist/first.d.cts +40 -3
  283. package/dist/first.d.cts.map +1 -0
  284. package/dist/first.d.ts +40 -3
  285. package/dist/first.d.ts.map +1 -0
  286. package/dist/first.js +2 -1
  287. package/dist/first.js.map +1 -0
  288. package/dist/flat-map.cjs +1 -1
  289. package/dist/flat-map.d.cts +47 -2
  290. package/dist/flat-map.d.cts.map +1 -0
  291. package/dist/flat-map.d.ts +47 -2
  292. package/dist/flat-map.d.ts.map +1 -0
  293. package/dist/flat-map.js +2 -1
  294. package/dist/flat-map.js.map +1 -0
  295. package/dist/flat.cjs +1 -1
  296. package/dist/flat.d.cts +53 -3
  297. package/dist/flat.d.cts.map +1 -0
  298. package/dist/flat.d.ts +53 -3
  299. package/dist/flat.d.ts.map +1 -0
  300. package/dist/flat.js +2 -1
  301. package/dist/flat.js.map +1 -0
  302. package/dist/floor.cjs +1 -1
  303. package/dist/floor.d.cts +39 -2
  304. package/dist/floor.d.cts.map +1 -0
  305. package/dist/floor.d.ts +39 -2
  306. package/dist/floor.d.ts.map +1 -0
  307. package/dist/floor.js +2 -1
  308. package/dist/floor.js.map +1 -0
  309. package/dist/for-each-obj.cjs +1 -1
  310. package/dist/for-each-obj.d.cts +47 -5
  311. package/dist/for-each-obj.d.cts.map +1 -0
  312. package/dist/for-each-obj.d.ts +47 -5
  313. package/dist/for-each-obj.d.ts.map +1 -0
  314. package/dist/for-each-obj.js +2 -1
  315. package/dist/for-each-obj.js.map +1 -0
  316. package/dist/for-each.cjs +1 -1
  317. package/dist/for-each.d.cts +54 -3
  318. package/dist/for-each.d.cts.map +1 -0
  319. package/dist/for-each.d.ts +54 -3
  320. package/dist/for-each.d.ts.map +1 -0
  321. package/dist/for-each.js +2 -1
  322. package/dist/for-each.js.map +1 -0
  323. package/dist/from-entries.cjs +1 -1
  324. package/dist/from-entries.d.cts +68 -4
  325. package/dist/from-entries.d.cts.map +1 -0
  326. package/dist/from-entries.d.ts +68 -4
  327. package/dist/from-entries.d.ts.map +1 -0
  328. package/dist/from-entries.js +2 -1
  329. package/dist/from-entries.js.map +1 -0
  330. package/dist/from-keys.cjs +1 -1
  331. package/dist/from-keys.d.cts +60 -5
  332. package/dist/from-keys.d.cts.map +1 -0
  333. package/dist/from-keys.d.ts +60 -5
  334. package/dist/from-keys.d.ts.map +1 -0
  335. package/dist/from-keys.js +2 -1
  336. package/dist/from-keys.js.map +1 -0
  337. package/dist/funnel.cjs +1 -1
  338. package/dist/funnel.d.cts +155 -2
  339. package/dist/funnel.d.cts.map +1 -0
  340. package/dist/funnel.d.ts +155 -2
  341. package/dist/funnel.d.ts.map +1 -0
  342. package/dist/funnel.js +2 -1
  343. package/dist/funnel.js.map +1 -0
  344. package/dist/funnel.lodash-debounce-with-cached-value.test.cjs +1 -1
  345. package/dist/funnel.lodash-debounce-with-cached-value.test.js +1 -1
  346. package/dist/funnel.lodash-debounce-with-cached-value.test.js.map +1 -1
  347. package/dist/funnel.lodash-debounce.test.cjs +1 -1
  348. package/dist/funnel.lodash-debounce.test.js +1 -1
  349. package/dist/funnel.lodash-debounce.test.js.map +1 -1
  350. package/dist/funnel.lodash-throttle-with-cached-value.test.cjs +1 -1
  351. package/dist/funnel.lodash-throttle-with-cached-value.test.js +1 -1
  352. package/dist/funnel.lodash-throttle-with-cached-value.test.js.map +1 -1
  353. package/dist/funnel.lodash-throttle.test.cjs +1 -1
  354. package/dist/funnel.lodash-throttle.test.js +1 -1
  355. package/dist/funnel.lodash-throttle.test.js.map +1 -1
  356. package/dist/funnel.perkakas-debounce.test.cjs +1 -1
  357. package/dist/funnel.perkakas-debounce.test.js +1 -1
  358. package/dist/funnel.perkakas-debounce.test.js.map +1 -1
  359. package/dist/funnel.reference-batch.test.cjs +1 -1
  360. package/dist/funnel.reference-batch.test.js +1 -1
  361. package/dist/funnel.reference-batch.test.js.map +1 -1
  362. package/dist/funnel.test-d.cjs +1 -1
  363. package/dist/funnel.test-d.js +1 -1
  364. package/dist/funnel.test-d.js.map +1 -1
  365. package/dist/funnel.test.cjs +1 -1
  366. package/dist/funnel.test.js +1 -1
  367. package/dist/funnel.test.js.map +1 -1
  368. package/dist/group-by-prop.cjs +1 -1
  369. package/dist/group-by-prop.d.cts +89 -11
  370. package/dist/group-by-prop.d.cts.map +1 -0
  371. package/dist/group-by-prop.d.ts +89 -11
  372. package/dist/group-by-prop.d.ts.map +1 -0
  373. package/dist/group-by-prop.js +2 -1
  374. package/dist/group-by-prop.js.map +1 -0
  375. package/dist/group-by.cjs +1 -1
  376. package/dist/group-by.d.cts +69 -5
  377. package/dist/group-by.d.cts.map +1 -0
  378. package/dist/group-by.d.ts +69 -5
  379. package/dist/group-by.d.ts.map +1 -0
  380. package/dist/group-by.js +2 -1
  381. package/dist/group-by.js.map +1 -0
  382. package/dist/has-at-least-BXwOPLQK.cjs +1 -0
  383. package/dist/has-at-least-DyIhWZJH.js +2 -0
  384. package/dist/has-at-least-DyIhWZJH.js.map +1 -0
  385. package/dist/has-at-least.cjs +1 -1
  386. package/dist/has-at-least.d.cts +59 -8
  387. package/dist/has-at-least.d.cts.map +1 -0
  388. package/dist/has-at-least.d.ts +59 -8
  389. package/dist/has-at-least.d.ts.map +1 -0
  390. package/dist/has-at-least.js +1 -1
  391. package/dist/has-sub-object.cjs +1 -1
  392. package/dist/has-sub-object.d.cts +44 -2
  393. package/dist/has-sub-object.d.cts.map +1 -0
  394. package/dist/has-sub-object.d.ts +44 -2
  395. package/dist/has-sub-object.d.ts.map +1 -0
  396. package/dist/has-sub-object.js +2 -1
  397. package/dist/has-sub-object.js.map +1 -0
  398. package/dist/heap-DWDhbxfx.cjs +1 -0
  399. package/dist/heap-bARaRULU.js +2 -0
  400. package/dist/heap-bARaRULU.js.map +1 -0
  401. package/dist/human-readable-file-size.cjs +1 -1
  402. package/dist/human-readable-file-size.d.cts +17 -2
  403. package/dist/human-readable-file-size.d.cts.map +1 -0
  404. package/dist/human-readable-file-size.d.ts +17 -2
  405. package/dist/human-readable-file-size.d.ts.map +1 -0
  406. package/dist/human-readable-file-size.js +2 -1
  407. package/dist/human-readable-file-size.js.map +1 -0
  408. package/dist/identity.cjs +1 -1
  409. package/dist/identity.d.cts +22 -2
  410. package/dist/identity.d.cts.map +1 -0
  411. package/dist/identity.d.ts +22 -2
  412. package/dist/identity.d.ts.map +1 -0
  413. package/dist/identity.js +2 -1
  414. package/dist/identity.js.map +1 -0
  415. package/dist/index-by.cjs +1 -1
  416. package/dist/index-by.d.cts +53 -4
  417. package/dist/index-by.d.cts.map +1 -0
  418. package/dist/index-by.d.ts +53 -4
  419. package/dist/index-by.d.ts.map +1 -0
  420. package/dist/index-by.js +2 -1
  421. package/dist/index-by.js.map +1 -0
  422. package/dist/index.cjs +1 -1
  423. package/dist/index.d.cts +160 -183
  424. package/dist/index.d.cts.map +1 -1
  425. package/dist/index.d.ts +160 -183
  426. package/dist/index.d.ts.map +1 -1
  427. package/dist/index.js +1 -1
  428. package/dist/index.js.map +1 -1
  429. package/dist/int-range-inclusive-ClGdUant.d.ts +15 -0
  430. package/dist/int-range-inclusive-ClGdUant.d.ts.map +1 -0
  431. package/dist/int-range-inclusive-q-Jb7w6P.d.cts +15 -0
  432. package/dist/int-range-inclusive-q-Jb7w6P.d.cts.map +1 -0
  433. package/dist/intersection-with.cjs +1 -1
  434. package/dist/intersection-with.d.cts +54 -2
  435. package/dist/intersection-with.d.cts.map +1 -0
  436. package/dist/intersection-with.d.ts +54 -2
  437. package/dist/intersection-with.d.ts.map +1 -0
  438. package/dist/intersection-with.js +2 -1
  439. package/dist/intersection-with.js.map +1 -0
  440. package/dist/intersection.cjs +1 -1
  441. package/dist/intersection.d.cts +37 -2
  442. package/dist/intersection.d.cts.map +1 -0
  443. package/dist/intersection.d.ts +37 -2
  444. package/dist/intersection.d.ts.map +1 -0
  445. package/dist/intersection.js +2 -1
  446. package/dist/intersection.js.map +1 -0
  447. package/dist/invert.cjs +1 -1
  448. package/dist/invert.d.cts +33 -3
  449. package/dist/invert.d.cts.map +1 -0
  450. package/dist/invert.d.ts +33 -3
  451. package/dist/invert.d.ts.map +1 -0
  452. package/dist/invert.js +2 -1
  453. package/dist/invert.js.map +1 -0
  454. package/dist/is-array.cjs +1 -1
  455. package/dist/is-array.d.cts +21 -3
  456. package/dist/is-array.d.cts.map +1 -0
  457. package/dist/is-array.d.ts +21 -3
  458. package/dist/is-array.d.ts.map +1 -0
  459. package/dist/is-array.js +2 -1
  460. package/dist/is-array.js.map +1 -0
  461. package/dist/is-big-int.cjs +1 -1
  462. package/dist/is-big-int.d.cts +22 -3
  463. package/dist/is-big-int.d.cts.map +1 -0
  464. package/dist/is-big-int.d.ts +22 -3
  465. package/dist/is-big-int.d.ts.map +1 -0
  466. package/dist/is-big-int.js +2 -1
  467. package/dist/is-big-int.js.map +1 -0
  468. package/dist/is-boolean.cjs +1 -1
  469. package/dist/is-boolean.d.cts +21 -3
  470. package/dist/is-boolean.d.cts.map +1 -0
  471. package/dist/is-boolean.d.ts +21 -3
  472. package/dist/is-boolean.d.ts.map +1 -0
  473. package/dist/is-boolean.js +2 -1
  474. package/dist/is-boolean.js.map +1 -0
  475. package/dist/is-bounded-record-BGclJjRX.d.ts +34 -0
  476. package/dist/is-bounded-record-BGclJjRX.d.ts.map +1 -0
  477. package/dist/is-bounded-record-D9YK_OC8.d.cts +34 -0
  478. package/dist/is-bounded-record-D9YK_OC8.d.cts.map +1 -0
  479. package/dist/is-date.cjs +1 -1
  480. package/dist/is-date.d.cts +17 -2
  481. package/dist/is-date.d.cts.map +1 -0
  482. package/dist/is-date.d.ts +17 -2
  483. package/dist/is-date.d.ts.map +1 -0
  484. package/dist/is-date.js +2 -1
  485. package/dist/is-date.js.map +1 -0
  486. package/dist/is-deep-equal.cjs +1 -1
  487. package/dist/is-deep-equal.d.cts +71 -2
  488. package/dist/is-deep-equal.d.cts.map +1 -0
  489. package/dist/is-deep-equal.d.ts +71 -2
  490. package/dist/is-deep-equal.d.ts.map +1 -0
  491. package/dist/is-deep-equal.js +2 -1
  492. package/dist/is-deep-equal.js.map +1 -0
  493. package/dist/is-defined.cjs +1 -1
  494. package/dist/is-defined.d.cts +19 -2
  495. package/dist/is-defined.d.cts.map +1 -0
  496. package/dist/is-defined.d.ts +19 -2
  497. package/dist/is-defined.d.ts.map +1 -0
  498. package/dist/is-defined.js +2 -1
  499. package/dist/is-defined.js.map +1 -0
  500. package/dist/is-empty.cjs +1 -1
  501. package/dist/is-empty.d.cts +35 -3
  502. package/dist/is-empty.d.cts.map +1 -0
  503. package/dist/is-empty.d.ts +35 -3
  504. package/dist/is-empty.d.ts.map +1 -0
  505. package/dist/is-empty.js +2 -1
  506. package/dist/is-empty.js.map +1 -0
  507. package/dist/is-emptyish-CIxZzxxz.d.ts +74 -0
  508. package/dist/is-emptyish-CIxZzxxz.d.ts.map +1 -0
  509. package/dist/is-emptyish-oX5mpcfW.d.cts +74 -0
  510. package/dist/is-emptyish-oX5mpcfW.d.cts.map +1 -0
  511. package/dist/is-emptyish.cjs +1 -0
  512. package/dist/is-emptyish.d.cts +2 -0
  513. package/dist/is-emptyish.d.ts +2 -0
  514. package/dist/is-emptyish.js +2 -0
  515. package/dist/is-emptyish.js.map +1 -0
  516. package/dist/is-emptyish.test-d.cjs +1 -0
  517. package/dist/is-emptyish.test-d.d.cts +8 -0
  518. package/dist/is-emptyish.test-d.d.cts.map +1 -0
  519. package/dist/is-emptyish.test-d.d.ts +8 -0
  520. package/dist/is-emptyish.test-d.d.ts.map +1 -0
  521. package/dist/is-emptyish.test-d.js +2 -0
  522. package/dist/is-emptyish.test-d.js.map +1 -0
  523. package/dist/is-emptyish.test.cjs +1 -0
  524. package/dist/is-emptyish.test.d.cts +1 -0
  525. package/dist/is-emptyish.test.d.ts +1 -0
  526. package/dist/is-emptyish.test.js +2 -0
  527. package/dist/is-emptyish.test.js.map +1 -0
  528. package/dist/is-error.cjs +1 -1
  529. package/dist/is-error.d.cts +18 -2
  530. package/dist/is-error.d.cts.map +1 -0
  531. package/dist/is-error.d.ts +18 -2
  532. package/dist/is-error.d.ts.map +1 -0
  533. package/dist/is-error.js +2 -1
  534. package/dist/is-error.js.map +1 -0
  535. package/dist/is-function.cjs +1 -1
  536. package/dist/is-function.d.cts +18 -2
  537. package/dist/is-function.d.cts.map +1 -0
  538. package/dist/is-function.d.ts +18 -2
  539. package/dist/is-function.d.ts.map +1 -0
  540. package/dist/is-function.js +2 -1
  541. package/dist/is-function.js.map +1 -0
  542. package/dist/is-included-in.cjs +1 -1
  543. package/dist/is-included-in.d.cts +110 -4
  544. package/dist/is-included-in.d.cts.map +1 -0
  545. package/dist/is-included-in.d.ts +110 -4
  546. package/dist/is-included-in.d.ts.map +1 -0
  547. package/dist/is-included-in.js +2 -1
  548. package/dist/is-included-in.js.map +1 -0
  549. package/dist/is-non-null.cjs +1 -1
  550. package/dist/is-non-null.d.cts +19 -2
  551. package/dist/is-non-null.d.cts.map +1 -0
  552. package/dist/is-non-null.d.ts +19 -2
  553. package/dist/is-non-null.d.ts.map +1 -0
  554. package/dist/is-non-null.js +2 -1
  555. package/dist/is-non-null.js.map +1 -0
  556. package/dist/is-non-nullish.cjs +1 -1
  557. package/dist/is-non-nullish.d.cts +20 -2
  558. package/dist/is-non-nullish.d.cts.map +1 -0
  559. package/dist/is-non-nullish.d.ts +20 -2
  560. package/dist/is-non-nullish.d.ts.map +1 -0
  561. package/dist/is-non-nullish.js +2 -1
  562. package/dist/is-non-nullish.js.map +1 -0
  563. package/dist/is-not.cjs +1 -1
  564. package/dist/is-not.d.cts +19 -2
  565. package/dist/is-not.d.cts.map +1 -0
  566. package/dist/is-not.d.ts +19 -2
  567. package/dist/is-not.d.ts.map +1 -0
  568. package/dist/is-not.js +2 -1
  569. package/dist/is-not.js.map +1 -0
  570. package/dist/is-nullish.cjs +1 -1
  571. package/dist/is-nullish.d.cts +23 -3
  572. package/dist/is-nullish.d.cts.map +1 -0
  573. package/dist/is-nullish.d.ts +23 -3
  574. package/dist/is-nullish.d.ts.map +1 -0
  575. package/dist/is-nullish.js +2 -1
  576. package/dist/is-nullish.js.map +1 -0
  577. package/dist/is-number.cjs +1 -1
  578. package/dist/is-number.d.cts +22 -3
  579. package/dist/is-number.d.cts.map +1 -0
  580. package/dist/is-number.d.ts +22 -3
  581. package/dist/is-number.d.ts.map +1 -0
  582. package/dist/is-number.js +2 -1
  583. package/dist/is-number.js.map +1 -0
  584. package/dist/is-object-type.cjs +1 -1
  585. package/dist/is-object-type.d.cts +35 -3
  586. package/dist/is-object-type.d.cts.map +1 -0
  587. package/dist/is-object-type.d.ts +35 -3
  588. package/dist/is-object-type.d.ts.map +1 -0
  589. package/dist/is-object-type.js +2 -1
  590. package/dist/is-object-type.js.map +1 -0
  591. package/dist/is-plain-object.cjs +1 -1
  592. package/dist/is-plain-object.d.cts +33 -3
  593. package/dist/is-plain-object.d.cts.map +1 -0
  594. package/dist/is-plain-object.d.ts +33 -3
  595. package/dist/is-plain-object.d.ts.map +1 -0
  596. package/dist/is-plain-object.js +2 -1
  597. package/dist/is-plain-object.js.map +1 -0
  598. package/dist/is-promise.cjs +1 -1
  599. package/dist/is-promise.d.cts +18 -2
  600. package/dist/is-promise.d.cts.map +1 -0
  601. package/dist/is-promise.d.ts +18 -2
  602. package/dist/is-promise.d.ts.map +1 -0
  603. package/dist/is-promise.js +2 -1
  604. package/dist/is-promise.js.map +1 -0
  605. package/dist/is-shallow-equal.cjs +1 -1
  606. package/dist/is-shallow-equal.d.cts +71 -2
  607. package/dist/is-shallow-equal.d.cts.map +1 -0
  608. package/dist/is-shallow-equal.d.ts +71 -2
  609. package/dist/is-shallow-equal.d.ts.map +1 -0
  610. package/dist/is-shallow-equal.js +2 -1
  611. package/dist/is-shallow-equal.js.map +1 -0
  612. package/dist/is-strict-equal.cjs +1 -1
  613. package/dist/is-strict-equal.d.cts +67 -2
  614. package/dist/is-strict-equal.d.cts.map +1 -0
  615. package/dist/is-strict-equal.d.ts +67 -2
  616. package/dist/is-strict-equal.d.ts.map +1 -0
  617. package/dist/is-strict-equal.js +2 -1
  618. package/dist/is-strict-equal.js.map +1 -0
  619. package/dist/is-string.cjs +1 -1
  620. package/dist/is-string.d.cts +20 -3
  621. package/dist/is-string.d.cts.map +1 -0
  622. package/dist/is-string.d.ts +20 -3
  623. package/dist/is-string.d.ts.map +1 -0
  624. package/dist/is-string.js +2 -1
  625. package/dist/is-string.js.map +1 -0
  626. package/dist/is-symbol.cjs +1 -1
  627. package/dist/is-symbol.d.cts +20 -3
  628. package/dist/is-symbol.d.cts.map +1 -0
  629. package/dist/is-symbol.d.ts +20 -3
  630. package/dist/is-symbol.d.ts.map +1 -0
  631. package/dist/is-symbol.js +2 -1
  632. package/dist/is-symbol.js.map +1 -0
  633. package/dist/is-truthy.cjs +1 -1
  634. package/dist/is-truthy.d.cts +21 -2
  635. package/dist/is-truthy.d.cts.map +1 -0
  636. package/dist/is-truthy.d.ts +21 -2
  637. package/dist/is-truthy.d.ts.map +1 -0
  638. package/dist/is-truthy.js +2 -1
  639. package/dist/is-truthy.js.map +1 -0
  640. package/dist/is-union-Bu19sEkP.d.ts +8 -0
  641. package/dist/is-union-Bu19sEkP.d.ts.map +1 -0
  642. package/dist/is-union-Dp9mCo1b.d.cts +8 -0
  643. package/dist/is-union-Dp9mCo1b.d.cts.map +1 -0
  644. package/dist/iterable-container-BdjPuIjL.d.ts +17 -0
  645. package/dist/iterable-container-BdjPuIjL.d.ts.map +1 -0
  646. package/dist/iterable-container-OFsaw8WL.d.cts +17 -0
  647. package/dist/iterable-container-OFsaw8WL.d.cts.map +1 -0
  648. package/dist/join.cjs +1 -1
  649. package/dist/join.d.cts +46 -2
  650. package/dist/join.d.cts.map +1 -0
  651. package/dist/join.d.ts +46 -2
  652. package/dist/join.d.ts.map +1 -0
  653. package/dist/join.js +2 -1
  654. package/dist/join.js.map +1 -0
  655. package/dist/key-codes.cjs +1 -1
  656. package/dist/key-codes.d.cts +29 -2
  657. package/dist/key-codes.d.cts.map +1 -0
  658. package/dist/key-codes.d.ts +29 -2
  659. package/dist/key-codes.d.ts.map +1 -0
  660. package/dist/key-codes.js +2 -1
  661. package/dist/key-codes.js.map +1 -0
  662. package/dist/keys.cjs +1 -1
  663. package/dist/keys.d.cts +38 -5
  664. package/dist/keys.d.cts.map +1 -0
  665. package/dist/keys.d.ts +38 -5
  666. package/dist/keys.d.ts.map +1 -0
  667. package/dist/keys.js +2 -1
  668. package/dist/keys.js.map +1 -0
  669. package/dist/last.cjs +1 -1
  670. package/dist/last.d.cts +37 -3
  671. package/dist/last.d.cts.map +1 -0
  672. package/dist/last.d.ts +37 -3
  673. package/dist/last.d.ts.map +1 -0
  674. package/dist/last.js +2 -1
  675. package/dist/last.js.map +1 -0
  676. package/dist/lazy-data-last-impl-D4kLybyP.cjs +1 -0
  677. package/dist/lazy-data-last-impl-DW5TXWv8.js +2 -0
  678. package/dist/lazy-data-last-impl-DW5TXWv8.js.map +1 -0
  679. package/dist/length.cjs +1 -1
  680. package/dist/length.d.cts +28 -2
  681. package/dist/length.d.cts.map +1 -0
  682. package/dist/length.d.ts +28 -2
  683. package/dist/length.d.ts.map +1 -0
  684. package/dist/length.js +2 -1
  685. package/dist/length.js.map +1 -0
  686. package/dist/magic-string.es-BY9a6RR2.js +15 -0
  687. package/dist/magic-string.es-BY9a6RR2.js.map +1 -0
  688. package/dist/magic-string.es-CGYIWauW.cjs +15 -0
  689. package/dist/map-keys.cjs +1 -1
  690. package/dist/map-keys.d.cts +34 -7
  691. package/dist/map-keys.d.cts.map +1 -0
  692. package/dist/map-keys.d.ts +34 -7
  693. package/dist/map-keys.d.ts.map +1 -0
  694. package/dist/map-keys.js +2 -1
  695. package/dist/map-keys.js.map +1 -0
  696. package/dist/map-to-obj.cjs +1 -1
  697. package/dist/map-to-obj.d.cts +68 -2
  698. package/dist/map-to-obj.d.cts.map +1 -0
  699. package/dist/map-to-obj.d.ts +68 -2
  700. package/dist/map-to-obj.d.ts.map +1 -0
  701. package/dist/map-to-obj.js +2 -1
  702. package/dist/map-to-obj.js.map +1 -0
  703. package/dist/map-values.cjs +1 -1
  704. package/dist/map-values.d.cts +42 -5
  705. package/dist/map-values.d.cts.map +1 -0
  706. package/dist/map-values.d.ts +42 -5
  707. package/dist/map-values.d.ts.map +1 -0
  708. package/dist/map-values.js +2 -1
  709. package/dist/map-values.js.map +1 -0
  710. package/dist/map-with-feedback.cjs +1 -1
  711. package/dist/map-with-feedback.d.cts +54 -4
  712. package/dist/map-with-feedback.d.cts.map +1 -0
  713. package/dist/map-with-feedback.d.ts +54 -4
  714. package/dist/map-with-feedback.d.ts.map +1 -0
  715. package/dist/map-with-feedback.js +2 -1
  716. package/dist/map-with-feedback.js.map +1 -0
  717. package/dist/map.cjs +1 -1
  718. package/dist/map.d.cts +47 -4
  719. package/dist/map.d.cts.map +1 -0
  720. package/dist/map.d.ts +47 -4
  721. package/dist/map.d.ts.map +1 -0
  722. package/dist/map.js +2 -1
  723. package/dist/map.js.map +1 -0
  724. package/dist/mapped-LCblUtt3.d.ts +7 -0
  725. package/dist/mapped-LCblUtt3.d.ts.map +1 -0
  726. package/dist/mapped-m3FRlUOA.d.cts +7 -0
  727. package/dist/mapped-m3FRlUOA.d.cts.map +1 -0
  728. package/dist/mean-by.cjs +1 -1
  729. package/dist/mean-by.d.cts +35 -2
  730. package/dist/mean-by.d.cts.map +1 -0
  731. package/dist/mean-by.d.ts +35 -2
  732. package/dist/mean-by.d.ts.map +1 -0
  733. package/dist/mean-by.js +2 -1
  734. package/dist/mean-by.js.map +1 -0
  735. package/dist/merge-all-B9JBhVzy.d.ts +42 -0
  736. package/dist/merge-all-B9JBhVzy.d.ts.map +1 -0
  737. package/dist/merge-all-CW8DGAy8.d.cts +42 -0
  738. package/dist/merge-all-CW8DGAy8.d.cts.map +1 -0
  739. package/dist/merge-all.cjs +1 -1
  740. package/dist/merge-all.d.cts +1 -5
  741. package/dist/merge-all.d.ts +1 -5
  742. package/dist/merge-all.js +2 -1
  743. package/dist/merge-all.js.map +1 -0
  744. package/dist/merge-deep.cjs +1 -1
  745. package/dist/merge-deep.d.cts +37 -2
  746. package/dist/merge-deep.d.cts.map +1 -0
  747. package/dist/merge-deep.d.ts +37 -2
  748. package/dist/merge-deep.d.ts.map +1 -0
  749. package/dist/merge-deep.js +2 -1
  750. package/dist/merge-deep.js.map +1 -0
  751. package/dist/merge.cjs +1 -1
  752. package/dist/merge.d.cts +57 -2
  753. package/dist/merge.d.cts.map +1 -0
  754. package/dist/merge.d.ts +57 -2
  755. package/dist/merge.d.ts.map +1 -0
  756. package/dist/merge.js +2 -1
  757. package/dist/merge.js.map +1 -0
  758. package/dist/multiply.cjs +1 -1
  759. package/dist/multiply.d.cts +33 -2
  760. package/dist/multiply.d.cts.map +1 -0
  761. package/dist/multiply.d.ts +33 -2
  762. package/dist/multiply.d.ts.map +1 -0
  763. package/dist/multiply.js +2 -1
  764. package/dist/multiply.js.map +1 -0
  765. package/dist/n-tuple-Bu1e7UH_.d.cts +12 -0
  766. package/dist/n-tuple-Bu1e7UH_.d.cts.map +1 -0
  767. package/dist/n-tuple-DoE0z7Kl.d.ts +12 -0
  768. package/dist/n-tuple-DoE0z7Kl.d.ts.map +1 -0
  769. package/dist/narrowed-to-Yf5qTOcD.d.cts +15 -0
  770. package/dist/narrowed-to-Yf5qTOcD.d.cts.map +1 -0
  771. package/dist/narrowed-to-j75i8Rl2.d.ts +15 -0
  772. package/dist/narrowed-to-j75i8Rl2.d.ts.map +1 -0
  773. package/dist/no-infer-BIHbaQcD.d.ts +5 -0
  774. package/dist/no-infer-BIHbaQcD.d.ts.map +1 -0
  775. package/dist/no-infer-BVbyldno.d.cts +5 -0
  776. package/dist/no-infer-BVbyldno.d.cts.map +1 -0
  777. package/dist/non-empty-array-CFG7wGD-.d.cts +5 -0
  778. package/dist/non-empty-array-CFG7wGD-.d.cts.map +1 -0
  779. package/dist/non-empty-array-DXkY7ynY.d.ts +5 -0
  780. package/dist/non-empty-array-DXkY7ynY.d.ts.map +1 -0
  781. package/dist/nth-by-Bby4vIbZ.cjs +1 -0
  782. package/dist/nth-by-Bs6FNGL-.js +2 -0
  783. package/dist/nth-by-Bs6FNGL-.js.map +1 -0
  784. package/dist/nth-by.cjs +1 -1
  785. package/dist/nth-by.d.cts +42 -5
  786. package/dist/nth-by.d.cts.map +1 -0
  787. package/dist/nth-by.d.ts +42 -5
  788. package/dist/nth-by.d.ts.map +1 -0
  789. package/dist/nth-by.js +1 -1
  790. package/dist/obj-of.cjs +1 -1
  791. package/dist/obj-of.d.cts +27 -2
  792. package/dist/obj-of.d.cts.map +1 -0
  793. package/dist/obj-of.d.ts +27 -2
  794. package/dist/obj-of.d.ts.map +1 -0
  795. package/dist/obj-of.js +2 -1
  796. package/dist/obj-of.js.map +1 -0
  797. package/dist/omit-by.cjs +1 -1
  798. package/dist/omit-by.d.cts +52 -6
  799. package/dist/omit-by.d.cts.map +1 -0
  800. package/dist/omit-by.d.ts +52 -6
  801. package/dist/omit-by.d.ts.map +1 -0
  802. package/dist/omit-by.js +2 -1
  803. package/dist/omit-by.js.map +1 -0
  804. package/dist/omit.cjs +1 -1
  805. package/dist/omit.d.cts +29 -2
  806. package/dist/omit.d.cts.map +1 -0
  807. package/dist/omit.d.ts +29 -2
  808. package/dist/omit.d.ts.map +1 -0
  809. package/dist/omit.js +2 -1
  810. package/dist/omit.js.map +1 -0
  811. package/dist/once.cjs +1 -1
  812. package/dist/once.d.cts +17 -2
  813. package/dist/once.d.cts.map +1 -0
  814. package/dist/once.d.ts +17 -2
  815. package/dist/once.d.ts.map +1 -0
  816. package/dist/once.js +2 -1
  817. package/dist/once.js.map +1 -0
  818. package/dist/only.cjs +1 -1
  819. package/dist/only.d.cts +34 -3
  820. package/dist/only.d.cts.map +1 -0
  821. package/dist/only.d.ts +34 -3
  822. package/dist/only.d.ts.map +1 -0
  823. package/dist/only.js +2 -1
  824. package/dist/only.js.map +1 -0
  825. package/dist/partial-array-CeoXpbZU.d.ts +12 -0
  826. package/dist/partial-array-CeoXpbZU.d.ts.map +1 -0
  827. package/dist/partial-array-CoV_xxyQ.d.cts +12 -0
  828. package/dist/partial-array-CoV_xxyQ.d.cts.map +1 -0
  829. package/dist/partition.cjs +1 -1
  830. package/dist/partition.d.cts +51 -2
  831. package/dist/partition.d.cts.map +1 -0
  832. package/dist/partition.d.ts +51 -2
  833. package/dist/partition.d.ts.map +1 -0
  834. package/dist/partition.js +2 -1
  835. package/dist/partition.js.map +1 -0
  836. package/dist/path-or.cjs +1 -1
  837. package/dist/path-or.d.cts +87 -2
  838. package/dist/path-or.d.cts.map +1 -0
  839. package/dist/path-or.d.ts +87 -2
  840. package/dist/path-or.d.ts.map +1 -0
  841. package/dist/path-or.js +2 -1
  842. package/dist/path-or.js.map +1 -0
  843. package/dist/perkakas-type-error-BERl_sWR.d.cts +19 -0
  844. package/dist/perkakas-type-error-BERl_sWR.d.cts.map +1 -0
  845. package/dist/perkakas-type-error-DmmsEmEF.d.ts +19 -0
  846. package/dist/perkakas-type-error-DmmsEmEF.d.ts.map +1 -0
  847. package/dist/pick-by.cjs +1 -1
  848. package/dist/pick-by.d.cts +68 -6
  849. package/dist/pick-by.d.cts.map +1 -0
  850. package/dist/pick-by.d.ts +68 -6
  851. package/dist/pick-by.d.ts.map +1 -0
  852. package/dist/pick-by.js +2 -1
  853. package/dist/pick-by.js.map +1 -0
  854. package/dist/pick.cjs +1 -1
  855. package/dist/pick.d.cts +66 -7
  856. package/dist/pick.d.cts.map +1 -0
  857. package/dist/pick.d.ts +66 -7
  858. package/dist/pick.d.ts.map +1 -0
  859. package/dist/pick.js +2 -1
  860. package/dist/pick.js.map +1 -0
  861. package/dist/pipe-BGazHnZ_.js +2 -0
  862. package/dist/pipe-BGazHnZ_.js.map +1 -0
  863. package/dist/pipe-CB7Lufqv.cjs +1 -0
  864. package/dist/pipe.cjs +1 -1
  865. package/dist/pipe.d.cts +34 -2
  866. package/dist/pipe.d.cts.map +1 -0
  867. package/dist/pipe.d.ts +34 -2
  868. package/dist/pipe.d.ts.map +1 -0
  869. package/dist/pipe.js +1 -1
  870. package/dist/piped.cjs +1 -1
  871. package/dist/piped.d.cts +31 -2
  872. package/dist/piped.d.cts.map +1 -0
  873. package/dist/piped.d.ts +31 -2
  874. package/dist/piped.d.ts.map +1 -0
  875. package/dist/piped.js +2 -1
  876. package/dist/piped.js.map +1 -0
  877. package/dist/product.cjs +1 -1
  878. package/dist/product.d.cts +52 -3
  879. package/dist/product.d.cts.map +1 -0
  880. package/dist/product.d.ts +52 -3
  881. package/dist/product.d.ts.map +1 -0
  882. package/dist/product.js +2 -1
  883. package/dist/product.js.map +1 -0
  884. package/dist/prop-C3rYih5m.d.cts +86 -0
  885. package/dist/prop-C3rYih5m.d.cts.map +1 -0
  886. package/dist/prop-DulcbWGG.d.ts +86 -0
  887. package/dist/prop-DulcbWGG.d.ts.map +1 -0
  888. package/dist/prop.cjs +1 -1
  889. package/dist/prop.d.cts +1 -6
  890. package/dist/prop.d.ts +1 -6
  891. package/dist/prop.js +2 -1
  892. package/dist/prop.js.map +1 -0
  893. package/dist/pull-object.cjs +1 -1
  894. package/dist/pull-object.d.cts +70 -5
  895. package/dist/pull-object.d.cts.map +1 -0
  896. package/dist/pull-object.d.ts +70 -5
  897. package/dist/pull-object.d.ts.map +1 -0
  898. package/dist/pull-object.js +2 -1
  899. package/dist/pull-object.js.map +1 -0
  900. package/dist/random-integer.cjs +1 -1
  901. package/dist/random-integer.d.cts +23 -3
  902. package/dist/random-integer.d.cts.map +1 -0
  903. package/dist/random-integer.d.ts +23 -3
  904. package/dist/random-integer.d.ts.map +1 -0
  905. package/dist/random-integer.js +2 -1
  906. package/dist/random-integer.js.map +1 -0
  907. package/dist/random-string.cjs +1 -1
  908. package/dist/random-string.d.cts +29 -2
  909. package/dist/random-string.d.cts.map +1 -0
  910. package/dist/random-string.d.ts +29 -2
  911. package/dist/random-string.d.ts.map +1 -0
  912. package/dist/random-string.js +2 -1
  913. package/dist/random-string.js.map +1 -0
  914. package/dist/range.cjs +1 -1
  915. package/dist/range.d.cts +27 -2
  916. package/dist/range.d.cts.map +1 -0
  917. package/dist/range.d.ts +27 -2
  918. package/dist/range.d.ts.map +1 -0
  919. package/dist/range.js +2 -1
  920. package/dist/range.js.map +1 -0
  921. package/dist/rank-by.cjs +1 -1
  922. package/dist/rank-by.d.cts +45 -4
  923. package/dist/rank-by.d.cts.map +1 -0
  924. package/dist/rank-by.d.ts +45 -4
  925. package/dist/rank-by.d.ts.map +1 -0
  926. package/dist/rank-by.js +2 -1
  927. package/dist/rank-by.js.map +1 -0
  928. package/dist/reduce.cjs +1 -1
  929. package/dist/reduce.d.cts +53 -2
  930. package/dist/reduce.d.cts.map +1 -0
  931. package/dist/reduce.d.ts +53 -2
  932. package/dist/reduce.d.ts.map +1 -0
  933. package/dist/reduce.js +2 -1
  934. package/dist/reduce.js.map +1 -0
  935. package/dist/reordered-array-B2klHneX.d.ts +7 -0
  936. package/dist/reordered-array-B2klHneX.d.ts.map +1 -0
  937. package/dist/reordered-array-BsUBOnYh.d.cts +7 -0
  938. package/dist/reordered-array-BsUBOnYh.d.cts.map +1 -0
  939. package/dist/reverse.cjs +1 -1
  940. package/dist/reverse.d.cts +29 -2
  941. package/dist/reverse.d.cts.map +1 -0
  942. package/dist/reverse.d.ts +29 -2
  943. package/dist/reverse.d.ts.map +1 -0
  944. package/dist/reverse.js +2 -1
  945. package/dist/reverse.js.map +1 -0
  946. package/dist/round.cjs +1 -1
  947. package/dist/round.d.cts +39 -2
  948. package/dist/round.d.cts.map +1 -0
  949. package/dist/round.d.ts +39 -2
  950. package/dist/round.d.ts.map +1 -0
  951. package/dist/round.js +2 -1
  952. package/dist/round.js.map +1 -0
  953. package/dist/sample.cjs +1 -1
  954. package/dist/sample.d.cts +69 -8
  955. package/dist/sample.d.cts.map +1 -0
  956. package/dist/sample.d.ts +69 -8
  957. package/dist/sample.d.ts.map +1 -0
  958. package/dist/sample.js +2 -1
  959. package/dist/sample.js.map +1 -0
  960. package/dist/set-path.cjs +1 -1
  961. package/dist/set-path.d.cts +47 -3
  962. package/dist/set-path.d.cts.map +1 -0
  963. package/dist/set-path.d.ts +47 -3
  964. package/dist/set-path.d.ts.map +1 -0
  965. package/dist/set-path.js +2 -1
  966. package/dist/set-path.js.map +1 -0
  967. package/dist/set.cjs +1 -1
  968. package/dist/set.d.cts +40 -4
  969. package/dist/set.d.cts.map +1 -0
  970. package/dist/set.d.ts +40 -4
  971. package/dist/set.d.ts.map +1 -0
  972. package/dist/set.js +2 -1
  973. package/dist/set.js.map +1 -0
  974. package/dist/shuffle.cjs +1 -1
  975. package/dist/shuffle.d.cts +31 -4
  976. package/dist/shuffle.d.cts.map +1 -0
  977. package/dist/shuffle.d.ts +31 -4
  978. package/dist/shuffle.d.ts.map +1 -0
  979. package/dist/shuffle.js +2 -1
  980. package/dist/shuffle.js.map +1 -0
  981. package/dist/sleep.cjs +1 -1
  982. package/dist/sleep.d.cts +16 -2
  983. package/dist/sleep.d.cts.map +1 -0
  984. package/dist/sleep.d.ts +16 -2
  985. package/dist/sleep.d.ts.map +1 -0
  986. package/dist/sleep.js +2 -1
  987. package/dist/sleep.js.map +1 -0
  988. package/dist/slice-string.cjs +1 -1
  989. package/dist/slice-string.d.cts +41 -2
  990. package/dist/slice-string.d.cts.map +1 -0
  991. package/dist/slice-string.d.ts +41 -2
  992. package/dist/slice-string.d.ts.map +1 -0
  993. package/dist/slice-string.js +2 -1
  994. package/dist/slice-string.js.map +1 -0
  995. package/dist/slugify.cjs +1 -1
  996. package/dist/slugify.d.cts +15 -2
  997. package/dist/slugify.d.cts.map +1 -0
  998. package/dist/slugify.d.ts +15 -2
  999. package/dist/slugify.d.ts.map +1 -0
  1000. package/dist/slugify.js +2 -1
  1001. package/dist/slugify.js.map +1 -0
  1002. package/dist/sort-by.cjs +1 -1
  1003. package/dist/sort-by.d.cts +88 -6
  1004. package/dist/sort-by.d.cts.map +1 -0
  1005. package/dist/sort-by.d.ts +88 -6
  1006. package/dist/sort-by.d.ts.map +1 -0
  1007. package/dist/sort-by.js +2 -1
  1008. package/dist/sort-by.js.map +1 -0
  1009. package/dist/sort.cjs +1 -1
  1010. package/dist/sort.d.cts +39 -4
  1011. package/dist/sort.d.cts.map +1 -0
  1012. package/dist/sort.d.ts +39 -4
  1013. package/dist/sort.d.ts.map +1 -0
  1014. package/dist/sort.js +2 -1
  1015. package/dist/sort.js.map +1 -0
  1016. package/dist/sorted-index-by.cjs +1 -1
  1017. package/dist/sorted-index-by.d.cts +70 -2
  1018. package/dist/sorted-index-by.d.cts.map +1 -0
  1019. package/dist/sorted-index-by.d.ts +70 -2
  1020. package/dist/sorted-index-by.d.ts.map +1 -0
  1021. package/dist/sorted-index-by.js +2 -1
  1022. package/dist/sorted-index-by.js.map +1 -0
  1023. package/dist/sorted-index-with.cjs +1 -1
  1024. package/dist/sorted-index-with.d.cts +72 -2
  1025. package/dist/sorted-index-with.d.cts.map +1 -0
  1026. package/dist/sorted-index-with.d.ts +72 -2
  1027. package/dist/sorted-index-with.d.ts.map +1 -0
  1028. package/dist/sorted-index-with.js +2 -1
  1029. package/dist/sorted-index-with.js.map +1 -0
  1030. package/dist/sorted-index.cjs +1 -1
  1031. package/dist/sorted-index.d.cts +45 -2
  1032. package/dist/sorted-index.d.cts.map +1 -0
  1033. package/dist/sorted-index.d.ts +45 -2
  1034. package/dist/sorted-index.d.ts.map +1 -0
  1035. package/dist/sorted-index.js +2 -1
  1036. package/dist/sorted-index.js.map +1 -0
  1037. package/dist/sorted-last-index-by.cjs +1 -1
  1038. package/dist/sorted-last-index-by.d.cts +72 -2
  1039. package/dist/sorted-last-index-by.d.cts.map +1 -0
  1040. package/dist/sorted-last-index-by.d.ts +72 -2
  1041. package/dist/sorted-last-index-by.d.ts.map +1 -0
  1042. package/dist/sorted-last-index-by.js +2 -1
  1043. package/dist/sorted-last-index-by.js.map +1 -0
  1044. package/dist/sorted-last-index.cjs +1 -1
  1045. package/dist/sorted-last-index.d.cts +45 -2
  1046. package/dist/sorted-last-index.d.cts.map +1 -0
  1047. package/dist/sorted-last-index.d.ts +45 -2
  1048. package/dist/sorted-last-index.d.ts.map +1 -0
  1049. package/dist/sorted-last-index.js +2 -1
  1050. package/dist/sorted-last-index.js.map +1 -0
  1051. package/dist/splice.cjs +1 -1
  1052. package/dist/splice.d.cts +35 -2
  1053. package/dist/splice.d.cts.map +1 -0
  1054. package/dist/splice.d.ts +35 -2
  1055. package/dist/splice.d.ts.map +1 -0
  1056. package/dist/splice.js +2 -1
  1057. package/dist/splice.js.map +1 -0
  1058. package/dist/split-at.cjs +1 -1
  1059. package/dist/split-at.d.cts +31 -2
  1060. package/dist/split-at.d.cts.map +1 -0
  1061. package/dist/split-at.d.ts +31 -2
  1062. package/dist/split-at.d.ts.map +1 -0
  1063. package/dist/split-at.js +2 -1
  1064. package/dist/split-at.js.map +1 -0
  1065. package/dist/split-when.cjs +1 -1
  1066. package/dist/split-when.d.cts +29 -2
  1067. package/dist/split-when.d.cts.map +1 -0
  1068. package/dist/split-when.d.ts +29 -2
  1069. package/dist/split-when.d.ts.map +1 -0
  1070. package/dist/split-when.js +2 -1
  1071. package/dist/split-when.js.map +1 -0
  1072. package/dist/split.cjs +1 -1
  1073. package/dist/split.d.cts +62 -2
  1074. package/dist/split.d.cts.map +1 -0
  1075. package/dist/split.d.ts +62 -2
  1076. package/dist/split.d.ts.map +1 -0
  1077. package/dist/split.js +2 -1
  1078. package/dist/split.js.map +1 -0
  1079. package/dist/string-to-path.cjs +1 -1
  1080. package/dist/string-to-path.d.cts +39 -2
  1081. package/dist/string-to-path.d.cts.map +1 -0
  1082. package/dist/string-to-path.d.ts +39 -2
  1083. package/dist/string-to-path.d.ts.map +1 -0
  1084. package/dist/string-to-path.js +2 -1
  1085. package/dist/string-to-path.js.map +1 -0
  1086. package/dist/subtract.cjs +1 -1
  1087. package/dist/subtract.d.cts +35 -2
  1088. package/dist/subtract.d.cts.map +1 -0
  1089. package/dist/subtract.d.ts +35 -2
  1090. package/dist/subtract.d.ts.map +1 -0
  1091. package/dist/subtract.js +2 -1
  1092. package/dist/subtract.js.map +1 -0
  1093. package/dist/sum-by.cjs +1 -1
  1094. package/dist/sum-by.d.cts +57 -3
  1095. package/dist/sum-by.d.cts.map +1 -0
  1096. package/dist/sum-by.d.ts +57 -3
  1097. package/dist/sum-by.d.ts.map +1 -0
  1098. package/dist/sum-by.js +2 -1
  1099. package/dist/sum-by.js.map +1 -0
  1100. package/dist/sum.cjs +1 -1
  1101. package/dist/sum.d.cts +50 -3
  1102. package/dist/sum.d.cts.map +1 -0
  1103. package/dist/sum.d.ts +50 -3
  1104. package/dist/sum.d.ts.map +1 -0
  1105. package/dist/sum.js +2 -1
  1106. package/dist/sum.js.map +1 -0
  1107. package/dist/swap-in-place-BHkB_mvV.cjs +1 -0
  1108. package/dist/swap-in-place-COm7qHj4.js +2 -0
  1109. package/dist/swap-in-place-COm7qHj4.js.map +1 -0
  1110. package/dist/swap-indices.cjs +1 -1
  1111. package/dist/swap-indices.d.cts +61 -3
  1112. package/dist/swap-indices.d.cts.map +1 -0
  1113. package/dist/swap-indices.d.ts +61 -3
  1114. package/dist/swap-indices.d.ts.map +1 -0
  1115. package/dist/swap-indices.js +2 -1
  1116. package/dist/swap-indices.js.map +1 -0
  1117. package/dist/swap-props.cjs +1 -1
  1118. package/dist/swap-props.d.cts +34 -2
  1119. package/dist/swap-props.d.cts.map +1 -0
  1120. package/dist/swap-props.d.ts +34 -2
  1121. package/dist/swap-props.d.ts.map +1 -0
  1122. package/dist/swap-props.js +2 -1
  1123. package/dist/swap-props.js.map +1 -0
  1124. package/dist/take-first-by.cjs +1 -1
  1125. package/dist/take-first-by.d.cts +41 -4
  1126. package/dist/take-first-by.d.cts.map +1 -0
  1127. package/dist/take-first-by.d.ts +41 -4
  1128. package/dist/take-first-by.d.ts.map +1 -0
  1129. package/dist/take-first-by.js +2 -1
  1130. package/dist/take-first-by.js.map +1 -0
  1131. package/dist/take-last-while.cjs +1 -1
  1132. package/dist/take-last-while.d.cts +36 -3
  1133. package/dist/take-last-while.d.cts.map +1 -0
  1134. package/dist/take-last-while.d.ts +36 -3
  1135. package/dist/take-last-while.d.ts.map +1 -0
  1136. package/dist/take-last-while.js +2 -1
  1137. package/dist/take-last-while.js.map +1 -0
  1138. package/dist/take-last.cjs +1 -1
  1139. package/dist/take-last.d.cts +32 -3
  1140. package/dist/take-last.d.cts.map +1 -0
  1141. package/dist/take-last.d.ts +32 -3
  1142. package/dist/take-last.d.ts.map +1 -0
  1143. package/dist/take-last.js +2 -1
  1144. package/dist/take-last.js.map +1 -0
  1145. package/dist/take-while.cjs +1 -1
  1146. package/dist/take-while.d.cts +34 -3
  1147. package/dist/take-while.d.cts.map +1 -0
  1148. package/dist/take-while.d.ts +34 -3
  1149. package/dist/take-while.d.ts.map +1 -0
  1150. package/dist/take-while.js +2 -1
  1151. package/dist/take-while.js.map +1 -0
  1152. package/dist/take.cjs +1 -1
  1153. package/dist/take.d.cts +34 -3
  1154. package/dist/take.d.cts.map +1 -0
  1155. package/dist/take.d.ts +34 -3
  1156. package/dist/take.d.ts.map +1 -0
  1157. package/dist/take.js +2 -1
  1158. package/dist/take.js.map +1 -0
  1159. package/dist/tap.cjs +1 -1
  1160. package/dist/tap.d.cts +42 -2
  1161. package/dist/tap.d.cts.map +1 -0
  1162. package/dist/tap.d.ts +42 -2
  1163. package/dist/tap.d.ts.map +1 -0
  1164. package/dist/tap.js +2 -1
  1165. package/dist/tap.js.map +1 -0
  1166. package/dist/times.cjs +1 -1
  1167. package/dist/times.d.cts +48 -2
  1168. package/dist/times.d.cts.map +1 -0
  1169. package/dist/times.d.ts +48 -2
  1170. package/dist/times.d.ts.map +1 -0
  1171. package/dist/times.js +2 -1
  1172. package/dist/times.js.map +1 -0
  1173. package/dist/to-camel-case.cjs +1 -1
  1174. package/dist/to-camel-case.d.cts +32 -3
  1175. package/dist/to-camel-case.d.cts.map +1 -0
  1176. package/dist/to-camel-case.d.ts +32 -3
  1177. package/dist/to-camel-case.d.ts.map +1 -0
  1178. package/dist/to-camel-case.js +2 -1
  1179. package/dist/to-camel-case.js.map +1 -0
  1180. package/dist/to-capital-case.cjs +1 -1
  1181. package/dist/to-capital-case.d.cts +31 -3
  1182. package/dist/to-capital-case.d.cts.map +1 -0
  1183. package/dist/to-capital-case.d.ts +31 -3
  1184. package/dist/to-capital-case.d.ts.map +1 -0
  1185. package/dist/to-capital-case.js +2 -1
  1186. package/dist/to-capital-case.js.map +1 -0
  1187. package/dist/to-constant-case.cjs +1 -1
  1188. package/dist/to-constant-case.d.cts +31 -3
  1189. package/dist/to-constant-case.d.cts.map +1 -0
  1190. package/dist/to-constant-case.d.ts +31 -3
  1191. package/dist/to-constant-case.d.ts.map +1 -0
  1192. package/dist/to-constant-case.js +2 -1
  1193. package/dist/to-constant-case.js.map +1 -0
  1194. package/dist/to-kebab-case.cjs +1 -1
  1195. package/dist/to-kebab-case.d.cts +31 -3
  1196. package/dist/to-kebab-case.d.cts.map +1 -0
  1197. package/dist/to-kebab-case.d.ts +31 -3
  1198. package/dist/to-kebab-case.d.ts.map +1 -0
  1199. package/dist/to-kebab-case.js +2 -1
  1200. package/dist/to-kebab-case.js.map +1 -0
  1201. package/dist/to-no-case.cjs +1 -1
  1202. package/dist/to-no-case.d.cts +31 -3
  1203. package/dist/to-no-case.d.cts.map +1 -0
  1204. package/dist/to-no-case.d.ts +31 -3
  1205. package/dist/to-no-case.d.ts.map +1 -0
  1206. package/dist/to-no-case.js +2 -1
  1207. package/dist/to-no-case.js.map +1 -0
  1208. package/dist/to-pascal-case.cjs +1 -1
  1209. package/dist/to-pascal-case.d.cts +32 -3
  1210. package/dist/to-pascal-case.d.cts.map +1 -0
  1211. package/dist/to-pascal-case.d.ts +32 -3
  1212. package/dist/to-pascal-case.d.ts.map +1 -0
  1213. package/dist/to-pascal-case.js +2 -1
  1214. package/dist/to-pascal-case.js.map +1 -0
  1215. package/dist/to-pascal-snake-case.cjs +1 -1
  1216. package/dist/to-pascal-snake-case.d.cts +31 -3
  1217. package/dist/to-pascal-snake-case.d.cts.map +1 -0
  1218. package/dist/to-pascal-snake-case.d.ts +31 -3
  1219. package/dist/to-pascal-snake-case.d.ts.map +1 -0
  1220. package/dist/to-pascal-snake-case.js +2 -1
  1221. package/dist/to-pascal-snake-case.js.map +1 -0
  1222. package/dist/to-sentence-case.cjs +1 -1
  1223. package/dist/to-sentence-case.d.cts +31 -3
  1224. package/dist/to-sentence-case.d.cts.map +1 -0
  1225. package/dist/to-sentence-case.d.ts +31 -3
  1226. package/dist/to-sentence-case.d.ts.map +1 -0
  1227. package/dist/to-sentence-case.js +2 -1
  1228. package/dist/to-sentence-case.js.map +1 -0
  1229. package/dist/to-single-Chq_hKEk.cjs +1 -0
  1230. package/dist/to-single-vYpRavjM.js +2 -0
  1231. package/dist/to-single-vYpRavjM.js.map +1 -0
  1232. package/dist/to-snake-case.cjs +1 -1
  1233. package/dist/to-snake-case.d.cts +31 -3
  1234. package/dist/to-snake-case.d.cts.map +1 -0
  1235. package/dist/to-snake-case.d.ts +31 -3
  1236. package/dist/to-snake-case.d.ts.map +1 -0
  1237. package/dist/to-snake-case.js +2 -1
  1238. package/dist/to-snake-case.js.map +1 -0
  1239. package/dist/to-string-C6_OnZ6e.d.ts +13 -0
  1240. package/dist/to-string-C6_OnZ6e.d.ts.map +1 -0
  1241. package/dist/to-string-Se4KcQka.d.cts +13 -0
  1242. package/dist/to-string-Se4KcQka.d.cts.map +1 -0
  1243. package/dist/to-train-case.cjs +1 -1
  1244. package/dist/to-train-case.d.cts +31 -3
  1245. package/dist/to-train-case.d.cts.map +1 -0
  1246. package/dist/to-train-case.d.ts +31 -3
  1247. package/dist/to-train-case.d.ts.map +1 -0
  1248. package/dist/to-train-case.js +2 -1
  1249. package/dist/to-train-case.js.map +1 -0
  1250. package/dist/tuple-parts-BJQEORxn.d.cts +89 -0
  1251. package/dist/tuple-parts-BJQEORxn.d.cts.map +1 -0
  1252. package/dist/tuple-parts-Bhbm4jiu.d.ts +89 -0
  1253. package/dist/tuple-parts-Bhbm4jiu.d.ts.map +1 -0
  1254. package/dist/type.helpers.cjs +0 -1
  1255. package/dist/type.helpers.d.cts +5 -2
  1256. package/dist/type.helpers.d.cts.map +1 -0
  1257. package/dist/type.helpers.d.ts +5 -2
  1258. package/dist/type.helpers.d.ts.map +1 -0
  1259. package/dist/type.helpers.js +0 -1
  1260. package/dist/unique-by.cjs +1 -1
  1261. package/dist/unique-by.d.cts +44 -5
  1262. package/dist/unique-by.d.cts.map +1 -0
  1263. package/dist/unique-by.d.ts +44 -5
  1264. package/dist/unique-by.d.ts.map +1 -0
  1265. package/dist/unique-by.js +2 -1
  1266. package/dist/unique-by.js.map +1 -0
  1267. package/dist/unique-with.cjs +1 -1
  1268. package/dist/unique-with.d.cts +46 -5
  1269. package/dist/unique-with.d.cts.map +1 -0
  1270. package/dist/unique-with.d.ts +46 -5
  1271. package/dist/unique-with.d.ts.map +1 -0
  1272. package/dist/unique-with.js +2 -1
  1273. package/dist/unique-with.js.map +1 -0
  1274. package/dist/unique.cjs +1 -1
  1275. package/dist/unique.d.cts +39 -5
  1276. package/dist/unique.d.cts.map +1 -0
  1277. package/dist/unique.d.ts +39 -5
  1278. package/dist/unique.d.ts.map +1 -0
  1279. package/dist/unique.js +2 -1
  1280. package/dist/unique.js.map +1 -0
  1281. package/dist/upsert-prop-P-aJDDII.d.cts +9 -0
  1282. package/dist/upsert-prop-P-aJDDII.d.cts.map +1 -0
  1283. package/dist/upsert-prop-__xTQQ07.d.ts +9 -0
  1284. package/dist/upsert-prop-__xTQQ07.d.ts.map +1 -0
  1285. package/dist/utility-evaluators-BwYLtB8b.js +2 -0
  1286. package/dist/utility-evaluators-BwYLtB8b.js.map +1 -0
  1287. package/dist/utility-evaluators-CAbODbuk.cjs +1 -0
  1288. package/dist/values.cjs +1 -1
  1289. package/dist/values.d.cts +38 -4
  1290. package/dist/values.d.cts.map +1 -0
  1291. package/dist/values.d.ts +38 -4
  1292. package/dist/values.d.ts.map +1 -0
  1293. package/dist/values.js +2 -1
  1294. package/dist/values.js.map +1 -0
  1295. package/dist/with-precision-CWWiMmxZ.js +2 -0
  1296. package/dist/with-precision-CWWiMmxZ.js.map +1 -0
  1297. package/dist/with-precision-dQAYLrgr.cjs +1 -0
  1298. package/dist/zip-with.cjs +1 -1
  1299. package/dist/zip-with.d.cts +50 -3
  1300. package/dist/zip-with.d.cts.map +1 -0
  1301. package/dist/zip-with.d.ts +50 -3
  1302. package/dist/zip-with.d.ts.map +1 -0
  1303. package/dist/zip-with.js +2 -1
  1304. package/dist/zip-with.js.map +1 -0
  1305. package/dist/zip.cjs +1 -1
  1306. package/dist/zip.d.cts +38 -3
  1307. package/dist/zip.d.cts.map +1 -0
  1308. package/dist/zip.d.ts +38 -3
  1309. package/dist/zip.d.ts.map +1 -0
  1310. package/dist/zip.js +2 -1
  1311. package/dist/zip.js.map +1 -0
  1312. package/package.json +7 -9
  1313. package/dist/add-CbtGbPU8.cjs +0 -1
  1314. package/dist/add-D2WnMolJ.d.cts +0 -34
  1315. package/dist/add-D2WnMolJ.d.cts.map +0 -1
  1316. package/dist/add-XyDHfOBw.js +0 -2
  1317. package/dist/add-XyDHfOBw.js.map +0 -1
  1318. package/dist/add-im980AO9.d.ts +0 -34
  1319. package/dist/add-im980AO9.d.ts.map +0 -1
  1320. package/dist/add-prop-BxqZdgPd.cjs +0 -1
  1321. package/dist/add-prop-CMZauInB.d.ts +0 -46
  1322. package/dist/add-prop-CMZauInB.d.ts.map +0 -1
  1323. package/dist/add-prop-CX56m6sR.js +0 -2
  1324. package/dist/add-prop-CX56m6sR.js.map +0 -1
  1325. package/dist/add-prop-tIjpXGRH.d.cts +0 -46
  1326. package/dist/add-prop-tIjpXGRH.d.cts.map +0 -1
  1327. package/dist/all-pass-BCivJ27h.d.cts +0 -37
  1328. package/dist/all-pass-BCivJ27h.d.cts.map +0 -1
  1329. package/dist/all-pass-DXpE2AMI.d.ts +0 -37
  1330. package/dist/all-pass-DXpE2AMI.d.ts.map +0 -1
  1331. package/dist/all-pass-Dm8Dnhq7.cjs +0 -1
  1332. package/dist/all-pass-TOwgGHEo.js +0 -2
  1333. package/dist/all-pass-TOwgGHEo.js.map +0 -1
  1334. package/dist/any-pass-B1tqZ-S8.js +0 -2
  1335. package/dist/any-pass-B1tqZ-S8.js.map +0 -1
  1336. package/dist/any-pass-BUlFAsyd.d.cts +0 -37
  1337. package/dist/any-pass-BUlFAsyd.d.cts.map +0 -1
  1338. package/dist/any-pass-DODvFXfM.d.ts +0 -37
  1339. package/dist/any-pass-DODvFXfM.d.ts.map +0 -1
  1340. package/dist/any-pass-UiZWZkzr.cjs +0 -1
  1341. package/dist/array-required-prefix-BeSNHH4G.d.ts +0 -26
  1342. package/dist/array-required-prefix-BeSNHH4G.d.ts.map +0 -1
  1343. package/dist/array-required-prefix-FSH3Acx8.d.cts +0 -26
  1344. package/dist/array-required-prefix-FSH3Acx8.d.cts.map +0 -1
  1345. package/dist/binary-search-cutoff-index-B3xuP0oe.cjs +0 -1
  1346. package/dist/binary-search-cutoff-index-QhLfC_4-.js +0 -2
  1347. package/dist/binary-search-cutoff-index-QhLfC_4-.js.map +0 -1
  1348. package/dist/bounded-partial-A89bt7Kj.d.cts +0 -17
  1349. package/dist/bounded-partial-A89bt7Kj.d.cts.map +0 -1
  1350. package/dist/bounded-partial-TshEjJC1.d.ts +0 -17
  1351. package/dist/bounded-partial-TshEjJC1.d.ts.map +0 -1
  1352. package/dist/case.transform-0QyAGkjI.js +0 -2
  1353. package/dist/case.transform-0QyAGkjI.js.map +0 -1
  1354. package/dist/case.transform-UvmY1E5L.cjs +0 -1
  1355. package/dist/case.types-C4kGtbSS.d.cts +0 -19
  1356. package/dist/case.types-C4kGtbSS.d.cts.map +0 -1
  1357. package/dist/case.types-DegX_-fY.d.ts +0 -19
  1358. package/dist/case.types-DegX_-fY.d.ts.map +0 -1
  1359. package/dist/ceil--cMT2iUp.js +0 -2
  1360. package/dist/ceil--cMT2iUp.js.map +0 -1
  1361. package/dist/ceil-3wC2QOvT.d.ts +0 -39
  1362. package/dist/ceil-3wC2QOvT.d.ts.map +0 -1
  1363. package/dist/ceil-BfPd1zim.d.cts +0 -39
  1364. package/dist/ceil-BfPd1zim.d.cts.map +0 -1
  1365. package/dist/ceil-CgjlA1iG.cjs +0 -1
  1366. package/dist/chunk-21HuGLAn.d.ts +0 -76
  1367. package/dist/chunk-21HuGLAn.d.ts.map +0 -1
  1368. package/dist/chunk-C__yw06N.d.cts +0 -76
  1369. package/dist/chunk-C__yw06N.d.cts.map +0 -1
  1370. package/dist/chunk-_kldYmb1.cjs +0 -1
  1371. package/dist/chunk-dIPp871Q.js +0 -2
  1372. package/dist/chunk-dIPp871Q.js.map +0 -1
  1373. package/dist/clamp-Cnh0Qg03.cjs +0 -1
  1374. package/dist/clamp-DMX7Ua7I.d.cts +0 -37
  1375. package/dist/clamp-DMX7Ua7I.d.cts.map +0 -1
  1376. package/dist/clamp-V39NgixZ.d.ts +0 -37
  1377. package/dist/clamp-V39NgixZ.d.ts.map +0 -1
  1378. package/dist/clamp-zR5XX002.js +0 -2
  1379. package/dist/clamp-zR5XX002.js.map +0 -1
  1380. package/dist/clamped-integer-subtract-CQL8aT__.d.ts +0 -11
  1381. package/dist/clamped-integer-subtract-CQL8aT__.d.ts.map +0 -1
  1382. package/dist/clamped-integer-subtract-DId0tRjp.d.cts +0 -11
  1383. package/dist/clamped-integer-subtract-DId0tRjp.d.cts.map +0 -1
  1384. package/dist/clone-1QjPrzdD.d.cts +0 -35
  1385. package/dist/clone-1QjPrzdD.d.cts.map +0 -1
  1386. package/dist/clone-BcAGB1C1.js +0 -2
  1387. package/dist/clone-BcAGB1C1.js.map +0 -1
  1388. package/dist/clone-DyRAAJkh.cjs +0 -1
  1389. package/dist/clone-UasIry83.d.ts +0 -35
  1390. package/dist/clone-UasIry83.d.ts.map +0 -1
  1391. package/dist/coerced-array-DyA0Yc12.d.ts +0 -17
  1392. package/dist/coerced-array-DyA0Yc12.d.ts.map +0 -1
  1393. package/dist/coerced-array-kVJtBrMl.d.cts +0 -17
  1394. package/dist/coerced-array-kVJtBrMl.d.cts.map +0 -1
  1395. package/dist/concat-BdgaaV6q.d.cts +0 -41
  1396. package/dist/concat-BdgaaV6q.d.cts.map +0 -1
  1397. package/dist/concat-CVEXmYnw.js +0 -2
  1398. package/dist/concat-CVEXmYnw.js.map +0 -1
  1399. package/dist/concat-Cg3I4d7x.cjs +0 -1
  1400. package/dist/concat-DeyDusex.d.ts +0 -41
  1401. package/dist/concat-DeyDusex.d.ts.map +0 -1
  1402. package/dist/conditional-81kit9Lg.cjs +0 -1
  1403. package/dist/conditional-BivA0O7M.d.cts +0 -221
  1404. package/dist/conditional-BivA0O7M.d.cts.map +0 -1
  1405. package/dist/conditional-ClGfJoeu.js +0 -2
  1406. package/dist/conditional-ClGfJoeu.js.map +0 -1
  1407. package/dist/conditional-DeaF48-8.d.ts +0 -221
  1408. package/dist/conditional-DeaF48-8.d.ts.map +0 -1
  1409. package/dist/constant-BuIJ9GIn.cjs +0 -1
  1410. package/dist/constant-DD3Fj3xH.d.cts +0 -32
  1411. package/dist/constant-DD3Fj3xH.d.cts.map +0 -1
  1412. package/dist/constant-DrpDXHc7.js +0 -2
  1413. package/dist/constant-DrpDXHc7.js.map +0 -1
  1414. package/dist/constant-XCH8hVM0.d.ts +0 -32
  1415. package/dist/constant-XCH8hVM0.d.ts.map +0 -1
  1416. package/dist/count-by-CYv2OHvx.d.cts +0 -42
  1417. package/dist/count-by-CYv2OHvx.d.cts.map +0 -1
  1418. package/dist/count-by-DUtzS9CI.cjs +0 -1
  1419. package/dist/count-by-DZwTr8U_.js +0 -2
  1420. package/dist/count-by-DZwTr8U_.js.map +0 -1
  1421. package/dist/count-by-oQGTg_br.d.ts +0 -42
  1422. package/dist/count-by-oQGTg_br.d.ts.map +0 -1
  1423. package/dist/curry-B-8l-0vq.d.ts +0 -68
  1424. package/dist/curry-B-8l-0vq.d.ts.map +0 -1
  1425. package/dist/curry-BPVIsvo3.cjs +0 -1
  1426. package/dist/curry-CzZjDrpv.js +0 -2
  1427. package/dist/curry-CzZjDrpv.js.map +0 -1
  1428. package/dist/curry-from-lazy-BDH06qZ-.cjs +0 -1
  1429. package/dist/curry-from-lazy-BR-hoRDR.js +0 -2
  1430. package/dist/curry-from-lazy-BR-hoRDR.js.map +0 -1
  1431. package/dist/curry-gLBYaLmk.d.cts +0 -68
  1432. package/dist/curry-gLBYaLmk.d.cts.map +0 -1
  1433. package/dist/curry-order-rules-1zjlAgqa.d.cts +0 -48
  1434. package/dist/curry-order-rules-1zjlAgqa.d.cts.map +0 -1
  1435. package/dist/curry-order-rules-BuA7D1F4.js +0 -2
  1436. package/dist/curry-order-rules-BuA7D1F4.js.map +0 -1
  1437. package/dist/curry-order-rules-Cthu8rj4.d.ts +0 -48
  1438. package/dist/curry-order-rules-Cthu8rj4.d.ts.map +0 -1
  1439. package/dist/curry-order-rules-UcuuWkKd.cjs +0 -1
  1440. package/dist/debounce-6x-eQzOn.cjs +0 -1
  1441. package/dist/debounce-BNkJBFrQ.d.cts +0 -96
  1442. package/dist/debounce-BNkJBFrQ.d.cts.map +0 -1
  1443. package/dist/debounce-BtqBDYXu.d.ts +0 -96
  1444. package/dist/debounce-BtqBDYXu.d.ts.map +0 -1
  1445. package/dist/debounce-C9xIAomT.js +0 -2
  1446. package/dist/debounce-C9xIAomT.js.map +0 -1
  1447. package/dist/deduped-BpPNbB_u.d.cts +0 -23
  1448. package/dist/deduped-BpPNbB_u.d.cts.map +0 -1
  1449. package/dist/deduped-C1IQABjb.d.ts +0 -23
  1450. package/dist/deduped-C1IQABjb.d.ts.map +0 -1
  1451. package/dist/difference-B5WQzd-Z.cjs +0 -1
  1452. package/dist/difference-C1tclXTn.d.cts +0 -37
  1453. package/dist/difference-C1tclXTn.d.cts.map +0 -1
  1454. package/dist/difference-DM8qEnVj.d.ts +0 -37
  1455. package/dist/difference-DM8qEnVj.d.ts.map +0 -1
  1456. package/dist/difference-Dgeqsjn_.js +0 -2
  1457. package/dist/difference-Dgeqsjn_.js.map +0 -1
  1458. package/dist/difference-with-BqLSomQj.d.ts +0 -48
  1459. package/dist/difference-with-BqLSomQj.d.ts.map +0 -1
  1460. package/dist/difference-with-CNN8MVj2.cjs +0 -1
  1461. package/dist/difference-with-CTy1JWpg.d.cts +0 -48
  1462. package/dist/difference-with-CTy1JWpg.d.cts.map +0 -1
  1463. package/dist/difference-with-CiySHDr9.js +0 -2
  1464. package/dist/difference-with-CiySHDr9.js.map +0 -1
  1465. package/dist/dist-BQGZfjDS.js +0 -291
  1466. package/dist/dist-BQGZfjDS.js.map +0 -1
  1467. package/dist/dist-gvJoKj_M.cjs +0 -343
  1468. package/dist/divide-BI9ShWGE.js +0 -2
  1469. package/dist/divide-BI9ShWGE.js.map +0 -1
  1470. package/dist/divide-Bsz0OPIK.d.ts +0 -33
  1471. package/dist/divide-Bsz0OPIK.d.ts.map +0 -1
  1472. package/dist/divide-C8COFm-b.d.cts +0 -33
  1473. package/dist/divide-C8COFm-b.d.cts.map +0 -1
  1474. package/dist/divide-ZFT5ZqJ0.cjs +0 -1
  1475. package/dist/do-nothing-Be29JGDG.js +0 -2
  1476. package/dist/do-nothing-Be29JGDG.js.map +0 -1
  1477. package/dist/do-nothing-BvLrwjB7.d.ts +0 -28
  1478. package/dist/do-nothing-BvLrwjB7.d.ts.map +0 -1
  1479. package/dist/do-nothing-Cc1faYu6.cjs +0 -1
  1480. package/dist/do-nothing-xUCzRm4m.d.cts +0 -28
  1481. package/dist/do-nothing-xUCzRm4m.d.cts.map +0 -1
  1482. package/dist/drop-Bmm5QDJI.d.cts +0 -40
  1483. package/dist/drop-Bmm5QDJI.d.cts.map +0 -1
  1484. package/dist/drop-BvsV-rBc.js +0 -2
  1485. package/dist/drop-BvsV-rBc.js.map +0 -1
  1486. package/dist/drop-C-tVyU4K.cjs +0 -1
  1487. package/dist/drop-DTeHYc-D.d.ts +0 -40
  1488. package/dist/drop-DTeHYc-D.d.ts.map +0 -1
  1489. package/dist/drop-first-by-CSqeAzwS.d.cts +0 -41
  1490. package/dist/drop-first-by-CSqeAzwS.d.cts.map +0 -1
  1491. package/dist/drop-first-by-Cclqg5G_.js +0 -2
  1492. package/dist/drop-first-by-Cclqg5G_.js.map +0 -1
  1493. package/dist/drop-first-by-DJOgP-yE.cjs +0 -1
  1494. package/dist/drop-first-by-dH-OI2It.d.ts +0 -41
  1495. package/dist/drop-first-by-dH-OI2It.d.ts.map +0 -1
  1496. package/dist/drop-last-CX8JXA1b.cjs +0 -1
  1497. package/dist/drop-last-CuCKuM4n.js +0 -2
  1498. package/dist/drop-last-CuCKuM4n.js.map +0 -1
  1499. package/dist/drop-last-oiDr5Owj.d.cts +0 -32
  1500. package/dist/drop-last-oiDr5Owj.d.cts.map +0 -1
  1501. package/dist/drop-last-vbp5oZaK.d.ts +0 -32
  1502. package/dist/drop-last-vbp5oZaK.d.ts.map +0 -1
  1503. package/dist/drop-last-while-BbasDoJh.d.ts +0 -36
  1504. package/dist/drop-last-while-BbasDoJh.d.ts.map +0 -1
  1505. package/dist/drop-last-while-C_hHfAhU.d.cts +0 -36
  1506. package/dist/drop-last-while-C_hHfAhU.d.cts.map +0 -1
  1507. package/dist/drop-last-while-DMzZWC3Y.cjs +0 -1
  1508. package/dist/drop-last-while-StSGe_bf.js +0 -2
  1509. package/dist/drop-last-while-StSGe_bf.js.map +0 -1
  1510. package/dist/drop-while-BCln-hAn.js +0 -2
  1511. package/dist/drop-while-BCln-hAn.js.map +0 -1
  1512. package/dist/drop-while-BGbJsU8z.cjs +0 -1
  1513. package/dist/drop-while-CzvSV4z7.d.ts +0 -36
  1514. package/dist/drop-while-CzvSV4z7.d.ts.map +0 -1
  1515. package/dist/drop-while-T3z_MbtJ.d.cts +0 -36
  1516. package/dist/drop-while-T3z_MbtJ.d.cts.map +0 -1
  1517. package/dist/entries--JP88NsB.d.cts +0 -31
  1518. package/dist/entries--JP88NsB.d.cts.map +0 -1
  1519. package/dist/entries-B1cH8giK.cjs +0 -1
  1520. package/dist/entries-Bsl_GQTu.js +0 -2
  1521. package/dist/entries-Bsl_GQTu.js.map +0 -1
  1522. package/dist/entries-YDG-Mx3J.d.ts +0 -31
  1523. package/dist/entries-YDG-Mx3J.d.ts.map +0 -1
  1524. package/dist/enumerable-string-key-of-D2OpyD6n.d.cts +0 -17
  1525. package/dist/enumerable-string-key-of-D2OpyD6n.d.cts.map +0 -1
  1526. package/dist/enumerable-string-key-of-DKzYIarp.d.ts +0 -17
  1527. package/dist/enumerable-string-key-of-DKzYIarp.d.ts.map +0 -1
  1528. package/dist/enumerable-string-keyed-value-of-Bf_owt8O.d.ts +0 -12
  1529. package/dist/enumerable-string-keyed-value-of-Bf_owt8O.d.ts.map +0 -1
  1530. package/dist/enumerable-string-keyed-value-of-aov5dXss.d.cts +0 -12
  1531. package/dist/enumerable-string-keyed-value-of-aov5dXss.d.cts.map +0 -1
  1532. package/dist/evolve-BReerpSa.js +0 -2
  1533. package/dist/evolve-BReerpSa.js.map +0 -1
  1534. package/dist/evolve-CVvPsVxM.d.ts +0 -101
  1535. package/dist/evolve-CVvPsVxM.d.ts.map +0 -1
  1536. package/dist/evolve-DOxUNkYX.d.cts +0 -101
  1537. package/dist/evolve-DOxUNkYX.d.cts.map +0 -1
  1538. package/dist/evolve-DtSJxJiM.cjs +0 -1
  1539. package/dist/filter-CH_YQe9A.js +0 -2
  1540. package/dist/filter-CH_YQe9A.js.map +0 -1
  1541. package/dist/filter-CkFzFT5Q.d.cts +0 -50
  1542. package/dist/filter-CkFzFT5Q.d.cts.map +0 -1
  1543. package/dist/filter-Dlsk63lj.d.ts +0 -50
  1544. package/dist/filter-Dlsk63lj.d.ts.map +0 -1
  1545. package/dist/filter-DsjklegV.cjs +0 -1
  1546. package/dist/filtered-array-BGEkFwrv.d.ts +0 -13
  1547. package/dist/filtered-array-BGEkFwrv.d.ts.map +0 -1
  1548. package/dist/filtered-array-DQcAXQDD.d.cts +0 -13
  1549. package/dist/filtered-array-DQcAXQDD.d.cts.map +0 -1
  1550. package/dist/find-7ahTlXcE.d.ts +0 -64
  1551. package/dist/find-7ahTlXcE.d.ts.map +0 -1
  1552. package/dist/find-Bc-wGZYR.d.cts +0 -64
  1553. package/dist/find-Bc-wGZYR.d.cts.map +0 -1
  1554. package/dist/find-BuO4hH8Z.cjs +0 -1
  1555. package/dist/find-DR6lM3gh.js +0 -2
  1556. package/dist/find-DR6lM3gh.js.map +0 -1
  1557. package/dist/find-index-BO_tEYVo.d.ts +0 -50
  1558. package/dist/find-index-BO_tEYVo.d.ts.map +0 -1
  1559. package/dist/find-index-CojMwOU1.cjs +0 -1
  1560. package/dist/find-index-CzHRd1Ey.js +0 -2
  1561. package/dist/find-index-CzHRd1Ey.js.map +0 -1
  1562. package/dist/find-index-mVR2WVAJ.d.cts +0 -50
  1563. package/dist/find-index-mVR2WVAJ.d.cts.map +0 -1
  1564. package/dist/find-last-CekkNCww.d.ts +0 -62
  1565. package/dist/find-last-CekkNCww.d.ts.map +0 -1
  1566. package/dist/find-last-DqGxSxQ-.d.cts +0 -62
  1567. package/dist/find-last-DqGxSxQ-.d.cts.map +0 -1
  1568. package/dist/find-last-gCcPzwJP.js +0 -2
  1569. package/dist/find-last-gCcPzwJP.js.map +0 -1
  1570. package/dist/find-last-index-C-wdKiKp.cjs +0 -1
  1571. package/dist/find-last-index-C4il48Y6.d.cts +0 -50
  1572. package/dist/find-last-index-C4il48Y6.d.cts.map +0 -1
  1573. package/dist/find-last-index-DuYnKTXJ.js +0 -2
  1574. package/dist/find-last-index-DuYnKTXJ.js.map +0 -1
  1575. package/dist/find-last-index-XB_3-4xj.d.ts +0 -50
  1576. package/dist/find-last-index-XB_3-4xj.d.ts.map +0 -1
  1577. package/dist/find-last-yrb1RLMJ.cjs +0 -1
  1578. package/dist/first-1NtfTucX.d.ts +0 -40
  1579. package/dist/first-1NtfTucX.d.ts.map +0 -1
  1580. package/dist/first-C3rp67g0.d.cts +0 -40
  1581. package/dist/first-C3rp67g0.d.cts.map +0 -1
  1582. package/dist/first-DDQc8owl.js +0 -2
  1583. package/dist/first-DDQc8owl.js.map +0 -1
  1584. package/dist/first-Dbxt3OEg.cjs +0 -1
  1585. package/dist/first-by-B5IsCexF.js +0 -2
  1586. package/dist/first-by-B5IsCexF.js.map +0 -1
  1587. package/dist/first-by-BzxRBZ5J.cjs +0 -1
  1588. package/dist/first-by-C0qf5rwh.d.ts +0 -60
  1589. package/dist/first-by-C0qf5rwh.d.ts.map +0 -1
  1590. package/dist/first-by-Dm9iyhMz.d.cts +0 -60
  1591. package/dist/first-by-Dm9iyhMz.d.cts.map +0 -1
  1592. package/dist/flat-BayJJsR-.cjs +0 -1
  1593. package/dist/flat-BbBf5kJs.d.ts +0 -53
  1594. package/dist/flat-BbBf5kJs.d.ts.map +0 -1
  1595. package/dist/flat-CJrZ3ALE.d.cts +0 -53
  1596. package/dist/flat-CJrZ3ALE.d.cts.map +0 -1
  1597. package/dist/flat-Cd7pIXar.js +0 -2
  1598. package/dist/flat-Cd7pIXar.js.map +0 -1
  1599. package/dist/flat-map-1WAgW39N.js +0 -2
  1600. package/dist/flat-map-1WAgW39N.js.map +0 -1
  1601. package/dist/flat-map-BI-sJd2B.cjs +0 -1
  1602. package/dist/flat-map-Do5YLueq.d.cts +0 -47
  1603. package/dist/flat-map-Do5YLueq.d.cts.map +0 -1
  1604. package/dist/flat-map-Ok5sZOb2.d.ts +0 -47
  1605. package/dist/flat-map-Ok5sZOb2.d.ts.map +0 -1
  1606. package/dist/floor-Bj0O0YjY.cjs +0 -1
  1607. package/dist/floor-C9us6h14.d.ts +0 -39
  1608. package/dist/floor-C9us6h14.d.ts.map +0 -1
  1609. package/dist/floor-C_xareFD.js +0 -2
  1610. package/dist/floor-C_xareFD.js.map +0 -1
  1611. package/dist/floor-bA1oX38x.d.cts +0 -39
  1612. package/dist/floor-bA1oX38x.d.cts.map +0 -1
  1613. package/dist/for-each-BtbPzNDc.cjs +0 -1
  1614. package/dist/for-each-CYTR5H9O.d.cts +0 -54
  1615. package/dist/for-each-CYTR5H9O.d.cts.map +0 -1
  1616. package/dist/for-each-ClKbAv3A.js +0 -2
  1617. package/dist/for-each-ClKbAv3A.js.map +0 -1
  1618. package/dist/for-each-DIxtfnNY.d.ts +0 -54
  1619. package/dist/for-each-DIxtfnNY.d.ts.map +0 -1
  1620. package/dist/for-each-obj-B6BJwtgs.cjs +0 -1
  1621. package/dist/for-each-obj-CJFU3pj_.js +0 -2
  1622. package/dist/for-each-obj-CJFU3pj_.js.map +0 -1
  1623. package/dist/for-each-obj-DRgFFti8.d.ts +0 -47
  1624. package/dist/for-each-obj-DRgFFti8.d.ts.map +0 -1
  1625. package/dist/for-each-obj-yV90UbvE.d.cts +0 -47
  1626. package/dist/for-each-obj-yV90UbvE.d.cts.map +0 -1
  1627. package/dist/from-entries-BqW53CyR.d.ts +0 -68
  1628. package/dist/from-entries-BqW53CyR.d.ts.map +0 -1
  1629. package/dist/from-entries-CToFI5yO.d.cts +0 -68
  1630. package/dist/from-entries-CToFI5yO.d.cts.map +0 -1
  1631. package/dist/from-entries-D6f6Bd0l.js +0 -2
  1632. package/dist/from-entries-D6f6Bd0l.js.map +0 -1
  1633. package/dist/from-entries-DDkKcu-p.cjs +0 -1
  1634. package/dist/from-keys-BYHfvCLR.d.ts +0 -60
  1635. package/dist/from-keys-BYHfvCLR.d.ts.map +0 -1
  1636. package/dist/from-keys-CI2PJlIM.cjs +0 -1
  1637. package/dist/from-keys-DJe8xU7b.js +0 -2
  1638. package/dist/from-keys-DJe8xU7b.js.map +0 -1
  1639. package/dist/from-keys-Ds1mndVk.d.cts +0 -60
  1640. package/dist/from-keys-Ds1mndVk.d.cts.map +0 -1
  1641. package/dist/funnel-1FhwR-u9.d.ts +0 -155
  1642. package/dist/funnel-1FhwR-u9.d.ts.map +0 -1
  1643. package/dist/funnel-CEbURcmp.js +0 -2
  1644. package/dist/funnel-CEbURcmp.js.map +0 -1
  1645. package/dist/funnel-CL-QFpGk.cjs +0 -1
  1646. package/dist/funnel-DRrT4WPx.d.cts +0 -155
  1647. package/dist/funnel-DRrT4WPx.d.cts.map +0 -1
  1648. package/dist/group-by-057Glgkg.cjs +0 -1
  1649. package/dist/group-by-8exEDbij.js +0 -2
  1650. package/dist/group-by-8exEDbij.js.map +0 -1
  1651. package/dist/group-by-DDS1NPHf.d.cts +0 -69
  1652. package/dist/group-by-DDS1NPHf.d.cts.map +0 -1
  1653. package/dist/group-by-prop--MehVKql.d.ts +0 -89
  1654. package/dist/group-by-prop--MehVKql.d.ts.map +0 -1
  1655. package/dist/group-by-prop-ByeUoeXV.cjs +0 -1
  1656. package/dist/group-by-prop-CcSzCSuu.d.cts +0 -89
  1657. package/dist/group-by-prop-CcSzCSuu.d.cts.map +0 -1
  1658. package/dist/group-by-prop-Gi66eXCp.js +0 -2
  1659. package/dist/group-by-prop-Gi66eXCp.js.map +0 -1
  1660. package/dist/group-by-schxH1QR.d.ts +0 -69
  1661. package/dist/group-by-schxH1QR.d.ts.map +0 -1
  1662. package/dist/has-at-least-6iRvhsST.js +0 -2
  1663. package/dist/has-at-least-6iRvhsST.js.map +0 -1
  1664. package/dist/has-at-least-BbYfXc8L.d.cts +0 -59
  1665. package/dist/has-at-least-BbYfXc8L.d.cts.map +0 -1
  1666. package/dist/has-at-least-D-ahiJB6.cjs +0 -1
  1667. package/dist/has-at-least-D1A8i5J3.d.ts +0 -59
  1668. package/dist/has-at-least-D1A8i5J3.d.ts.map +0 -1
  1669. package/dist/has-sub-object-C7LwzJ88.js +0 -2
  1670. package/dist/has-sub-object-C7LwzJ88.js.map +0 -1
  1671. package/dist/has-sub-object-DPcKaDk7.d.ts +0 -44
  1672. package/dist/has-sub-object-DPcKaDk7.d.ts.map +0 -1
  1673. package/dist/has-sub-object-DjlCWSUi.cjs +0 -1
  1674. package/dist/has-sub-object-oUnH6b7a.d.cts +0 -44
  1675. package/dist/has-sub-object-oUnH6b7a.d.cts.map +0 -1
  1676. package/dist/heap-BrQEhV5W.js +0 -2
  1677. package/dist/heap-BrQEhV5W.js.map +0 -1
  1678. package/dist/heap-CpdbyWAN.cjs +0 -1
  1679. package/dist/human-readable-file-size-BtprvwQj.cjs +0 -1
  1680. package/dist/human-readable-file-size-C2gHuBVX.d.ts +0 -17
  1681. package/dist/human-readable-file-size-C2gHuBVX.d.ts.map +0 -1
  1682. package/dist/human-readable-file-size-CPeHO1Te.js +0 -2
  1683. package/dist/human-readable-file-size-CPeHO1Te.js.map +0 -1
  1684. package/dist/human-readable-file-size-DtwHNZes.d.cts +0 -17
  1685. package/dist/human-readable-file-size-DtwHNZes.d.cts.map +0 -1
  1686. package/dist/identity-BAryUWbs.cjs +0 -1
  1687. package/dist/identity-BwbmOFJX.d.ts +0 -22
  1688. package/dist/identity-BwbmOFJX.d.ts.map +0 -1
  1689. package/dist/identity-CPDLj9Cq.d.cts +0 -22
  1690. package/dist/identity-CPDLj9Cq.d.cts.map +0 -1
  1691. package/dist/identity-D7NWGnLw.js +0 -2
  1692. package/dist/identity-D7NWGnLw.js.map +0 -1
  1693. package/dist/index-by-BJH9P6kU.cjs +0 -1
  1694. package/dist/index-by-CJj3L6wv.d.ts +0 -53
  1695. package/dist/index-by-CJj3L6wv.d.ts.map +0 -1
  1696. package/dist/index-by-CNa3p-Is.d.cts +0 -53
  1697. package/dist/index-by-CNa3p-Is.d.cts.map +0 -1
  1698. package/dist/index-by-adSf-XkW.js +0 -2
  1699. package/dist/index-by-adSf-XkW.js.map +0 -1
  1700. package/dist/int-range-inclusive-BSXuRjMO.d.ts +0 -15
  1701. package/dist/int-range-inclusive-BSXuRjMO.d.ts.map +0 -1
  1702. package/dist/int-range-inclusive-DZG3R2Xl.d.cts +0 -15
  1703. package/dist/int-range-inclusive-DZG3R2Xl.d.cts.map +0 -1
  1704. package/dist/intersection-CaBWENw7.d.cts +0 -37
  1705. package/dist/intersection-CaBWENw7.d.cts.map +0 -1
  1706. package/dist/intersection-Crt0YdjH.js +0 -2
  1707. package/dist/intersection-Crt0YdjH.js.map +0 -1
  1708. package/dist/intersection-DJQJxp9k.d.ts +0 -37
  1709. package/dist/intersection-DJQJxp9k.d.ts.map +0 -1
  1710. package/dist/intersection-pxjmHAj1.cjs +0 -1
  1711. package/dist/intersection-with-COmRebRq.d.ts +0 -54
  1712. package/dist/intersection-with-COmRebRq.d.ts.map +0 -1
  1713. package/dist/intersection-with-DlHJvAUn.js +0 -2
  1714. package/dist/intersection-with-DlHJvAUn.js.map +0 -1
  1715. package/dist/intersection-with-Dre9A1oC.d.cts +0 -54
  1716. package/dist/intersection-with-Dre9A1oC.d.cts.map +0 -1
  1717. package/dist/intersection-with-X3fvRkLr.cjs +0 -1
  1718. package/dist/invert-DMSQXxyb.d.ts +0 -33
  1719. package/dist/invert-DMSQXxyb.d.ts.map +0 -1
  1720. package/dist/invert-DhET3F4O.cjs +0 -1
  1721. package/dist/invert-DsEwwjea.js +0 -2
  1722. package/dist/invert-DsEwwjea.js.map +0 -1
  1723. package/dist/invert-W6EUYMws.d.cts +0 -33
  1724. package/dist/invert-W6EUYMws.d.cts.map +0 -1
  1725. package/dist/is-array-DAz7gkMm.d.cts +0 -21
  1726. package/dist/is-array-DAz7gkMm.d.cts.map +0 -1
  1727. package/dist/is-array-DWFX2okh.js +0 -2
  1728. package/dist/is-array-DWFX2okh.js.map +0 -1
  1729. package/dist/is-array-KzYs6pgh.cjs +0 -1
  1730. package/dist/is-array-prXR4sUC.d.ts +0 -21
  1731. package/dist/is-array-prXR4sUC.d.ts.map +0 -1
  1732. package/dist/is-big-int-Cgisg7DN.cjs +0 -1
  1733. package/dist/is-big-int-CnWK6SmP.js +0 -2
  1734. package/dist/is-big-int-CnWK6SmP.js.map +0 -1
  1735. package/dist/is-big-int-Dow1Lswh.d.cts +0 -22
  1736. package/dist/is-big-int-Dow1Lswh.d.cts.map +0 -1
  1737. package/dist/is-big-int-e123CwI2.d.ts +0 -22
  1738. package/dist/is-big-int-e123CwI2.d.ts.map +0 -1
  1739. package/dist/is-boolean-CZKz4ij3.js +0 -2
  1740. package/dist/is-boolean-CZKz4ij3.js.map +0 -1
  1741. package/dist/is-boolean-DADmOIbu.cjs +0 -1
  1742. package/dist/is-boolean-DWuHhrIe.d.ts +0 -21
  1743. package/dist/is-boolean-DWuHhrIe.d.ts.map +0 -1
  1744. package/dist/is-boolean-NhoGl1jZ.d.cts +0 -21
  1745. package/dist/is-boolean-NhoGl1jZ.d.cts.map +0 -1
  1746. package/dist/is-bounded-record-DCEYRY41.d.ts +0 -34
  1747. package/dist/is-bounded-record-DCEYRY41.d.ts.map +0 -1
  1748. package/dist/is-bounded-record-kpsb1wQA.d.cts +0 -34
  1749. package/dist/is-bounded-record-kpsb1wQA.d.cts.map +0 -1
  1750. package/dist/is-date--gIC--NA.d.cts +0 -17
  1751. package/dist/is-date--gIC--NA.d.cts.map +0 -1
  1752. package/dist/is-date-BgcZ3-ed.d.ts +0 -17
  1753. package/dist/is-date-BgcZ3-ed.d.ts.map +0 -1
  1754. package/dist/is-date-CNebQb0Y.cjs +0 -1
  1755. package/dist/is-date-DKKVtHVY.js +0 -2
  1756. package/dist/is-date-DKKVtHVY.js.map +0 -1
  1757. package/dist/is-deep-equal-B_XN4vCU.d.ts +0 -71
  1758. package/dist/is-deep-equal-B_XN4vCU.d.ts.map +0 -1
  1759. package/dist/is-deep-equal-CtBdM4eT.d.cts +0 -71
  1760. package/dist/is-deep-equal-CtBdM4eT.d.cts.map +0 -1
  1761. package/dist/is-deep-equal-D7dqs3e2.js +0 -2
  1762. package/dist/is-deep-equal-D7dqs3e2.js.map +0 -1
  1763. package/dist/is-deep-equal-DR9xJg8D.cjs +0 -1
  1764. package/dist/is-defined-3Qp6lmQw.d.cts +0 -19
  1765. package/dist/is-defined-3Qp6lmQw.d.cts.map +0 -1
  1766. package/dist/is-defined-BnbPFPUx.cjs +0 -1
  1767. package/dist/is-defined-DESIOXqX.d.ts +0 -19
  1768. package/dist/is-defined-DESIOXqX.d.ts.map +0 -1
  1769. package/dist/is-defined-bdl8LRyD.js +0 -2
  1770. package/dist/is-defined-bdl8LRyD.js.map +0 -1
  1771. package/dist/is-empty-BSkgk0sE.js +0 -2
  1772. package/dist/is-empty-BSkgk0sE.js.map +0 -1
  1773. package/dist/is-empty-CFT22qg4.d.cts +0 -35
  1774. package/dist/is-empty-CFT22qg4.d.cts.map +0 -1
  1775. package/dist/is-empty-qOplNC63.d.ts +0 -35
  1776. package/dist/is-empty-qOplNC63.d.ts.map +0 -1
  1777. package/dist/is-empty-s3B43K38.cjs +0 -1
  1778. package/dist/is-error-7hLjNT9B.d.cts +0 -18
  1779. package/dist/is-error-7hLjNT9B.d.cts.map +0 -1
  1780. package/dist/is-error-C0Qr0E3U.js +0 -2
  1781. package/dist/is-error-C0Qr0E3U.js.map +0 -1
  1782. package/dist/is-error-CjiajQ5C.d.ts +0 -18
  1783. package/dist/is-error-CjiajQ5C.d.ts.map +0 -1
  1784. package/dist/is-error-bQ2IwWHj.cjs +0 -1
  1785. package/dist/is-function-DaoOpTFE.cjs +0 -1
  1786. package/dist/is-function-DpNu_iYN.d.ts +0 -18
  1787. package/dist/is-function-DpNu_iYN.d.ts.map +0 -1
  1788. package/dist/is-function-o1ixw9eS.d.cts +0 -18
  1789. package/dist/is-function-o1ixw9eS.d.cts.map +0 -1
  1790. package/dist/is-function-r9PVEQ1p.js +0 -2
  1791. package/dist/is-function-r9PVEQ1p.js.map +0 -1
  1792. package/dist/is-included-in-B1CoqHXo.cjs +0 -1
  1793. package/dist/is-included-in-BeJz7gyj.js +0 -2
  1794. package/dist/is-included-in-BeJz7gyj.js.map +0 -1
  1795. package/dist/is-included-in-CPnrdiNI.d.ts +0 -110
  1796. package/dist/is-included-in-CPnrdiNI.d.ts.map +0 -1
  1797. package/dist/is-included-in-ciZ0ThQh.d.cts +0 -110
  1798. package/dist/is-included-in-ciZ0ThQh.d.cts.map +0 -1
  1799. package/dist/is-non-null-BaxoBfPo.js +0 -2
  1800. package/dist/is-non-null-BaxoBfPo.js.map +0 -1
  1801. package/dist/is-non-null-DnDE6zDD.cjs +0 -1
  1802. package/dist/is-non-null-DtN0OIEX.d.cts +0 -19
  1803. package/dist/is-non-null-DtN0OIEX.d.cts.map +0 -1
  1804. package/dist/is-non-null-Y3FhczVS.d.ts +0 -19
  1805. package/dist/is-non-null-Y3FhczVS.d.ts.map +0 -1
  1806. package/dist/is-non-nullish-BW-uIWkn.d.cts +0 -20
  1807. package/dist/is-non-nullish-BW-uIWkn.d.cts.map +0 -1
  1808. package/dist/is-non-nullish-C7zZvb8c.d.ts +0 -20
  1809. package/dist/is-non-nullish-C7zZvb8c.d.ts.map +0 -1
  1810. package/dist/is-non-nullish-CgmLeA39.cjs +0 -1
  1811. package/dist/is-non-nullish-CsmQhBq1.js +0 -2
  1812. package/dist/is-non-nullish-CsmQhBq1.js.map +0 -1
  1813. package/dist/is-not-C2o5RmWD.cjs +0 -1
  1814. package/dist/is-not-CBCnEdKF.js +0 -2
  1815. package/dist/is-not-CBCnEdKF.js.map +0 -1
  1816. package/dist/is-not-DYVAMLBs.d.cts +0 -19
  1817. package/dist/is-not-DYVAMLBs.d.cts.map +0 -1
  1818. package/dist/is-not-VNjzMFnp.d.ts +0 -19
  1819. package/dist/is-not-VNjzMFnp.d.ts.map +0 -1
  1820. package/dist/is-nullish-CEDQo8Hn.d.ts +0 -23
  1821. package/dist/is-nullish-CEDQo8Hn.d.ts.map +0 -1
  1822. package/dist/is-nullish-DSaUMZZs.js +0 -2
  1823. package/dist/is-nullish-DSaUMZZs.js.map +0 -1
  1824. package/dist/is-nullish-Dd6vFJuS.cjs +0 -1
  1825. package/dist/is-nullish-Djw8KpQn.d.cts +0 -23
  1826. package/dist/is-nullish-Djw8KpQn.d.cts.map +0 -1
  1827. package/dist/is-number-CTdFYf2z.d.cts +0 -22
  1828. package/dist/is-number-CTdFYf2z.d.cts.map +0 -1
  1829. package/dist/is-number-CZ5Eb2Cm.d.ts +0 -22
  1830. package/dist/is-number-CZ5Eb2Cm.d.ts.map +0 -1
  1831. package/dist/is-number-DRJ5I-tT.js +0 -2
  1832. package/dist/is-number-DRJ5I-tT.js.map +0 -1
  1833. package/dist/is-number-Dh9GBANx.cjs +0 -1
  1834. package/dist/is-object-type-4fvedNiu.d.ts +0 -35
  1835. package/dist/is-object-type-4fvedNiu.d.ts.map +0 -1
  1836. package/dist/is-object-type-8OtwCXgl.cjs +0 -1
  1837. package/dist/is-object-type-BWyBChB5.js +0 -2
  1838. package/dist/is-object-type-BWyBChB5.js.map +0 -1
  1839. package/dist/is-object-type-D5u6pYGC.d.cts +0 -35
  1840. package/dist/is-object-type-D5u6pYGC.d.cts.map +0 -1
  1841. package/dist/is-plain-object-BlyD-E-m.d.ts +0 -33
  1842. package/dist/is-plain-object-BlyD-E-m.d.ts.map +0 -1
  1843. package/dist/is-plain-object-BvL_W8IP.d.cts +0 -33
  1844. package/dist/is-plain-object-BvL_W8IP.d.cts.map +0 -1
  1845. package/dist/is-plain-object-Cnx_x0Ei.js +0 -2
  1846. package/dist/is-plain-object-Cnx_x0Ei.js.map +0 -1
  1847. package/dist/is-plain-object-ufeXFQks.cjs +0 -1
  1848. package/dist/is-promise-BVzvJRjb.cjs +0 -1
  1849. package/dist/is-promise-CcLSSGQE.d.ts +0 -18
  1850. package/dist/is-promise-CcLSSGQE.d.ts.map +0 -1
  1851. package/dist/is-promise-DbVIpcYL.js +0 -2
  1852. package/dist/is-promise-DbVIpcYL.js.map +0 -1
  1853. package/dist/is-promise-VSzOkl6R.d.cts +0 -18
  1854. package/dist/is-promise-VSzOkl6R.d.cts.map +0 -1
  1855. package/dist/is-shallow-equal-BygWppM-.js +0 -2
  1856. package/dist/is-shallow-equal-BygWppM-.js.map +0 -1
  1857. package/dist/is-shallow-equal-CSDwHXxr.cjs +0 -1
  1858. package/dist/is-shallow-equal-DQCnwLNk.d.ts +0 -71
  1859. package/dist/is-shallow-equal-DQCnwLNk.d.ts.map +0 -1
  1860. package/dist/is-shallow-equal-DuVbTG3f.d.cts +0 -71
  1861. package/dist/is-shallow-equal-DuVbTG3f.d.cts.map +0 -1
  1862. package/dist/is-strict-equal-2zT4bfOn.js +0 -2
  1863. package/dist/is-strict-equal-2zT4bfOn.js.map +0 -1
  1864. package/dist/is-strict-equal-5yvkDn8Q.d.ts +0 -67
  1865. package/dist/is-strict-equal-5yvkDn8Q.d.ts.map +0 -1
  1866. package/dist/is-strict-equal-Ct5kAZ5_.d.cts +0 -67
  1867. package/dist/is-strict-equal-Ct5kAZ5_.d.cts.map +0 -1
  1868. package/dist/is-strict-equal-sxCmPWrn.cjs +0 -1
  1869. package/dist/is-string-A-koYYS3.js +0 -2
  1870. package/dist/is-string-A-koYYS3.js.map +0 -1
  1871. package/dist/is-string-DAe_2BJR.d.ts +0 -20
  1872. package/dist/is-string-DAe_2BJR.d.ts.map +0 -1
  1873. package/dist/is-string-DiT0W6sZ.cjs +0 -1
  1874. package/dist/is-string-wfqO0Lag.d.cts +0 -20
  1875. package/dist/is-string-wfqO0Lag.d.cts.map +0 -1
  1876. package/dist/is-symbol-CIR-W22K.d.cts +0 -20
  1877. package/dist/is-symbol-CIR-W22K.d.cts.map +0 -1
  1878. package/dist/is-symbol-CVwn3meF.d.ts +0 -20
  1879. package/dist/is-symbol-CVwn3meF.d.ts.map +0 -1
  1880. package/dist/is-symbol-DFWPkgNV.cjs +0 -1
  1881. package/dist/is-symbol-Vzo5mVUM.js +0 -2
  1882. package/dist/is-symbol-Vzo5mVUM.js.map +0 -1
  1883. package/dist/is-truthy-CJgAM1AZ.cjs +0 -1
  1884. package/dist/is-truthy-CoTXzAuK.d.cts +0 -21
  1885. package/dist/is-truthy-CoTXzAuK.d.cts.map +0 -1
  1886. package/dist/is-truthy-Ctdf-v7U.d.ts +0 -21
  1887. package/dist/is-truthy-Ctdf-v7U.d.ts.map +0 -1
  1888. package/dist/is-truthy-ZWo_GERD.js +0 -2
  1889. package/dist/is-truthy-ZWo_GERD.js.map +0 -1
  1890. package/dist/is-union-BEGCMhOi.d.cts +0 -8
  1891. package/dist/is-union-BEGCMhOi.d.cts.map +0 -1
  1892. package/dist/is-union-CBVcM_uW.d.ts +0 -8
  1893. package/dist/is-union-CBVcM_uW.d.ts.map +0 -1
  1894. package/dist/iterable-container-V5sa0V_H.d.cts +0 -17
  1895. package/dist/iterable-container-V5sa0V_H.d.cts.map +0 -1
  1896. package/dist/iterable-container-wtkYslN_.d.ts +0 -17
  1897. package/dist/iterable-container-wtkYslN_.d.ts.map +0 -1
  1898. package/dist/join-BXqvyin6.cjs +0 -1
  1899. package/dist/join-D0iujfDN.d.cts +0 -46
  1900. package/dist/join-D0iujfDN.d.cts.map +0 -1
  1901. package/dist/join-E8OrzoQ8.d.ts +0 -46
  1902. package/dist/join-E8OrzoQ8.d.ts.map +0 -1
  1903. package/dist/join-nCY8bATt.js +0 -2
  1904. package/dist/join-nCY8bATt.js.map +0 -1
  1905. package/dist/key-codes-3lqUuEMs.d.cts +0 -29
  1906. package/dist/key-codes-3lqUuEMs.d.cts.map +0 -1
  1907. package/dist/key-codes-ChQrhdSG.js +0 -2
  1908. package/dist/key-codes-ChQrhdSG.js.map +0 -1
  1909. package/dist/key-codes-Do_lEvpi.d.ts +0 -29
  1910. package/dist/key-codes-Do_lEvpi.d.ts.map +0 -1
  1911. package/dist/key-codes-DofSlv3v.cjs +0 -1
  1912. package/dist/keys-BOIca6L1.d.cts +0 -38
  1913. package/dist/keys-BOIca6L1.d.cts.map +0 -1
  1914. package/dist/keys-CeZxsvdJ.js +0 -2
  1915. package/dist/keys-CeZxsvdJ.js.map +0 -1
  1916. package/dist/keys-DQwPfo__.cjs +0 -1
  1917. package/dist/keys-fX8vI-uH.d.ts +0 -38
  1918. package/dist/keys-fX8vI-uH.d.ts.map +0 -1
  1919. package/dist/last-BoVh9Bgz.d.ts +0 -37
  1920. package/dist/last-BoVh9Bgz.d.ts.map +0 -1
  1921. package/dist/last-BsvhqAkE.js +0 -2
  1922. package/dist/last-BsvhqAkE.js.map +0 -1
  1923. package/dist/last-Cy_0pMbz.d.cts +0 -37
  1924. package/dist/last-Cy_0pMbz.d.cts.map +0 -1
  1925. package/dist/last-DCnS88X2.cjs +0 -1
  1926. package/dist/lazy-data-last-impl-3PAFkslW.cjs +0 -1
  1927. package/dist/lazy-data-last-impl-7QfM1xXg.js +0 -2
  1928. package/dist/lazy-data-last-impl-7QfM1xXg.js.map +0 -1
  1929. package/dist/length-BKo5HUVo.d.ts +0 -28
  1930. package/dist/length-BKo5HUVo.d.ts.map +0 -1
  1931. package/dist/length-BtKC_n_k.js +0 -2
  1932. package/dist/length-BtKC_n_k.js.map +0 -1
  1933. package/dist/length-Cch-gs0T.cjs +0 -1
  1934. package/dist/length-DQCuaUy9.d.cts +0 -28
  1935. package/dist/length-DQCuaUy9.d.cts.map +0 -1
  1936. package/dist/magic-string.es-Dlejmjth.cjs +0 -15
  1937. package/dist/magic-string.es-bOkeFdlI.js +0 -15
  1938. package/dist/magic-string.es-bOkeFdlI.js.map +0 -1
  1939. package/dist/map-2CmGA3HQ.cjs +0 -1
  1940. package/dist/map-D2kXyrhE.d.ts +0 -47
  1941. package/dist/map-D2kXyrhE.d.ts.map +0 -1
  1942. package/dist/map-hbl-e0fs.d.cts +0 -47
  1943. package/dist/map-hbl-e0fs.d.cts.map +0 -1
  1944. package/dist/map-keys-5JqEYSRn.js +0 -2
  1945. package/dist/map-keys-5JqEYSRn.js.map +0 -1
  1946. package/dist/map-keys-B636MLly.cjs +0 -1
  1947. package/dist/map-keys-BMF5TTCT.d.cts +0 -34
  1948. package/dist/map-keys-BMF5TTCT.d.cts.map +0 -1
  1949. package/dist/map-keys-DTuz2AU9.d.ts +0 -34
  1950. package/dist/map-keys-DTuz2AU9.d.ts.map +0 -1
  1951. package/dist/map-t5kkqRLl.js +0 -2
  1952. package/dist/map-t5kkqRLl.js.map +0 -1
  1953. package/dist/map-to-obj-C3TvW3Zq.d.ts +0 -68
  1954. package/dist/map-to-obj-C3TvW3Zq.d.ts.map +0 -1
  1955. package/dist/map-to-obj-D5MFa8lB.d.cts +0 -68
  1956. package/dist/map-to-obj-D5MFa8lB.d.cts.map +0 -1
  1957. package/dist/map-to-obj-D8GiFVoH.cjs +0 -1
  1958. package/dist/map-to-obj-DSoMzAgs.js +0 -2
  1959. package/dist/map-to-obj-DSoMzAgs.js.map +0 -1
  1960. package/dist/map-values-Bj4nhj3r.js +0 -2
  1961. package/dist/map-values-Bj4nhj3r.js.map +0 -1
  1962. package/dist/map-values-CXFe39-O.d.ts +0 -42
  1963. package/dist/map-values-CXFe39-O.d.ts.map +0 -1
  1964. package/dist/map-values-CbOf72JF.cjs +0 -1
  1965. package/dist/map-values-DgFd9qsH.d.cts +0 -42
  1966. package/dist/map-values-DgFd9qsH.d.cts.map +0 -1
  1967. package/dist/map-with-feedback-Bjyq9-ss.d.cts +0 -54
  1968. package/dist/map-with-feedback-Bjyq9-ss.d.cts.map +0 -1
  1969. package/dist/map-with-feedback-BwvFVDYW.cjs +0 -1
  1970. package/dist/map-with-feedback-DV8xKpjj.d.ts +0 -54
  1971. package/dist/map-with-feedback-DV8xKpjj.d.ts.map +0 -1
  1972. package/dist/map-with-feedback-l2Hn2I08.js +0 -2
  1973. package/dist/map-with-feedback-l2Hn2I08.js.map +0 -1
  1974. package/dist/mapped-CywWFD6s.d.ts +0 -7
  1975. package/dist/mapped-CywWFD6s.d.ts.map +0 -1
  1976. package/dist/mapped-DdfSDQ5D.d.cts +0 -7
  1977. package/dist/mapped-DdfSDQ5D.d.cts.map +0 -1
  1978. package/dist/mean-by-CSUU6ZRi.d.cts +0 -35
  1979. package/dist/mean-by-CSUU6ZRi.d.cts.map +0 -1
  1980. package/dist/mean-by-D6OE3lEe.cjs +0 -1
  1981. package/dist/mean-by-D6OGvOgW.js +0 -2
  1982. package/dist/mean-by-D6OGvOgW.js.map +0 -1
  1983. package/dist/mean-by-DiH-QI0U.d.ts +0 -35
  1984. package/dist/mean-by-DiH-QI0U.d.ts.map +0 -1
  1985. package/dist/merge-BKrUYniy.cjs +0 -1
  1986. package/dist/merge-CXnHl0ti.d.cts +0 -57
  1987. package/dist/merge-CXnHl0ti.d.cts.map +0 -1
  1988. package/dist/merge-DM3LuCr8.js +0 -2
  1989. package/dist/merge-DM3LuCr8.js.map +0 -1
  1990. package/dist/merge-EO0Q1QPA.d.ts +0 -57
  1991. package/dist/merge-EO0Q1QPA.d.ts.map +0 -1
  1992. package/dist/merge-all-BbdTIlUo.js +0 -2
  1993. package/dist/merge-all-BbdTIlUo.js.map +0 -1
  1994. package/dist/merge-all-DA-xZzpl.d.ts +0 -42
  1995. package/dist/merge-all-DA-xZzpl.d.ts.map +0 -1
  1996. package/dist/merge-all-DkmSC0ri.d.cts +0 -42
  1997. package/dist/merge-all-DkmSC0ri.d.cts.map +0 -1
  1998. package/dist/merge-all-MOlMBgeb.cjs +0 -1
  1999. package/dist/merge-deep-A4Cgd47e.d.ts +0 -37
  2000. package/dist/merge-deep-A4Cgd47e.d.ts.map +0 -1
  2001. package/dist/merge-deep-BcekJf0s.cjs +0 -1
  2002. package/dist/merge-deep-DAfbgx82.d.cts +0 -37
  2003. package/dist/merge-deep-DAfbgx82.d.cts.map +0 -1
  2004. package/dist/merge-deep-Dn1sRc5z.js +0 -2
  2005. package/dist/merge-deep-Dn1sRc5z.js.map +0 -1
  2006. package/dist/multiply-BI2VvlFd.js +0 -2
  2007. package/dist/multiply-BI2VvlFd.js.map +0 -1
  2008. package/dist/multiply-CTfXAoM_.cjs +0 -1
  2009. package/dist/multiply-UBFQYNUD.d.ts +0 -33
  2010. package/dist/multiply-UBFQYNUD.d.ts.map +0 -1
  2011. package/dist/multiply-gDDdmofq.d.cts +0 -33
  2012. package/dist/multiply-gDDdmofq.d.cts.map +0 -1
  2013. package/dist/n-tuple-BELi5yRe.d.ts +0 -12
  2014. package/dist/n-tuple-BELi5yRe.d.ts.map +0 -1
  2015. package/dist/n-tuple-Co_jgwEn.d.cts +0 -12
  2016. package/dist/n-tuple-Co_jgwEn.d.cts.map +0 -1
  2017. package/dist/narrowed-to-BTrqm7Xt.d.cts +0 -15
  2018. package/dist/narrowed-to-BTrqm7Xt.d.cts.map +0 -1
  2019. package/dist/narrowed-to-C6wP224-.d.ts +0 -15
  2020. package/dist/narrowed-to-C6wP224-.d.ts.map +0 -1
  2021. package/dist/non-empty-array-D3HWDPMt.d.ts +0 -5
  2022. package/dist/non-empty-array-D3HWDPMt.d.ts.map +0 -1
  2023. package/dist/non-empty-array-D3ZRHApS.d.cts +0 -5
  2024. package/dist/non-empty-array-D3ZRHApS.d.cts.map +0 -1
  2025. package/dist/nth-by-BLlYxw3C.cjs +0 -1
  2026. package/dist/nth-by-BR1fcwCZ.js +0 -2
  2027. package/dist/nth-by-BR1fcwCZ.js.map +0 -1
  2028. package/dist/nth-by-CKFOiBHp.d.cts +0 -42
  2029. package/dist/nth-by-CKFOiBHp.d.cts.map +0 -1
  2030. package/dist/nth-by-DX2PBdEe.d.ts +0 -42
  2031. package/dist/nth-by-DX2PBdEe.d.ts.map +0 -1
  2032. package/dist/obj-of-B7t_1Jdi.d.ts +0 -27
  2033. package/dist/obj-of-B7t_1Jdi.d.ts.map +0 -1
  2034. package/dist/obj-of-CXD9MOPS.js +0 -2
  2035. package/dist/obj-of-CXD9MOPS.js.map +0 -1
  2036. package/dist/obj-of-DE7eb-D1.cjs +0 -1
  2037. package/dist/obj-of-OgSK6d9I.d.cts +0 -27
  2038. package/dist/obj-of-OgSK6d9I.d.cts.map +0 -1
  2039. package/dist/omit-Bpyv8_An.d.ts +0 -29
  2040. package/dist/omit-Bpyv8_An.d.ts.map +0 -1
  2041. package/dist/omit-DB0YVkss.d.cts +0 -29
  2042. package/dist/omit-DB0YVkss.d.cts.map +0 -1
  2043. package/dist/omit-DDC-zMp9.cjs +0 -1
  2044. package/dist/omit-Dgi9IFmV.js +0 -2
  2045. package/dist/omit-Dgi9IFmV.js.map +0 -1
  2046. package/dist/omit-by-6UKJmELm.d.cts +0 -52
  2047. package/dist/omit-by-6UKJmELm.d.cts.map +0 -1
  2048. package/dist/omit-by-BUnyJURX.js +0 -2
  2049. package/dist/omit-by-BUnyJURX.js.map +0 -1
  2050. package/dist/omit-by-BwOILpho.d.ts +0 -52
  2051. package/dist/omit-by-BwOILpho.d.ts.map +0 -1
  2052. package/dist/omit-by-DODiMBly.cjs +0 -1
  2053. package/dist/once-CDA15oHo.js +0 -2
  2054. package/dist/once-CDA15oHo.js.map +0 -1
  2055. package/dist/once-CKjmehD8.d.cts +0 -17
  2056. package/dist/once-CKjmehD8.d.cts.map +0 -1
  2057. package/dist/once-DBa0D-t8.d.ts +0 -17
  2058. package/dist/once-DBa0D-t8.d.ts.map +0 -1
  2059. package/dist/once-ndNMC6PL.cjs +0 -1
  2060. package/dist/only-DRLNxyIr.d.cts +0 -34
  2061. package/dist/only-DRLNxyIr.d.cts.map +0 -1
  2062. package/dist/only-IIcEVYAb.cjs +0 -1
  2063. package/dist/only-Kwk1k50y.js +0 -2
  2064. package/dist/only-Kwk1k50y.js.map +0 -1
  2065. package/dist/only-iY0lPSED.d.ts +0 -34
  2066. package/dist/only-iY0lPSED.d.ts.map +0 -1
  2067. package/dist/partial-array-CzOnr197.d.cts +0 -12
  2068. package/dist/partial-array-CzOnr197.d.cts.map +0 -1
  2069. package/dist/partial-array-IoGI5gCo.d.ts +0 -12
  2070. package/dist/partial-array-IoGI5gCo.d.ts.map +0 -1
  2071. package/dist/partition-BAwbSsom.cjs +0 -1
  2072. package/dist/partition-BRCPpbRh.d.cts +0 -51
  2073. package/dist/partition-BRCPpbRh.d.cts.map +0 -1
  2074. package/dist/partition-BmC5u4fI.js +0 -2
  2075. package/dist/partition-BmC5u4fI.js.map +0 -1
  2076. package/dist/partition-TVQP5mCe.d.ts +0 -51
  2077. package/dist/partition-TVQP5mCe.d.ts.map +0 -1
  2078. package/dist/path-or-BY4Gf2OC.js +0 -2
  2079. package/dist/path-or-BY4Gf2OC.js.map +0 -1
  2080. package/dist/path-or-CVvftsB5.cjs +0 -1
  2081. package/dist/path-or-Cly_jEXS.d.ts +0 -87
  2082. package/dist/path-or-Cly_jEXS.d.ts.map +0 -1
  2083. package/dist/path-or-mXO0iY19.d.cts +0 -87
  2084. package/dist/path-or-mXO0iY19.d.cts.map +0 -1
  2085. package/dist/perkakas-type-error-0tHtaPbi.d.cts +0 -19
  2086. package/dist/perkakas-type-error-0tHtaPbi.d.cts.map +0 -1
  2087. package/dist/perkakas-type-error-Da3ni385.d.ts +0 -19
  2088. package/dist/perkakas-type-error-Da3ni385.d.ts.map +0 -1
  2089. package/dist/pick--K1QxTFe.cjs +0 -1
  2090. package/dist/pick-BeGmtZCr.d.ts +0 -66
  2091. package/dist/pick-BeGmtZCr.d.ts.map +0 -1
  2092. package/dist/pick-BuIVJICv.js +0 -2
  2093. package/dist/pick-BuIVJICv.js.map +0 -1
  2094. package/dist/pick-CsXZS_Xe.d.cts +0 -66
  2095. package/dist/pick-CsXZS_Xe.d.cts.map +0 -1
  2096. package/dist/pick-by-CVILzj6i.cjs +0 -1
  2097. package/dist/pick-by-CmgAp9Gv.d.ts +0 -68
  2098. package/dist/pick-by-CmgAp9Gv.d.ts.map +0 -1
  2099. package/dist/pick-by-D6ACT8QA.js +0 -2
  2100. package/dist/pick-by-D6ACT8QA.js.map +0 -1
  2101. package/dist/pick-by-DVekF8fN.d.cts +0 -68
  2102. package/dist/pick-by-DVekF8fN.d.cts.map +0 -1
  2103. package/dist/pipe-CjmXKJLt.d.ts +0 -34
  2104. package/dist/pipe-CjmXKJLt.d.ts.map +0 -1
  2105. package/dist/pipe-CtsfTnqv.js +0 -2
  2106. package/dist/pipe-CtsfTnqv.js.map +0 -1
  2107. package/dist/pipe-DGVP9PCt.d.cts +0 -34
  2108. package/dist/pipe-DGVP9PCt.d.cts.map +0 -1
  2109. package/dist/pipe-DlFjc4Wf.cjs +0 -1
  2110. package/dist/piped-7IMVVz1U.d.ts +0 -31
  2111. package/dist/piped-7IMVVz1U.d.ts.map +0 -1
  2112. package/dist/piped-Bj0X7cQT.js +0 -2
  2113. package/dist/piped-Bj0X7cQT.js.map +0 -1
  2114. package/dist/piped-Brc8b_TJ.d.cts +0 -31
  2115. package/dist/piped-Brc8b_TJ.d.cts.map +0 -1
  2116. package/dist/piped-Dk4o0Pdm.cjs +0 -1
  2117. package/dist/product-BHRT4Aan.cjs +0 -1
  2118. package/dist/product-D3OVy5Sj.js +0 -2
  2119. package/dist/product-D3OVy5Sj.js.map +0 -1
  2120. package/dist/product-DKaFnVZj.d.cts +0 -52
  2121. package/dist/product-DKaFnVZj.d.cts.map +0 -1
  2122. package/dist/product-DSfUTpxQ.d.ts +0 -52
  2123. package/dist/product-DSfUTpxQ.d.ts.map +0 -1
  2124. package/dist/prop-1ZO514Bp.d.cts +0 -88
  2125. package/dist/prop-1ZO514Bp.d.cts.map +0 -1
  2126. package/dist/prop-BAo3Mk2v.js +0 -2
  2127. package/dist/prop-BAo3Mk2v.js.map +0 -1
  2128. package/dist/prop-BMBSfMKq.d.ts +0 -88
  2129. package/dist/prop-BMBSfMKq.d.ts.map +0 -1
  2130. package/dist/prop-BRP9y5gY.cjs +0 -1
  2131. package/dist/pull-object-CmpUbuXg.d.ts +0 -70
  2132. package/dist/pull-object-CmpUbuXg.d.ts.map +0 -1
  2133. package/dist/pull-object-s5cSNZGP.js +0 -2
  2134. package/dist/pull-object-s5cSNZGP.js.map +0 -1
  2135. package/dist/pull-object-svkB0qoh.d.cts +0 -70
  2136. package/dist/pull-object-svkB0qoh.d.cts.map +0 -1
  2137. package/dist/pull-object-xYSFzkv6.cjs +0 -1
  2138. package/dist/random-integer-6M2bFpGx.d.cts +0 -23
  2139. package/dist/random-integer-6M2bFpGx.d.cts.map +0 -1
  2140. package/dist/random-integer-6gYh92ze.cjs +0 -1
  2141. package/dist/random-integer-BschXumd.d.ts +0 -23
  2142. package/dist/random-integer-BschXumd.d.ts.map +0 -1
  2143. package/dist/random-integer-D27vFslT.js +0 -2
  2144. package/dist/random-integer-D27vFslT.js.map +0 -1
  2145. package/dist/random-string-B49LA01O.js +0 -2
  2146. package/dist/random-string-B49LA01O.js.map +0 -1
  2147. package/dist/random-string-DBUea-au.d.ts +0 -29
  2148. package/dist/random-string-DBUea-au.d.ts.map +0 -1
  2149. package/dist/random-string-DlACN4ZV.d.cts +0 -29
  2150. package/dist/random-string-DlACN4ZV.d.cts.map +0 -1
  2151. package/dist/random-string-LG5QFZXR.cjs +0 -1
  2152. package/dist/range-BNpqskPd.d.ts +0 -27
  2153. package/dist/range-BNpqskPd.d.ts.map +0 -1
  2154. package/dist/range-BYm8b8OO.cjs +0 -1
  2155. package/dist/range-BtCOvN_L.js +0 -2
  2156. package/dist/range-BtCOvN_L.js.map +0 -1
  2157. package/dist/range-EauFMBl4.d.cts +0 -27
  2158. package/dist/range-EauFMBl4.d.cts.map +0 -1
  2159. package/dist/rank-by-B5nxlwg6.d.cts +0 -45
  2160. package/dist/rank-by-B5nxlwg6.d.cts.map +0 -1
  2161. package/dist/rank-by-B778jLnu.cjs +0 -1
  2162. package/dist/rank-by-D3jUXMA3.js +0 -2
  2163. package/dist/rank-by-D3jUXMA3.js.map +0 -1
  2164. package/dist/rank-by-urjGYBfY.d.ts +0 -45
  2165. package/dist/rank-by-urjGYBfY.d.ts.map +0 -1
  2166. package/dist/reduce-BXmHWGo2.cjs +0 -1
  2167. package/dist/reduce-DYv-piI7.d.cts +0 -53
  2168. package/dist/reduce-DYv-piI7.d.cts.map +0 -1
  2169. package/dist/reduce-RFXB_tDG.d.ts +0 -53
  2170. package/dist/reduce-RFXB_tDG.d.ts.map +0 -1
  2171. package/dist/reduce-RxP5hmH5.js +0 -2
  2172. package/dist/reduce-RxP5hmH5.js.map +0 -1
  2173. package/dist/reordered-array-BJtughHE.d.ts +0 -7
  2174. package/dist/reordered-array-BJtughHE.d.ts.map +0 -1
  2175. package/dist/reordered-array-CNK-grX0.d.cts +0 -7
  2176. package/dist/reordered-array-CNK-grX0.d.cts.map +0 -1
  2177. package/dist/reverse-Bu350kg_.d.cts +0 -29
  2178. package/dist/reverse-Bu350kg_.d.cts.map +0 -1
  2179. package/dist/reverse-DZc8DCPA.js +0 -2
  2180. package/dist/reverse-DZc8DCPA.js.map +0 -1
  2181. package/dist/reverse-l_bD9Y9C.cjs +0 -1
  2182. package/dist/reverse-w5Ru5uLJ.d.ts +0 -29
  2183. package/dist/reverse-w5Ru5uLJ.d.ts.map +0 -1
  2184. package/dist/round-BDhuebcp.d.ts +0 -39
  2185. package/dist/round-BDhuebcp.d.ts.map +0 -1
  2186. package/dist/round-CBhbfa_y.cjs +0 -1
  2187. package/dist/round-DhclizH1.js +0 -2
  2188. package/dist/round-DhclizH1.js.map +0 -1
  2189. package/dist/round-rQiLyN4w.d.cts +0 -39
  2190. package/dist/round-rQiLyN4w.d.cts.map +0 -1
  2191. package/dist/sample-9vI5EmCM.d.cts +0 -69
  2192. package/dist/sample-9vI5EmCM.d.cts.map +0 -1
  2193. package/dist/sample-BHIZQL57.d.ts +0 -69
  2194. package/dist/sample-BHIZQL57.d.ts.map +0 -1
  2195. package/dist/sample-DEt8y7NC.js +0 -2
  2196. package/dist/sample-DEt8y7NC.js.map +0 -1
  2197. package/dist/sample-arGcBCIK.cjs +0 -1
  2198. package/dist/set-B-FVFS41.cjs +0 -1
  2199. package/dist/set-C3uDSGtA.d.cts +0 -40
  2200. package/dist/set-C3uDSGtA.d.cts.map +0 -1
  2201. package/dist/set-DXK1kRjm.js +0 -2
  2202. package/dist/set-DXK1kRjm.js.map +0 -1
  2203. package/dist/set-Dg5x0drC.d.ts +0 -40
  2204. package/dist/set-Dg5x0drC.d.ts.map +0 -1
  2205. package/dist/set-path-B7WmM4pj.cjs +0 -1
  2206. package/dist/set-path-BBiEMMBi.d.cts +0 -47
  2207. package/dist/set-path-BBiEMMBi.d.cts.map +0 -1
  2208. package/dist/set-path-BIWA01lW.d.ts +0 -47
  2209. package/dist/set-path-BIWA01lW.d.ts.map +0 -1
  2210. package/dist/set-path-DpNQC1fV.js +0 -2
  2211. package/dist/set-path-DpNQC1fV.js.map +0 -1
  2212. package/dist/shuffle-0bfhzGGR.cjs +0 -1
  2213. package/dist/shuffle-BLhbIQQt.js +0 -2
  2214. package/dist/shuffle-BLhbIQQt.js.map +0 -1
  2215. package/dist/shuffle-BzeqMrKZ.d.ts +0 -31
  2216. package/dist/shuffle-BzeqMrKZ.d.ts.map +0 -1
  2217. package/dist/shuffle-CaSQtM8e.d.cts +0 -31
  2218. package/dist/shuffle-CaSQtM8e.d.cts.map +0 -1
  2219. package/dist/sleep-1rGV3wAg.cjs +0 -1
  2220. package/dist/sleep-BCki6kgY.d.cts +0 -16
  2221. package/dist/sleep-BCki6kgY.d.cts.map +0 -1
  2222. package/dist/sleep-BtY6g8Yq.d.ts +0 -16
  2223. package/dist/sleep-BtY6g8Yq.d.ts.map +0 -1
  2224. package/dist/sleep-DvzRMgY-.js +0 -2
  2225. package/dist/sleep-DvzRMgY-.js.map +0 -1
  2226. package/dist/slice-string-BwFQg4Yf.d.ts +0 -41
  2227. package/dist/slice-string-BwFQg4Yf.d.ts.map +0 -1
  2228. package/dist/slice-string-DejPzRCB.js +0 -2
  2229. package/dist/slice-string-DejPzRCB.js.map +0 -1
  2230. package/dist/slice-string-LJL__fcW.d.cts +0 -41
  2231. package/dist/slice-string-LJL__fcW.d.cts.map +0 -1
  2232. package/dist/slice-string-q-zH_WUu.cjs +0 -1
  2233. package/dist/slugify-5J_YiC6S.js +0 -2
  2234. package/dist/slugify-5J_YiC6S.js.map +0 -1
  2235. package/dist/slugify-CAFKQvdB.cjs +0 -1
  2236. package/dist/slugify-D7YgZAoM.d.cts +0 -15
  2237. package/dist/slugify-D7YgZAoM.d.cts.map +0 -1
  2238. package/dist/slugify-DXOLjypc.d.ts +0 -15
  2239. package/dist/slugify-DXOLjypc.d.ts.map +0 -1
  2240. package/dist/sort-CTZy6xBq.d.cts +0 -39
  2241. package/dist/sort-CTZy6xBq.d.cts.map +0 -1
  2242. package/dist/sort-CVjvrZjo.d.ts +0 -39
  2243. package/dist/sort-CVjvrZjo.d.ts.map +0 -1
  2244. package/dist/sort-CaAnTT3F.cjs +0 -1
  2245. package/dist/sort-D8s8kRLr.js +0 -2
  2246. package/dist/sort-D8s8kRLr.js.map +0 -1
  2247. package/dist/sort-by-CrMqBzvd.d.cts +0 -88
  2248. package/dist/sort-by-CrMqBzvd.d.cts.map +0 -1
  2249. package/dist/sort-by-DBCZSbb4.cjs +0 -1
  2250. package/dist/sort-by-DPlbBz7L.js +0 -2
  2251. package/dist/sort-by-DPlbBz7L.js.map +0 -1
  2252. package/dist/sort-by-ovbQMg9U.d.ts +0 -88
  2253. package/dist/sort-by-ovbQMg9U.d.ts.map +0 -1
  2254. package/dist/sorted-index-BFrWiZn3.cjs +0 -1
  2255. package/dist/sorted-index-Bmn5VLYJ.d.ts +0 -45
  2256. package/dist/sorted-index-Bmn5VLYJ.d.ts.map +0 -1
  2257. package/dist/sorted-index-CTM_l6te.d.cts +0 -45
  2258. package/dist/sorted-index-CTM_l6te.d.cts.map +0 -1
  2259. package/dist/sorted-index-DMcONUoc.js +0 -2
  2260. package/dist/sorted-index-DMcONUoc.js.map +0 -1
  2261. package/dist/sorted-index-by-CEUsUJdi.d.cts +0 -70
  2262. package/dist/sorted-index-by-CEUsUJdi.d.cts.map +0 -1
  2263. package/dist/sorted-index-by-CLUr58al.js +0 -2
  2264. package/dist/sorted-index-by-CLUr58al.js.map +0 -1
  2265. package/dist/sorted-index-by-CyQx_bQb.d.ts +0 -70
  2266. package/dist/sorted-index-by-CyQx_bQb.d.ts.map +0 -1
  2267. package/dist/sorted-index-by-ywbBQhCr.cjs +0 -1
  2268. package/dist/sorted-index-with-CGyMmjPN.d.ts +0 -72
  2269. package/dist/sorted-index-with-CGyMmjPN.d.ts.map +0 -1
  2270. package/dist/sorted-index-with-Cy9W9sdh.d.cts +0 -72
  2271. package/dist/sorted-index-with-Cy9W9sdh.d.cts.map +0 -1
  2272. package/dist/sorted-index-with-D5BcwSL_.cjs +0 -1
  2273. package/dist/sorted-index-with-kTK8prmw.js +0 -2
  2274. package/dist/sorted-index-with-kTK8prmw.js.map +0 -1
  2275. package/dist/sorted-last-index-B4zg__sQ.js +0 -2
  2276. package/dist/sorted-last-index-B4zg__sQ.js.map +0 -1
  2277. package/dist/sorted-last-index-CHvbfpBS.d.cts +0 -45
  2278. package/dist/sorted-last-index-CHvbfpBS.d.cts.map +0 -1
  2279. package/dist/sorted-last-index-CdPROn6x.cjs +0 -1
  2280. package/dist/sorted-last-index-DnqTn-Ev.d.ts +0 -45
  2281. package/dist/sorted-last-index-DnqTn-Ev.d.ts.map +0 -1
  2282. package/dist/sorted-last-index-by-B-IP-O5g.cjs +0 -1
  2283. package/dist/sorted-last-index-by-BGr5WioW.js +0 -2
  2284. package/dist/sorted-last-index-by-BGr5WioW.js.map +0 -1
  2285. package/dist/sorted-last-index-by-BipSOnBS.d.ts +0 -72
  2286. package/dist/sorted-last-index-by-BipSOnBS.d.ts.map +0 -1
  2287. package/dist/sorted-last-index-by-u7mPctkh.d.cts +0 -72
  2288. package/dist/sorted-last-index-by-u7mPctkh.d.cts.map +0 -1
  2289. package/dist/splice-BwsAFdV8.cjs +0 -1
  2290. package/dist/splice-CR6DLiFm.d.cts +0 -35
  2291. package/dist/splice-CR6DLiFm.d.cts.map +0 -1
  2292. package/dist/splice-CRabhu-x.d.ts +0 -35
  2293. package/dist/splice-CRabhu-x.d.ts.map +0 -1
  2294. package/dist/splice-DCOBlrIJ.js +0 -2
  2295. package/dist/splice-DCOBlrIJ.js.map +0 -1
  2296. package/dist/split-BMnz50TJ.d.ts +0 -62
  2297. package/dist/split-BMnz50TJ.d.ts.map +0 -1
  2298. package/dist/split-BSiis5Fh.d.cts +0 -62
  2299. package/dist/split-BSiis5Fh.d.cts.map +0 -1
  2300. package/dist/split-Bs-frJ_a.cjs +0 -1
  2301. package/dist/split-D1qUxipp.js +0 -2
  2302. package/dist/split-D1qUxipp.js.map +0 -1
  2303. package/dist/split-at-B3v6wCCc.d.ts +0 -31
  2304. package/dist/split-at-B3v6wCCc.d.ts.map +0 -1
  2305. package/dist/split-at-CU-3otme.d.cts +0 -31
  2306. package/dist/split-at-CU-3otme.d.cts.map +0 -1
  2307. package/dist/split-at-DUSqIHw-.cjs +0 -1
  2308. package/dist/split-at-vzCujYHL.js +0 -2
  2309. package/dist/split-at-vzCujYHL.js.map +0 -1
  2310. package/dist/split-when-BTekNxF-.d.ts +0 -29
  2311. package/dist/split-when-BTekNxF-.d.ts.map +0 -1
  2312. package/dist/split-when-C7OSEoW3.js +0 -2
  2313. package/dist/split-when-C7OSEoW3.js.map +0 -1
  2314. package/dist/split-when-CCi2Wq1B.cjs +0 -1
  2315. package/dist/split-when-DaTD5jVa.d.cts +0 -29
  2316. package/dist/split-when-DaTD5jVa.d.cts.map +0 -1
  2317. package/dist/string-to-path-C7H_9SeW.d.cts +0 -39
  2318. package/dist/string-to-path-C7H_9SeW.d.cts.map +0 -1
  2319. package/dist/string-to-path-CS10CXKM.d.ts +0 -39
  2320. package/dist/string-to-path-CS10CXKM.d.ts.map +0 -1
  2321. package/dist/string-to-path-D4HSg6rf.js +0 -2
  2322. package/dist/string-to-path-D4HSg6rf.js.map +0 -1
  2323. package/dist/string-to-path-Q_OMxElX.cjs +0 -1
  2324. package/dist/subtract-CktIeIei.js +0 -2
  2325. package/dist/subtract-CktIeIei.js.map +0 -1
  2326. package/dist/subtract-Crhaj882.cjs +0 -1
  2327. package/dist/subtract-DxrBj9Ir.d.ts +0 -35
  2328. package/dist/subtract-DxrBj9Ir.d.ts.map +0 -1
  2329. package/dist/subtract-WxyebhP-.d.cts +0 -35
  2330. package/dist/subtract-WxyebhP-.d.cts.map +0 -1
  2331. package/dist/sum-BL8tGYgI.cjs +0 -1
  2332. package/dist/sum-CcpwR68x.d.cts +0 -50
  2333. package/dist/sum-CcpwR68x.d.cts.map +0 -1
  2334. package/dist/sum-bjQo9S5Q.d.ts +0 -50
  2335. package/dist/sum-bjQo9S5Q.d.ts.map +0 -1
  2336. package/dist/sum-by-BLqXTrME.d.ts +0 -57
  2337. package/dist/sum-by-BLqXTrME.d.ts.map +0 -1
  2338. package/dist/sum-by-CIOYhCgY.cjs +0 -1
  2339. package/dist/sum-by-CqGEkkyR.d.cts +0 -57
  2340. package/dist/sum-by-CqGEkkyR.d.cts.map +0 -1
  2341. package/dist/sum-by-eeHiHAej.js +0 -2
  2342. package/dist/sum-by-eeHiHAej.js.map +0 -1
  2343. package/dist/sum-lEJNA4zT.js +0 -2
  2344. package/dist/sum-lEJNA4zT.js.map +0 -1
  2345. package/dist/swap-in-place-BBqaxzzG.js +0 -2
  2346. package/dist/swap-in-place-BBqaxzzG.js.map +0 -1
  2347. package/dist/swap-in-place-CJrU2n1_.cjs +0 -1
  2348. package/dist/swap-indices-CMgMD_dW.js +0 -2
  2349. package/dist/swap-indices-CMgMD_dW.js.map +0 -1
  2350. package/dist/swap-indices-CRAsQaXi.cjs +0 -1
  2351. package/dist/swap-indices-CdclLgV-.d.ts +0 -61
  2352. package/dist/swap-indices-CdclLgV-.d.ts.map +0 -1
  2353. package/dist/swap-indices-KQ4fsLkb.d.cts +0 -61
  2354. package/dist/swap-indices-KQ4fsLkb.d.cts.map +0 -1
  2355. package/dist/swap-props-BQ2a9nZO.cjs +0 -1
  2356. package/dist/swap-props-D-buo88H.d.ts +0 -34
  2357. package/dist/swap-props-D-buo88H.d.ts.map +0 -1
  2358. package/dist/swap-props-D7be4C3M.d.cts +0 -34
  2359. package/dist/swap-props-D7be4C3M.d.cts.map +0 -1
  2360. package/dist/swap-props-sxLIvQ4Y.js +0 -2
  2361. package/dist/swap-props-sxLIvQ4Y.js.map +0 -1
  2362. package/dist/take-BV-ctBqK.d.cts +0 -34
  2363. package/dist/take-BV-ctBqK.d.cts.map +0 -1
  2364. package/dist/take-Cn0xLGe4.js +0 -2
  2365. package/dist/take-Cn0xLGe4.js.map +0 -1
  2366. package/dist/take-CnVckkWV.d.ts +0 -34
  2367. package/dist/take-CnVckkWV.d.ts.map +0 -1
  2368. package/dist/take-DwT7ymnA.cjs +0 -1
  2369. package/dist/take-first-by-BGSUzX61.js +0 -2
  2370. package/dist/take-first-by-BGSUzX61.js.map +0 -1
  2371. package/dist/take-first-by-BgONSKvT.d.ts +0 -41
  2372. package/dist/take-first-by-BgONSKvT.d.ts.map +0 -1
  2373. package/dist/take-first-by-Cpgu4Dll.d.cts +0 -41
  2374. package/dist/take-first-by-Cpgu4Dll.d.cts.map +0 -1
  2375. package/dist/take-first-by-CtrznSxG.cjs +0 -1
  2376. package/dist/take-last-8PzLMvw3.js +0 -2
  2377. package/dist/take-last-8PzLMvw3.js.map +0 -1
  2378. package/dist/take-last-BnF7ADxy.d.ts +0 -32
  2379. package/dist/take-last-BnF7ADxy.d.ts.map +0 -1
  2380. package/dist/take-last-BvjeJFre.d.cts +0 -32
  2381. package/dist/take-last-BvjeJFre.d.cts.map +0 -1
  2382. package/dist/take-last-DT3U0fro.cjs +0 -1
  2383. package/dist/take-last-while-7hpO-w-n.cjs +0 -1
  2384. package/dist/take-last-while-CGrVFpA9.d.ts +0 -36
  2385. package/dist/take-last-while-CGrVFpA9.d.ts.map +0 -1
  2386. package/dist/take-last-while-CNlwvmIf.d.cts +0 -36
  2387. package/dist/take-last-while-CNlwvmIf.d.cts.map +0 -1
  2388. package/dist/take-last-while-D4D1elUu.js +0 -2
  2389. package/dist/take-last-while-D4D1elUu.js.map +0 -1
  2390. package/dist/take-while-BoYdbQRK.cjs +0 -1
  2391. package/dist/take-while-CPEBQO5f.d.cts +0 -34
  2392. package/dist/take-while-CPEBQO5f.d.cts.map +0 -1
  2393. package/dist/take-while-D7M5vbwg.js +0 -2
  2394. package/dist/take-while-D7M5vbwg.js.map +0 -1
  2395. package/dist/take-while-e4aa4Rzo.d.ts +0 -34
  2396. package/dist/take-while-e4aa4Rzo.d.ts.map +0 -1
  2397. package/dist/tap-2SHLmCBm.cjs +0 -1
  2398. package/dist/tap-BjWhN6y_.d.ts +0 -42
  2399. package/dist/tap-BjWhN6y_.d.ts.map +0 -1
  2400. package/dist/tap-GLPlAKCD.js +0 -2
  2401. package/dist/tap-GLPlAKCD.js.map +0 -1
  2402. package/dist/tap-gF124Yhn.d.cts +0 -42
  2403. package/dist/tap-gF124Yhn.d.cts.map +0 -1
  2404. package/dist/times-BoE5WrNr.d.cts +0 -48
  2405. package/dist/times-BoE5WrNr.d.cts.map +0 -1
  2406. package/dist/times-C4txaWWG.js +0 -2
  2407. package/dist/times-C4txaWWG.js.map +0 -1
  2408. package/dist/times-ChlK_wAM.cjs +0 -1
  2409. package/dist/times-CzRXDAnV.d.ts +0 -48
  2410. package/dist/times-CzRXDAnV.d.ts.map +0 -1
  2411. package/dist/to-camel-case-5ZN25UuZ.d.cts +0 -32
  2412. package/dist/to-camel-case-5ZN25UuZ.d.cts.map +0 -1
  2413. package/dist/to-camel-case-DJ5dmboH.d.ts +0 -32
  2414. package/dist/to-camel-case-DJ5dmboH.d.ts.map +0 -1
  2415. package/dist/to-camel-case-JdiHeuUd.js +0 -2
  2416. package/dist/to-camel-case-JdiHeuUd.js.map +0 -1
  2417. package/dist/to-camel-case-MCv0xSE_.cjs +0 -1
  2418. package/dist/to-capital-case-BBTx9xpN.d.cts +0 -31
  2419. package/dist/to-capital-case-BBTx9xpN.d.cts.map +0 -1
  2420. package/dist/to-capital-case-BD9MIiKM.cjs +0 -1
  2421. package/dist/to-capital-case-BDs8sikX.d.ts +0 -31
  2422. package/dist/to-capital-case-BDs8sikX.d.ts.map +0 -1
  2423. package/dist/to-capital-case-DFgHWUP7.js +0 -2
  2424. package/dist/to-capital-case-DFgHWUP7.js.map +0 -1
  2425. package/dist/to-constant-case-Bobbz_hT.d.cts +0 -31
  2426. package/dist/to-constant-case-Bobbz_hT.d.cts.map +0 -1
  2427. package/dist/to-constant-case-Bs1J4UNN.js +0 -2
  2428. package/dist/to-constant-case-Bs1J4UNN.js.map +0 -1
  2429. package/dist/to-constant-case-C6XG49MZ.cjs +0 -1
  2430. package/dist/to-constant-case-DlZZVrYx.d.ts +0 -31
  2431. package/dist/to-constant-case-DlZZVrYx.d.ts.map +0 -1
  2432. package/dist/to-kebab-case-BKdi-Rk7.d.ts +0 -31
  2433. package/dist/to-kebab-case-BKdi-Rk7.d.ts.map +0 -1
  2434. package/dist/to-kebab-case-BRVFPXE9.d.cts +0 -31
  2435. package/dist/to-kebab-case-BRVFPXE9.d.cts.map +0 -1
  2436. package/dist/to-kebab-case-Cud7RCjt.cjs +0 -1
  2437. package/dist/to-kebab-case-z5oAWVif.js +0 -2
  2438. package/dist/to-kebab-case-z5oAWVif.js.map +0 -1
  2439. package/dist/to-no-case-BDX0619s.cjs +0 -1
  2440. package/dist/to-no-case-Bt57ASib.js +0 -2
  2441. package/dist/to-no-case-Bt57ASib.js.map +0 -1
  2442. package/dist/to-no-case-D6nPbja8.d.cts +0 -31
  2443. package/dist/to-no-case-D6nPbja8.d.cts.map +0 -1
  2444. package/dist/to-no-case-ctaqyxQN.d.ts +0 -31
  2445. package/dist/to-no-case-ctaqyxQN.d.ts.map +0 -1
  2446. package/dist/to-pascal-case-7nVKvcNg.d.cts +0 -32
  2447. package/dist/to-pascal-case-7nVKvcNg.d.cts.map +0 -1
  2448. package/dist/to-pascal-case-BSZrgkTx.cjs +0 -1
  2449. package/dist/to-pascal-case-COG25kzw.js +0 -2
  2450. package/dist/to-pascal-case-COG25kzw.js.map +0 -1
  2451. package/dist/to-pascal-case-DUupmGjS.d.ts +0 -32
  2452. package/dist/to-pascal-case-DUupmGjS.d.ts.map +0 -1
  2453. package/dist/to-pascal-snake-case-BVvnru7G.d.ts +0 -31
  2454. package/dist/to-pascal-snake-case-BVvnru7G.d.ts.map +0 -1
  2455. package/dist/to-pascal-snake-case-C360MTFV.d.cts +0 -31
  2456. package/dist/to-pascal-snake-case-C360MTFV.d.cts.map +0 -1
  2457. package/dist/to-pascal-snake-case-C38j94Cu.cjs +0 -1
  2458. package/dist/to-pascal-snake-case-C64pBLFr.js +0 -2
  2459. package/dist/to-pascal-snake-case-C64pBLFr.js.map +0 -1
  2460. package/dist/to-sentence-case--9p0YnHo.js +0 -2
  2461. package/dist/to-sentence-case--9p0YnHo.js.map +0 -1
  2462. package/dist/to-sentence-case-7mo0QXqC.d.cts +0 -31
  2463. package/dist/to-sentence-case-7mo0QXqC.d.cts.map +0 -1
  2464. package/dist/to-sentence-case-BTrqI21a.d.ts +0 -31
  2465. package/dist/to-sentence-case-BTrqI21a.d.ts.map +0 -1
  2466. package/dist/to-sentence-case-C2TveqdZ.cjs +0 -1
  2467. package/dist/to-single-Bnq9l8Zp.cjs +0 -1
  2468. package/dist/to-single-bHVECPzX.js +0 -2
  2469. package/dist/to-single-bHVECPzX.js.map +0 -1
  2470. package/dist/to-snake-case-BuWvjluH.cjs +0 -1
  2471. package/dist/to-snake-case-Ddi9YNyo.d.ts +0 -31
  2472. package/dist/to-snake-case-Ddi9YNyo.d.ts.map +0 -1
  2473. package/dist/to-snake-case-IHXwNjtp.js +0 -2
  2474. package/dist/to-snake-case-IHXwNjtp.js.map +0 -1
  2475. package/dist/to-snake-case-e2ooEcFB.d.cts +0 -31
  2476. package/dist/to-snake-case-e2ooEcFB.d.cts.map +0 -1
  2477. package/dist/to-string-RweoJgSy.d.ts +0 -13
  2478. package/dist/to-string-RweoJgSy.d.ts.map +0 -1
  2479. package/dist/to-string-gK5yUyfp.d.cts +0 -13
  2480. package/dist/to-string-gK5yUyfp.d.cts.map +0 -1
  2481. package/dist/to-train-case-B03OndqT.d.cts +0 -31
  2482. package/dist/to-train-case-B03OndqT.d.cts.map +0 -1
  2483. package/dist/to-train-case-B06CqIxe.js +0 -2
  2484. package/dist/to-train-case-B06CqIxe.js.map +0 -1
  2485. package/dist/to-train-case-CLDlt-Y6.d.ts +0 -31
  2486. package/dist/to-train-case-CLDlt-Y6.d.ts.map +0 -1
  2487. package/dist/to-train-case-CsRLhQ9b.cjs +0 -1
  2488. package/dist/tuple-parts-BIyABPYv.d.cts +0 -89
  2489. package/dist/tuple-parts-BIyABPYv.d.cts.map +0 -1
  2490. package/dist/tuple-parts-BxpZLJ7r.d.ts +0 -89
  2491. package/dist/tuple-parts-BxpZLJ7r.d.ts.map +0 -1
  2492. package/dist/type.helpers-C0eszdCH.d.cts +0 -10
  2493. package/dist/type.helpers-C0eszdCH.d.cts.map +0 -1
  2494. package/dist/type.helpers-CNVsSXtV.cjs +0 -0
  2495. package/dist/type.helpers-CRhd_JIH.js +0 -0
  2496. package/dist/type.helpers-CrSxBVxJ.d.ts +0 -10
  2497. package/dist/type.helpers-CrSxBVxJ.d.ts.map +0 -1
  2498. package/dist/unique-4ky12IzI.d.cts +0 -39
  2499. package/dist/unique-4ky12IzI.d.cts.map +0 -1
  2500. package/dist/unique-DMbDhoaS.js +0 -2
  2501. package/dist/unique-DMbDhoaS.js.map +0 -1
  2502. package/dist/unique-Dx_8Tg2u.d.ts +0 -39
  2503. package/dist/unique-Dx_8Tg2u.d.ts.map +0 -1
  2504. package/dist/unique-Na2E_cV5.cjs +0 -1
  2505. package/dist/unique-by-927ymOrT.js +0 -2
  2506. package/dist/unique-by-927ymOrT.js.map +0 -1
  2507. package/dist/unique-by-B1t_QxyV.d.ts +0 -44
  2508. package/dist/unique-by-B1t_QxyV.d.ts.map +0 -1
  2509. package/dist/unique-by-BYeRvKkn.cjs +0 -1
  2510. package/dist/unique-by-D4r9b-C2.d.cts +0 -44
  2511. package/dist/unique-by-D4r9b-C2.d.cts.map +0 -1
  2512. package/dist/unique-with-B0Atc1ch.d.cts +0 -46
  2513. package/dist/unique-with-B0Atc1ch.d.cts.map +0 -1
  2514. package/dist/unique-with-DN7oz8DS.js +0 -2
  2515. package/dist/unique-with-DN7oz8DS.js.map +0 -1
  2516. package/dist/unique-with-DODXeZJO.cjs +0 -1
  2517. package/dist/unique-with-_6gjzVmk.d.ts +0 -46
  2518. package/dist/unique-with-_6gjzVmk.d.ts.map +0 -1
  2519. package/dist/upsert-prop-CE7fi_mP.d.ts +0 -9
  2520. package/dist/upsert-prop-CE7fi_mP.d.ts.map +0 -1
  2521. package/dist/upsert-prop-Dtu5xY0L.d.cts +0 -9
  2522. package/dist/upsert-prop-Dtu5xY0L.d.cts.map +0 -1
  2523. package/dist/utility-evaluators-CnQVdcZv.js +0 -2
  2524. package/dist/utility-evaluators-CnQVdcZv.js.map +0 -1
  2525. package/dist/utility-evaluators-DqJcWENu.cjs +0 -1
  2526. package/dist/values-BXlzhi3A.cjs +0 -1
  2527. package/dist/values-CIS32AYx.d.cts +0 -38
  2528. package/dist/values-CIS32AYx.d.cts.map +0 -1
  2529. package/dist/values-DUzzQ-p6.d.ts +0 -38
  2530. package/dist/values-DUzzQ-p6.d.ts.map +0 -1
  2531. package/dist/values-Dsgo6Wke.js +0 -2
  2532. package/dist/values-Dsgo6Wke.js.map +0 -1
  2533. package/dist/with-precision-BgF-Y_mF.cjs +0 -1
  2534. package/dist/with-precision-BoiuafbM.js +0 -2
  2535. package/dist/with-precision-BoiuafbM.js.map +0 -1
  2536. package/dist/zip-CA2if4ix.cjs +0 -1
  2537. package/dist/zip-CoEM-79C.d.cts +0 -38
  2538. package/dist/zip-CoEM-79C.d.cts.map +0 -1
  2539. package/dist/zip-DhsVpwcO.js +0 -2
  2540. package/dist/zip-DhsVpwcO.js.map +0 -1
  2541. package/dist/zip-with-BRpfRkdc.js +0 -2
  2542. package/dist/zip-with-BRpfRkdc.js.map +0 -1
  2543. package/dist/zip-with-CABk7jf5.d.ts +0 -50
  2544. package/dist/zip-with-CABk7jf5.d.ts.map +0 -1
  2545. package/dist/zip-with-D0Ey6gSU.d.cts +0 -50
  2546. package/dist/zip-with-D0Ey6gSU.d.cts.map +0 -1
  2547. package/dist/zip-with-D7HfIW7V.cjs +0 -1
  2548. package/dist/zip-xjUg1DcS.d.ts +0 -38
  2549. package/dist/zip-xjUg1DcS.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funnel.js","names":["burstTimeoutId: ReturnType<typeof setTimeout> | undefined","intervalTimeoutId: ReturnType<typeof setTimeout> | undefined","preparedData: R | undefined","burstStartTimestamp: number | undefined"],"sources":["../src/funnel.ts"],"sourcesContent":["import type { RequireAtLeastOne } from 'type-fest';\n\n/**\n * We use the value provided by the reducer to also determine if a call\n * was done during a timeout period. This means that even when no reducer\n * is provided, we still need a dummy reducer that would return something\n * other than `undefined`. It is safe to cast this to R (which might be\n * anything) because the callback would never use it as it would be typed\n * as a zero-args function.\n */\nconst VOID_REDUCER_SYMBOL = Symbol('funnel/voidReducer');\nconst voidReducer = <R>(): R => VOID_REDUCER_SYMBOL as R;\n\ntype FunnelOptions<Args extends RestArguments, R> = {\n readonly reducer?: (accumulator: R | undefined, ...params: Args) => R;\n} & FunnelTimingOptions;\n\n/**\n * Not all combinations of timing options are valid, there are dependencies\n * between them to ensure users can't configure the funnel in a way which would\n * cause it to never trigger.\n */\ntype FunnelTimingOptions\n = | ({ readonly triggerAt?: 'end' } & (\n | ({ readonly minGapMs: number } & RequireAtLeastOne<{\n readonly minQuietPeriodMs: number;\n readonly maxBurstDurationMs: number;\n }>)\n | {\n readonly minQuietPeriodMs?: number;\n readonly maxBurstDurationMs?: number;\n readonly minGapMs?: never;\n }\n ))\n | {\n readonly triggerAt: 'start' | 'both';\n readonly minQuietPeriodMs?: number;\n readonly maxBurstDurationMs?: number;\n readonly minGapMs?: number;\n };\n\n// eslint-disable-next-line ts/no-explicit-any -- TypeScript has some quirks with generic function types, and works best with `any` and not `unknown`. This follows the typing of built-in utilities like `ReturnType` and `Parameters`.\ntype RestArguments = Array<any>;\n\ninterface Funnel<Args extends RestArguments = []> {\n /**\n * Call the function. This might result in the `execute` function being called\n * now or later, depending on it's configuration and it's current state.\n *\n * @param args - The args are defined by the `reducer` function.\n */\n\n readonly call: (...args: Args) => void;\n\n /**\n * Resets the funnel to it's initial state. Any calls made since the last\n * invocation will be discarded.\n */\n readonly cancel: () => void;\n\n /**\n * Triggers an invocation regardless of the current state of the funnel.\n * Like any other invocation, The funnel will also be reset to it's initial\n * state afterwards.\n */\n readonly flush: () => void;\n\n /**\n * The funnel is in it's initial state (there are no active timeouts).\n */\n readonly isIdle: boolean;\n}\n\n/**\n * Creates a funnel that controls the timing and execution of `callback`. Its\n * main purpose is to manage multiple consecutive (usually fast-paced) calls,\n * reshaping them according to a defined batching strategy and timing policy.\n * This is useful when handling uncontrolled call rates, such as DOM events or\n * network traffic. It can implement strategies like debouncing, throttling,\n * batching, and more.\n *\n * An optional `reducer` function can be provided to allow passing data to the\n * callback via calls to `call` (otherwise the signature of `call` takes no\n * arguments).\n *\n * Typing is inferred from `callback`s param, and from the rest params that\n * the optional `reducer` function accepts. Use **explicit** types for these\n * to ensure that everything _else_ is well-typed.\n *\n * Notice that this function constructs a funnel **object**, and does **not**\n * execute anything when called. The returned object should be used to execute\n * the funnel via the its `call` method.\n *\n * - Debouncing: use `minQuietPeriodMs` and any `triggerAt`.\n * - Throttling: use `minGapMs` and `triggerAt: \"start\"` or `\"both\"`.\n * - Batching: See the reference implementation in [`funnel.reference-batch.test.ts`](https://github.com/vinicunca/perkakas/blob/main/src/funnel.reference-batch.test.ts).\n *\n * @param callback - The main function that would be invoked periodically based\n * on `options`. The function would take the latest result of the `reducer`; if\n * no calls where made since the last time it was invoked it will not be\n * invoked. (If a return value is needed, it should be passed via a reference or\n * via closure to the outer scope of the funnel).\n * @param options - An object that defines when `execute` should be invoked,\n * relative to the calls of `call`. An empty/missing options object is\n * equivalent to setting `minQuietPeriodMs` to `0`.\n * @param options.reducer - Combines the arguments passed to `call` with the\n * value computed on the previous call (or `undefined` on the first time). The\n * goal of the function is to extract and summarize the data needed for\n * `callback`. It should be fast and simple as it is called often and should\n * defer heavy operations to the `execute` function. If the final value\n * is `undefined`, `callback` will not be called.\n * @param options.triggerAt - At what \"edges\" of the funnel's burst window\n * would `execute` invoke:\n * - `start` - the function will be invoked immediately (within the **same**\n * execution frame!), and any subsequent calls would be ignored until the funnel\n * is idle again. During this period `reducer` will also not be called.\n * - `end` - the function will **not** be invoked initially but the timer will\n * be started. Any calls during this time would be passed to the reducer, and\n * when the timers are done, the reduced result would trigger an invocation.\n * - `both` - the function will be invoked immediately, and then the funnel\n * would behave as if it was in the 'end' state. @default 'end'.\n * @param options.minQuietPeriodMs - The burst timer prevents subsequent calls\n * in short succession to cause excessive invocations (aka \"debounce\"). This\n * duration represents the **minimum** amount of time that needs to pass\n * between calls (the \"quiet\" part) in order for the subsequent call to **not**\n * be considered part of the burst. In other words, as long as calls are faster\n * than this, they are considered part of the burst and the burst is extended.\n * @param options.maxBurstDurationMs - Bursts are extended every time a call is\n * made within the burst period. This means that the burst period could be\n * extended indefinitely. To prevent such cases, a maximum burst duration could\n * be defined. When `minQuietPeriodMs` is not defined and this option is, they\n * will both share the same value.\n * @param options.minGapMs - A minimum duration between calls of `execute`.\n * This is maintained regardless of the shape of the burst and is ensured even\n * if the `maxBurstDurationMs` is reached before it. (aka \"throttle\").\n * @returns A funnel with a `call` function that is used to trigger invocations.\n * In addition to it the funnel also comes with the following functions and\n * properties:\n * - `cancel` - Resets the funnel to it's initial state, discarding the current\n * `reducer` result without calling `execute` on it.\n * - `flush` - Triggers an invocation even if there are active timeouts, and\n * then resets the funnel to it's initial state.\n * - `isIdle` - Checks if there are any active timeouts.\n * @signature\n * P.funnel(callback, options);\n * @example\n * const debouncer = P.funnel(\n * () => {\n * console.log(\"Callback executed!\");\n * },\n * { minQuietPeriodMs: 100 },\n * );\n * debouncer.call();\n * debouncer.call();\n *\n * const throttle = P.funnel(\n * () => {\n * console.log(\"Callback executed!\");\n * },\n * { minGapMs: 100, triggerAt: \"start\" },\n * );\n * throttle.call();\n * throttle.call();\n * @category Function\n */\nexport function funnel<Args extends RestArguments = [], R = never>(\n callback: (data: R) => void,\n {\n triggerAt = 'end',\n minQuietPeriodMs,\n maxBurstDurationMs,\n minGapMs,\n reducer = voidReducer,\n }: FunnelOptions<Args, R>,\n): Funnel<Args> {\n /**\n * We manage execution via 2 timeouts, one to track bursts of calls, and one\n * to track the interval between invocations. Together we refer to the period\n * where any of these are active as a \"cool-down period\".\n */\n let burstTimeoutId: ReturnType<typeof setTimeout> | undefined;\n let intervalTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n /**\n * Until invoked, all calls are reduced into a single value that would be sent\n * to the executor on invocation.\n */\n let preparedData: R | undefined;\n\n /**\n * In order to be able to limit the total size of the burst (when\n * `maxBurstDurationMs` is used) we need to track when the burst started.\n */\n let burstStartTimestamp: number | undefined;\n\n function invoke(): void {\n const param = preparedData;\n if (param === undefined) {\n // There were no calls during both cool-down periods.\n return;\n }\n\n // Make sure the args aren't accidentally used again\n preparedData = undefined;\n\n // eslint-disable-next-line sonar/different-types-comparison\n if (param === VOID_REDUCER_SYMBOL) {\n // @ts-expect-error [ts2554] -- R is typed as `never` because we hide the\n // symbol that `voidReducer` returns; there's no way to make TypeScript\n // aware of this.\n callback();\n } else {\n callback(param);\n }\n\n if (minGapMs !== undefined) {\n intervalTimeoutId = setTimeout(handleIntervalEnd, minGapMs);\n }\n }\n\n function handleIntervalEnd(): void {\n /**\n * When called via a timeout the timeout is already cleared, but when called\n * via `flush` we need to manually clear it.\n */\n clearTimeout(intervalTimeoutId);\n intervalTimeoutId = undefined;\n\n if (burstTimeoutId !== undefined) {\n /**\n * As long as one of the timeouts is active we don't invoke the function.\n * Each timeout's end event handler has a call to invoke, so we are\n * guaranteed to invoke the function eventually.\n */\n return;\n }\n\n invoke();\n };\n\n function handleBurstEnd(): void {\n /**\n * When called via a timeout the timeout is already cleared, but when called\n * via `flush` we need to manually clear it.\n */\n clearTimeout(burstTimeoutId);\n burstTimeoutId = undefined;\n burstStartTimestamp = undefined;\n\n if (intervalTimeoutId !== undefined) {\n /**\n * As long as one of the timeouts is active we don't invoke the function.\n * Each timeout's end event handler has a call to invoke, so we are\n * guaranteed to invoke the function eventually.\n */\n return;\n }\n\n invoke();\n };\n\n return {\n call: (...args) => {\n /**\n * We act based on the initial state of the timeouts before the call is\n * handled and causes the timeouts to change.\n */\n const wasIdle = burstTimeoutId === undefined && intervalTimeoutId === undefined;\n\n if (triggerAt !== 'start' || wasIdle) {\n preparedData = reducer(preparedData, ...args);\n }\n\n if (burstTimeoutId === undefined && !wasIdle) {\n /**\n * We are not in an active burst period but in an interval period. We\n * don't start a new burst window until the next invoke.\n */\n return;\n }\n\n if (\n minQuietPeriodMs !== undefined\n || maxBurstDurationMs !== undefined\n || minGapMs === undefined\n ) {\n /**\n * The timeout tracking the burst period needs to be reset every time\n * another call is made so that it waits the full cool-down duration\n * before it is released.\n */\n clearTimeout(burstTimeoutId);\n\n const now = Date.now();\n\n burstStartTimestamp ??= now;\n\n const burstRemainingMs\n = maxBurstDurationMs === undefined\n ? (minQuietPeriodMs ?? 0)\n : Math.min(\n minQuietPeriodMs ?? maxBurstDurationMs,\n /**\n * We need to account for the time already spent so that we\n * don't wait longer than the maxDelay.\n */\n maxBurstDurationMs - (now - burstStartTimestamp),\n );\n\n burstTimeoutId = setTimeout(handleBurstEnd, burstRemainingMs);\n }\n\n if (triggerAt !== 'end' && wasIdle) {\n invoke();\n }\n },\n\n cancel: () => {\n clearTimeout(burstTimeoutId);\n burstTimeoutId = undefined;\n burstStartTimestamp = undefined;\n\n clearTimeout(intervalTimeoutId);\n intervalTimeoutId = undefined;\n\n preparedData = undefined;\n },\n\n flush: () => {\n handleBurstEnd();\n handleIntervalEnd();\n },\n\n get isIdle() {\n return burstTimeoutId === undefined && intervalTimeoutId === undefined;\n },\n };\n}\n"],"mappings":"AAUA,MAAM,EAAsB,OAAO,qBAAqB,CAClD,MAA0B,EA0JhC,SAAgB,EACd,EACA,CACE,YAAY,MACZ,mBACA,qBACA,WACA,UAAU,GAEE,CAMd,IAAIA,EACAC,EAMAC,EAMAC,EAEJ,SAAS,GAAe,CACtB,IAAM,EAAQ,EACV,IAAU,IAAA,KAMd,EAAe,IAAA,GAGX,IAAU,EAIZ,GAAU,CAEV,EAAS,EAAM,CAGb,IAAa,IAAA,KACf,EAAoB,WAAW,EAAmB,EAAS,GAI/D,SAAS,GAA0B,CAKjC,aAAa,EAAkB,CAC/B,EAAoB,IAAA,GAEhB,IAAmB,IAAA,IASvB,GAAQ,CAGV,SAAS,GAAuB,CAK9B,aAAa,EAAe,CAC5B,EAAiB,IAAA,GACjB,EAAsB,IAAA,GAElB,IAAsB,IAAA,IAS1B,GAAQ,CAGV,MAAO,CACL,MAAO,GAAG,IAAS,CAKjB,IAAM,EAAU,IAAmB,IAAA,IAAa,IAAsB,IAAA,GAEtE,IAAI,IAAc,SAAW,KAC3B,EAAe,EAAQ,EAAc,GAAG,EAAK,EAG3C,MAAmB,IAAA,IAAa,CAAC,GAQrC,IACE,IAAqB,IAAA,IAClB,IAAuB,IAAA,IACvB,IAAa,IAAA,GAChB,CAMA,aAAa,EAAe,CAE5B,IAAM,EAAM,KAAK,KAAK,CAEtB,IAAwB,EAExB,IAAM,EACF,IAAuB,IAAA,GACpB,GAAoB,EACrB,KAAK,IACH,GAAoB,EAKpB,GAAsB,EAAM,GAC7B,CAEP,EAAiB,WAAW,EAAgB,EAAiB,CAG3D,IAAc,OAAS,GACzB,GAAQ,GAIZ,WAAc,CACZ,aAAa,EAAe,CAC5B,EAAiB,IAAA,GACjB,EAAsB,IAAA,GAEtB,aAAa,EAAkB,CAC/B,EAAoB,IAAA,GAEpB,EAAe,IAAA,IAGjB,UAAa,CACX,GAAgB,CAChB,GAAmB,EAGrB,IAAI,QAAS,CACX,OAAO,IAAmB,IAAA,IAAa,IAAsB,IAAA,IAEhE"}
@@ -1 +1 @@
1
- const e=require(`./dist-gvJoKj_M.cjs`),t=require(`./constant-BuIJ9GIn.cjs`),n=require(`./funnel-CL-QFpGk.cjs`),r=require(`./identity-BAryUWbs.cjs`),i=require(`./sleep-1rGV3wAg.cjs`);function a(e,t=0,{leading:r=!1,trailing:i=!0,maxWait:a}={}){let o,{call:s,flush:c,cancel:l}=n.funnel(t=>{!r&&!i||(o=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,...a!==void 0&&{maxBurstDurationMs:a},...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(s(...e),o),{flush:()=>(c(),o),cancel:l})}const o=16;e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{e.it(`should debounce a function`,async()=>{let t=e.vi.fn(r.identity()),n=a(t,16);e.globalExpect(n(`a`)).toBeUndefined(),e.globalExpect(n(`b`)).toBeUndefined(),e.globalExpect(n(`c`)).toBeUndefined(),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(1),e.globalExpect(n(`d`)).toBe(`c`),e.globalExpect(n(`e`)).toBe(`c`),e.globalExpect(n(`f`)).toBe(`c`),e.globalExpect(t).toHaveBeenCalledTimes(1),await i.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("subsequent debounced calls return the last `func` result",async()=>{let t=a(r.identity(),16);t(`a`),await i.sleep(32),e.globalExpect(t(`b`)).not.toBe(`b`),await i.sleep(32),e.globalExpect(t(`c`)).not.toBe(`c`)}),e.it("subsequent leading debounced calls return the last `func` result",async()=>{let t=a(r.identity(),16,{leading:!0,trailing:!1});e.globalExpect(t(`a`)).toBe(`a`),e.globalExpect(t(`b`)).toBe(`a`),await i.sleep(32),e.globalExpect(t(`c`)).toBe(`c`),e.globalExpect(t(`d`)).toBe(`c`)}),e.it("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let n={},r=e.vi.fn(t.constant(!1)),o=a(r,16,{maxWait:32});for(;o(n,`a`)??!0;)await i.sleep(0);await i.sleep(32),e.globalExpect(r).toHaveBeenCalledTimes(2),e.globalExpect(r).toHaveBeenLastCalledWith(n,`a`)})}),e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.it("should reset `lastCalled` after cancelling",async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!0});e.globalExpect(n()).toBe(1),n.cancel(),e.globalExpect(n()).toBe(2),n(),await i.sleep(32),e.globalExpect(t).toBe(3)}),e.it(`should support flushing delayed calls`,async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!1});n(),e.globalExpect(n.flush()).toBe(1),await i.sleep(32),e.globalExpect(t).toBe(1)}),e.it("should noop `cancel` and `flush` when nothing is queued",async()=>{let n=e.vi.fn(t.constant(`hello`)),r=a(n,16);r.cancel(),e.globalExpect(r.flush()).toBeUndefined(),await i.sleep(32),e.globalExpect(n).toHaveBeenCalledTimes(0)})}),e.describe(`features not tested by Lodash`,()=>{e.it(`does nothing when neither leading nor trailing are enabled`,async()=>{let t=a(r.identity(),16,{leading:!1,trailing:!1});e.globalExpect(t(`hello`)).toBeUndefined(),e.globalExpect(t(`world`)).toBeUndefined(),await i.sleep(64),e.globalExpect(t(`goodbye`)).toBeUndefined()})});
1
+ const e=require(`./dist-CiyBKPT6.cjs`),t=require(`./constant.cjs`),n=require(`./funnel.cjs`),r=require(`./identity.cjs`),i=require(`./sleep.cjs`);function a(e,t=0,{leading:r=!1,trailing:i=!0,maxWait:a}={}){let o,{call:s,flush:c,cancel:l}=n.funnel(t=>{!r&&!i||(o=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,...a!==void 0&&{maxBurstDurationMs:a},...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(s(...e),o),{flush:()=>(c(),o),cancel:l})}const o=16;e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{e.a(`should debounce a function`,async()=>{let t=e.r.fn(r.identity()),n=a(t,16);e.n(n(`a`)).toBeUndefined(),e.n(n(`b`)).toBeUndefined(),e.n(n(`c`)).toBeUndefined(),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(64),e.n(t).toHaveBeenCalledTimes(1),e.n(n(`d`)).toBe(`c`),e.n(n(`e`)).toBe(`c`),e.n(n(`f`)).toBe(`c`),e.n(t).toHaveBeenCalledTimes(1),await i.sleep(64),e.n(t).toHaveBeenCalledTimes(2)}),e.a("subsequent debounced calls return the last `func` result",async()=>{let t=a(r.identity(),16);t(`a`),await i.sleep(32),e.n(t(`b`)).not.toBe(`b`),await i.sleep(32),e.n(t(`c`)).not.toBe(`c`)}),e.a("subsequent leading debounced calls return the last `func` result",async()=>{let t=a(r.identity(),16,{leading:!0,trailing:!1});e.n(t(`a`)).toBe(`a`),e.n(t(`b`)).toBe(`a`),await i.sleep(32),e.n(t(`c`)).toBe(`c`),e.n(t(`d`)).toBe(`c`)}),e.a("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let n={},r=e.r.fn(t.constant(!1)),o=a(r,16,{maxWait:32});for(;o(n,`a`)??!0;)await i.sleep(0);await i.sleep(32),e.n(r).toHaveBeenCalledTimes(2),e.n(r).toHaveBeenLastCalledWith(n,`a`)})}),e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.a("should reset `lastCalled` after cancelling",async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!0});e.n(n()).toBe(1),n.cancel(),e.n(n()).toBe(2),n(),await i.sleep(32),e.n(t).toBe(3)}),e.a(`should support flushing delayed calls`,async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!1});n(),e.n(n.flush()).toBe(1),await i.sleep(32),e.n(t).toBe(1)}),e.a("should noop `cancel` and `flush` when nothing is queued",async()=>{let n=e.r.fn(t.constant(`hello`)),r=a(n,16);r.cancel(),e.n(r.flush()).toBeUndefined(),await i.sleep(32),e.n(n).toHaveBeenCalledTimes(0)})}),e.i(`features not tested by Lodash`,()=>{e.a(`does nothing when neither leading nor trailing are enabled`,async()=>{let t=a(r.identity(),16,{leading:!1,trailing:!1});e.n(t(`hello`)).toBeUndefined(),e.n(t(`world`)).toBeUndefined(),await i.sleep(64),e.n(t(`goodbye`)).toBeUndefined()})});
@@ -1,2 +1,2 @@
1
- import{describe as e,globalExpect as t,it as n,vi as r}from"./dist-BQGZfjDS.js";import{constant as i}from"./constant-DrpDXHc7.js";import{funnel as a}from"./funnel-CEbURcmp.js";import{identity as o}from"./identity-D7NWGnLw.js";import{sleep as s}from"./sleep-DvzRMgY-.js";function c(e,t=0,{leading:n=!1,trailing:r=!0,maxWait:i}={}){let o,{call:s,flush:c,cancel:l}=a(t=>{!n&&!r||(o=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,...i!==void 0&&{maxBurstDurationMs:i},...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(s(...e),o),{flush:()=>(c(),o),cancel:l})}e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{n(`should debounce a function`,async()=>{let e=r.fn(o()),n=c(e,16);t(n(`a`)).toBeUndefined(),t(n(`b`)).toBeUndefined(),t(n(`c`)).toBeUndefined(),t(e).toHaveBeenCalledTimes(0),await s(64),t(e).toHaveBeenCalledTimes(1),t(n(`d`)).toBe(`c`),t(n(`e`)).toBe(`c`),t(n(`f`)).toBe(`c`),t(e).toHaveBeenCalledTimes(1),await s(64),t(e).toHaveBeenCalledTimes(2)}),n("subsequent debounced calls return the last `func` result",async()=>{let e=c(o(),16);e(`a`),await s(32),t(e(`b`)).not.toBe(`b`),await s(32),t(e(`c`)).not.toBe(`c`)}),n("subsequent leading debounced calls return the last `func` result",async()=>{let e=c(o(),16,{leading:!0,trailing:!1});t(e(`a`)).toBe(`a`),t(e(`b`)).toBe(`a`),await s(32),t(e(`c`)).toBe(`c`),t(e(`d`)).toBe(`c`)}),n("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e={},n=r.fn(i(!1)),a=c(n,16,{maxWait:32});for(;a(e,`a`)??!0;)await s(0);await s(32),t(n).toHaveBeenCalledTimes(2),t(n).toHaveBeenLastCalledWith(e,`a`)})}),e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{n("should reset `lastCalled` after cancelling",async()=>{let e=0,n=c(()=>(e+=1,e),16,{leading:!0});t(n()).toBe(1),n.cancel(),t(n()).toBe(2),n(),await s(32),t(e).toBe(3)}),n(`should support flushing delayed calls`,async()=>{let e=0,n=c(()=>(e+=1,e),16,{leading:!1});n(),t(n.flush()).toBe(1),await s(32),t(e).toBe(1)}),n("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(i(`hello`)),n=c(e,16);n.cancel(),t(n.flush()).toBeUndefined(),await s(32),t(e).toHaveBeenCalledTimes(0)})}),e(`features not tested by Lodash`,()=>{n(`does nothing when neither leading nor trailing are enabled`,async()=>{let e=c(o(),16,{leading:!1,trailing:!1});t(e(`hello`)).toBeUndefined(),t(e(`world`)).toBeUndefined(),await s(64),t(e(`goodbye`)).toBeUndefined()})});
1
+ import{a as e,i as t,n,r}from"./dist-CUT1dnRU.js";import{constant as i}from"./constant.js";import{funnel as a}from"./funnel.js";import{identity as o}from"./identity.js";import{sleep as s}from"./sleep.js";function c(e,t=0,{leading:n=!1,trailing:r=!0,maxWait:i}={}){let o,{call:s,flush:c,cancel:l}=a(t=>{!n&&!r||(o=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,...i!==void 0&&{maxBurstDurationMs:i},...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(s(...e),o),{flush:()=>(c(),o),cancel:l})}t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{e(`should debounce a function`,async()=>{let e=r.fn(o()),t=c(e,16);n(t(`a`)).toBeUndefined(),n(t(`b`)).toBeUndefined(),n(t(`c`)).toBeUndefined(),n(e).toHaveBeenCalledTimes(0),await s(64),n(e).toHaveBeenCalledTimes(1),n(t(`d`)).toBe(`c`),n(t(`e`)).toBe(`c`),n(t(`f`)).toBe(`c`),n(e).toHaveBeenCalledTimes(1),await s(64),n(e).toHaveBeenCalledTimes(2)}),e("subsequent debounced calls return the last `func` result",async()=>{let e=c(o(),16);e(`a`),await s(32),n(e(`b`)).not.toBe(`b`),await s(32),n(e(`c`)).not.toBe(`c`)}),e("subsequent leading debounced calls return the last `func` result",async()=>{let e=c(o(),16,{leading:!0,trailing:!1});n(e(`a`)).toBe(`a`),n(e(`b`)).toBe(`a`),await s(32),n(e(`c`)).toBe(`c`),n(e(`d`)).toBe(`c`)}),e("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e={},t=r.fn(i(!1)),a=c(t,16,{maxWait:32});for(;a(e,`a`)??!0;)await s(0);await s(32),n(t).toHaveBeenCalledTimes(2),n(t).toHaveBeenLastCalledWith(e,`a`)})}),t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e("should reset `lastCalled` after cancelling",async()=>{let e=0,t=c(()=>(e+=1,e),16,{leading:!0});n(t()).toBe(1),t.cancel(),n(t()).toBe(2),t(),await s(32),n(e).toBe(3)}),e(`should support flushing delayed calls`,async()=>{let e=0,t=c(()=>(e+=1,e),16,{leading:!1});t(),n(t.flush()).toBe(1),await s(32),n(e).toBe(1)}),e("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(i(`hello`)),t=c(e,16);t.cancel(),n(t.flush()).toBeUndefined(),await s(32),n(e).toHaveBeenCalledTimes(0)})}),t(`features not tested by Lodash`,()=>{e(`does nothing when neither leading nor trailing are enabled`,async()=>{let e=c(o(),16,{leading:!1,trailing:!1});n(e(`hello`)).toBeUndefined(),n(e(`world`)).toBeUndefined(),await s(64),n(e(`goodbye`)).toBeUndefined()})});
2
2
  //# sourceMappingURL=funnel.lodash-debounce-with-cached-value.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"funnel.lodash-debounce-with-cached-value.test.js","names":["cachedValue: ReturnType<F> | undefined"],"sources":["../src/funnel.lodash-debounce-with-cached-value.test.ts"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable antfu/consistent-list-newline */\n/* eslint-disable ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { constant } from './constant';\nimport { funnel } from './funnel';\nimport { identity } from './identity';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `debounce` function using the\n * The `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your codebase and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a more complex implementation which respects Lodash capability to\n * track the return value of the callback function. In most cases you are more\n * likely to prefer the simpler reference implementation `debounce` which can\n * be found in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for debounce.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests. Tests that are unrelated to the cache\n * capability have been removed to avoid duplication with the other test file.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#debounce\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10372\n * @see Lodash Tests: https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L374\n */\nfunction debounceWithCachedValue<F extends (...args: any) => any>(\n func: F,\n wait = 0,\n {\n leading = false,\n trailing = true,\n maxWait,\n }: {\n readonly leading?: boolean;\n readonly trailing?: boolean;\n readonly maxWait?: number;\n } = {}) {\n let cachedValue: ReturnType<F> | undefined;\n\n const { call, flush, cancel } = funnel(\n (args: Parameters<F>) => {\n if (!leading && !trailing) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * debounce window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n * Also, every time the function is invoked the cached value is updated.\n */\n cachedValue = func(...args) as ReturnType<F>;\n },\n {\n /**\n * Debounce stores the latest args it was called with for the next\n * invocation of the callback.\n */\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n ...(maxWait !== undefined && { maxBurstDurationMs: maxWait }),\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n\n /**\n * Lodash uses a legacy JS-isms to attach helper functions to the main\n * callback of `debounce`. In our function we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(\n (...args: Parameters<F>) => {\n call(...args);\n return cachedValue;\n },\n {\n flush: () => {\n flush();\n return cachedValue;\n },\n\n cancel,\n },\n );\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187', () => {\n it('should debounce a function', async () => {\n const mockFn = vi.fn<(x: string) => string>(identity());\n const debounced = debounceWithCachedValue(mockFn, UT);\n\n expect(debounced('a')).toBeUndefined();\n expect(debounced('b')).toBeUndefined();\n expect(debounced('c')).toBeUndefined();\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n expect(debounced('d')).toBe('c');\n expect(debounced('e')).toBe('c');\n expect(debounced('f')).toBe('c');\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('subsequent debounced calls return the last `func` result', async () => {\n const debounced = debounceWithCachedValue(identity(), UT);\n debounced('a');\n await sleep(2 * UT);\n\n expect(debounced('b')).not.toBe('b');\n\n await sleep(2 * UT);\n\n expect(debounced('c')).not.toBe('c');\n });\n\n it('subsequent leading debounced calls return the last `func` result', async () => {\n const debounced = debounceWithCachedValue(identity(), UT, {\n leading: true,\n trailing: false,\n });\n\n expect(debounced('a')).toBe('a');\n expect(debounced('b')).toBe('a');\n\n await sleep(2 * UT);\n\n expect(debounced('c')).toBe('c');\n expect(debounced('d')).toBe('c');\n });\n\n it('should invoke the trailing call with the correct arguments and `this` binding', async () => {\n const DATA = {};\n const mockFn = vi.fn<(a: object, b: string) => boolean>(constant(false));\n\n /**\n * In Lodash the test uses both `leading` and `trailing` timing options\n * for this test, but it only works because the `leading` option in Lodash\n * runs within the same execution frame as the call to the debouncer; the\n * Lodash test also passes when the `leading` option is removed. For our\n * implementation the \"leading\" option is delayed to the next execution\n * frame, which, when used together with `maxWait` would cause the debouncer\n * to see a \"quiet window\" and trigger an additional invocation of the\n * mockFn, and the test to fail.\n */\n const debounced = debounceWithCachedValue(mockFn, UT, { maxWait: 2 * UT });\n\n while (debounced(DATA, 'a') ?? true) {\n // eslint-disable-next-line no-await-in-loop -- We sleep to yield execution so that the timeouts in the debouncer have a chance to run.\n await sleep(0);\n }\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n expect(mockFn).toHaveBeenLastCalledWith(DATA, 'a');\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should reset `lastCalled` after cancelling', async () => {\n let callCount = 0;\n const debounced = debounceWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: true },\n );\n\n expect(debounced()).toBe(1);\n\n debounced.cancel();\n\n expect(debounced()).toBe(2);\n\n debounced();\n await sleep(2 * UT);\n\n expect(callCount).toBe(3);\n });\n\n it('should support flushing delayed calls', async () => {\n let callCount = 0;\n const debounced = debounceWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: false },\n );\n debounced();\n\n expect(debounced.flush()).toBe(1);\n\n await sleep(2 * UT);\n\n expect(callCount).toBe(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => string>(constant('hello'));\n const debounced = debounceWithCachedValue(mockFn, UT);\n debounced.cancel();\n\n expect(debounced.flush()).toBeUndefined();\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\ndescribe('features not tested by Lodash', () => {\n it('does nothing when neither leading nor trailing are enabled', async () => {\n const debounced = debounceWithCachedValue(identity(), UT, {\n leading: false,\n trailing: false,\n });\n\n expect(debounced('hello')).toBeUndefined();\n expect(debounced('world')).toBeUndefined();\n\n await sleep(4 * UT);\n\n expect(debounced('goodbye')).toBeUndefined();\n });\n});\n"],"mappings":"8QAwCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,GACX,WAKE,EAAE,CAAE,CACR,IAAIA,EAEE,CAAE,OAAM,QAAO,UAAW,EAC7B,GAAwB,CACnB,CAAC,GAAW,CAAC,IAiBjB,EAAc,EAAK,GAAG,EAAK,GAE7B,CAKE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,GAAI,IAAY,IAAA,IAAa,CAAE,mBAAoB,EAAS,CAC5D,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAQD,OAAO,OAAO,QACX,GAAG,KACF,EAAK,GAAG,EAAK,CACN,GAET,CACE,WACE,GAAO,CACA,GAGT,SACD,CACF,CAYH,EAAS,uEAA0E,CACjF,EAAG,6BAA8B,SAAY,CAC3C,IAAM,EAAS,EAAG,GAA0B,GAAU,CAAC,CACjD,EAAY,EAAwB,EAAQ,GAAG,CAErD,EAAO,EAAU,IAAI,CAAC,CAAC,eAAe,CACtC,EAAO,EAAU,IAAI,CAAC,CAAC,eAAe,CACtC,EAAO,EAAU,IAAI,CAAC,CAAC,eAAe,CACtC,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,CACvC,EAAO,EAAU,IAAI,CAAC,CAAC,KAAK,IAAI,CAChC,EAAO,EAAU,IAAI,CAAC,CAAC,KAAK,IAAI,CAChC,EAAO,EAAU,IAAI,CAAC,CAAC,KAA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AO,GAAW,CAAC,CAAC,KAAK,EAAE,CAE3B,GAAW,CACX,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAU,CAAC,KAAK,EAAE,EACzB,CAEF,EAAG,wCAAyC,SAAY,CACtD,IAAI,EAAY,EACV,EAAY,OAEd,GAAa,EACN,GAET,GACA,CAAE,QAAS,GAAO,CACnB,CACD,GAAW,CAEX,EAAO,EAAU,OAAO,CAAC,CAAC,KAAK,EAAE,CAEjC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAU,CAAC,KAAK,EAAE,EACzB,CAEF,EAAG,0DAA2D,SAAY,CACxE,IAAM,EAAS,EAAG,GAAiB,EAAS,QAAQ,CAAC,CAC/C,EAAY,EAAwB,EAAQ,GAAG,CACrD,EAAU,QAAQ,CAElB,EAAO,EAAU,OAAO,CAAC,CAAC,eAAe,CAEzC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF,CAEF,EAAS,oCAAuC,CAC9C,EAAG,6DAA8D,SAAY,CAC3E,IAAM,EAAY,EAAwB,GAAU,CAAE,GAAI,CACxD,QAAS,GACT,SAAU,GACX,CAAC,CAEF,EAAO,EAAU,QAAQ,CAAC,CAAC,eAAe,CAC1C,EAAO,EAAU,QAAQ,CAAC,CAAC,eAAe,CAE1C,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAU,UAAU,CAAC,CAAC,eAAe,EAC5C,EACF"}
1
+ {"version":3,"file":"funnel.lodash-debounce-with-cached-value.test.js","names":["cachedValue: ReturnType<F> | undefined"],"sources":["../src/funnel.lodash-debounce-with-cached-value.test.ts"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable antfu/consistent-list-newline */\n/* eslint-disable ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { constant } from './constant';\nimport { funnel } from './funnel';\nimport { identity } from './identity';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `debounce` function using the\n * The `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your codebase and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a more complex implementation which respects Lodash capability to\n * track the return value of the callback function. In most cases you are more\n * likely to prefer the simpler reference implementation `debounce` which can\n * be found in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for debounce.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests. Tests that are unrelated to the cache\n * capability have been removed to avoid duplication with the other test file.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#debounce\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10372\n * @see Lodash Tests: https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L374\n */\nfunction debounceWithCachedValue<F extends (...args: any) => any>(\n func: F,\n wait = 0,\n {\n leading = false,\n trailing = true,\n maxWait,\n }: {\n readonly leading?: boolean;\n readonly trailing?: boolean;\n readonly maxWait?: number;\n } = {}) {\n let cachedValue: ReturnType<F> | undefined;\n\n const { call, flush, cancel } = funnel(\n (args: Parameters<F>) => {\n if (!leading && !trailing) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * debounce window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n * Also, every time the function is invoked the cached value is updated.\n */\n cachedValue = func(...args) as ReturnType<F>;\n },\n {\n /**\n * Debounce stores the latest args it was called with for the next\n * invocation of the callback.\n */\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n ...(maxWait !== undefined && { maxBurstDurationMs: maxWait }),\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n\n /**\n * Lodash uses a legacy JS-isms to attach helper functions to the main\n * callback of `debounce`. In our function we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(\n (...args: Parameters<F>) => {\n call(...args);\n return cachedValue;\n },\n {\n flush: () => {\n flush();\n return cachedValue;\n },\n\n cancel,\n },\n );\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187', () => {\n it('should debounce a function', async () => {\n const mockFn = vi.fn<(x: string) => string>(identity());\n const debounced = debounceWithCachedValue(mockFn, UT);\n\n expect(debounced('a')).toBeUndefined();\n expect(debounced('b')).toBeUndefined();\n expect(debounced('c')).toBeUndefined();\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n expect(debounced('d')).toBe('c');\n expect(debounced('e')).toBe('c');\n expect(debounced('f')).toBe('c');\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('subsequent debounced calls return the last `func` result', async () => {\n const debounced = debounceWithCachedValue(identity(), UT);\n debounced('a');\n await sleep(2 * UT);\n\n expect(debounced('b')).not.toBe('b');\n\n await sleep(2 * UT);\n\n expect(debounced('c')).not.toBe('c');\n });\n\n it('subsequent leading debounced calls return the last `func` result', async () => {\n const debounced = debounceWithCachedValue(identity(), UT, {\n leading: true,\n trailing: false,\n });\n\n expect(debounced('a')).toBe('a');\n expect(debounced('b')).toBe('a');\n\n await sleep(2 * UT);\n\n expect(debounced('c')).toBe('c');\n expect(debounced('d')).toBe('c');\n });\n\n it('should invoke the trailing call with the correct arguments and `this` binding', async () => {\n const DATA = {};\n const mockFn = vi.fn<(a: object, b: string) => boolean>(constant(false));\n\n /**\n * In Lodash the test uses both `leading` and `trailing` timing options\n * for this test, but it only works because the `leading` option in Lodash\n * runs within the same execution frame as the call to the debouncer; the\n * Lodash test also passes when the `leading` option is removed. For our\n * implementation the \"leading\" option is delayed to the next execution\n * frame, which, when used together with `maxWait` would cause the debouncer\n * to see a \"quiet window\" and trigger an additional invocation of the\n * mockFn, and the test to fail.\n */\n const debounced = debounceWithCachedValue(mockFn, UT, { maxWait: 2 * UT });\n\n while (debounced(DATA, 'a') ?? true) {\n // eslint-disable-next-line no-await-in-loop -- We sleep to yield execution so that the timeouts in the debouncer have a chance to run.\n await sleep(0);\n }\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n expect(mockFn).toHaveBeenLastCalledWith(DATA, 'a');\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should reset `lastCalled` after cancelling', async () => {\n let callCount = 0;\n const debounced = debounceWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: true },\n );\n\n expect(debounced()).toBe(1);\n\n debounced.cancel();\n\n expect(debounced()).toBe(2);\n\n debounced();\n await sleep(2 * UT);\n\n expect(callCount).toBe(3);\n });\n\n it('should support flushing delayed calls', async () => {\n let callCount = 0;\n const debounced = debounceWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: false },\n );\n debounced();\n\n expect(debounced.flush()).toBe(1);\n\n await sleep(2 * UT);\n\n expect(callCount).toBe(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => string>(constant('hello'));\n const debounced = debounceWithCachedValue(mockFn, UT);\n debounced.cancel();\n\n expect(debounced.flush()).toBeUndefined();\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\ndescribe('features not tested by Lodash', () => {\n it('does nothing when neither leading nor trailing are enabled', async () => {\n const debounced = debounceWithCachedValue(identity(), UT, {\n leading: false,\n trailing: false,\n });\n\n expect(debounced('hello')).toBeUndefined();\n expect(debounced('world')).toBeUndefined();\n\n await sleep(4 * UT);\n\n expect(debounced('goodbye')).toBeUndefined();\n });\n});\n"],"mappings":"4MAwCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,GACX,WAKE,EAAE,CAAE,CACR,IAAIA,EAEE,CAAE,OAAM,QAAO,UAAW,EAC7B,GAAwB,CACnB,CAAC,GAAW,CAAC,IAiBjB,EAAc,EAAK,GAAG,EAAK,GAE7B,CAKE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,GAAI,IAAY,IAAA,IAAa,CAAE,mBAAoB,EAAS,CAC5D,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAQD,OAAO,OAAO,QACX,GAAG,KACF,EAAK,GAAG,EAAK,CACN,GAET,CACE,WACE,GAAO,CACA,GAGT,SACD,CACF,CAYH,EAAS,uEAA0E,CACjF,EAAG,6BAA8B,SAAY,CAC3C,IAAM,EAAS,EAAG,GAA0B,GAAU,CAAC,CACjD,EAAY,EAAwB,EAAQ,GAAG,CAErD,EAAO,EAAU,IAAI,CAAC,CAAC,eAAe,CACtC,EAAO,EAAU,IAAI,CAAC,CAAC,eAAe,CACtC,EAAO,EAAU,IAAI,CAAC,CAAC,eAAe,CACtC,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAA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{call:o,isIdle:s,...c}=t.funnel(t=>{!i&&!r||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:n,...a!==void 0&&{maxBurstDurationMs:a},...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(o,c)}const i=16;e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{e.it(`should debounce a function`,async()=>{let t=e.vi.fn(),i=r(t,16);i(`a`),i(`b`),i(`c`),e.globalExpect(t).toHaveBeenCalledTimes(0),await n.sleep(64),e.globalExpect(t).toHaveBeenCalledExactlyOnceWith(`c`),i(`d`),i(`e`),i(`f`),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should not immediately call `func` when `wait` is `0`",async()=>{let t=e.vi.fn(),n=r(t,0);n(),n(),e.globalExpect(t).toHaveBeenCalledTimes(0),await a(),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it(`should apply default options`,async()=>{let t=e.vi.fn();r(t,16,{})(),e.globalExpect(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("should support a `leading` option",async()=>{let t=e.vi.fn(),i=e.vi.fn(),a=r(t,16,{leading:!0,trailing:!1}),o=r(i,16,{leading:!0,trailing:!0});a(),e.globalExpect(t).toHaveBeenCalledTimes(1),o(),o(),e.globalExpect(i).toHaveBeenCalledTimes(1),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1),e.globalExpect(i).toHaveBeenCalledTimes(2),a(),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should support a `trailing` option",async()=>{let t=e.vi.fn(),i=e.vi.fn(),a=r(t,16,{trailing:!0}),o=r(i,16,{trailing:!1});a(),e.globalExpect(t).toHaveBeenCalledTimes(0),o(),e.globalExpect(i).toHaveBeenCalledTimes(0),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1),e.globalExpect(i).toHaveBeenCalledTimes(0)}),e.it("should support a `maxWait` option",async()=>{let t=e.vi.fn(),i=r(t,16,{maxWait:32});i(),i(),e.globalExpect(t).toHaveBeenCalledTimes(0),await n.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(1),i(),i(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should support `maxWait` in a tight loop",async()=>{let t=e.vi.fn(),n=e.vi.fn(),i=r(t,32,{maxWait:64}),o=r(n,48),s=Date.now()+160;for(;Date.now()<s;)i(),o();e.globalExpect(n).toHaveBeenCalledTimes(0),e.globalExpect(t).toHaveBeenCalledTimes(0),await a(),e.globalExpect(n).toHaveBeenCalledTimes(0),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let t=e.vi.fn(),i=r(t,96,{maxWait:96});i(),await n.sleep(5.5*16),i(),await n.sleep(.5*16),i(),await n.sleep(.5*16),i(),await n.sleep(9.5*16),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let t=e.vi.fn(),i=r(t,16,{maxWait:32});i(),await n.sleep(64),i(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let t=e.vi.fn(),i={},o=r(t,16,{leading:!0,maxWait:32});for(;t.mock.calls.length<2;)o(i,`a`),await a();await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(2),e.globalExpect(t).toHaveBeenLastCalledWith(i,`a`)})}),e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.it("should use a default `wait` of `0`",async()=>{let t=e.vi.fn(),i=r(t);i(),await n.sleep(16),i(),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it(`supports recursive calls`,async()=>{let t=[],i=[`a`,`b`,`c`],a=r(e=>{t.push(e);let n=i.shift();n!==void 0&&a(n)},16);a(i.shift()),e.globalExpect(t).toStrictEqual([]),await n.sleep(128),e.globalExpect(t).toStrictEqual([`a`,`b`,`c`])}),e.it(`should support cancelling delayed calls`,async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!1});i(),i.cancel(),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(0)}),e.it("should reset `lastCalled` after cancelling",async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!0});i(),e.globalExpect(t).toHaveBeenCalledTimes(1),i.cancel(),i(),e.globalExpect(t).toHaveBeenCalledTimes(2),i(),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(3)}),e.it(`should support flushing delayed calls`,async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!1});i(),i.flush(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("should noop `cancel` and `flush` when nothing is queued",async()=>{let t=e.vi.fn(),i=r(t,16);i.cancel(),i.flush(),e.globalExpect(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(0)})});async function a(){return await n.sleep(0)}
1
+ const e=require(`./dist-CiyBKPT6.cjs`),t=require(`./funnel.cjs`),n=require(`./sleep.cjs`);function r(e,n=0,{leading:r=!1,trailing:i=!0,maxWait:a}={}){let{call:o,isIdle:s,...c}=t.funnel(t=>{!i&&!r||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:n,...a!==void 0&&{maxBurstDurationMs:a},...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(o,c)}const i=16;e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{e.a(`should debounce a function`,async()=>{let t=e.r.fn(),i=r(t,16);i(`a`),i(`b`),i(`c`),e.n(t).toHaveBeenCalledTimes(0),await n.sleep(64),e.n(t).toHaveBeenCalledExactlyOnceWith(`c`),i(`d`),i(`e`),i(`f`),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should not immediately call `func` when `wait` is `0`",async()=>{let t=e.r.fn(),n=r(t,0);n(),n(),e.n(t).toHaveBeenCalledTimes(0),await a(),e.n(t).toHaveBeenCalledTimes(1)}),e.a(`should apply default options`,async()=>{let t=e.r.fn();r(t,16,{})(),e.n(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1)}),e.a("should support a `leading` option",async()=>{let t=e.r.fn(),i=e.r.fn(),a=r(t,16,{leading:!0,trailing:!1}),o=r(i,16,{leading:!0,trailing:!0});a(),e.n(t).toHaveBeenCalledTimes(1),o(),o(),e.n(i).toHaveBeenCalledTimes(1),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1),e.n(i).toHaveBeenCalledTimes(2),a(),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should support a `trailing` option",async()=>{let t=e.r.fn(),i=e.r.fn(),a=r(t,16,{trailing:!0}),o=r(i,16,{trailing:!1});a(),e.n(t).toHaveBeenCalledTimes(0),o(),e.n(i).toHaveBeenCalledTimes(0),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1),e.n(i).toHaveBeenCalledTimes(0)}),e.a("should support a `maxWait` option",async()=>{let t=e.r.fn(),i=r(t,16,{maxWait:32});i(),i(),e.n(t).toHaveBeenCalledTimes(0),await n.sleep(64),e.n(t).toHaveBeenCalledTimes(1),i(),i(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should support `maxWait` in a tight loop",async()=>{let t=e.r.fn(),n=e.r.fn(),i=r(t,32,{maxWait:64}),o=r(n,48),s=Date.now()+160;for(;Date.now()<s;)i(),o();e.n(n).toHaveBeenCalledTimes(0),e.n(t).toHaveBeenCalledTimes(0),await a(),e.n(n).toHaveBeenCalledTimes(0),e.n(t).toHaveBeenCalledTimes(1)}),e.a("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let t=e.r.fn(),i=r(t,96,{maxWait:96});i(),await n.sleep(5.5*16),i(),await n.sleep(.5*16),i(),await n.sleep(.5*16),i(),await n.sleep(9.5*16),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let t=e.r.fn(),i=r(t,16,{maxWait:32});i(),await n.sleep(64),i(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let t=e.r.fn(),i={},o=r(t,16,{leading:!0,maxWait:32});for(;t.mock.calls.length<2;)o(i,`a`),await a();await n.sleep(32),e.n(t).toHaveBeenCalledTimes(2),e.n(t).toHaveBeenLastCalledWith(i,`a`)})}),e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.a("should use a default `wait` of `0`",async()=>{let t=e.r.fn(),i=r(t);i(),await n.sleep(16),i(),e.n(t).toHaveBeenCalledTimes(1)}),e.a(`supports recursive calls`,async()=>{let t=[],i=[`a`,`b`,`c`],a=r(e=>{t.push(e);let n=i.shift();n!==void 0&&a(n)},16);a(i.shift()),e.n(t).toStrictEqual([]),await n.sleep(128),e.n(t).toStrictEqual([`a`,`b`,`c`])}),e.a(`should support cancelling delayed calls`,async()=>{let t=e.r.fn(),i=r(t,16,{leading:!1});i(),i.cancel(),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(0)}),e.a("should reset `lastCalled` after cancelling",async()=>{let t=e.r.fn(),i=r(t,16,{leading:!0});i(),e.n(t).toHaveBeenCalledTimes(1),i.cancel(),i(),e.n(t).toHaveBeenCalledTimes(2),i(),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(3)}),e.a(`should support flushing delayed calls`,async()=>{let t=e.r.fn(),i=r(t,16,{leading:!1});i(),i.flush(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1)}),e.a("should noop `cancel` and `flush` when nothing is queued",async()=>{let t=e.r.fn(),i=r(t,16);i.cancel(),i.flush(),e.n(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(0)})});async function a(){return await n.sleep(0)}
@@ -1,2 +1,2 @@
1
- import{describe as e,globalExpect as t,it as n,vi as r}from"./dist-BQGZfjDS.js";import{funnel as i}from"./funnel-CEbURcmp.js";import{sleep as a}from"./sleep-DvzRMgY-.js";function o(e,t=0,{leading:n=!1,trailing:r=!0,maxWait:a}={}){let{call:o,isIdle:s,...c}=i(t=>{!r&&!n||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:t,...a!==void 0&&{maxBurstDurationMs:a},...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(o,c)}e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{n(`should debounce a function`,async()=>{let e=r.fn(),n=o(e,16);n(`a`),n(`b`),n(`c`),t(e).toHaveBeenCalledTimes(0),await a(64),t(e).toHaveBeenCalledExactlyOnceWith(`c`),n(`d`),n(`e`),n(`f`),t(e).toHaveBeenCalledTimes(1),await a(64),t(e).toHaveBeenCalledTimes(2)}),n("should not immediately call `func` when `wait` is `0`",async()=>{let e=r.fn(),n=o(e,0);n(),n(),t(e).toHaveBeenCalledTimes(0),await s(),t(e).toHaveBeenCalledTimes(1)}),n(`should apply default options`,async()=>{let e=r.fn();o(e,16,{})(),t(e).toHaveBeenCalledTimes(0),await a(32),t(e).toHaveBeenCalledTimes(1)}),n("should support a `leading` option",async()=>{let e=r.fn(),n=r.fn(),i=o(e,16,{leading:!0,trailing:!1}),s=o(n,16,{leading:!0,trailing:!0});i(),t(e).toHaveBeenCalledTimes(1),s(),s(),t(n).toHaveBeenCalledTimes(1),await a(32),t(e).toHaveBeenCalledTimes(1),t(n).toHaveBeenCalledTimes(2),i(),t(e).toHaveBeenCalledTimes(2)}),n("should support a `trailing` option",async()=>{let e=r.fn(),n=r.fn(),i=o(e,16,{trailing:!0}),s=o(n,16,{trailing:!1});i(),t(e).toHaveBeenCalledTimes(0),s(),t(n).toHaveBeenCalledTimes(0),await a(32),t(e).toHaveBeenCalledTimes(1),t(n).toHaveBeenCalledTimes(0)}),n("should support a `maxWait` option",async()=>{let e=r.fn(),n=o(e,16,{maxWait:32});n(),n(),t(e).toHaveBeenCalledTimes(0),await a(64),t(e).toHaveBeenCalledTimes(1),n(),n(),t(e).toHaveBeenCalledTimes(1),await a(64),t(e).toHaveBeenCalledTimes(2)}),n("should support `maxWait` in a tight loop",async()=>{let e=r.fn(),n=r.fn(),i=o(e,32,{maxWait:64}),a=o(n,48),c=Date.now()+160;for(;Date.now()<c;)i(),a();t(n).toHaveBeenCalledTimes(0),t(e).toHaveBeenCalledTimes(0),await s(),t(n).toHaveBeenCalledTimes(0),t(e).toHaveBeenCalledTimes(1)}),n("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=r.fn(),n=o(e,96,{maxWait:96});n(),await a(5.5*16),n(),await a(.5*16),n(),await a(.5*16),n(),await a(9.5*16),t(e).toHaveBeenCalledTimes(2)}),n("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=r.fn(),n=o(e,16,{maxWait:32});n(),await a(64),n(),t(e).toHaveBeenCalledTimes(1),await a(32),t(e).toHaveBeenCalledTimes(2)}),n("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e=r.fn(),n={},i=o(e,16,{leading:!0,maxWait:32});for(;e.mock.calls.length<2;)i(n,`a`),await s();await a(32),t(e).toHaveBeenCalledTimes(2),t(e).toHaveBeenLastCalledWith(n,`a`)})}),e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{n("should use a default `wait` of `0`",async()=>{let e=r.fn(),n=o(e);n(),await a(16),n(),t(e).toHaveBeenCalledTimes(1)}),n(`supports recursive calls`,async()=>{let e=[],n=[`a`,`b`,`c`],r=o(t=>{e.push(t);let i=n.shift();i!==void 0&&r(i)},16);r(n.shift()),t(e).toStrictEqual([]),await a(128),t(e).toStrictEqual([`a`,`b`,`c`])}),n(`should support cancelling delayed calls`,async()=>{let e=r.fn(),n=o(e,16,{leading:!1});n(),n.cancel(),await a(32),t(e).toHaveBeenCalledTimes(0)}),n("should reset `lastCalled` after cancelling",async()=>{let e=r.fn(),n=o(e,16,{leading:!0});n(),t(e).toHaveBeenCalledTimes(1),n.cancel(),n(),t(e).toHaveBeenCalledTimes(2),n(),await a(32),t(e).toHaveBeenCalledTimes(3)}),n(`should support flushing delayed calls`,async()=>{let e=r.fn(),n=o(e,16,{leading:!1});n(),n.flush(),t(e).toHaveBeenCalledTimes(1),await a(32),t(e).toHaveBeenCalledTimes(1)}),n("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(),n=o(e,16);n.cancel(),n.flush(),t(e).toHaveBeenCalledTimes(0),await a(32),t(e).toHaveBeenCalledTimes(0)})});async function s(){return await a(0)}
1
+ import{a as e,i as t,n,r}from"./dist-CUT1dnRU.js";import{funnel as i}from"./funnel.js";import{sleep as a}from"./sleep.js";function o(e,t=0,{leading:n=!1,trailing:r=!0,maxWait:a}={}){let{call:o,isIdle:s,...c}=i(t=>{!r&&!n||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:t,...a!==void 0&&{maxBurstDurationMs:a},...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(o,c)}t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187`,()=>{e(`should debounce a function`,async()=>{let e=r.fn(),t=o(e,16);t(`a`),t(`b`),t(`c`),n(e).toHaveBeenCalledTimes(0),await a(64),n(e).toHaveBeenCalledExactlyOnceWith(`c`),t(`d`),t(`e`),t(`f`),n(e).toHaveBeenCalledTimes(1),await a(64),n(e).toHaveBeenCalledTimes(2)}),e("should not immediately call `func` when `wait` is `0`",async()=>{let e=r.fn(),t=o(e,0);t(),t(),n(e).toHaveBeenCalledTimes(0),await s(),n(e).toHaveBeenCalledTimes(1)}),e(`should apply default options`,async()=>{let e=r.fn();o(e,16,{})(),n(e).toHaveBeenCalledTimes(0),await a(32),n(e).toHaveBeenCalledTimes(1)}),e("should support a `leading` option",async()=>{let e=r.fn(),t=r.fn(),i=o(e,16,{leading:!0,trailing:!1}),s=o(t,16,{leading:!0,trailing:!0});i(),n(e).toHaveBeenCalledTimes(1),s(),s(),n(t).toHaveBeenCalledTimes(1),await a(32),n(e).toHaveBeenCalledTimes(1),n(t).toHaveBeenCalledTimes(2),i(),n(e).toHaveBeenCalledTimes(2)}),e("should support a `trailing` option",async()=>{let e=r.fn(),t=r.fn(),i=o(e,16,{trailing:!0}),s=o(t,16,{trailing:!1});i(),n(e).toHaveBeenCalledTimes(0),s(),n(t).toHaveBeenCalledTimes(0),await a(32),n(e).toHaveBeenCalledTimes(1),n(t).toHaveBeenCalledTimes(0)}),e("should support a `maxWait` option",async()=>{let e=r.fn(),t=o(e,16,{maxWait:32});t(),t(),n(e).toHaveBeenCalledTimes(0),await a(64),n(e).toHaveBeenCalledTimes(1),t(),t(),n(e).toHaveBeenCalledTimes(1),await a(64),n(e).toHaveBeenCalledTimes(2)}),e("should support `maxWait` in a tight loop",async()=>{let e=r.fn(),t=r.fn(),i=o(e,32,{maxWait:64}),a=o(t,48),c=Date.now()+160;for(;Date.now()<c;)i(),a();n(t).toHaveBeenCalledTimes(0),n(e).toHaveBeenCalledTimes(0),await s(),n(t).toHaveBeenCalledTimes(0),n(e).toHaveBeenCalledTimes(1)}),e("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let e=r.fn(),t=o(e,96,{maxWait:96});t(),await a(5.5*16),t(),await a(.5*16),t(),await a(.5*16),t(),await a(9.5*16),n(e).toHaveBeenCalledTimes(2)}),e("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let e=r.fn(),t=o(e,16,{maxWait:32});t(),await a(64),t(),n(e).toHaveBeenCalledTimes(1),await a(32),n(e).toHaveBeenCalledTimes(2)}),e("should invoke the trailing call with the correct arguments and `this` binding",async()=>{let e=r.fn(),t={},i=o(e,16,{leading:!0,maxWait:32});for(;e.mock.calls.length<2;)i(t,`a`),await s();await a(32),n(e).toHaveBeenCalledTimes(2),n(e).toHaveBeenLastCalledWith(t,`a`)})}),t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e("should use a default `wait` of `0`",async()=>{let e=r.fn(),t=o(e);t(),await a(16),t(),n(e).toHaveBeenCalledTimes(1)}),e(`supports recursive calls`,async()=>{let e=[],t=[`a`,`b`,`c`],r=o(n=>{e.push(n);let i=t.shift();i!==void 0&&r(i)},16);r(t.shift()),n(e).toStrictEqual([]),await a(128),n(e).toStrictEqual([`a`,`b`,`c`])}),e(`should support cancelling delayed calls`,async()=>{let e=r.fn(),t=o(e,16,{leading:!1});t(),t.cancel(),await a(32),n(e).toHaveBeenCalledTimes(0)}),e("should reset `lastCalled` after cancelling",async()=>{let e=r.fn(),t=o(e,16,{leading:!0});t(),n(e).toHaveBeenCalledTimes(1),t.cancel(),t(),n(e).toHaveBeenCalledTimes(2),t(),await a(32),n(e).toHaveBeenCalledTimes(3)}),e(`should support flushing delayed calls`,async()=>{let e=r.fn(),t=o(e,16,{leading:!1});t(),t.flush(),n(e).toHaveBeenCalledTimes(1),await a(32),n(e).toHaveBeenCalledTimes(1)}),e("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(),t=o(e,16);t.cancel(),t.flush(),n(e).toHaveBeenCalledTimes(0),await a(32),n(e).toHaveBeenCalledTimes(0)})});async function s(){return await a(0)}
2
2
  //# sourceMappingURL=funnel.lodash-debounce.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"funnel.lodash-debounce.test.js","names":[],"sources":["../src/funnel.lodash-debounce.test.ts"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable antfu/consistent-list-newline */\n/* eslint-disable ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { funnel } from './funnel';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `debounce` function using the\n * Our `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your code base and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a simplified implementation which ignores the Lodash capability to\n * track the return value of the callback function, but it is most likely the\n * more common use-case. For a more complete (and more complex) implementation\n * that also handles that requirement see the reference implementation for\n * `debounceWithCachedValue` in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for debounce.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#debounce\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10372\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L374\n */\nfunction debounce<F extends (...args: any) => void>(\n func: F,\n wait = 0,\n {\n leading = false,\n trailing = true,\n maxWait,\n }: {\n readonly leading?: boolean;\n readonly trailing?: boolean;\n readonly maxWait?: number;\n } = {}) {\n const {\n call,\n // Lodash v4 doesn't provide access to the `isIdle` (called `pending` in Lodash v5) information.\n isIdle: _isIdle,\n ...rest\n } = funnel(\n (args: Parameters<F>) => {\n if (!trailing && !leading) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * debounce window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n */\n func(...args);\n },\n {\n // Debounce stores the latest args it was called with for the next invocation of the callback.\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n ...(maxWait !== undefined && { maxBurstDurationMs: maxWait }),\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n\n /**\n * Lodash uses a legacy JS-ism to attach helper functions to the main\n * callback of `debounce`. In our's we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(call, rest);\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187', () => {\n it('should debounce a function', async () => {\n const mockFn = vi.fn<(x: string) => void>();\n const debounced = debounce(mockFn, UT);\n debounced('a');\n debounced('b');\n debounced('c');\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith('c');\n\n debounced('d');\n debounced('e');\n debounced('f');\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should not immediately call `func` when `wait` is `0`', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, 0);\n debounced();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await yieldExecution();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should apply default options', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, {});\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should support a `leading` option', async () => {\n const mockWithLeading = vi.fn<() => void>();\n const mockWithLeadingAndTrailing = vi.fn<() => void>();\n const withLeading = debounce(mockWithLeading, UT, {\n leading: true,\n /**\n * This Lodash test configures both debouncers with the same timing\n * options which doesn't seem to be the intent of the test based on the test\n * name and the debouncer names. We fixed it in our test.\n */\n trailing: false,\n });\n const withLeadingAndTrailing = debounce(mockWithLeadingAndTrailing, UT, {\n leading: true,\n trailing: true,\n });\n withLeading();\n\n expect(mockWithLeading).toHaveBeenCalledTimes(1);\n\n withLeadingAndTrailing();\n withLeadingAndTrailing();\n\n expect(mockWithLeadingAndTrailing).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockWithLeading).toHaveBeenCalledTimes(1);\n expect(mockWithLeadingAndTrailing).toHaveBeenCalledTimes(2);\n\n withLeading();\n\n expect(mockWithLeading).toHaveBeenCalledTimes(2);\n });\n\n it('should support a `trailing` option', async () => {\n const mockWith = vi.fn<() => void>();\n const mockWithout = vi.fn<() => void>();\n const withTrailing = debounce(mockWith, UT, { trailing: true });\n /**\n * The lodash test disabled `trailing` but doesn't enable `leading`\n * resulting in a debouncer that has no effective timing policy. We handle\n * this situation so we kept the test, but it might be have been what the\n * test was supposed to test.\n */\n const withoutTrailing = debounce(mockWithout, UT, { trailing: false });\n withTrailing();\n\n expect(mockWith).toHaveBeenCalledTimes(0);\n\n withoutTrailing();\n\n expect(mockWithout).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockWith).toHaveBeenCalledTimes(1);\n expect(mockWithout).toHaveBeenCalledTimes(0);\n });\n\n it('should support a `maxWait` option', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { maxWait: 2 * UT });\n debounced();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n debounced();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should support `maxWait` in a tight loop', async () => {\n const mockWith = vi.fn<() => void>();\n const mockWithout = vi.fn<() => void>();\n const withMaxWait = debounce(mockWith, 2 * UT, { maxWait: 4 * UT });\n const withoutMaxWait = debounce(mockWithout, 3 * UT);\n const end = Date.now() + 10 * UT;\n while (Date.now() < end) {\n withMaxWait();\n withoutMaxWait();\n }\n\n /**\n * There's a bug in the Lodash test where they take the result before the\n * sleep (setTimeout); but it still worked for them coincidentally because\n * of how maxWait is implemented:\n * In Lodash, when the maxWait is reached, the callback is invoked within\n * the same execution frame (without a setTimeout). In our's we use a\n * setTimeout even when it's effective delay is 0ms. This means that we fail\n * the lodash test if we don't first yield the execution frame to get the\n * timeout to run; Oddly, the Lodash test already had this yield in place\n * (although removing it won't break the lodash test), so to fix the test we\n * simply added more expects to show the difference in implementations.\n */\n\n expect(mockWithout).toHaveBeenCalledTimes(0);\n expect(mockWith).toHaveBeenCalledTimes(0);\n\n await yieldExecution();\n\n expect(mockWithout).toHaveBeenCalledTimes(0);\n expect(mockWith).toHaveBeenCalledTimes(1);\n });\n\n it('should queue a trailing call for subsequent debounced calls after `maxWait`', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, 6 * UT, { maxWait: 6 * UT });\n debounced();\n await sleep(5.5 * UT);\n debounced();\n await sleep(0.5 * UT);\n debounced();\n await sleep(0.5 * UT);\n debounced();\n await sleep(9.5 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should cancel `maxDelayed` when `delayed` is invoked', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { maxWait: 2 * UT });\n debounced();\n await sleep(4 * UT);\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should invoke the trailing call with the correct arguments and `this` binding', async () => {\n const mockFn = vi.fn<(a: object, b: string) => void>();\n const DATA = {};\n const debounced = debounce(mockFn, UT, {\n leading: true,\n maxWait: 2 * UT,\n });\n while (mockFn.mock.calls.length < 2) {\n debounced(DATA, 'a');\n // eslint-disable-next-line no-await-in-loop\n await yieldExecution();\n }\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n expect(mockFn).toHaveBeenLastCalledWith(DATA, 'a');\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should use a default `wait` of `0`', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn);\n debounced();\n await sleep(UT);\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('supports recursive calls', async () => {\n const actual = [] as Array<string>;\n const queue = ['a', 'b', 'c'];\n const debounced = debounce((chr: string) => {\n actual.push(chr);\n const next = queue.shift();\n if (next !== undefined) {\n debounced(next);\n }\n }, UT);\n debounced(queue.shift()!);\n\n expect(actual).toStrictEqual([]);\n\n await sleep(8 * UT);\n\n expect(actual).toStrictEqual(['a', 'b', 'c']);\n });\n\n it('should support cancelling delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { leading: false });\n debounced();\n debounced.cancel();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n\n it('should reset `lastCalled` after cancelling', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { leading: true });\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n debounced.cancel();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n\n debounced();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(3);\n });\n\n it('should support flushing delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { leading: false });\n debounced();\n debounced.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT);\n debounced.cancel();\n debounced.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\n/**\n * Funnel relies on letting the timeouts run. To ensure that happens the tests\n * need to yield execution.\n */\nasync function yieldExecution() {\n return await sleep(0);\n}\n"],"mappings":"0KAqCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,GACX,WAKE,EAAE,CAAE,CACR,GAAM,CACJ,OAEA,OAAQ,EACR,GAAG,GACD,EACD,GAAwB,CACnB,CAAC,GAAY,CAAC,GAgBlB,EAAK,GAAG,EAAK,EAEf,CAEE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,GAAI,IAAY,IAAA,IAAa,CAAE,mBAAoB,EAAS,CAC5D,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAQD,OAAO,OAAO,OAAO,EAAM,EAAK,CAYlC,EAAS,uEAA0E,CACjF,EAAG,6BAA8B,SAAY,CAC3C,IAAM,EAAS,EAAG,IAAyB,CACrC,EAAY,EAAS,EAAQ,GAAG,CACtC,EAAU,IAAI,CACd,EAAU,IAAI,CACd,EAAU,IAAI,CAEd,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,gCAAgC,IAAI,CAEnD,EAAU,IAAI,CACd,EAAU,IAAI,CACd,EAAU,IAAI,CAEd,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAA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,0CAA2C,SAAY,CACxD,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAI,CAAE,QAAS,GAAO,CAAC,CAC1D,GAAW,CACX,EAAU,QAAQ,CAClB,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,CAEF,EAAG,6CAA8C,SAAY,CAC3D,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAI,CAAE,QAAS,GAAM,CAAC,CACzD,GAAW,CAEX,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,EAAU,QAAQ,CAClB,GAAW,CAEX,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,GAAW,CACX,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,CAEF,EAAG,wCAAyC,SAAY,CACtD,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAI,CAAE,QAAS,GAAO,CAAC,CAC1D,GAAW,CACX,EAAU,OAAO,CAEjB,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,CAEF,EAAG,0DAA2D,SAAY,CACxE,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAG,CACtC,EAAU,QAAQ,CAClB,EAAU,OAAO,CAEjB,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF,CAMF,eAAe,GAAiB,CAC9B,OAAO,MAAM,EAAM,EAAE"}
1
+ {"version":3,"file":"funnel.lodash-debounce.test.js","names":[],"sources":["../src/funnel.lodash-debounce.test.ts"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable antfu/consistent-list-newline */\n/* eslint-disable ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { funnel } from './funnel';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `debounce` function using the\n * Our `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your code base and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a simplified implementation which ignores the Lodash capability to\n * track the return value of the callback function, but it is most likely the\n * more common use-case. For a more complete (and more complex) implementation\n * that also handles that requirement see the reference implementation for\n * `debounceWithCachedValue` in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for debounce.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#debounce\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10372\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L374\n */\nfunction debounce<F extends (...args: any) => void>(\n func: F,\n wait = 0,\n {\n leading = false,\n trailing = true,\n maxWait,\n }: {\n readonly leading?: boolean;\n readonly trailing?: boolean;\n readonly maxWait?: number;\n } = {}) {\n const {\n call,\n // Lodash v4 doesn't provide access to the `isIdle` (called `pending` in Lodash v5) information.\n isIdle: _isIdle,\n ...rest\n } = funnel(\n (args: Parameters<F>) => {\n if (!trailing && !leading) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * debounce window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n */\n func(...args);\n },\n {\n // Debounce stores the latest args it was called with for the next invocation of the callback.\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n ...(maxWait !== undefined && { maxBurstDurationMs: maxWait }),\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n\n /**\n * Lodash uses a legacy JS-ism to attach helper functions to the main\n * callback of `debounce`. In our's we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(call, rest);\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L4187', () => {\n it('should debounce a function', async () => {\n const mockFn = vi.fn<(x: string) => void>();\n const debounced = debounce(mockFn, UT);\n debounced('a');\n debounced('b');\n debounced('c');\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith('c');\n\n debounced('d');\n debounced('e');\n debounced('f');\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should not immediately call `func` when `wait` is `0`', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, 0);\n debounced();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await yieldExecution();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should apply default options', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, {});\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should support a `leading` option', async () => {\n const mockWithLeading = vi.fn<() => void>();\n const mockWithLeadingAndTrailing = vi.fn<() => void>();\n const withLeading = debounce(mockWithLeading, UT, {\n leading: true,\n /**\n * This Lodash test configures both debouncers with the same timing\n * options which doesn't seem to be the intent of the test based on the test\n * name and the debouncer names. We fixed it in our test.\n */\n trailing: false,\n });\n const withLeadingAndTrailing = debounce(mockWithLeadingAndTrailing, UT, {\n leading: true,\n trailing: true,\n });\n withLeading();\n\n expect(mockWithLeading).toHaveBeenCalledTimes(1);\n\n withLeadingAndTrailing();\n withLeadingAndTrailing();\n\n expect(mockWithLeadingAndTrailing).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockWithLeading).toHaveBeenCalledTimes(1);\n expect(mockWithLeadingAndTrailing).toHaveBeenCalledTimes(2);\n\n withLeading();\n\n expect(mockWithLeading).toHaveBeenCalledTimes(2);\n });\n\n it('should support a `trailing` option', async () => {\n const mockWith = vi.fn<() => void>();\n const mockWithout = vi.fn<() => void>();\n const withTrailing = debounce(mockWith, UT, { trailing: true });\n /**\n * The lodash test disabled `trailing` but doesn't enable `leading`\n * resulting in a debouncer that has no effective timing policy. We handle\n * this situation so we kept the test, but it might be have been what the\n * test was supposed to test.\n */\n const withoutTrailing = debounce(mockWithout, UT, { trailing: false });\n withTrailing();\n\n expect(mockWith).toHaveBeenCalledTimes(0);\n\n withoutTrailing();\n\n expect(mockWithout).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockWith).toHaveBeenCalledTimes(1);\n expect(mockWithout).toHaveBeenCalledTimes(0);\n });\n\n it('should support a `maxWait` option', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { maxWait: 2 * UT });\n debounced();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n debounced();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should support `maxWait` in a tight loop', async () => {\n const mockWith = vi.fn<() => void>();\n const mockWithout = vi.fn<() => void>();\n const withMaxWait = debounce(mockWith, 2 * UT, { maxWait: 4 * UT });\n const withoutMaxWait = debounce(mockWithout, 3 * UT);\n const end = Date.now() + 10 * UT;\n while (Date.now() < end) {\n withMaxWait();\n withoutMaxWait();\n }\n\n /**\n * There's a bug in the Lodash test where they take the result before the\n * sleep (setTimeout); but it still worked for them coincidentally because\n * of how maxWait is implemented:\n * In Lodash, when the maxWait is reached, the callback is invoked within\n * the same execution frame (without a setTimeout). In our's we use a\n * setTimeout even when it's effective delay is 0ms. This means that we fail\n * the lodash test if we don't first yield the execution frame to get the\n * timeout to run; Oddly, the Lodash test already had this yield in place\n * (although removing it won't break the lodash test), so to fix the test we\n * simply added more expects to show the difference in implementations.\n */\n\n expect(mockWithout).toHaveBeenCalledTimes(0);\n expect(mockWith).toHaveBeenCalledTimes(0);\n\n await yieldExecution();\n\n expect(mockWithout).toHaveBeenCalledTimes(0);\n expect(mockWith).toHaveBeenCalledTimes(1);\n });\n\n it('should queue a trailing call for subsequent debounced calls after `maxWait`', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, 6 * UT, { maxWait: 6 * UT });\n debounced();\n await sleep(5.5 * UT);\n debounced();\n await sleep(0.5 * UT);\n debounced();\n await sleep(0.5 * UT);\n debounced();\n await sleep(9.5 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should cancel `maxDelayed` when `delayed` is invoked', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { maxWait: 2 * UT });\n debounced();\n await sleep(4 * UT);\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should invoke the trailing call with the correct arguments and `this` binding', async () => {\n const mockFn = vi.fn<(a: object, b: string) => void>();\n const DATA = {};\n const debounced = debounce(mockFn, UT, {\n leading: true,\n maxWait: 2 * UT,\n });\n while (mockFn.mock.calls.length < 2) {\n debounced(DATA, 'a');\n // eslint-disable-next-line no-await-in-loop\n await yieldExecution();\n }\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n expect(mockFn).toHaveBeenLastCalledWith(DATA, 'a');\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should use a default `wait` of `0`', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn);\n debounced();\n await sleep(UT);\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('supports recursive calls', async () => {\n const actual = [] as Array<string>;\n const queue = ['a', 'b', 'c'];\n const debounced = debounce((chr: string) => {\n actual.push(chr);\n const next = queue.shift();\n if (next !== undefined) {\n debounced(next);\n }\n }, UT);\n debounced(queue.shift()!);\n\n expect(actual).toStrictEqual([]);\n\n await sleep(8 * UT);\n\n expect(actual).toStrictEqual(['a', 'b', 'c']);\n });\n\n it('should support cancelling delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { leading: false });\n debounced();\n debounced.cancel();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n\n it('should reset `lastCalled` after cancelling', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { leading: true });\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n debounced.cancel();\n debounced();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n\n debounced();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(3);\n });\n\n it('should support flushing delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT, { leading: false });\n debounced();\n debounced.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => void>();\n const debounced = debounce(mockFn, UT);\n debounced.cancel();\n debounced.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\n/**\n * Funnel relies on letting the timeouts run. To ensure that happens the tests\n * need to yield execution.\n */\nasync function yieldExecution() {\n return await sleep(0);\n}\n"],"mappings":"0HAqCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,GACX,WAKE,EAAE,CAAE,CACR,GAAM,CACJ,OAEA,OAAQ,EACR,GAAG,GACD,EACD,GAAwB,CACnB,CAAC,GAAY,CAAC,GAgBlB,EAAK,GAAG,EAAK,EAEf,CAEE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,GAAI,IAAY,IAAA,IAAa,CAAE,mBAAoB,EAAS,CAC5D,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAQD,OAAO,OAAO,OAAO,EAAM,EAAK,CAYlC,EAAS,uEAA0E,CACjF,EAAG,6BAA8B,SAAY,CAC3C,IAAM,EAAS,EAAG,IAAyB,CACrC,EAAY,EAAS,EAAQ,GAAG,CACtC,EAAU,IAAI,CACd,EAAU,IAAI,CACd,EAAU,IAAI,CAEd,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,gCAAgC,IAAI,CAEnD,EAAU,IAAI,CACd,EAAU,IAAI,CACd,EAAU,IAAI,CAEd,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EA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`./sleep-1rGV3wAg.cjs`);function a(e,t=0,{leading:r=!0,trailing:i=!0}={}){let a,{call:o,flush:s,cancel:c}=n.funnel(t=>{!r&&!i||(a=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,maxBurstDurationMs:t,...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(o(...e),a),{flush:()=>(s(),a),cancel:c})}const o=16;e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{e.it(`subsequent calls should return the result of the first call`,async()=>{let t=a(r.identity(),16);e.globalExpect(t(`a`)).toBe(`a`),e.globalExpect(t(`b`)).toBe(`a`),await i.sleep(32);let n=t(`c`),o=t(`d`);e.globalExpect(n).not.toBe(`a`),e.globalExpect(n).toBeDefined(),e.globalExpect(o).not.toBe(`d`),e.globalExpect(o).toBeDefined()}),e.it("should support a `leading` option",()=>{let t=a(r.identity(),16,{leading:!0}),n=a(r.identity(),16,{leading:!1});e.globalExpect(t(`a`)).toBe(`a`),e.globalExpect(n(`a`)).toBeUndefined()}),e.it("should support a `trailing` option",async()=>{let t=e.vi.fn(r.identity()),n=e.vi.fn(r.identity()),o=a(t,32,{trailing:!0}),s=a(n,32,{trailing:!1});e.globalExpect(o(`a`)).toBe(`a`),e.globalExpect(o(`b`)).toBe(`a`),e.globalExpect(s(`a`)).toBe(`a`),e.globalExpect(s(`b`)).toBe(`a`),await i.sleep(128),e.globalExpect(t).toHaveBeenCalledTimes(2),e.globalExpect(n).toHaveBeenCalledTimes(1)})}),e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.it("should reset `lastCalled` after cancelling",async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!0});e.globalExpect(n()).toBe(1),n.cancel(),e.globalExpect(n()).toBe(2),n(),await i.sleep(32),e.globalExpect(t).toBe(3)}),e.it(`should support flushing delayed calls`,async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!1});n(),e.globalExpect(n.flush()).toBe(1),await i.sleep(32),e.globalExpect(t).toBe(1)}),e.it("should noop `cancel` and `flush` when nothing is queued",async()=>{let n=e.vi.fn(t.constant(`hello`)),r=a(n,16);r.cancel(),e.globalExpect(r.flush()).toBeUndefined(),await i.sleep(32),e.globalExpect(n).toHaveBeenCalledTimes(0)})}),e.describe(`features not tested by Lodash`,()=>{e.it(`does nothing when neither leading nor trailing are enabled`,async()=>{let t=a(r.identity(),16,{leading:!1,trailing:!1});e.globalExpect(t(`hello`)).toBeUndefined(),e.globalExpect(t(`world`)).toBeUndefined(),await i.sleep(64),e.globalExpect(t(`goodbye`)).toBeUndefined()})});
1
+ const e=require(`./dist-CiyBKPT6.cjs`),t=require(`./constant.cjs`),n=require(`./funnel.cjs`),r=require(`./identity.cjs`),i=require(`./sleep.cjs`);function a(e,t=0,{leading:r=!0,trailing:i=!0}={}){let a,{call:o,flush:s,cancel:c}=n.funnel(t=>{!r&&!i||(a=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,maxBurstDurationMs:t,...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(o(...e),a),{flush:()=>(s(),a),cancel:c})}const o=16;e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{e.a(`subsequent calls should return the result of the first call`,async()=>{let t=a(r.identity(),16);e.n(t(`a`)).toBe(`a`),e.n(t(`b`)).toBe(`a`),await i.sleep(32);let n=t(`c`),o=t(`d`);e.n(n).not.toBe(`a`),e.n(n).toBeDefined(),e.n(o).not.toBe(`d`),e.n(o).toBeDefined()}),e.a("should support a `leading` option",()=>{let t=a(r.identity(),16,{leading:!0}),n=a(r.identity(),16,{leading:!1});e.n(t(`a`)).toBe(`a`),e.n(n(`a`)).toBeUndefined()}),e.a("should support a `trailing` option",async()=>{let t=e.r.fn(r.identity()),n=e.r.fn(r.identity()),o=a(t,32,{trailing:!0}),s=a(n,32,{trailing:!1});e.n(o(`a`)).toBe(`a`),e.n(o(`b`)).toBe(`a`),e.n(s(`a`)).toBe(`a`),e.n(s(`b`)).toBe(`a`),await i.sleep(128),e.n(t).toHaveBeenCalledTimes(2),e.n(n).toHaveBeenCalledTimes(1)})}),e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.a("should reset `lastCalled` after cancelling",async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!0});e.n(n()).toBe(1),n.cancel(),e.n(n()).toBe(2),n(),await i.sleep(32),e.n(t).toBe(3)}),e.a(`should support flushing delayed calls`,async()=>{let t=0,n=a(()=>(t+=1,t),16,{leading:!1});n(),e.n(n.flush()).toBe(1),await i.sleep(32),e.n(t).toBe(1)}),e.a("should noop `cancel` and `flush` when nothing is queued",async()=>{let n=e.r.fn(t.constant(`hello`)),r=a(n,16);r.cancel(),e.n(r.flush()).toBeUndefined(),await i.sleep(32),e.n(n).toHaveBeenCalledTimes(0)})}),e.i(`features not tested by Lodash`,()=>{e.a(`does nothing when neither leading nor trailing are enabled`,async()=>{let t=a(r.identity(),16,{leading:!1,trailing:!1});e.n(t(`hello`)).toBeUndefined(),e.n(t(`world`)).toBeUndefined(),await i.sleep(64),e.n(t(`goodbye`)).toBeUndefined()})});
@@ -1,2 +1,2 @@
1
- import{describe as e,globalExpect as t,it as n,vi as r}from"./dist-BQGZfjDS.js";import{constant as i}from"./constant-DrpDXHc7.js";import{funnel as a}from"./funnel-CEbURcmp.js";import{identity as o}from"./identity-D7NWGnLw.js";import{sleep as s}from"./sleep-DvzRMgY-.js";function c(e,t=0,{leading:n=!0,trailing:r=!0}={}){let i,{call:o,flush:s,cancel:c}=a(t=>{!n&&!r||(i=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,maxBurstDurationMs:t,...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(o(...e),i),{flush:()=>(s(),i),cancel:c})}e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{n(`subsequent calls should return the result of the first call`,async()=>{let e=c(o(),16);t(e(`a`)).toBe(`a`),t(e(`b`)).toBe(`a`),await s(32);let n=e(`c`),r=e(`d`);t(n).not.toBe(`a`),t(n).toBeDefined(),t(r).not.toBe(`d`),t(r).toBeDefined()}),n("should support a `leading` option",()=>{let e=c(o(),16,{leading:!0}),n=c(o(),16,{leading:!1});t(e(`a`)).toBe(`a`),t(n(`a`)).toBeUndefined()}),n("should support a `trailing` option",async()=>{let e=r.fn(o()),n=r.fn(o()),i=c(e,32,{trailing:!0}),a=c(n,32,{trailing:!1});t(i(`a`)).toBe(`a`),t(i(`b`)).toBe(`a`),t(a(`a`)).toBe(`a`),t(a(`b`)).toBe(`a`),await s(128),t(e).toHaveBeenCalledTimes(2),t(n).toHaveBeenCalledTimes(1)})}),e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{n("should reset `lastCalled` after cancelling",async()=>{let e=0,n=c(()=>(e+=1,e),16,{leading:!0});t(n()).toBe(1),n.cancel(),t(n()).toBe(2),n(),await s(32),t(e).toBe(3)}),n(`should support flushing delayed calls`,async()=>{let e=0,n=c(()=>(e+=1,e),16,{leading:!1});n(),t(n.flush()).toBe(1),await s(32),t(e).toBe(1)}),n("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(i(`hello`)),n=c(e,16);n.cancel(),t(n.flush()).toBeUndefined(),await s(32),t(e).toHaveBeenCalledTimes(0)})}),e(`features not tested by Lodash`,()=>{n(`does nothing when neither leading nor trailing are enabled`,async()=>{let e=c(o(),16,{leading:!1,trailing:!1});t(e(`hello`)).toBeUndefined(),t(e(`world`)).toBeUndefined(),await s(64),t(e(`goodbye`)).toBeUndefined()})});
1
+ import{a as e,i as t,n,r}from"./dist-CUT1dnRU.js";import{constant as i}from"./constant.js";import{funnel as a}from"./funnel.js";import{identity as o}from"./identity.js";import{sleep as s}from"./sleep.js";function c(e,t=0,{leading:n=!0,trailing:r=!0}={}){let i,{call:o,flush:s,cancel:c}=a(t=>{!n&&!r||(i=e(...t))},{reducer:(e,...t)=>t,minQuietPeriodMs:t,maxBurstDurationMs:t,...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign((...e)=>(o(...e),i),{flush:()=>(s(),i),cancel:c})}t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{e(`subsequent calls should return the result of the first call`,async()=>{let e=c(o(),16);n(e(`a`)).toBe(`a`),n(e(`b`)).toBe(`a`),await s(32);let t=e(`c`),r=e(`d`);n(t).not.toBe(`a`),n(t).toBeDefined(),n(r).not.toBe(`d`),n(r).toBeDefined()}),e("should support a `leading` option",()=>{let e=c(o(),16,{leading:!0}),t=c(o(),16,{leading:!1});n(e(`a`)).toBe(`a`),n(t(`a`)).toBeUndefined()}),e("should support a `trailing` option",async()=>{let e=r.fn(o()),t=r.fn(o()),i=c(e,32,{trailing:!0}),a=c(t,32,{trailing:!1});n(i(`a`)).toBe(`a`),n(i(`b`)).toBe(`a`),n(a(`a`)).toBe(`a`),n(a(`b`)).toBe(`a`),await s(128),n(e).toHaveBeenCalledTimes(2),n(t).toHaveBeenCalledTimes(1)})}),t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e("should reset `lastCalled` after cancelling",async()=>{let e=0,t=c(()=>(e+=1,e),16,{leading:!0});n(t()).toBe(1),t.cancel(),n(t()).toBe(2),t(),await s(32),n(e).toBe(3)}),e(`should support flushing delayed calls`,async()=>{let e=0,t=c(()=>(e+=1,e),16,{leading:!1});t(),n(t.flush()).toBe(1),await s(32),n(e).toBe(1)}),e("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(i(`hello`)),t=c(e,16);t.cancel(),n(t.flush()).toBeUndefined(),await s(32),n(e).toHaveBeenCalledTimes(0)})}),t(`features not tested by Lodash`,()=>{e(`does nothing when neither leading nor trailing are enabled`,async()=>{let e=c(o(),16,{leading:!1,trailing:!1});n(e(`hello`)).toBeUndefined(),n(e(`world`)).toBeUndefined(),await s(64),n(e(`goodbye`)).toBeUndefined()})});
2
2
  //# sourceMappingURL=funnel.lodash-throttle-with-cached-value.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"funnel.lodash-throttle-with-cached-value.test.js","names":["cachedValue: ReturnType<F> | undefined"],"sources":["../src/funnel.lodash-throttle-with-cached-value.test.ts"],"sourcesContent":["/* eslint-disable no-nested-ternary, function-paren-newline, ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { constant } from './constant';\nimport { funnel } from './funnel';\nimport { identity } from './identity';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `throttle` function using the\n * Our `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your codebase and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a more complex implementation which respects Lodash capability to\n * track the return value of the callback function. In most cases you are more\n * likely to prefer the simpler reference implementation `throttle` which can\n * be found in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for throttle.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests. Tests that are unrelated to the cache\n * capability have been removed to avoid duplication with the other test file.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#throttle\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10965\n * @see Lodash Tests: https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L1347\n */\nfunction throttleWithCachedValue<F extends (...args: any) => any>(\n func: F,\n wait = 0,\n {\n leading = true,\n trailing = true,\n }: { readonly leading?: boolean; readonly trailing?: boolean } = {},\n) {\n let cachedValue: ReturnType<F> | undefined;\n\n const { call, flush, cancel } = funnel(\n (args: Parameters<F>) => {\n if (!leading && !trailing) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * throttle window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n * Also, every time the function is invoked the cached value is updated.\n */\n cachedValue = func(...args) as ReturnType<F>;\n },\n {\n // Throttle stores the latest args it was called with for the next invocation of the callback.\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n maxBurstDurationMs: wait,\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n\n /**\n * Lodash uses a legacy JS-isms to attach helper functions to the main\n * callback of `throttle`. In our's we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(\n (...args: Parameters<F>) => {\n call(...args);\n return cachedValue;\n },\n {\n flush: () => {\n flush();\n return cachedValue;\n },\n\n cancel,\n },\n );\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768', () => {\n it('subsequent calls should return the result of the first call', async () => {\n const throttled = throttleWithCachedValue(identity(), UT);\n\n expect(throttled('a')).toBe('a');\n expect(throttled('b')).toBe('a');\n\n await sleep(2 * UT);\n const resultC = throttled('c');\n const resultD = throttled('d');\n\n expect(resultC).not.toBe('a');\n expect(resultC).toBeDefined();\n expect(resultD).not.toBe('d');\n expect(resultD).toBeDefined();\n });\n\n it('should support a `leading` option', () => {\n const withLeading = throttleWithCachedValue(identity(), UT, {\n leading: true,\n });\n const withoutLeading = throttleWithCachedValue(identity(), UT, {\n leading: false,\n });\n\n expect(withLeading('a')).toBe('a');\n expect(withoutLeading('a')).toBeUndefined();\n });\n\n it('should support a `trailing` option', async () => {\n const mockWith = vi.fn<<T>(x: T) => T>(identity());\n const mockWithout = vi.fn<<T>(x: T) => T>(identity());\n const withTrailing = throttleWithCachedValue(mockWith, 2 * UT, {\n trailing: true,\n });\n const withoutTrailing = throttleWithCachedValue(mockWithout, 2 * UT, {\n trailing: false,\n });\n\n expect(withTrailing('a')).toBe('a');\n expect(withTrailing('b')).toBe('a');\n expect(withoutTrailing('a')).toBe('a');\n expect(withoutTrailing('b')).toBe('a');\n\n await sleep(8 * UT);\n\n expect(mockWith).toHaveBeenCalledTimes(2);\n expect(mockWithout).toHaveBeenCalledTimes(1);\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should reset `lastCalled` after cancelling', async () => {\n let callCount = 0;\n const throttled = throttleWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: true },\n );\n\n expect(throttled()).toBe(1);\n\n throttled.cancel();\n\n expect(throttled()).toBe(2);\n\n throttled();\n await sleep(2 * UT);\n\n expect(callCount).toBe(3);\n });\n\n it('should support flushing delayed calls', async () => {\n let callCount = 0;\n const throttled = throttleWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: false },\n );\n throttled();\n\n expect(throttled.flush()).toBe(1);\n\n await sleep(2 * UT);\n\n expect(callCount).toBe(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => string>(constant('hello'));\n const throttled = throttleWithCachedValue(mockFn, UT);\n throttled.cancel();\n\n expect(throttled.flush()).toBeUndefined();\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\ndescribe('features not tested by Lodash', () => {\n it('does nothing when neither leading nor trailing are enabled', async () => {\n const throttled = throttleWithCachedValue(identity(), UT, {\n leading: false,\n trailing: false,\n });\n\n expect(throttled('hello')).toBeUndefined();\n expect(throttled('world')).toBeUndefined();\n\n await sleep(4 * UT);\n\n expect(throttled('goodbye')).toBeUndefined();\n });\n});\n"],"mappings":"8QAsCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,IACoD,EAAE,CACnE,CACA,IAAIA,EAEE,CAAE,OAAM,QAAO,UAAW,EAC7B,GAAwB,CACnB,CAAC,GAAW,CAAC,IAiBjB,EAAc,EAAK,GAAG,EAAK,GAE7B,CAEE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,mBAAoB,EACpB,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAQD,OAAO,OAAO,QACX,GAAG,KACF,EAAK,GAAG,EAAK,CACN,GAET,CACE,WACE,GAAO,CACA,GAGT,SACD,CACF,CAYH,EAAS,wEAA2E,CAClF,EAAG,8DAA+D,SAAY,CAC5E,IAAM,EAAY,EAAwB,GAAU,CAAE,GAAG,CAEzD,EAAO,EAAU,IAAI,CAAC,CAAC,KAAK,IAAI,CAChC,EAAO,EAAU,IAAI,CAAC,CAAC,KAAK,IAAI,CAEhC,MAAM,EAAM,GAAO,CACnB,IAAM,EAAU,EAAU,IAAI,CACxB,EAAU,EAAU,IAAI,CAE9B,EAAO,EAAQ,CAAC,IAAI,KAAK,IAAI,CAC7B,EAAO,EAAQ,CAAC,aAAa,CAC7B,EAAO,EAAQ,CAAC,IAAI,KAAK,IAAI,CAC7B,EAAO,EAAQ,CAAC,aAAa,EAC7B,CAEF,EAAG,wCAA2C,CAC5C,IAAM,EAAc,EAAwB,GAA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EnB,EAAO,EAAU,CAAC,KAAK,EAAE,EACzB,CAEF,EAAG,0DAA2D,SAAY,CACxE,IAAM,EAAS,EAAG,GAAiB,EAAS,QAAQ,CAAC,CAC/C,EAAY,EAAwB,EAAQ,GAAG,CACrD,EAAU,QAAQ,CAElB,EAAO,EAAU,OAAO,CAAC,CAAC,eAAe,CAEzC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF,CAEF,EAAS,oCAAuC,CAC9C,EAAG,6DAA8D,SAAY,CAC3E,IAAM,EAAY,EAAwB,GAAU,CAAE,GAAI,CACxD,QAAS,GACT,SAAU,GACX,CAAC,CAEF,EAAO,EAAU,QAAQ,CAAC,CAAC,eAAe,CAC1C,EAAO,EAAU,QAAQ,CAAC,CAAC,eAAe,CAE1C,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAU,UAAU,CAAC,CAAC,eAAe,EAC5C,EACF"}
1
+ {"version":3,"file":"funnel.lodash-throttle-with-cached-value.test.js","names":["cachedValue: ReturnType<F> | undefined"],"sources":["../src/funnel.lodash-throttle-with-cached-value.test.ts"],"sourcesContent":["/* eslint-disable no-nested-ternary, function-paren-newline, ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { constant } from './constant';\nimport { funnel } from './funnel';\nimport { identity } from './identity';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `throttle` function using the\n * Our `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your codebase and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a more complex implementation which respects Lodash capability to\n * track the return value of the callback function. In most cases you are more\n * likely to prefer the simpler reference implementation `throttle` which can\n * be found in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for throttle.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests. Tests that are unrelated to the cache\n * capability have been removed to avoid duplication with the other test file.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#throttle\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10965\n * @see Lodash Tests: https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L1347\n */\nfunction throttleWithCachedValue<F extends (...args: any) => any>(\n func: F,\n wait = 0,\n {\n leading = true,\n trailing = true,\n }: { readonly leading?: boolean; readonly trailing?: boolean } = {},\n) {\n let cachedValue: ReturnType<F> | undefined;\n\n const { call, flush, cancel } = funnel(\n (args: Parameters<F>) => {\n if (!leading && !trailing) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * throttle window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n * Also, every time the function is invoked the cached value is updated.\n */\n cachedValue = func(...args) as ReturnType<F>;\n },\n {\n // Throttle stores the latest args it was called with for the next invocation of the callback.\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n maxBurstDurationMs: wait,\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n\n /**\n * Lodash uses a legacy JS-isms to attach helper functions to the main\n * callback of `throttle`. In our's we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(\n (...args: Parameters<F>) => {\n call(...args);\n return cachedValue;\n },\n {\n flush: () => {\n flush();\n return cachedValue;\n },\n\n cancel,\n },\n );\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768', () => {\n it('subsequent calls should return the result of the first call', async () => {\n const throttled = throttleWithCachedValue(identity(), UT);\n\n expect(throttled('a')).toBe('a');\n expect(throttled('b')).toBe('a');\n\n await sleep(2 * UT);\n const resultC = throttled('c');\n const resultD = throttled('d');\n\n expect(resultC).not.toBe('a');\n expect(resultC).toBeDefined();\n expect(resultD).not.toBe('d');\n expect(resultD).toBeDefined();\n });\n\n it('should support a `leading` option', () => {\n const withLeading = throttleWithCachedValue(identity(), UT, {\n leading: true,\n });\n const withoutLeading = throttleWithCachedValue(identity(), UT, {\n leading: false,\n });\n\n expect(withLeading('a')).toBe('a');\n expect(withoutLeading('a')).toBeUndefined();\n });\n\n it('should support a `trailing` option', async () => {\n const mockWith = vi.fn<<T>(x: T) => T>(identity());\n const mockWithout = vi.fn<<T>(x: T) => T>(identity());\n const withTrailing = throttleWithCachedValue(mockWith, 2 * UT, {\n trailing: true,\n });\n const withoutTrailing = throttleWithCachedValue(mockWithout, 2 * UT, {\n trailing: false,\n });\n\n expect(withTrailing('a')).toBe('a');\n expect(withTrailing('b')).toBe('a');\n expect(withoutTrailing('a')).toBe('a');\n expect(withoutTrailing('b')).toBe('a');\n\n await sleep(8 * UT);\n\n expect(mockWith).toHaveBeenCalledTimes(2);\n expect(mockWithout).toHaveBeenCalledTimes(1);\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should reset `lastCalled` after cancelling', async () => {\n let callCount = 0;\n const throttled = throttleWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: true },\n );\n\n expect(throttled()).toBe(1);\n\n throttled.cancel();\n\n expect(throttled()).toBe(2);\n\n throttled();\n await sleep(2 * UT);\n\n expect(callCount).toBe(3);\n });\n\n it('should support flushing delayed calls', async () => {\n let callCount = 0;\n const throttled = throttleWithCachedValue(\n () => {\n callCount += 1;\n return callCount;\n },\n UT,\n { leading: false },\n );\n throttled();\n\n expect(throttled.flush()).toBe(1);\n\n await sleep(2 * UT);\n\n expect(callCount).toBe(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => string>(constant('hello'));\n const throttled = throttleWithCachedValue(mockFn, UT);\n throttled.cancel();\n\n expect(throttled.flush()).toBeUndefined();\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\ndescribe('features not tested by Lodash', () => {\n it('does nothing when neither leading nor trailing are enabled', async () => {\n const throttled = throttleWithCachedValue(identity(), UT, {\n leading: false,\n trailing: false,\n });\n\n expect(throttled('hello')).toBeUndefined();\n expect(throttled('world')).toBeUndefined();\n\n await sleep(4 * UT);\n\n expect(throttled('goodbye')).toBeUndefined();\n });\n});\n"],"mappings":"4MAsCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,IACoD,EAAE,CACnE,CACA,IAAIA,EAEE,CAAE,OAAM,QAAO,UAAW,EAC7B,GAAwB,CACnB,CAAC,GAAW,CAAC,IAiBjB,EAAc,EAAK,GAAG,EAAK,GAE7B,CAEE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,mBAAoB,EACpB,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAQD,OAAO,OAAO,QACX,GAAG,KACF,EAAK,GAAG,EAAK,CACN,GAET,CACE,WACE,GAAO,CACA,GAGT,SACD,CACF,CAYH,EAAS,wEAA2E,CAClF,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er:(e,...t)=>t,minQuietPeriodMs:n,maxBurstDurationMs:n,...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(a,s)}const i=16;e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{e.it(`should throttle a function`,async()=>{let t=e.vi.fn(),i=r(t,16);i(),i(),i();let a=t.mock.calls.length;e.globalExpect(a).toBeGreaterThan(0),await n.sleep(32),e.globalExpect(t.mock.calls.length).toBeGreaterThan(a)}),e.it("should clear timeout when `func` is called",async()=>{let t=e.vi.fn(),i=r(t,16);i(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(32),i(),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it(`should not trigger a trailing call when invoked once`,async()=>{let t=e.vi.fn();r(t,16)(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it(`should trigger a call when invoked repeatedly`,()=>{let t=e.vi.fn(),n=r(t,16),i=Date.now()+160;for(;Date.now()<i;)n();e.globalExpect(t).toHaveBeenCalledExactlyOnceWith()}),e.it("should trigger a call when invoked repeatedly and `leading` is `false`",async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!1}),a=Date.now()+160;for(;Date.now()<a;)i();await n.sleep(0),e.globalExpect(t).toHaveBeenCalledExactlyOnceWith()}),e.it(`should trigger a second throttled call as soon as possible`,async()=>{let t=e.vi.fn(),i=r(t,64,{leading:!1});i(),await n.sleep(96),e.globalExpect(t).toHaveBeenCalledTimes(1),i(),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it(`should apply default options`,async()=>{let t=e.vi.fn(),i=r(t,16,{});i(),i(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should support a `leading` option",()=>{let t=e.vi.fn(),n=e.vi.fn(),i=r(t,16,{leading:!0}),a=r(n,16,{leading:!1});i(),a(),e.globalExpect(t).toHaveBeenCalledTimes(1),e.globalExpect(n).toHaveBeenCalledTimes(0)}),e.it("should support a `trailing` option",async()=>{let t=e.vi.fn(),i=e.vi.fn(),a=r(t,32,{trailing:!0}),o=r(i,32,{trailing:!1});a(`a`),a(`b`),o(`a`),o(`b`),e.globalExpect(t).toHaveBeenCalledExactlyOnceWith(`a`),e.globalExpect(i).toHaveBeenCalledExactlyOnceWith(`a`),await n.sleep(128),e.globalExpect(t).toHaveBeenCalledTimes(2),e.globalExpect(i).toHaveBeenCalledTimes(1)}),e.it("should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`",async()=>{let t=e.vi.fn(),i=r(t,64,{trailing:!1});i(),i(),await n.sleep(48),i(),i(),await n.sleep(48),e.globalExpect(t).toHaveBeenCalledExactlyOnceWith()})}),e.describe(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.it("should use a default `wait` of `0`",async()=>{let t=e.vi.fn(),i=r(t);i(),await n.sleep(16),i(),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it(`supports recursive calls`,async()=>{let t=[],i=[`a`,`b`,`c`],a=r(e=>{t.push(e);let n=i.shift();n!==void 0&&a(n)},16);a(i.shift()),e.globalExpect(t).toStrictEqual([`a`]),await n.sleep(128),e.globalExpect(t).toStrictEqual([`a`,`b`,`c`])}),e.it(`should support cancelling delayed calls`,async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!1});i(),i.cancel(),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(0)}),e.it("should reset `lastCalled` after cancelling",async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!0});i(),e.globalExpect(t).toHaveBeenCalledTimes(1),i.cancel(),i(),e.globalExpect(t).toHaveBeenCalledTimes(2),i(),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(3)}),e.it(`should support flushing delayed calls`,async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!1});i(),i.flush(),e.globalExpect(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("should noop `cancel` and `flush` when nothing is queued",async()=>{let t=e.vi.fn(),i=r(t,16);i.cancel(),i.flush(),e.globalExpect(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(0)})}),e.describe(`not tested by Lodash`,()=>{e.it("should do nothing when `leading` and `trailing` are both `disabled`",async()=>{let t=e.vi.fn(),i=r(t,16,{leading:!1,trailing:!1});i(),i(),i(),e.globalExpect(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.globalExpect(t).toHaveBeenCalledTimes(0)})});
1
+ const e=require(`./dist-CiyBKPT6.cjs`),t=require(`./funnel.cjs`),n=require(`./sleep.cjs`);function r(e,n=0,{leading:r=!0,trailing:i=!0}={}){let{call:a,isIdle:o,...s}=t.funnel(t=>{!r&&!i||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:n,maxBurstDurationMs:n,...i?r?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(a,s)}const i=16;e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{e.a(`should throttle a function`,async()=>{let t=e.r.fn(),i=r(t,16);i(),i(),i();let a=t.mock.calls.length;e.n(a).toBeGreaterThan(0),await n.sleep(32),e.n(t.mock.calls.length).toBeGreaterThan(a)}),e.a("should clear timeout when `func` is called",async()=>{let t=e.r.fn(),i=r(t,16);i(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(32),i(),e.n(t).toHaveBeenCalledTimes(2)}),e.a(`should not trigger a trailing call when invoked once`,async()=>{let t=e.r.fn();r(t,16)(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1)}),e.a(`should trigger a call when invoked repeatedly`,()=>{let t=e.r.fn(),n=r(t,16),i=Date.now()+160;for(;Date.now()<i;)n();e.n(t).toHaveBeenCalledExactlyOnceWith()}),e.a("should trigger a call when invoked repeatedly and `leading` is `false`",async()=>{let t=e.r.fn(),i=r(t,16,{leading:!1}),a=Date.now()+160;for(;Date.now()<a;)i();await n.sleep(0),e.n(t).toHaveBeenCalledExactlyOnceWith()}),e.a(`should trigger a second throttled call as soon as possible`,async()=>{let t=e.r.fn(),i=r(t,64,{leading:!1});i(),await n.sleep(96),e.n(t).toHaveBeenCalledTimes(1),i(),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.n(t).toHaveBeenCalledTimes(2)}),e.a(`should apply default options`,async()=>{let t=e.r.fn(),i=r(t,16,{});i(),i(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(64),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should support a `leading` option",()=>{let t=e.r.fn(),n=e.r.fn(),i=r(t,16,{leading:!0}),a=r(n,16,{leading:!1});i(),a(),e.n(t).toHaveBeenCalledTimes(1),e.n(n).toHaveBeenCalledTimes(0)}),e.a("should support a `trailing` option",async()=>{let t=e.r.fn(),i=e.r.fn(),a=r(t,32,{trailing:!0}),o=r(i,32,{trailing:!1});a(`a`),a(`b`),o(`a`),o(`b`),e.n(t).toHaveBeenCalledExactlyOnceWith(`a`),e.n(i).toHaveBeenCalledExactlyOnceWith(`a`),await n.sleep(128),e.n(t).toHaveBeenCalledTimes(2),e.n(i).toHaveBeenCalledTimes(1)}),e.a("should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`",async()=>{let t=e.r.fn(),i=r(t,64,{trailing:!1});i(),i(),await n.sleep(48),i(),i(),await n.sleep(48),e.n(t).toHaveBeenCalledExactlyOnceWith()})}),e.i(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e.a("should use a default `wait` of `0`",async()=>{let t=e.r.fn(),i=r(t);i(),await n.sleep(16),i(),e.n(t).toHaveBeenCalledTimes(2)}),e.a(`supports recursive calls`,async()=>{let t=[],i=[`a`,`b`,`c`],a=r(e=>{t.push(e);let n=i.shift();n!==void 0&&a(n)},16);a(i.shift()),e.n(t).toStrictEqual([`a`]),await n.sleep(128),e.n(t).toStrictEqual([`a`,`b`,`c`])}),e.a(`should support cancelling delayed calls`,async()=>{let t=e.r.fn(),i=r(t,16,{leading:!1});i(),i.cancel(),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(0)}),e.a("should reset `lastCalled` after cancelling",async()=>{let t=e.r.fn(),i=r(t,16,{leading:!0});i(),e.n(t).toHaveBeenCalledTimes(1),i.cancel(),i(),e.n(t).toHaveBeenCalledTimes(2),i(),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(3)}),e.a(`should support flushing delayed calls`,async()=>{let t=e.r.fn(),i=r(t,16,{leading:!1});i(),i.flush(),e.n(t).toHaveBeenCalledTimes(1),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(1)}),e.a("should noop `cancel` and `flush` when nothing is queued",async()=>{let t=e.r.fn(),i=r(t,16);i.cancel(),i.flush(),e.n(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(0)})}),e.i(`not tested by Lodash`,()=>{e.a("should do nothing when `leading` and `trailing` are both `disabled`",async()=>{let t=e.r.fn(),i=r(t,16,{leading:!1,trailing:!1});i(),i(),i(),e.n(t).toHaveBeenCalledTimes(0),await n.sleep(32),e.n(t).toHaveBeenCalledTimes(0)})});
@@ -1,2 +1,2 @@
1
- import{describe as e,globalExpect as t,it as n,vi as r}from"./dist-BQGZfjDS.js";import{funnel as i}from"./funnel-CEbURcmp.js";import{sleep as a}from"./sleep-DvzRMgY-.js";function o(e,t=0,{leading:n=!0,trailing:r=!0}={}){let{call:a,isIdle:o,...s}=i(t=>{!n&&!r||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:t,maxBurstDurationMs:t,...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(a,s)}e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{n(`should throttle a function`,async()=>{let e=r.fn(),n=o(e,16);n(),n(),n();let i=e.mock.calls.length;t(i).toBeGreaterThan(0),await a(32),t(e.mock.calls.length).toBeGreaterThan(i)}),n("should clear timeout when `func` is called",async()=>{let e=r.fn(),n=o(e,16);n(),t(e).toHaveBeenCalledTimes(1),await a(32),n(),t(e).toHaveBeenCalledTimes(2)}),n(`should not trigger a trailing call when invoked once`,async()=>{let e=r.fn();o(e,16)(),t(e).toHaveBeenCalledTimes(1),await a(32),t(e).toHaveBeenCalledTimes(1)}),n(`should trigger a call when invoked repeatedly`,()=>{let e=r.fn(),n=o(e,16),i=Date.now()+160;for(;Date.now()<i;)n();t(e).toHaveBeenCalledExactlyOnceWith()}),n("should trigger a call when invoked repeatedly and `leading` is `false`",async()=>{let e=r.fn(),n=o(e,16,{leading:!1}),i=Date.now()+160;for(;Date.now()<i;)n();await a(0),t(e).toHaveBeenCalledExactlyOnceWith()}),n(`should trigger a second throttled call as soon as possible`,async()=>{let e=r.fn(),n=o(e,64,{leading:!1});n(),await a(96),t(e).toHaveBeenCalledTimes(1),n(),await a(32),t(e).toHaveBeenCalledTimes(1),await a(64),t(e).toHaveBeenCalledTimes(2)}),n(`should apply default options`,async()=>{let e=r.fn(),n=o(e,16,{});n(),n(),t(e).toHaveBeenCalledTimes(1),await a(64),t(e).toHaveBeenCalledTimes(2)}),n("should support a `leading` option",()=>{let e=r.fn(),n=r.fn(),i=o(e,16,{leading:!0}),a=o(n,16,{leading:!1});i(),a(),t(e).toHaveBeenCalledTimes(1),t(n).toHaveBeenCalledTimes(0)}),n("should support a `trailing` option",async()=>{let e=r.fn(),n=r.fn(),i=o(e,32,{trailing:!0}),s=o(n,32,{trailing:!1});i(`a`),i(`b`),s(`a`),s(`b`),t(e).toHaveBeenCalledExactlyOnceWith(`a`),t(n).toHaveBeenCalledExactlyOnceWith(`a`),await a(128),t(e).toHaveBeenCalledTimes(2),t(n).toHaveBeenCalledTimes(1)}),n("should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`",async()=>{let e=r.fn(),n=o(e,64,{trailing:!1});n(),n(),await a(48),n(),n(),await a(48),t(e).toHaveBeenCalledExactlyOnceWith()})}),e(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{n("should use a default `wait` of `0`",async()=>{let e=r.fn(),n=o(e);n(),await a(16),n(),t(e).toHaveBeenCalledTimes(2)}),n(`supports recursive calls`,async()=>{let e=[],n=[`a`,`b`,`c`],r=o(t=>{e.push(t);let i=n.shift();i!==void 0&&r(i)},16);r(n.shift()),t(e).toStrictEqual([`a`]),await a(128),t(e).toStrictEqual([`a`,`b`,`c`])}),n(`should support cancelling delayed calls`,async()=>{let e=r.fn(),n=o(e,16,{leading:!1});n(),n.cancel(),await a(32),t(e).toHaveBeenCalledTimes(0)}),n("should reset `lastCalled` after cancelling",async()=>{let e=r.fn(),n=o(e,16,{leading:!0});n(),t(e).toHaveBeenCalledTimes(1),n.cancel(),n(),t(e).toHaveBeenCalledTimes(2),n(),await a(32),t(e).toHaveBeenCalledTimes(3)}),n(`should support flushing delayed calls`,async()=>{let e=r.fn(),n=o(e,16,{leading:!1});n(),n.flush(),t(e).toHaveBeenCalledTimes(1),await a(32),t(e).toHaveBeenCalledTimes(1)}),n("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(),n=o(e,16);n.cancel(),n.flush(),t(e).toHaveBeenCalledTimes(0),await a(32),t(e).toHaveBeenCalledTimes(0)})}),e(`not tested by Lodash`,()=>{n("should do nothing when `leading` and `trailing` are both `disabled`",async()=>{let e=r.fn(),n=o(e,16,{leading:!1,trailing:!1});n(),n(),n(),t(e).toHaveBeenCalledTimes(0),await a(32),t(e).toHaveBeenCalledTimes(0)})});
1
+ import{a as e,i as t,n,r}from"./dist-CUT1dnRU.js";import{funnel as i}from"./funnel.js";import{sleep as a}from"./sleep.js";function o(e,t=0,{leading:n=!0,trailing:r=!0}={}){let{call:a,isIdle:o,...s}=i(t=>{!n&&!r||e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:t,maxBurstDurationMs:t,...r?n?{triggerAt:`both`}:{triggerAt:`end`}:{triggerAt:`start`}});return Object.assign(a,s)}t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768`,()=>{e(`should throttle a function`,async()=>{let e=r.fn(),t=o(e,16);t(),t(),t();let i=e.mock.calls.length;n(i).toBeGreaterThan(0),await a(32),n(e.mock.calls.length).toBeGreaterThan(i)}),e("should clear timeout when `func` is called",async()=>{let e=r.fn(),t=o(e,16);t(),n(e).toHaveBeenCalledTimes(1),await a(32),t(),n(e).toHaveBeenCalledTimes(2)}),e(`should not trigger a trailing call when invoked once`,async()=>{let e=r.fn();o(e,16)(),n(e).toHaveBeenCalledTimes(1),await a(32),n(e).toHaveBeenCalledTimes(1)}),e(`should trigger a call when invoked repeatedly`,()=>{let e=r.fn(),t=o(e,16),i=Date.now()+160;for(;Date.now()<i;)t();n(e).toHaveBeenCalledExactlyOnceWith()}),e("should trigger a call when invoked repeatedly and `leading` is `false`",async()=>{let e=r.fn(),t=o(e,16,{leading:!1}),i=Date.now()+160;for(;Date.now()<i;)t();await a(0),n(e).toHaveBeenCalledExactlyOnceWith()}),e(`should trigger a second throttled call as soon as possible`,async()=>{let e=r.fn(),t=o(e,64,{leading:!1});t(),await a(96),n(e).toHaveBeenCalledTimes(1),t(),await a(32),n(e).toHaveBeenCalledTimes(1),await a(64),n(e).toHaveBeenCalledTimes(2)}),e(`should apply default options`,async()=>{let e=r.fn(),t=o(e,16,{});t(),t(),n(e).toHaveBeenCalledTimes(1),await a(64),n(e).toHaveBeenCalledTimes(2)}),e("should support a `leading` option",()=>{let e=r.fn(),t=r.fn(),i=o(e,16,{leading:!0}),a=o(t,16,{leading:!1});i(),a(),n(e).toHaveBeenCalledTimes(1),n(t).toHaveBeenCalledTimes(0)}),e("should support a `trailing` option",async()=>{let e=r.fn(),t=r.fn(),i=o(e,32,{trailing:!0}),s=o(t,32,{trailing:!1});i(`a`),i(`b`),s(`a`),s(`b`),n(e).toHaveBeenCalledExactlyOnceWith(`a`),n(t).toHaveBeenCalledExactlyOnceWith(`a`),await a(128),n(e).toHaveBeenCalledTimes(2),n(t).toHaveBeenCalledTimes(1)}),e("should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`",async()=>{let e=r.fn(),t=o(e,64,{trailing:!1});t(),t(),await a(48),t(),t(),await a(48),n(e).toHaveBeenCalledExactlyOnceWith()})}),t(`https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038`,()=>{e("should use a default `wait` of `0`",async()=>{let e=r.fn(),t=o(e);t(),await a(16),t(),n(e).toHaveBeenCalledTimes(2)}),e(`supports recursive calls`,async()=>{let e=[],t=[`a`,`b`,`c`],r=o(n=>{e.push(n);let i=t.shift();i!==void 0&&r(i)},16);r(t.shift()),n(e).toStrictEqual([`a`]),await a(128),n(e).toStrictEqual([`a`,`b`,`c`])}),e(`should support cancelling delayed calls`,async()=>{let e=r.fn(),t=o(e,16,{leading:!1});t(),t.cancel(),await a(32),n(e).toHaveBeenCalledTimes(0)}),e("should reset `lastCalled` after cancelling",async()=>{let e=r.fn(),t=o(e,16,{leading:!0});t(),n(e).toHaveBeenCalledTimes(1),t.cancel(),t(),n(e).toHaveBeenCalledTimes(2),t(),await a(32),n(e).toHaveBeenCalledTimes(3)}),e(`should support flushing delayed calls`,async()=>{let e=r.fn(),t=o(e,16,{leading:!1});t(),t.flush(),n(e).toHaveBeenCalledTimes(1),await a(32),n(e).toHaveBeenCalledTimes(1)}),e("should noop `cancel` and `flush` when nothing is queued",async()=>{let e=r.fn(),t=o(e,16);t.cancel(),t.flush(),n(e).toHaveBeenCalledTimes(0),await a(32),n(e).toHaveBeenCalledTimes(0)})}),t(`not tested by Lodash`,()=>{e("should do nothing when `leading` and `trailing` are both `disabled`",async()=>{let e=r.fn(),t=o(e,16,{leading:!1,trailing:!1});t(),t(),t(),n(e).toHaveBeenCalledTimes(0),await a(32),n(e).toHaveBeenCalledTimes(0)})});
2
2
  //# sourceMappingURL=funnel.lodash-throttle.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"funnel.lodash-throttle.test.js","names":[],"sources":["../src/funnel.lodash-throttle.test.ts"],"sourcesContent":["/* eslint-disable function-paren-newline, no-nested-ternary, ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { funnel } from './funnel';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `throttle` function using the\n * Our `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your code base and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a simplified implementation which ignores the Lodash capability to\n * track the return value of the callback function, but it is most likely the\n * more common use-case. For a more complete (and more complex) implementation\n * that also does that see the reference implementation for\n * `throttleWithCachedValue` in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for throttle.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#throttle\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10965\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L1347\n */\nfunction throttle<F extends (...args: any) => void>(\n func: F,\n wait = 0,\n {\n leading = true,\n trailing = true,\n }: { readonly leading?: boolean; readonly trailing?: boolean } = {},\n) {\n const {\n call,\n // Lodash v4 doesn't provide access to the `isIdle` (called `pending` in Lodash v5) information.\n isIdle: _isIdle,\n ...rest\n } = funnel(\n (args: Parameters<F>) => {\n if (!leading && !trailing) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * throttle window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n */\n func(...args);\n },\n {\n // Throttle stores the latest args it was called with for the next invocation of the callback.\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n maxBurstDurationMs: wait,\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n /**\n * Lodash uses a legacy JS-ism to attach helper functions to the main\n * callback of `throttle`. In our's we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(call, rest);\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768', () => {\n it('should throttle a function', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled();\n throttled();\n throttled();\n const callCount = mockFn.mock.calls.length;\n\n expect(callCount).toBeGreaterThan(0);\n\n await sleep(2 * UT);\n\n expect(mockFn.mock.calls.length).toBeGreaterThan(callCount);\n });\n\n it('should clear timeout when `func` is called', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should not trigger a trailing call when invoked once', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should trigger a call when invoked repeatedly', () => {\n const mockFn = vi.fn<() => void>();\n\n const throttled = throttle(mockFn, UT);\n\n const end = Date.now() + 10 * UT;\n while (Date.now() < end) {\n throttled();\n }\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith();\n });\n\n it('should trigger a call when invoked repeatedly and `leading` is `false`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false });\n const end = Date.now() + 10 * UT;\n while (Date.now() < end) {\n throttled();\n }\n // Yield execution to allow timeouts to run\n await sleep(0);\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith();\n });\n\n it('should trigger a second throttled call as soon as possible', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, 4 * UT, { leading: false });\n throttled();\n await sleep(6 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n throttled();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should apply default options', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, {});\n throttled();\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should support a `leading` option', () => {\n const mockWith = vi.fn<() => void>();\n const mockWithout = vi.fn<() => void>();\n const withLeading = throttle(mockWith, UT, { leading: true });\n const withoutLeading = throttle(mockWithout, UT, { leading: false });\n\n withLeading();\n withoutLeading();\n\n expect(mockWith).toHaveBeenCalledTimes(1);\n expect(mockWithout).toHaveBeenCalledTimes(0);\n });\n\n it('should support a `trailing` option', async () => {\n const mockWith = vi.fn<(x: string) => void>();\n const mockWithout = vi.fn<(x: string) => void>();\n const withTrailing = throttle(mockWith, 2 * UT, { trailing: true });\n const withoutTrailing = throttle(mockWithout, 2 * UT, { trailing: false });\n withTrailing('a');\n withTrailing('b');\n withoutTrailing('a');\n withoutTrailing('b');\n\n expect(mockWith).toHaveBeenCalledExactlyOnceWith('a');\n expect(mockWithout).toHaveBeenCalledExactlyOnceWith('a');\n\n await sleep(8 * UT);\n\n expect(mockWith).toHaveBeenCalledTimes(2);\n expect(mockWithout).toHaveBeenCalledTimes(1);\n });\n\n it('should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, 64, { trailing: false });\n throttled();\n throttled();\n await sleep(3 * UT);\n throttled();\n throttled();\n await sleep(3 * UT);\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith();\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should use a default `wait` of `0`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn);\n throttled();\n await sleep(UT);\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('supports recursive calls', async () => {\n const actual = [] as Array<string>;\n const queue = ['a', 'b', 'c'];\n const throttled = throttle((chr: string) => {\n actual.push(chr);\n const next = queue.shift();\n if (next !== undefined) {\n throttled(next);\n }\n }, UT);\n throttled(queue.shift()!);\n\n expect(actual).toStrictEqual(['a']);\n\n await sleep(8 * UT);\n\n expect(actual).toStrictEqual(['a', 'b', 'c']);\n });\n\n it('should support cancelling delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false });\n throttled();\n throttled.cancel();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n\n it('should reset `lastCalled` after cancelling', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: true });\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n throttled.cancel();\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n\n throttled();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(3);\n });\n\n it('should support flushing delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false });\n throttled();\n throttled.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled.cancel();\n throttled.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\ndescribe('not tested by Lodash', () => {\n it('should do nothing when `leading` and `trailing` are both `disabled`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false, trailing: false });\n throttled();\n throttled();\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n"],"mappings":"0KAmCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,IACoD,EAAE,CACnE,CACA,GAAM,CACJ,OAEA,OAAQ,EACR,GAAG,GACD,EACD,GAAwB,CACnB,CAAC,GAAW,CAAC,GAgBjB,EAAK,GAAG,EAAK,EAEf,CAEE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,mBAAoB,EACpB,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAOD,OAAO,OAAO,OAAO,EAAM,EAAK,CAYlC,EAAS,wEAA2E,CAClF,EAAG,6BAA8B,SAAY,CAC3C,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAG,CACtC,GAAW,CACX,GAAW,CAC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AAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,CAEF,EAAG,wCAAyC,SAAY,CACtD,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAI,CAAE,QAAS,GAAO,CAAC,CAC1D,GAAW,CACX,EAAU,OAAO,CAEjB,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,CAEF,EAAG,0DAA2D,SAAY,CACxE,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAG,CACtC,EAAU,QAAQ,CAClB,EAAU,OAAO,CAEjB,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF,CAEF,EAAS,2BAA8B,CACrC,EAAG,sEAAuE,SAAY,CACpF,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAI,CAAE,QAAS,GAAO,SAAU,GAAO,CAAC,CAC3E,GAAW,CACX,GAAW,CACX,GAAW,CAEX,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF"}
1
+ {"version":3,"file":"funnel.lodash-throttle.test.js","names":[],"sources":["../src/funnel.lodash-throttle.test.ts"],"sourcesContent":["/* eslint-disable function-paren-newline, no-nested-ternary, ts/explicit-function-return-type, ts/no-explicit-any --\n * These aren't useful for a reference implementation for a legacy library!\n */\n\nimport { describe, expect, it, vi } from 'vitest';\nimport { funnel } from './funnel';\nimport { sleep } from './sleep';\n\n/**\n * A reference implementation of the Lodash `throttle` function using the\n * Our `funnel` function. While migrating from Lodash you can copy this\n * function as-is into your code base and use it as a drop-in replacement; but\n * we recommend eventually inlining the call to `funnel` so you can adjust the\n * function to your specific needs.\n *\n * This is a simplified implementation which ignores the Lodash capability to\n * track the return value of the callback function, but it is most likely the\n * more common use-case. For a more complete (and more complex) implementation\n * that also does that see the reference implementation for\n * `throttleWithCachedValue` in the other test file.\n *\n * The following tests in this file are based on the Lodash tests for throttle.\n * They have been adapted to work with our testing framework, have been fixed\n * or expanded slightly were it felt necessary, and have been modernized for\n * better readability. The names of the test cases have been preserved to ease\n * comparing them to the original tests.\n *\n * Note that this means that whenever Lodash offered a concrete spec, we made\n * sure our reference implementation respects it, but there might be untested\n * use-cases that would have differing runtime behaviors.\n *\n * @see Lodash Documentation: https://lodash.com/docs/4.17.15#throttle\n * @see Lodash Implementation: https://github.com/lodash/lodash/blob/4.17.21/lodash.js#L10965\n * @see Lodash Typing: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/common/function.d.ts#L1347\n */\nfunction throttle<F extends (...args: any) => void>(\n func: F,\n wait = 0,\n {\n leading = true,\n trailing = true,\n }: { readonly leading?: boolean; readonly trailing?: boolean } = {},\n) {\n const {\n call,\n // Lodash v4 doesn't provide access to the `isIdle` (called `pending` in Lodash v5) information.\n isIdle: _isIdle,\n ...rest\n } = funnel(\n (args: Parameters<F>) => {\n if (!leading && !trailing) {\n /**\n * In Lodash you can disable both the trailing and leading edges of the\n * throttle window, effectively causing the function to never be\n * invoked. Our's uses the invokedAt enum exactly to prevent such a\n * situation; so to simulate Lodash we need to only pass the callback\n * when at least one of them is enabled.\n */\n return;\n }\n\n /**\n * Funnel provides more control over the args, but lodash simply passes\n * them through, to replicate this behavior we need to spread the args\n * array maintained via the reducer below.\n */\n func(...args);\n },\n {\n // Throttle stores the latest args it was called with for the next invocation of the callback.\n reducer: (_, ...args: Parameters<F>) => args,\n minQuietPeriodMs: wait,\n maxBurstDurationMs: wait,\n ...(trailing\n ? leading\n ? { triggerAt: 'both' }\n : { triggerAt: 'end' }\n : { triggerAt: 'start' }),\n },\n );\n /**\n * Lodash uses a legacy JS-ism to attach helper functions to the main\n * callback of `throttle`. In our's we return a proper object where the\n * callback is one of the available properties. Here we destructure and then\n * reconstruct the object to fit the Lodash API.\n */\n return Object.assign(call, rest);\n}\n\n/**\n * We need some non-trivial duration to use in all our tests, to abstract the\n * actual chosen value we use this UnitOfTime (UT) constant. As long as it is a\n * positive integer, the actual value doesn't matter (but the larger it is,\n * the longer the tests would take to run); the value used by Lodash is 32.\n * The number is in milliseconds.\n */\nconst UT = 16;\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L22768', () => {\n it('should throttle a function', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled();\n throttled();\n throttled();\n const callCount = mockFn.mock.calls.length;\n\n expect(callCount).toBeGreaterThan(0);\n\n await sleep(2 * UT);\n\n expect(mockFn.mock.calls.length).toBeGreaterThan(callCount);\n });\n\n it('should clear timeout when `func` is called', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should not trigger a trailing call when invoked once', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should trigger a call when invoked repeatedly', () => {\n const mockFn = vi.fn<() => void>();\n\n const throttled = throttle(mockFn, UT);\n\n const end = Date.now() + 10 * UT;\n while (Date.now() < end) {\n throttled();\n }\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith();\n });\n\n it('should trigger a call when invoked repeatedly and `leading` is `false`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false });\n const end = Date.now() + 10 * UT;\n while (Date.now() < end) {\n throttled();\n }\n // Yield execution to allow timeouts to run\n await sleep(0);\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith();\n });\n\n it('should trigger a second throttled call as soon as possible', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, 4 * UT, { leading: false });\n throttled();\n await sleep(6 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n throttled();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should apply default options', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, {});\n throttled();\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(4 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('should support a `leading` option', () => {\n const mockWith = vi.fn<() => void>();\n const mockWithout = vi.fn<() => void>();\n const withLeading = throttle(mockWith, UT, { leading: true });\n const withoutLeading = throttle(mockWithout, UT, { leading: false });\n\n withLeading();\n withoutLeading();\n\n expect(mockWith).toHaveBeenCalledTimes(1);\n expect(mockWithout).toHaveBeenCalledTimes(0);\n });\n\n it('should support a `trailing` option', async () => {\n const mockWith = vi.fn<(x: string) => void>();\n const mockWithout = vi.fn<(x: string) => void>();\n const withTrailing = throttle(mockWith, 2 * UT, { trailing: true });\n const withoutTrailing = throttle(mockWithout, 2 * UT, { trailing: false });\n withTrailing('a');\n withTrailing('b');\n withoutTrailing('a');\n withoutTrailing('b');\n\n expect(mockWith).toHaveBeenCalledExactlyOnceWith('a');\n expect(mockWithout).toHaveBeenCalledExactlyOnceWith('a');\n\n await sleep(8 * UT);\n\n expect(mockWith).toHaveBeenCalledTimes(2);\n expect(mockWithout).toHaveBeenCalledTimes(1);\n });\n\n it('should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, 64, { trailing: false });\n throttled();\n throttled();\n await sleep(3 * UT);\n throttled();\n throttled();\n await sleep(3 * UT);\n\n expect(mockFn).toHaveBeenCalledExactlyOnceWith();\n });\n});\n\ndescribe('https://github.com/lodash/lodash/blob/4.17.21/test/test.js#L23038', () => {\n it('should use a default `wait` of `0`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn);\n throttled();\n await sleep(UT);\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n });\n\n it('supports recursive calls', async () => {\n const actual = [] as Array<string>;\n const queue = ['a', 'b', 'c'];\n const throttled = throttle((chr: string) => {\n actual.push(chr);\n const next = queue.shift();\n if (next !== undefined) {\n throttled(next);\n }\n }, UT);\n throttled(queue.shift()!);\n\n expect(actual).toStrictEqual(['a']);\n\n await sleep(8 * UT);\n\n expect(actual).toStrictEqual(['a', 'b', 'c']);\n });\n\n it('should support cancelling delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false });\n throttled();\n throttled.cancel();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n\n it('should reset `lastCalled` after cancelling', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: true });\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n throttled.cancel();\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(2);\n\n throttled();\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(3);\n });\n\n it('should support flushing delayed calls', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false });\n throttled();\n throttled.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(1);\n });\n\n it('should noop `cancel` and `flush` when nothing is queued', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT);\n throttled.cancel();\n throttled.flush();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n\ndescribe('not tested by Lodash', () => {\n it('should do nothing when `leading` and `trailing` are both `disabled`', async () => {\n const mockFn = vi.fn<() => void>();\n const throttled = throttle(mockFn, UT, { leading: false, trailing: false });\n throttled();\n throttled();\n throttled();\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n\n await sleep(2 * UT);\n\n expect(mockFn).toHaveBeenCalledTimes(0);\n });\n});\n"],"mappings":"0HAmCA,SAAS,EACP,EACA,EAAO,EACP,CACE,UAAU,GACV,WAAW,IACoD,EAAE,CACnE,CACA,GAAM,CACJ,OAEA,OAAQ,EACR,GAAG,GACD,EACD,GAAwB,CACnB,CAAC,GAAW,CAAC,GAgBjB,EAAK,GAAG,EAAK,EAEf,CAEE,SAAU,EAAG,GAAG,IAAwB,EACxC,iBAAkB,EAClB,mBAAoB,EACpB,GAAI,EACA,EACE,CAAE,UAAW,OAAQ,CACrB,CAAE,UAAW,MAAO,CACtB,CAAE,UAAW,QAAS,CAC3B,CACF,CAOD,OAAO,OAAO,OAAO,EAAM,EAAK,CAYlC,EAAS,wEAA2E,CAClF,EAAG,6BAA8B,SAAY,CAC3C,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAG,CACtC,GAAW,CACX,GAAW,CACX,GAAW,CACX,IAAM,EAAY,EAAO,KAAK,MAAM,OAEpC,EAAO,EAAU,CAAC,gBAAgB,EAAE,CAEpC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,KAAK,MAAM,OAAO,CAAC,gBAAgB,EAAU,EAC3D,CAEF,EAAG,6CAA8C,SAAY,CAC3D,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAG,CACtC,GAAW,CAEX,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,GAAW,CAEX,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,CAEF,EAAG,uDAAwD,SAAY,CACrE,IAAM,EA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,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF,CAEF,EAAS,2BAA8B,CACrC,EAAG,sEAAuE,SAAY,CACpF,IAAM,EAAS,EAAG,IAAgB,CAC5B,EAAY,EAAS,EAAQ,GAAI,CAAE,QAAS,GAAO,SAAU,GAAO,CAAC,CAC3E,GAAW,CACX,GAAW,CACX,GAAW,CAEX,EAAO,EAAO,CAAC,sBAAsB,EAAE,CAEvC,MAAM,EAAM,GAAO,CAEnB,EAAO,EAAO,CAAC,sBAAsB,EAAE,EACvC,EACF"}
@@ -1 +1 @@
1
- const e=require(`./dist-gvJoKj_M.cjs`),t=require(`./constant-BuIJ9GIn.cjs`),n=require(`./funnel-CL-QFpGk.cjs`),r=require(`./identity-BAryUWbs.cjs`),i=require(`./sleep-1rGV3wAg.cjs`);function a(e,{timing:t,waitMs:r,maxWaitMs:i}){if(i!==void 0&&r!==void 0&&i<r)throw Error(`debounce: maxWaitMs (${i.toString()}) cannot be less than waitMs (${r.toString()})`);let a,o=n.funnel(t=>{a=e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:r??i??0,...i!==void 0&&{maxBurstDurationMs:i},...t===`leading`?{triggerAt:`start`}:t===`both`?{triggerAt:`both`}:{triggerAt:`end`}});return{call:(...e)=>(o.call(...e),a),flush:()=>(o.flush(),a),cancel:()=>{o.cancel()},get isPending(){return!o.isIdle},get cachedValue(){return a}}}e.describe(`main functionality`,()=>{e.it(`should debounce a function`,async()=>{let t=e.vi.fn(r.identity()),n=a(t,{waitMs:32});e.globalExpect([n.call(`a`),n.call(`b`),n.call(`c`)]).toStrictEqual([void 0,void 0,void 0]),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(128),e.globalExpect(t).toHaveBeenCalledTimes(1),e.globalExpect([n.call(`d`),n.call(`e`),n.call(`f`)]).toStrictEqual([`c`,`c`,`c`]),e.globalExpect(t).toHaveBeenCalledTimes(1),await i.sleep(256),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("subsequent debounced calls return the last `func` result",async()=>{let t=a(r.identity(),{waitMs:32});t.call(`a`),await i.sleep(64),e.globalExpect(t.call(`b`)).toBe(`a`),await i.sleep(128),e.globalExpect(t.call(`c`)).toBe(`b`)}),e.it("should not immediately call `func` when `wait` is `0`",async()=>{let t=e.vi.fn(),n=a(t,{});n.call(),n.call(),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(5),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it(`should apply default options`,async()=>{let t=e.vi.fn();a(t,{waitMs:32}).call(),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("should support a `leading` option",async()=>{let t=e.vi.fn(),n=e.vi.fn(),r=a(t,{waitMs:32,timing:`leading`});r.call(),e.globalExpect(t).toHaveBeenCalledTimes(1);let o=a(n,{waitMs:32,timing:`both`});o.call(),o.call(),e.globalExpect(n).toHaveBeenCalledTimes(1),await i.sleep(64),e.globalExpect(n).toHaveBeenCalledTimes(2),r.call(),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("subsequent leading debounced calls return the last `func` result",async()=>{let t=a(r.identity(),{waitMs:32,timing:`leading`});e.globalExpect([t.call(`a`),t.call(`b`)]).toStrictEqual([`a`,`a`]),await i.sleep(64),e.globalExpect([t.call(`c`),t.call(`d`)]).toStrictEqual([`c`,`c`])}),e.it("should support a `trailing` option",async()=>{let t=e.vi.fn();a(t,{waitMs:32,timing:`trailing`}).call(),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(64),e.globalExpect(t).toHaveBeenCalledTimes(1)})}),e.describe(`optional param maxWaitMs`,()=>{e.it("should support a `maxWait` option",async()=>{let t=e.vi.fn(),n=a(t,{waitMs:32,maxWaitMs:64});n.call(`a`),n.call(`b`),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(128),e.globalExpect(t).toHaveBeenCalledTimes(1),n.call(`c`),n.call(`d`),e.globalExpect(t).toHaveBeenCalledTimes(1),await i.sleep(256),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should support `maxWait` in a tight loop",async()=>{let t=e.vi.fn(),n=e.vi.fn(),r=a(t,{waitMs:32,maxWaitMs:128}),o=a(n,{waitMs:96}),s=Date.now();for(;Date.now()-s<320;)r.call(),o.call();await i.sleep(1),e.globalExpect(n).toHaveBeenCalledTimes(0),e.globalExpect(t).not.toHaveBeenCalledTimes(0)}),e.it("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let t=e.vi.fn(),n=a(t,{waitMs:200,maxWaitMs:200});n.call(),setTimeout(()=>{n.call()},190),setTimeout(()=>{n.call()},200),setTimeout(()=>{n.call()},210),await i.sleep(500),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let t=e.vi.fn(),n=a(t,{waitMs:32,maxWaitMs:64});n.call(),await i.sleep(128),n.call(),e.globalExpect(t).toHaveBeenCalledTimes(1),await i.sleep(192),e.globalExpect(t).toHaveBeenCalledTimes(2)}),e.it(`works like a leaky bucket when only maxWaitMs is set`,async()=>{let t=e.vi.fn(),n=a(t,{maxWaitMs:32});n.call(),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(16),n.call(),e.globalExpect(t).toHaveBeenCalledTimes(0),await i.sleep(17),e.globalExpect(t).toHaveBeenCalledTimes(1)})}),e.describe(`additional functionality`,()=>{e.it(`can cancel before the timer starts`,async()=>{let t=a(r.identity(),{waitMs:32});e.globalExpect(()=>{t.cancel()}).not.toThrow(),e.globalExpect(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.globalExpect(t.call(`world`)).toBe(`hello`)}),e.it(`can cancel the timer`,async()=>{let n=e.vi.fn(t.constant(`Hello, World!`)),r=a(n,{waitMs:32});e.globalExpect(r.call()).toBeUndefined(),e.globalExpect(n).toHaveBeenCalledTimes(0),await i.sleep(1),e.globalExpect(r.call()).toBeUndefined(),e.globalExpect(n).toHaveBeenCalledTimes(0),r.cancel(),await i.sleep(32),e.globalExpect(r.call()).toBeUndefined(),e.globalExpect(n).toHaveBeenCalledTimes(0),await i.sleep(32),e.globalExpect(r.call()).toBe(`Hello, World!`),e.globalExpect(n).toHaveBeenCalledTimes(1)}),e.it(`can cancel after the timer ends`,async()=>{let t=a(r.identity(),{waitMs:32});e.globalExpect(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.globalExpect(t.call(`world`)).toBe(`hello`),e.globalExpect(()=>{t.cancel()}).not.toThrow()}),e.it(`can cancel maxWait timer`,async()=>{let t=a(r.identity(),{waitMs:16,maxWaitMs:32});e.globalExpect(t.call(`hello`)).toBeUndefined(),await i.sleep(1),t.cancel(),await i.sleep(32),e.globalExpect(t.call(`world`)).toBeUndefined()}),e.it(`can return a cached value`,()=>{let t=a(r.identity(),{timing:`leading`,waitMs:32});e.globalExpect(t.cachedValue).toBeUndefined(),e.globalExpect(t.call(`hello`)).toBe(`hello`),e.globalExpect(t.cachedValue).toBe(`hello`)}),e.it(`can check for inflight timers (trailing)`,async()=>{let t=a(r.identity(),{waitMs:32});e.globalExpect(t.isPending).toBe(!1),e.globalExpect(t.call(`hello`)).toBeUndefined(),e.globalExpect(t.isPending).toBe(!0),await i.sleep(1),e.globalExpect(t.isPending).toBe(!0),await i.sleep(32),e.globalExpect(t.isPending).toBe(!1)}),e.it(`can check for inflight timers (leading)`,async()=>{let t=a(r.identity(),{timing:`leading`,waitMs:32});e.globalExpect(t.isPending).toBe(!1),e.globalExpect(t.call(`hello`)).toBe(`hello`),e.globalExpect(t.isPending).toBe(!0),await i.sleep(1),e.globalExpect(t.isPending).toBe(!0),await i.sleep(32),e.globalExpect(t.isPending).toBe(!1)}),e.it(`can flush before a cool-down`,async()=>{let t=a(r.identity(),{waitMs:32});e.globalExpect(t.flush()).toBeUndefined(),e.globalExpect(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.globalExpect(t.call(`world`)).toBe(`hello`)}),e.it(`can flush during a cool-down`,async()=>{let t=a(r.identity(),{waitMs:32});e.globalExpect(t.call(`hello`)).toBeUndefined(),await i.sleep(1),e.globalExpect(t.call(`world`)).toBeUndefined(),await i.sleep(1),e.globalExpect(t.flush()).toBe(`world`)}),e.it(`can flush after a cool-down`,async()=>{let t=a(r.identity(),{waitMs:32});e.globalExpect(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.globalExpect(t.flush()).toBe(`hello`)})}),e.describe(`errors`,()=>{e.it(`prevents maxWaitMs to be less then waitMs`,()=>{e.globalExpect(()=>a(r.identity(),{waitMs:32,maxWaitMs:16})).toThrow(`debounce: maxWaitMs (16) cannot be less than waitMs (32)`)})});
1
+ const e=require(`./dist-CiyBKPT6.cjs`),t=require(`./constant.cjs`),n=require(`./funnel.cjs`),r=require(`./identity.cjs`),i=require(`./sleep.cjs`);function a(e,{timing:t,waitMs:r,maxWaitMs:i}){if(i!==void 0&&r!==void 0&&i<r)throw Error(`debounce: maxWaitMs (${i.toString()}) cannot be less than waitMs (${r.toString()})`);let a,o=n.funnel(t=>{a=e(...t)},{reducer:(e,...t)=>t,minQuietPeriodMs:r??i??0,...i!==void 0&&{maxBurstDurationMs:i},...t===`leading`?{triggerAt:`start`}:t===`both`?{triggerAt:`both`}:{triggerAt:`end`}});return{call:(...e)=>(o.call(...e),a),flush:()=>(o.flush(),a),cancel:()=>{o.cancel()},get isPending(){return!o.isIdle},get cachedValue(){return a}}}e.i(`main functionality`,()=>{e.a(`should debounce a function`,async()=>{let t=e.r.fn(r.identity()),n=a(t,{waitMs:32});e.n([n.call(`a`),n.call(`b`),n.call(`c`)]).toStrictEqual([void 0,void 0,void 0]),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(128),e.n(t).toHaveBeenCalledTimes(1),e.n([n.call(`d`),n.call(`e`),n.call(`f`)]).toStrictEqual([`c`,`c`,`c`]),e.n(t).toHaveBeenCalledTimes(1),await i.sleep(256),e.n(t).toHaveBeenCalledTimes(2)}),e.a("subsequent debounced calls return the last `func` result",async()=>{let t=a(r.identity(),{waitMs:32});t.call(`a`),await i.sleep(64),e.n(t.call(`b`)).toBe(`a`),await i.sleep(128),e.n(t.call(`c`)).toBe(`b`)}),e.a("should not immediately call `func` when `wait` is `0`",async()=>{let t=e.r.fn(),n=a(t,{});n.call(),n.call(),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(5),e.n(t).toHaveBeenCalledTimes(1)}),e.a(`should apply default options`,async()=>{let t=e.r.fn();a(t,{waitMs:32}).call(),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(64),e.n(t).toHaveBeenCalledTimes(1)}),e.a("should support a `leading` option",async()=>{let t=e.r.fn(),n=e.r.fn(),r=a(t,{waitMs:32,timing:`leading`});r.call(),e.n(t).toHaveBeenCalledTimes(1);let o=a(n,{waitMs:32,timing:`both`});o.call(),o.call(),e.n(n).toHaveBeenCalledTimes(1),await i.sleep(64),e.n(n).toHaveBeenCalledTimes(2),r.call(),e.n(t).toHaveBeenCalledTimes(2)}),e.a("subsequent leading debounced calls return the last `func` result",async()=>{let t=a(r.identity(),{waitMs:32,timing:`leading`});e.n([t.call(`a`),t.call(`b`)]).toStrictEqual([`a`,`a`]),await i.sleep(64),e.n([t.call(`c`),t.call(`d`)]).toStrictEqual([`c`,`c`])}),e.a("should support a `trailing` option",async()=>{let t=e.r.fn();a(t,{waitMs:32,timing:`trailing`}).call(),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(64),e.n(t).toHaveBeenCalledTimes(1)})}),e.i(`optional param maxWaitMs`,()=>{e.a("should support a `maxWait` option",async()=>{let t=e.r.fn(),n=a(t,{waitMs:32,maxWaitMs:64});n.call(`a`),n.call(`b`),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(128),e.n(t).toHaveBeenCalledTimes(1),n.call(`c`),n.call(`d`),e.n(t).toHaveBeenCalledTimes(1),await i.sleep(256),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should support `maxWait` in a tight loop",async()=>{let t=e.r.fn(),n=e.r.fn(),r=a(t,{waitMs:32,maxWaitMs:128}),o=a(n,{waitMs:96}),s=Date.now();for(;Date.now()-s<320;)r.call(),o.call();await i.sleep(1),e.n(n).toHaveBeenCalledTimes(0),e.n(t).not.toHaveBeenCalledTimes(0)}),e.a("should queue a trailing call for subsequent debounced calls after `maxWait`",async()=>{let t=e.r.fn(),n=a(t,{waitMs:200,maxWaitMs:200});n.call(),setTimeout(()=>{n.call()},190),setTimeout(()=>{n.call()},200),setTimeout(()=>{n.call()},210),await i.sleep(500),e.n(t).toHaveBeenCalledTimes(2)}),e.a("should cancel `maxDelayed` when `delayed` is invoked",async()=>{let t=e.r.fn(),n=a(t,{waitMs:32,maxWaitMs:64});n.call(),await i.sleep(128),n.call(),e.n(t).toHaveBeenCalledTimes(1),await i.sleep(192),e.n(t).toHaveBeenCalledTimes(2)}),e.a(`works like a leaky bucket when only maxWaitMs is set`,async()=>{let t=e.r.fn(),n=a(t,{maxWaitMs:32});n.call(),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(16),n.call(),e.n(t).toHaveBeenCalledTimes(0),await i.sleep(17),e.n(t).toHaveBeenCalledTimes(1)})}),e.i(`additional functionality`,()=>{e.a(`can cancel before the timer starts`,async()=>{let t=a(r.identity(),{waitMs:32});e.n(()=>{t.cancel()}).not.toThrow(),e.n(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.n(t.call(`world`)).toBe(`hello`)}),e.a(`can cancel the timer`,async()=>{let n=e.r.fn(t.constant(`Hello, World!`)),r=a(n,{waitMs:32});e.n(r.call()).toBeUndefined(),e.n(n).toHaveBeenCalledTimes(0),await i.sleep(1),e.n(r.call()).toBeUndefined(),e.n(n).toHaveBeenCalledTimes(0),r.cancel(),await i.sleep(32),e.n(r.call()).toBeUndefined(),e.n(n).toHaveBeenCalledTimes(0),await i.sleep(32),e.n(r.call()).toBe(`Hello, World!`),e.n(n).toHaveBeenCalledTimes(1)}),e.a(`can cancel after the timer ends`,async()=>{let t=a(r.identity(),{waitMs:32});e.n(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.n(t.call(`world`)).toBe(`hello`),e.n(()=>{t.cancel()}).not.toThrow()}),e.a(`can cancel maxWait timer`,async()=>{let t=a(r.identity(),{waitMs:16,maxWaitMs:32});e.n(t.call(`hello`)).toBeUndefined(),await i.sleep(1),t.cancel(),await i.sleep(32),e.n(t.call(`world`)).toBeUndefined()}),e.a(`can return a cached value`,()=>{let t=a(r.identity(),{timing:`leading`,waitMs:32});e.n(t.cachedValue).toBeUndefined(),e.n(t.call(`hello`)).toBe(`hello`),e.n(t.cachedValue).toBe(`hello`)}),e.a(`can check for inflight timers (trailing)`,async()=>{let t=a(r.identity(),{waitMs:32});e.n(t.isPending).toBe(!1),e.n(t.call(`hello`)).toBeUndefined(),e.n(t.isPending).toBe(!0),await i.sleep(1),e.n(t.isPending).toBe(!0),await i.sleep(32),e.n(t.isPending).toBe(!1)}),e.a(`can check for inflight timers (leading)`,async()=>{let t=a(r.identity(),{timing:`leading`,waitMs:32});e.n(t.isPending).toBe(!1),e.n(t.call(`hello`)).toBe(`hello`),e.n(t.isPending).toBe(!0),await i.sleep(1),e.n(t.isPending).toBe(!0),await i.sleep(32),e.n(t.isPending).toBe(!1)}),e.a(`can flush before a cool-down`,async()=>{let t=a(r.identity(),{waitMs:32});e.n(t.flush()).toBeUndefined(),e.n(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.n(t.call(`world`)).toBe(`hello`)}),e.a(`can flush during a cool-down`,async()=>{let t=a(r.identity(),{waitMs:32});e.n(t.call(`hello`)).toBeUndefined(),await i.sleep(1),e.n(t.call(`world`)).toBeUndefined(),await i.sleep(1),e.n(t.flush()).toBe(`world`)}),e.a(`can flush after a cool-down`,async()=>{let t=a(r.identity(),{waitMs:32});e.n(t.call(`hello`)).toBeUndefined(),await i.sleep(32),e.n(t.flush()).toBe(`hello`)})}),e.i(`errors`,()=>{e.a(`prevents maxWaitMs to be less then waitMs`,()=>{e.n(()=>a(r.identity(),{waitMs:32,maxWaitMs:16})).toThrow(`debounce: maxWaitMs (16) cannot be less than waitMs (32)`)})});