@vinicunca/perkakas 1.13.2 → 1.14.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 (1524) hide show
  1. package/dist/add-prop.cjs +2 -1
  2. package/dist/add-prop.cjs.map +1 -0
  3. package/dist/add-prop.js +1 -1
  4. package/dist/add-prop.js.map +1 -1
  5. package/dist/add.cjs +2 -1
  6. package/dist/add.cjs.map +1 -0
  7. package/dist/add.js +1 -1
  8. package/dist/add.js.map +1 -1
  9. package/dist/all-pass.cjs +2 -1
  10. package/dist/all-pass.cjs.map +1 -0
  11. package/dist/all-pass.js +1 -1
  12. package/dist/all-pass.js.map +1 -1
  13. package/dist/any-pass.cjs +2 -1
  14. package/dist/any-pass.cjs.map +1 -0
  15. package/dist/any-pass.js +1 -1
  16. package/dist/any-pass.js.map +1 -1
  17. package/dist/binary-search-cutoff-index-CLFtXYPc.cjs +2 -0
  18. package/dist/binary-search-cutoff-index-CLFtXYPc.cjs.map +1 -0
  19. package/dist/binary-search-cutoff-index-TJlnoie4.js +2 -0
  20. package/dist/binary-search-cutoff-index-TJlnoie4.js.map +1 -0
  21. package/dist/capitalize.cjs +2 -1
  22. package/dist/capitalize.cjs.map +1 -0
  23. package/dist/capitalize.js +1 -1
  24. package/dist/capitalize.js.map +1 -1
  25. package/dist/ceil.cjs +2 -1
  26. package/dist/ceil.cjs.map +1 -0
  27. package/dist/ceil.js +1 -1
  28. package/dist/ceil.js.map +1 -1
  29. package/dist/chunk.cjs +2 -1
  30. package/dist/chunk.cjs.map +1 -0
  31. package/dist/chunk.js +1 -1
  32. package/dist/chunk.js.map +1 -1
  33. package/dist/clamp.cjs +2 -1
  34. package/dist/clamp.cjs.map +1 -0
  35. package/dist/clamp.js +1 -1
  36. package/dist/clamp.js.map +1 -1
  37. package/dist/clone.cjs +2 -1
  38. package/dist/clone.cjs.map +1 -0
  39. package/dist/clone.js +1 -1
  40. package/dist/clone.js.map +1 -1
  41. package/dist/concat.cjs +2 -1
  42. package/dist/concat.cjs.map +1 -0
  43. package/dist/concat.js +1 -1
  44. package/dist/concat.js.map +1 -1
  45. package/dist/conditional-3wcaMG9k.cjs +2 -0
  46. package/dist/conditional-3wcaMG9k.cjs.map +1 -0
  47. package/dist/conditional-CTEJD5TX.js +2 -0
  48. package/dist/conditional-CTEJD5TX.js.map +1 -0
  49. package/dist/conditional.cjs +1 -1
  50. package/dist/conditional.js +1 -1
  51. package/dist/constant.cjs +2 -1
  52. package/dist/constant.cjs.map +1 -0
  53. package/dist/constant.js.map +1 -1
  54. package/dist/count-by.cjs +2 -1
  55. package/dist/count-by.cjs.map +1 -0
  56. package/dist/count-by.js +1 -1
  57. package/dist/count-by.js.map +1 -1
  58. package/dist/curry-from-lazy-BvN_VKlH.cjs +2 -0
  59. package/dist/curry-from-lazy-BvN_VKlH.cjs.map +1 -0
  60. package/dist/curry-from-lazy-CtH1dp14.js +2 -0
  61. package/dist/curry-from-lazy-CtH1dp14.js.map +1 -0
  62. package/dist/curry-order-rules-BLyCSMdZ.js +2 -0
  63. package/dist/curry-order-rules-BLyCSMdZ.js.map +1 -0
  64. package/dist/curry-order-rules-DsJSy3gX.cjs +2 -0
  65. package/dist/curry-order-rules-DsJSy3gX.cjs.map +1 -0
  66. package/dist/curry.cjs +2 -1
  67. package/dist/curry.cjs.map +1 -0
  68. package/dist/curry.js +2 -1
  69. package/dist/curry.js.map +1 -0
  70. package/dist/debounce.cjs +2 -1
  71. package/dist/debounce.cjs.map +1 -0
  72. package/dist/debounce.js +1 -1
  73. package/dist/debounce.js.map +1 -1
  74. package/dist/default-to.cjs +2 -0
  75. package/dist/default-to.cjs.map +1 -0
  76. package/dist/default-to.js +2 -0
  77. package/dist/default-to.js.map +1 -0
  78. package/dist/difference-with.cjs +2 -1
  79. package/dist/difference-with.cjs.map +1 -0
  80. package/dist/difference-with.js +1 -1
  81. package/dist/difference-with.js.map +1 -1
  82. package/dist/difference.cjs +2 -1
  83. package/dist/difference.cjs.map +1 -0
  84. package/dist/difference.js +1 -1
  85. package/dist/difference.js.map +1 -1
  86. package/dist/divide.cjs +2 -1
  87. package/dist/divide.cjs.map +1 -0
  88. package/dist/divide.js +1 -1
  89. package/dist/divide.js.map +1 -1
  90. package/dist/do-nothing.cjs +2 -1
  91. package/dist/do-nothing.cjs.map +1 -0
  92. package/dist/do-nothing.js.map +1 -1
  93. package/dist/drop-first-by.cjs +2 -1
  94. package/dist/drop-first-by.cjs.map +1 -0
  95. package/dist/drop-first-by.js +1 -1
  96. package/dist/drop-first-by.js.map +1 -1
  97. package/dist/drop-last-while.cjs +2 -1
  98. package/dist/drop-last-while.cjs.map +1 -0
  99. package/dist/drop-last-while.js +1 -1
  100. package/dist/drop-last-while.js.map +1 -1
  101. package/dist/drop-last.cjs +2 -1
  102. package/dist/drop-last.cjs.map +1 -0
  103. package/dist/drop-last.js +1 -1
  104. package/dist/drop-last.js.map +1 -1
  105. package/dist/drop-while.cjs +2 -1
  106. package/dist/drop-while.cjs.map +1 -0
  107. package/dist/drop-while.js +1 -1
  108. package/dist/drop-while.js.map +1 -1
  109. package/dist/drop.cjs +2 -1
  110. package/dist/drop.cjs.map +1 -0
  111. package/dist/drop.js +1 -1
  112. package/dist/drop.js.map +1 -1
  113. package/dist/ends-with.cjs +2 -0
  114. package/dist/ends-with.cjs.map +1 -0
  115. package/dist/ends-with.js +2 -0
  116. package/dist/ends-with.js.map +1 -0
  117. package/dist/entries.cjs +2 -1
  118. package/dist/entries.cjs.map +1 -0
  119. package/dist/entries.js +1 -1
  120. package/dist/entries.js.map +1 -1
  121. package/dist/evolve.cjs +2 -1
  122. package/dist/evolve.cjs.map +1 -0
  123. package/dist/evolve.js +1 -1
  124. package/dist/evolve.js.map +1 -1
  125. package/dist/filter.cjs +2 -1
  126. package/dist/filter.cjs.map +1 -0
  127. package/dist/filter.js +1 -1
  128. package/dist/filter.js.map +1 -1
  129. package/dist/find-index.cjs +2 -1
  130. package/dist/find-index.cjs.map +1 -0
  131. package/dist/find-index.js +1 -1
  132. package/dist/find-index.js.map +1 -1
  133. package/dist/find-last-index.cjs +2 -1
  134. package/dist/find-last-index.cjs.map +1 -0
  135. package/dist/find-last-index.js +1 -1
  136. package/dist/find-last-index.js.map +1 -1
  137. package/dist/find-last.cjs +2 -1
  138. package/dist/find-last.cjs.map +1 -0
  139. package/dist/find-last.js +1 -1
  140. package/dist/find-last.js.map +1 -1
  141. package/dist/find.cjs +2 -1
  142. package/dist/find.cjs.map +1 -0
  143. package/dist/find.js +1 -1
  144. package/dist/find.js.map +1 -1
  145. package/dist/first-by.cjs +2 -1
  146. package/dist/first-by.cjs.map +1 -0
  147. package/dist/first-by.js +1 -1
  148. package/dist/first-by.js.map +1 -1
  149. package/dist/first.cjs +2 -1
  150. package/dist/first.cjs.map +1 -0
  151. package/dist/first.js +1 -1
  152. package/dist/first.js.map +1 -1
  153. package/dist/flat-map.cjs +2 -1
  154. package/dist/flat-map.cjs.map +1 -0
  155. package/dist/flat-map.js +1 -1
  156. package/dist/flat-map.js.map +1 -1
  157. package/dist/flat.cjs +2 -1
  158. package/dist/flat.cjs.map +1 -0
  159. package/dist/flat.js +1 -1
  160. package/dist/flat.js.map +1 -1
  161. package/dist/floor.cjs +2 -1
  162. package/dist/floor.cjs.map +1 -0
  163. package/dist/floor.js +1 -1
  164. package/dist/floor.js.map +1 -1
  165. package/dist/for-each-obj.cjs +2 -1
  166. package/dist/for-each-obj.cjs.map +1 -0
  167. package/dist/for-each-obj.js +1 -1
  168. package/dist/for-each-obj.js.map +1 -1
  169. package/dist/for-each.cjs +2 -1
  170. package/dist/for-each.cjs.map +1 -0
  171. package/dist/for-each.js +1 -1
  172. package/dist/for-each.js.map +1 -1
  173. package/dist/from-entries.cjs +2 -1
  174. package/dist/from-entries.cjs.map +1 -0
  175. package/dist/from-entries.js +1 -1
  176. package/dist/from-entries.js.map +1 -1
  177. package/dist/from-keys.cjs +2 -1
  178. package/dist/from-keys.cjs.map +1 -0
  179. package/dist/from-keys.js +1 -1
  180. package/dist/from-keys.js.map +1 -1
  181. package/dist/funnel.cjs +2 -1
  182. package/dist/funnel.cjs.map +1 -0
  183. package/dist/funnel.js +1 -1
  184. package/dist/funnel.js.map +1 -1
  185. package/dist/group-by-prop.cjs +2 -1
  186. package/dist/group-by-prop.cjs.map +1 -0
  187. package/dist/group-by-prop.js +1 -1
  188. package/dist/group-by-prop.js.map +1 -1
  189. package/dist/group-by.cjs +2 -1
  190. package/dist/group-by.cjs.map +1 -0
  191. package/dist/group-by.js +1 -1
  192. package/dist/group-by.js.map +1 -1
  193. package/dist/has-at-least.cjs +2 -1
  194. package/dist/has-at-least.cjs.map +1 -0
  195. package/dist/has-at-least.js +2 -1
  196. package/dist/has-at-least.js.map +1 -0
  197. package/dist/has-sub-object.cjs +2 -1
  198. package/dist/has-sub-object.cjs.map +1 -0
  199. package/dist/has-sub-object.js +1 -1
  200. package/dist/has-sub-object.js.map +1 -1
  201. package/dist/heap-C0zPQGC0.cjs +2 -0
  202. package/dist/heap-C0zPQGC0.cjs.map +1 -0
  203. package/dist/heap-M6D40vkc.js +2 -0
  204. package/dist/heap-M6D40vkc.js.map +1 -0
  205. package/dist/human-readable-file-size.cjs +2 -1
  206. package/dist/human-readable-file-size.cjs.map +1 -0
  207. package/dist/identity.cjs +2 -1
  208. package/dist/identity.cjs.map +1 -0
  209. package/dist/identity.js +1 -1
  210. package/dist/identity.js.map +1 -1
  211. package/dist/index-by.cjs +2 -1
  212. package/dist/index-by.cjs.map +1 -0
  213. package/dist/index-by.js +1 -1
  214. package/dist/index-by.js.map +1 -1
  215. package/dist/index.cjs +2 -1
  216. package/dist/index.cjs.map +1 -0
  217. package/dist/index.d.cts +12489 -158
  218. package/dist/index.d.cts.map +1 -1
  219. package/dist/index.d.ts +12489 -158
  220. package/dist/index.d.ts.map +1 -1
  221. package/dist/index.js +1 -1
  222. package/dist/index.js.map +1 -1
  223. package/dist/intersection-with.cjs +2 -1
  224. package/dist/intersection-with.cjs.map +1 -0
  225. package/dist/intersection-with.js +1 -1
  226. package/dist/intersection-with.js.map +1 -1
  227. package/dist/intersection.cjs +2 -1
  228. package/dist/intersection.cjs.map +1 -0
  229. package/dist/intersection.js +1 -1
  230. package/dist/intersection.js.map +1 -1
  231. package/dist/invert.cjs +2 -1
  232. package/dist/invert.cjs.map +1 -0
  233. package/dist/invert.js +1 -1
  234. package/dist/invert.js.map +1 -1
  235. package/dist/is-array.cjs +2 -1
  236. package/dist/is-array.cjs.map +1 -0
  237. package/dist/is-array.js.map +1 -1
  238. package/dist/is-big-int.cjs +2 -1
  239. package/dist/is-big-int.cjs.map +1 -0
  240. package/dist/is-big-int.js.map +1 -1
  241. package/dist/is-boolean.cjs +2 -1
  242. package/dist/is-boolean.cjs.map +1 -0
  243. package/dist/is-boolean.js.map +1 -1
  244. package/dist/is-date.cjs +2 -1
  245. package/dist/is-date.cjs.map +1 -0
  246. package/dist/is-date.js.map +1 -1
  247. package/dist/is-deep-equal.cjs +2 -1
  248. package/dist/is-deep-equal.cjs.map +1 -0
  249. package/dist/is-deep-equal.js +1 -1
  250. package/dist/is-deep-equal.js.map +1 -1
  251. package/dist/is-defined.cjs +2 -1
  252. package/dist/is-defined.cjs.map +1 -0
  253. package/dist/is-defined.js.map +1 -1
  254. package/dist/is-empty.cjs +2 -1
  255. package/dist/is-empty.cjs.map +1 -0
  256. package/dist/is-empty.js +1 -1
  257. package/dist/is-empty.js.map +1 -1
  258. package/dist/is-emptyish.cjs +2 -1
  259. package/dist/is-emptyish.cjs.map +1 -0
  260. package/dist/is-emptyish.js.map +1 -1
  261. package/dist/is-error.cjs +2 -1
  262. package/dist/is-error.cjs.map +1 -0
  263. package/dist/is-error.js.map +1 -1
  264. package/dist/is-function.cjs +2 -1
  265. package/dist/is-function.cjs.map +1 -0
  266. package/dist/is-function.js.map +1 -1
  267. package/dist/is-included-in.cjs +2 -1
  268. package/dist/is-included-in.cjs.map +1 -0
  269. package/dist/is-included-in.js.map +1 -1
  270. package/dist/is-non-null.cjs +2 -1
  271. package/dist/is-non-null.cjs.map +1 -0
  272. package/dist/is-non-null.js.map +1 -1
  273. package/dist/is-non-nullish.cjs +2 -1
  274. package/dist/is-non-nullish.cjs.map +1 -0
  275. package/dist/is-non-nullish.js.map +1 -1
  276. package/dist/is-not.cjs +2 -1
  277. package/dist/is-not.cjs.map +1 -0
  278. package/dist/is-not.js.map +1 -1
  279. package/dist/is-nullish.cjs +2 -1
  280. package/dist/is-nullish.cjs.map +1 -0
  281. package/dist/is-nullish.js.map +1 -1
  282. package/dist/is-number.cjs +2 -1
  283. package/dist/is-number.cjs.map +1 -0
  284. package/dist/is-number.js.map +1 -1
  285. package/dist/is-object-type.cjs +2 -1
  286. package/dist/is-object-type.cjs.map +1 -0
  287. package/dist/is-object-type.js.map +1 -1
  288. package/dist/is-plain-object.cjs +2 -1
  289. package/dist/is-plain-object.cjs.map +1 -0
  290. package/dist/is-plain-object.js.map +1 -1
  291. package/dist/is-promise.cjs +2 -1
  292. package/dist/is-promise.cjs.map +1 -0
  293. package/dist/is-promise.js.map +1 -1
  294. package/dist/is-shallow-equal.cjs +2 -1
  295. package/dist/is-shallow-equal.cjs.map +1 -0
  296. package/dist/is-shallow-equal.js +1 -1
  297. package/dist/is-shallow-equal.js.map +1 -1
  298. package/dist/is-strict-equal.cjs +2 -1
  299. package/dist/is-strict-equal.cjs.map +1 -0
  300. package/dist/is-strict-equal.js +1 -1
  301. package/dist/is-strict-equal.js.map +1 -1
  302. package/dist/is-string.cjs +2 -1
  303. package/dist/is-string.cjs.map +1 -0
  304. package/dist/is-string.js.map +1 -1
  305. package/dist/is-symbol.cjs +2 -1
  306. package/dist/is-symbol.cjs.map +1 -0
  307. package/dist/is-symbol.js.map +1 -1
  308. package/dist/is-truthy.cjs +2 -1
  309. package/dist/is-truthy.cjs.map +1 -0
  310. package/dist/is-truthy.js.map +1 -1
  311. package/dist/join.cjs +2 -1
  312. package/dist/join.cjs.map +1 -0
  313. package/dist/join.js +1 -1
  314. package/dist/join.js.map +1 -1
  315. package/dist/key-codes.cjs +2 -1
  316. package/dist/key-codes.cjs.map +1 -0
  317. package/dist/keys.cjs +2 -1
  318. package/dist/keys.cjs.map +1 -0
  319. package/dist/keys.js +1 -1
  320. package/dist/keys.js.map +1 -1
  321. package/dist/last.cjs +2 -1
  322. package/dist/last.cjs.map +1 -0
  323. package/dist/last.js +1 -1
  324. package/dist/last.js.map +1 -1
  325. package/dist/lazy-data-last-impl-B05ZpguF.cjs +2 -0
  326. package/dist/lazy-data-last-impl-B05ZpguF.cjs.map +1 -0
  327. package/dist/lazy-data-last-impl-Vt_M0l7X.js +2 -0
  328. package/dist/lazy-data-last-impl-Vt_M0l7X.js.map +1 -0
  329. package/dist/length.cjs +2 -1
  330. package/dist/length.cjs.map +1 -0
  331. package/dist/length.js +1 -1
  332. package/dist/length.js.map +1 -1
  333. package/dist/map-keys.cjs +2 -1
  334. package/dist/map-keys.cjs.map +1 -0
  335. package/dist/map-keys.js +1 -1
  336. package/dist/map-keys.js.map +1 -1
  337. package/dist/map-to-obj.cjs +2 -1
  338. package/dist/map-to-obj.cjs.map +1 -0
  339. package/dist/map-to-obj.js +1 -1
  340. package/dist/map-to-obj.js.map +1 -1
  341. package/dist/map-values.cjs +2 -1
  342. package/dist/map-values.cjs.map +1 -0
  343. package/dist/map-values.js +1 -1
  344. package/dist/map-values.js.map +1 -1
  345. package/dist/map-with-feedback.cjs +2 -1
  346. package/dist/map-with-feedback.cjs.map +1 -0
  347. package/dist/map-with-feedback.js +1 -1
  348. package/dist/map-with-feedback.js.map +1 -1
  349. package/dist/map.cjs +2 -1
  350. package/dist/map.cjs.map +1 -0
  351. package/dist/map.js +1 -1
  352. package/dist/map.js.map +1 -1
  353. package/dist/mean-by.cjs +2 -1
  354. package/dist/mean-by.cjs.map +1 -0
  355. package/dist/mean-by.js +1 -1
  356. package/dist/mean-by.js.map +1 -1
  357. package/dist/mean.cjs +2 -0
  358. package/dist/mean.cjs.map +1 -0
  359. package/dist/mean.js +2 -0
  360. package/dist/mean.js.map +1 -0
  361. package/dist/median.cjs +2 -0
  362. package/dist/median.cjs.map +1 -0
  363. package/dist/median.js +2 -0
  364. package/dist/median.js.map +1 -0
  365. package/dist/merge-all.cjs +2 -1
  366. package/dist/merge-all.cjs.map +1 -0
  367. package/dist/merge-all.js.map +1 -1
  368. package/dist/merge-deep.cjs +2 -1
  369. package/dist/merge-deep.cjs.map +1 -0
  370. package/dist/merge-deep.js +1 -1
  371. package/dist/merge-deep.js.map +1 -1
  372. package/dist/merge.cjs +2 -1
  373. package/dist/merge.cjs.map +1 -0
  374. package/dist/merge.js +1 -1
  375. package/dist/merge.js.map +1 -1
  376. package/dist/multiply.cjs +2 -1
  377. package/dist/multiply.cjs.map +1 -0
  378. package/dist/multiply.js +1 -1
  379. package/dist/multiply.js.map +1 -1
  380. package/dist/nth-by-DhfNV5xd.js +2 -0
  381. package/dist/nth-by-DhfNV5xd.js.map +1 -0
  382. package/dist/nth-by-zZ3RM-mR.cjs +2 -0
  383. package/dist/nth-by-zZ3RM-mR.cjs.map +1 -0
  384. package/dist/nth-by.cjs +1 -1
  385. package/dist/nth-by.js +1 -1
  386. package/dist/obj-of.cjs +2 -1
  387. package/dist/obj-of.cjs.map +1 -0
  388. package/dist/obj-of.js +1 -1
  389. package/dist/obj-of.js.map +1 -1
  390. package/dist/omit-by.cjs +2 -1
  391. package/dist/omit-by.cjs.map +1 -0
  392. package/dist/omit-by.js +1 -1
  393. package/dist/omit-by.js.map +1 -1
  394. package/dist/omit.cjs +2 -1
  395. package/dist/omit.cjs.map +1 -0
  396. package/dist/omit.js +1 -1
  397. package/dist/omit.js.map +1 -1
  398. package/dist/once.cjs +2 -1
  399. package/dist/once.cjs.map +1 -0
  400. package/dist/once.js.map +1 -1
  401. package/dist/only.cjs +2 -1
  402. package/dist/only.cjs.map +1 -0
  403. package/dist/only.js +1 -1
  404. package/dist/only.js.map +1 -1
  405. package/dist/partial-bind.cjs +2 -0
  406. package/dist/partial-bind.cjs.map +1 -0
  407. package/dist/partial-bind.js +2 -0
  408. package/dist/partial-bind.js.map +1 -0
  409. package/dist/partial-last-bind.cjs +2 -0
  410. package/dist/partial-last-bind.cjs.map +1 -0
  411. package/dist/partial-last-bind.js +2 -0
  412. package/dist/partial-last-bind.js.map +1 -0
  413. package/dist/partition.cjs +2 -1
  414. package/dist/partition.cjs.map +1 -0
  415. package/dist/partition.js +1 -1
  416. package/dist/partition.js.map +1 -1
  417. package/dist/path-or.cjs +2 -1
  418. package/dist/path-or.cjs.map +1 -0
  419. package/dist/path-or.js +1 -1
  420. package/dist/path-or.js.map +1 -1
  421. package/dist/pick-by.cjs +2 -1
  422. package/dist/pick-by.cjs.map +1 -0
  423. package/dist/pick-by.js +1 -1
  424. package/dist/pick-by.js.map +1 -1
  425. package/dist/pick.cjs +2 -1
  426. package/dist/pick.cjs.map +1 -0
  427. package/dist/pick.js +1 -1
  428. package/dist/pick.js.map +1 -1
  429. package/dist/pipe.cjs +2 -1
  430. package/dist/pipe.cjs.map +1 -0
  431. package/dist/pipe.js +2 -1
  432. package/dist/pipe.js.map +1 -0
  433. package/dist/piped.cjs +2 -1
  434. package/dist/piped.cjs.map +1 -0
  435. package/dist/piped.js +1 -1
  436. package/dist/piped.js.map +1 -1
  437. package/dist/product.cjs +2 -1
  438. package/dist/product.cjs.map +1 -0
  439. package/dist/product.js +1 -1
  440. package/dist/product.js.map +1 -1
  441. package/dist/prop.cjs +2 -1
  442. package/dist/prop.cjs.map +1 -0
  443. package/dist/prop.js.map +1 -1
  444. package/dist/pull-object.cjs +2 -1
  445. package/dist/pull-object.cjs.map +1 -0
  446. package/dist/pull-object.js +1 -1
  447. package/dist/pull-object.js.map +1 -1
  448. package/dist/random-big-int.cjs +2 -0
  449. package/dist/random-big-int.cjs.map +1 -0
  450. package/dist/random-big-int.js +2 -0
  451. package/dist/random-big-int.js.map +1 -0
  452. package/dist/random-integer.cjs +2 -1
  453. package/dist/random-integer.cjs.map +1 -0
  454. package/dist/random-integer.js +1 -1
  455. package/dist/random-integer.js.map +1 -1
  456. package/dist/random-string.cjs +2 -1
  457. package/dist/random-string.cjs.map +1 -0
  458. package/dist/random-string.js +1 -1
  459. package/dist/random-string.js.map +1 -1
  460. package/dist/range.cjs +2 -1
  461. package/dist/range.cjs.map +1 -0
  462. package/dist/range.js +1 -1
  463. package/dist/range.js.map +1 -1
  464. package/dist/rank-by.cjs +2 -1
  465. package/dist/rank-by.cjs.map +1 -0
  466. package/dist/rank-by.js +1 -1
  467. package/dist/rank-by.js.map +1 -1
  468. package/dist/reduce.cjs +2 -1
  469. package/dist/reduce.cjs.map +1 -0
  470. package/dist/reduce.js +1 -1
  471. package/dist/reduce.js.map +1 -1
  472. package/dist/reverse.cjs +2 -1
  473. package/dist/reverse.cjs.map +1 -0
  474. package/dist/reverse.js +1 -1
  475. package/dist/reverse.js.map +1 -1
  476. package/dist/round.cjs +2 -1
  477. package/dist/round.cjs.map +1 -0
  478. package/dist/round.js +1 -1
  479. package/dist/round.js.map +1 -1
  480. package/dist/sample.cjs +2 -1
  481. package/dist/sample.cjs.map +1 -0
  482. package/dist/sample.js +1 -1
  483. package/dist/sample.js.map +1 -1
  484. package/dist/set-path.cjs +2 -1
  485. package/dist/set-path.cjs.map +1 -0
  486. package/dist/set-path.js +1 -1
  487. package/dist/set-path.js.map +1 -1
  488. package/dist/set.cjs +2 -1
  489. package/dist/set.cjs.map +1 -0
  490. package/dist/set.js +1 -1
  491. package/dist/set.js.map +1 -1
  492. package/dist/shuffle.cjs +2 -1
  493. package/dist/shuffle.cjs.map +1 -0
  494. package/dist/shuffle.js +1 -1
  495. package/dist/shuffle.js.map +1 -1
  496. package/dist/sleep.cjs +2 -1
  497. package/dist/sleep.cjs.map +1 -0
  498. package/dist/slice-string.cjs +2 -1
  499. package/dist/slice-string.cjs.map +1 -0
  500. package/dist/slice-string.js.map +1 -1
  501. package/dist/slugify.cjs +2 -1
  502. package/dist/slugify.cjs.map +1 -0
  503. package/dist/sort-by.cjs +2 -1
  504. package/dist/sort-by.cjs.map +1 -0
  505. package/dist/sort-by.js +1 -1
  506. package/dist/sort-by.js.map +1 -1
  507. package/dist/sort.cjs +2 -1
  508. package/dist/sort.cjs.map +1 -0
  509. package/dist/sort.js +1 -1
  510. package/dist/sort.js.map +1 -1
  511. package/dist/sorted-index-by.cjs +2 -1
  512. package/dist/sorted-index-by.cjs.map +1 -0
  513. package/dist/sorted-index-by.js +1 -1
  514. package/dist/sorted-index-by.js.map +1 -1
  515. package/dist/sorted-index-with.cjs +2 -1
  516. package/dist/sorted-index-with.cjs.map +1 -0
  517. package/dist/sorted-index-with.js +1 -1
  518. package/dist/sorted-index-with.js.map +1 -1
  519. package/dist/sorted-index.cjs +2 -1
  520. package/dist/sorted-index.cjs.map +1 -0
  521. package/dist/sorted-index.js +1 -1
  522. package/dist/sorted-index.js.map +1 -1
  523. package/dist/sorted-last-index-by.cjs +2 -1
  524. package/dist/sorted-last-index-by.cjs.map +1 -0
  525. package/dist/sorted-last-index-by.js +1 -1
  526. package/dist/sorted-last-index-by.js.map +1 -1
  527. package/dist/sorted-last-index.cjs +2 -1
  528. package/dist/sorted-last-index.cjs.map +1 -0
  529. package/dist/sorted-last-index.js +1 -1
  530. package/dist/sorted-last-index.js.map +1 -1
  531. package/dist/splice.cjs +2 -1
  532. package/dist/splice.cjs.map +1 -0
  533. package/dist/splice.js +1 -1
  534. package/dist/splice.js.map +1 -1
  535. package/dist/split-at.cjs +2 -1
  536. package/dist/split-at.cjs.map +1 -0
  537. package/dist/split-at.js +1 -1
  538. package/dist/split-at.js.map +1 -1
  539. package/dist/split-when.cjs +2 -1
  540. package/dist/split-when.cjs.map +1 -0
  541. package/dist/split-when.js +1 -1
  542. package/dist/split-when.js.map +1 -1
  543. package/dist/split.cjs +2 -1
  544. package/dist/split.cjs.map +1 -0
  545. package/dist/split.js.map +1 -1
  546. package/dist/starts-with.cjs +2 -0
  547. package/dist/starts-with.cjs.map +1 -0
  548. package/dist/starts-with.js +2 -0
  549. package/dist/starts-with.js.map +1 -0
  550. package/dist/string-to-path.cjs +2 -1
  551. package/dist/string-to-path.cjs.map +1 -0
  552. package/dist/string-to-path.js.map +1 -1
  553. package/dist/subtract.cjs +2 -1
  554. package/dist/subtract.cjs.map +1 -0
  555. package/dist/subtract.js +1 -1
  556. package/dist/subtract.js.map +1 -1
  557. package/dist/sum-by.cjs +2 -1
  558. package/dist/sum-by.cjs.map +1 -0
  559. package/dist/sum-by.js +1 -1
  560. package/dist/sum-by.js.map +1 -1
  561. package/dist/sum.cjs +2 -1
  562. package/dist/sum.cjs.map +1 -0
  563. package/dist/sum.js +1 -1
  564. package/dist/sum.js.map +1 -1
  565. package/dist/swap-in-place-BzNaxwB3.js +2 -0
  566. package/dist/swap-in-place-BzNaxwB3.js.map +1 -0
  567. package/dist/swap-in-place-D1vasegg.cjs +2 -0
  568. package/dist/swap-in-place-D1vasegg.cjs.map +1 -0
  569. package/dist/swap-indices.cjs +2 -1
  570. package/dist/swap-indices.cjs.map +1 -0
  571. package/dist/swap-indices.js +1 -1
  572. package/dist/swap-indices.js.map +1 -1
  573. package/dist/swap-props.cjs +2 -1
  574. package/dist/swap-props.cjs.map +1 -0
  575. package/dist/swap-props.js +1 -1
  576. package/dist/swap-props.js.map +1 -1
  577. package/dist/take-first-by.cjs +2 -1
  578. package/dist/take-first-by.cjs.map +1 -0
  579. package/dist/take-first-by.js +1 -1
  580. package/dist/take-first-by.js.map +1 -1
  581. package/dist/take-last-while.cjs +2 -1
  582. package/dist/take-last-while.cjs.map +1 -0
  583. package/dist/take-last-while.js +1 -1
  584. package/dist/take-last-while.js.map +1 -1
  585. package/dist/take-last.cjs +2 -1
  586. package/dist/take-last.cjs.map +1 -0
  587. package/dist/take-last.js +1 -1
  588. package/dist/take-last.js.map +1 -1
  589. package/dist/take-while.cjs +2 -1
  590. package/dist/take-while.cjs.map +1 -0
  591. package/dist/take-while.js +1 -1
  592. package/dist/take-while.js.map +1 -1
  593. package/dist/take.cjs +2 -1
  594. package/dist/take.cjs.map +1 -0
  595. package/dist/take.js +1 -1
  596. package/dist/take.js.map +1 -1
  597. package/dist/tap.cjs +2 -1
  598. package/dist/tap.cjs.map +1 -0
  599. package/dist/tap.js +1 -1
  600. package/dist/tap.js.map +1 -1
  601. package/dist/times.cjs +2 -1
  602. package/dist/times.cjs.map +1 -0
  603. package/dist/times.js +1 -1
  604. package/dist/times.js.map +1 -1
  605. package/dist/to-camel-case.cjs +2 -1
  606. package/dist/to-camel-case.cjs.map +1 -0
  607. package/dist/to-camel-case.js +1 -1
  608. package/dist/to-camel-case.js.map +1 -1
  609. package/dist/to-kebab-case.cjs +2 -1
  610. package/dist/to-kebab-case.cjs.map +1 -0
  611. package/dist/to-kebab-case.js +1 -1
  612. package/dist/to-kebab-case.js.map +1 -1
  613. package/dist/to-lower-case.cjs +2 -1
  614. package/dist/to-lower-case.cjs.map +1 -0
  615. package/dist/to-lower-case.js +1 -1
  616. package/dist/to-lower-case.js.map +1 -1
  617. package/dist/to-single-BunGuk7o.cjs +2 -0
  618. package/dist/to-single-BunGuk7o.cjs.map +1 -0
  619. package/dist/to-single-XEXXW73e.js +2 -0
  620. package/dist/to-single-XEXXW73e.js.map +1 -0
  621. package/dist/to-snake-case.cjs +2 -1
  622. package/dist/to-snake-case.cjs.map +1 -0
  623. package/dist/to-snake-case.js +1 -1
  624. package/dist/to-snake-case.js.map +1 -1
  625. package/dist/to-title-case.cjs +2 -1
  626. package/dist/to-title-case.cjs.map +1 -0
  627. package/dist/to-title-case.js +1 -1
  628. package/dist/to-title-case.js.map +1 -1
  629. package/dist/to-upper-case.cjs +2 -1
  630. package/dist/to-upper-case.cjs.map +1 -0
  631. package/dist/to-upper-case.js +1 -1
  632. package/dist/to-upper-case.js.map +1 -1
  633. package/dist/truncate.cjs +2 -0
  634. package/dist/truncate.cjs.map +1 -0
  635. package/dist/truncate.js +2 -0
  636. package/dist/truncate.js.map +1 -0
  637. package/dist/uncapitalize.cjs +2 -1
  638. package/dist/uncapitalize.cjs.map +1 -0
  639. package/dist/uncapitalize.js +1 -1
  640. package/dist/uncapitalize.js.map +1 -1
  641. package/dist/unique-by.cjs +2 -1
  642. package/dist/unique-by.cjs.map +1 -0
  643. package/dist/unique-by.js +1 -1
  644. package/dist/unique-by.js.map +1 -1
  645. package/dist/unique-with.cjs +2 -1
  646. package/dist/unique-with.cjs.map +1 -0
  647. package/dist/unique-with.js +1 -1
  648. package/dist/unique-with.js.map +1 -1
  649. package/dist/unique.cjs +2 -1
  650. package/dist/unique.cjs.map +1 -0
  651. package/dist/unique.js +1 -1
  652. package/dist/unique.js.map +1 -1
  653. package/dist/utility-evaluators-C8koSp9T.cjs +2 -0
  654. package/dist/utility-evaluators-C8koSp9T.cjs.map +1 -0
  655. package/dist/utility-evaluators-ZAaUtL2Z.js +2 -0
  656. package/dist/utility-evaluators-ZAaUtL2Z.js.map +1 -0
  657. package/dist/values.cjs +2 -1
  658. package/dist/values.cjs.map +1 -0
  659. package/dist/values.js +1 -1
  660. package/dist/values.js.map +1 -1
  661. package/dist/when.cjs +2 -0
  662. package/dist/when.cjs.map +1 -0
  663. package/dist/when.js +2 -0
  664. package/dist/when.js.map +1 -0
  665. package/dist/with-precision-CgRuf7Wl.js +2 -0
  666. package/dist/with-precision-CgRuf7Wl.js.map +1 -0
  667. package/dist/with-precision-DVi9325n.cjs +2 -0
  668. package/dist/with-precision-DVi9325n.cjs.map +1 -0
  669. package/dist/words-C8Rd_80F.cjs +3 -0
  670. package/dist/words-C8Rd_80F.cjs.map +1 -0
  671. package/dist/words-CYZ0Lyko.js +3 -0
  672. package/dist/words-CYZ0Lyko.js.map +1 -0
  673. package/dist/zip-with.cjs +2 -1
  674. package/dist/zip-with.cjs.map +1 -0
  675. package/dist/zip-with.js +1 -1
  676. package/dist/zip-with.js.map +1 -1
  677. package/dist/zip.cjs +2 -1
  678. package/dist/zip.cjs.map +1 -0
  679. package/dist/zip.js +1 -1
  680. package/dist/zip.js.map +1 -1
  681. package/package.json +16 -18
  682. package/dist/add-prop.d.cts +0 -46
  683. package/dist/add-prop.d.cts.map +0 -1
  684. package/dist/add-prop.d.ts +0 -46
  685. package/dist/add-prop.d.ts.map +0 -1
  686. package/dist/add.d.cts +0 -34
  687. package/dist/add.d.cts.map +0 -1
  688. package/dist/add.d.ts +0 -34
  689. package/dist/add.d.ts.map +0 -1
  690. package/dist/all-pass.d.cts +0 -37
  691. package/dist/all-pass.d.cts.map +0 -1
  692. package/dist/all-pass.d.ts +0 -37
  693. package/dist/all-pass.d.ts.map +0 -1
  694. package/dist/any-pass.d.cts +0 -37
  695. package/dist/any-pass.d.cts.map +0 -1
  696. package/dist/any-pass.d.ts +0 -37
  697. package/dist/any-pass.d.ts.map +0 -1
  698. package/dist/array-required-prefix-BFDM7eSS.d.cts +0 -26
  699. package/dist/array-required-prefix-BFDM7eSS.d.cts.map +0 -1
  700. package/dist/array-required-prefix-DwpaLy0D.d.ts +0 -26
  701. package/dist/array-required-prefix-DwpaLy0D.d.ts.map +0 -1
  702. package/dist/binary-search-cutoff-index-CN25H71A.js +0 -2
  703. package/dist/binary-search-cutoff-index-CN25H71A.js.map +0 -1
  704. package/dist/binary-search-cutoff-index-ClkmTCR5.cjs +0 -1
  705. package/dist/bounded-partial-CPc1XU57.d.ts +0 -17
  706. package/dist/bounded-partial-CPc1XU57.d.ts.map +0 -1
  707. package/dist/bounded-partial-CtOsGqxa.d.cts +0 -17
  708. package/dist/bounded-partial-CtOsGqxa.d.cts.map +0 -1
  709. package/dist/capitalize.d.cts +0 -53
  710. package/dist/capitalize.d.cts.map +0 -1
  711. package/dist/capitalize.d.ts +0 -53
  712. package/dist/capitalize.d.ts.map +0 -1
  713. package/dist/ceil.d.cts +0 -39
  714. package/dist/ceil.d.cts.map +0 -1
  715. package/dist/ceil.d.ts +0 -39
  716. package/dist/ceil.d.ts.map +0 -1
  717. package/dist/chunk.d.cts +0 -76
  718. package/dist/chunk.d.cts.map +0 -1
  719. package/dist/chunk.d.ts +0 -76
  720. package/dist/chunk.d.ts.map +0 -1
  721. package/dist/clamp.d.cts +0 -37
  722. package/dist/clamp.d.cts.map +0 -1
  723. package/dist/clamp.d.ts +0 -37
  724. package/dist/clamp.d.ts.map +0 -1
  725. package/dist/clamped-integer-subtract-C-AIuFhk.d.ts +0 -11
  726. package/dist/clamped-integer-subtract-C-AIuFhk.d.ts.map +0 -1
  727. package/dist/clamped-integer-subtract-DueGS_u_.d.cts +0 -11
  728. package/dist/clamped-integer-subtract-DueGS_u_.d.cts.map +0 -1
  729. package/dist/clone.d.cts +0 -35
  730. package/dist/clone.d.cts.map +0 -1
  731. package/dist/clone.d.ts +0 -35
  732. package/dist/clone.d.ts.map +0 -1
  733. package/dist/coerced-array-BKR9Bvsl.d.cts +0 -17
  734. package/dist/coerced-array-BKR9Bvsl.d.cts.map +0 -1
  735. package/dist/coerced-array-BfTLxqLo.d.ts +0 -17
  736. package/dist/coerced-array-BfTLxqLo.d.ts.map +0 -1
  737. package/dist/concat.d.cts +0 -41
  738. package/dist/concat.d.cts.map +0 -1
  739. package/dist/concat.d.ts +0 -41
  740. package/dist/concat.d.ts.map +0 -1
  741. package/dist/conditional-6ff4g8Sy.cjs +0 -1
  742. package/dist/conditional-Br0uqqc9.d.cts +0 -221
  743. package/dist/conditional-Br0uqqc9.d.cts.map +0 -1
  744. package/dist/conditional-CDez6uXp.d.ts +0 -221
  745. package/dist/conditional-CDez6uXp.d.ts.map +0 -1
  746. package/dist/conditional-WbmvQs8H.js +0 -2
  747. package/dist/conditional-WbmvQs8H.js.map +0 -1
  748. package/dist/conditional.d.cts +0 -2
  749. package/dist/conditional.d.ts +0 -2
  750. package/dist/constant.d.cts +0 -32
  751. package/dist/constant.d.cts.map +0 -1
  752. package/dist/constant.d.ts +0 -32
  753. package/dist/constant.d.ts.map +0 -1
  754. package/dist/count-by.d.cts +0 -42
  755. package/dist/count-by.d.cts.map +0 -1
  756. package/dist/count-by.d.ts +0 -42
  757. package/dist/count-by.d.ts.map +0 -1
  758. package/dist/curry-BsY0Z8jH.cjs +0 -1
  759. package/dist/curry-CKDQ1osk.d.ts +0 -70
  760. package/dist/curry-CKDQ1osk.d.ts.map +0 -1
  761. package/dist/curry-NmniqyJ0.js +0 -2
  762. package/dist/curry-NmniqyJ0.js.map +0 -1
  763. package/dist/curry-from-lazy-BCGvmhyS.cjs +0 -1
  764. package/dist/curry-from-lazy-PQ0BbG-7.js +0 -2
  765. package/dist/curry-from-lazy-PQ0BbG-7.js.map +0 -1
  766. package/dist/curry-mh6BKSIA.d.cts +0 -70
  767. package/dist/curry-mh6BKSIA.d.cts.map +0 -1
  768. package/dist/curry-order-rules-BoF09Dq2.d.cts +0 -48
  769. package/dist/curry-order-rules-BoF09Dq2.d.cts.map +0 -1
  770. package/dist/curry-order-rules-ClqHrs8_.cjs +0 -1
  771. package/dist/curry-order-rules-CoO4bk5I.d.ts +0 -48
  772. package/dist/curry-order-rules-CoO4bk5I.d.ts.map +0 -1
  773. package/dist/curry-order-rules-DwrF-_P1.js +0 -2
  774. package/dist/curry-order-rules-DwrF-_P1.js.map +0 -1
  775. package/dist/curry.d.cts +0 -2
  776. package/dist/curry.d.ts +0 -2
  777. package/dist/debounce.d.cts +0 -98
  778. package/dist/debounce.d.cts.map +0 -1
  779. package/dist/debounce.d.ts +0 -98
  780. package/dist/debounce.d.ts.map +0 -1
  781. package/dist/deduped-DdwAYzXs.d.cts +0 -23
  782. package/dist/deduped-DdwAYzXs.d.cts.map +0 -1
  783. package/dist/deduped-RY-1u-ns.d.ts +0 -23
  784. package/dist/deduped-RY-1u-ns.d.ts.map +0 -1
  785. package/dist/difference-with.d.cts +0 -48
  786. package/dist/difference-with.d.cts.map +0 -1
  787. package/dist/difference-with.d.ts +0 -48
  788. package/dist/difference-with.d.ts.map +0 -1
  789. package/dist/difference.d.cts +0 -37
  790. package/dist/difference.d.cts.map +0 -1
  791. package/dist/difference.d.ts +0 -37
  792. package/dist/difference.d.ts.map +0 -1
  793. package/dist/dist-8XtUY3ad.cjs +0 -114
  794. package/dist/dist-Bd1vawFi.js +0 -103
  795. package/dist/dist-Bd1vawFi.js.map +0 -1
  796. package/dist/divide.d.cts +0 -33
  797. package/dist/divide.d.cts.map +0 -1
  798. package/dist/divide.d.ts +0 -33
  799. package/dist/divide.d.ts.map +0 -1
  800. package/dist/do-nothing.d.cts +0 -28
  801. package/dist/do-nothing.d.cts.map +0 -1
  802. package/dist/do-nothing.d.ts +0 -28
  803. package/dist/do-nothing.d.ts.map +0 -1
  804. package/dist/drop-first-by.d.cts +0 -41
  805. package/dist/drop-first-by.d.cts.map +0 -1
  806. package/dist/drop-first-by.d.ts +0 -41
  807. package/dist/drop-first-by.d.ts.map +0 -1
  808. package/dist/drop-last-while.d.cts +0 -36
  809. package/dist/drop-last-while.d.cts.map +0 -1
  810. package/dist/drop-last-while.d.ts +0 -36
  811. package/dist/drop-last-while.d.ts.map +0 -1
  812. package/dist/drop-last.d.cts +0 -32
  813. package/dist/drop-last.d.cts.map +0 -1
  814. package/dist/drop-last.d.ts +0 -32
  815. package/dist/drop-last.d.ts.map +0 -1
  816. package/dist/drop-while.d.cts +0 -36
  817. package/dist/drop-while.d.cts.map +0 -1
  818. package/dist/drop-while.d.ts +0 -36
  819. package/dist/drop-while.d.ts.map +0 -1
  820. package/dist/drop.d.cts +0 -40
  821. package/dist/drop.d.cts.map +0 -1
  822. package/dist/drop.d.ts +0 -40
  823. package/dist/drop.d.ts.map +0 -1
  824. package/dist/entries.d.cts +0 -31
  825. package/dist/entries.d.cts.map +0 -1
  826. package/dist/entries.d.ts +0 -31
  827. package/dist/entries.d.ts.map +0 -1
  828. package/dist/enumerable-string-key-of-CZQf3ld_.d.ts +0 -17
  829. package/dist/enumerable-string-key-of-CZQf3ld_.d.ts.map +0 -1
  830. package/dist/enumerable-string-key-of-DhcNc5iz.d.cts +0 -17
  831. package/dist/enumerable-string-key-of-DhcNc5iz.d.cts.map +0 -1
  832. package/dist/enumerable-string-keyed-value-of-CRlVAvdp.d.ts +0 -12
  833. package/dist/enumerable-string-keyed-value-of-CRlVAvdp.d.ts.map +0 -1
  834. package/dist/enumerable-string-keyed-value-of-icm2q60J.d.cts +0 -12
  835. package/dist/enumerable-string-keyed-value-of-icm2q60J.d.cts.map +0 -1
  836. package/dist/evolve.d.cts +0 -101
  837. package/dist/evolve.d.cts.map +0 -1
  838. package/dist/evolve.d.ts +0 -101
  839. package/dist/evolve.d.ts.map +0 -1
  840. package/dist/filter.d.cts +0 -50
  841. package/dist/filter.d.cts.map +0 -1
  842. package/dist/filter.d.ts +0 -50
  843. package/dist/filter.d.ts.map +0 -1
  844. package/dist/filtered-array-C--8loav.d.cts +0 -22
  845. package/dist/filtered-array-C--8loav.d.cts.map +0 -1
  846. package/dist/filtered-array-wtIEwdU7.d.ts +0 -22
  847. package/dist/filtered-array-wtIEwdU7.d.ts.map +0 -1
  848. package/dist/find-index.d.cts +0 -50
  849. package/dist/find-index.d.cts.map +0 -1
  850. package/dist/find-index.d.ts +0 -50
  851. package/dist/find-index.d.ts.map +0 -1
  852. package/dist/find-last-index.d.cts +0 -50
  853. package/dist/find-last-index.d.cts.map +0 -1
  854. package/dist/find-last-index.d.ts +0 -50
  855. package/dist/find-last-index.d.ts.map +0 -1
  856. package/dist/find-last.d.cts +0 -62
  857. package/dist/find-last.d.cts.map +0 -1
  858. package/dist/find-last.d.ts +0 -62
  859. package/dist/find-last.d.ts.map +0 -1
  860. package/dist/find.d.cts +0 -64
  861. package/dist/find.d.cts.map +0 -1
  862. package/dist/find.d.ts +0 -64
  863. package/dist/find.d.ts.map +0 -1
  864. package/dist/first-by.d.cts +0 -60
  865. package/dist/first-by.d.cts.map +0 -1
  866. package/dist/first-by.d.ts +0 -60
  867. package/dist/first-by.d.ts.map +0 -1
  868. package/dist/first.d.cts +0 -40
  869. package/dist/first.d.cts.map +0 -1
  870. package/dist/first.d.ts +0 -40
  871. package/dist/first.d.ts.map +0 -1
  872. package/dist/flat-map.d.cts +0 -47
  873. package/dist/flat-map.d.cts.map +0 -1
  874. package/dist/flat-map.d.ts +0 -47
  875. package/dist/flat-map.d.ts.map +0 -1
  876. package/dist/flat.d.cts +0 -53
  877. package/dist/flat.d.cts.map +0 -1
  878. package/dist/flat.d.ts +0 -53
  879. package/dist/flat.d.ts.map +0 -1
  880. package/dist/floor.d.cts +0 -39
  881. package/dist/floor.d.cts.map +0 -1
  882. package/dist/floor.d.ts +0 -39
  883. package/dist/floor.d.ts.map +0 -1
  884. package/dist/for-each-obj.d.cts +0 -47
  885. package/dist/for-each-obj.d.cts.map +0 -1
  886. package/dist/for-each-obj.d.ts +0 -47
  887. package/dist/for-each-obj.d.ts.map +0 -1
  888. package/dist/for-each.d.cts +0 -54
  889. package/dist/for-each.d.cts.map +0 -1
  890. package/dist/for-each.d.ts +0 -54
  891. package/dist/for-each.d.ts.map +0 -1
  892. package/dist/from-entries.d.cts +0 -68
  893. package/dist/from-entries.d.cts.map +0 -1
  894. package/dist/from-entries.d.ts +0 -68
  895. package/dist/from-entries.d.ts.map +0 -1
  896. package/dist/from-keys.d.cts +0 -60
  897. package/dist/from-keys.d.cts.map +0 -1
  898. package/dist/from-keys.d.ts +0 -60
  899. package/dist/from-keys.d.ts.map +0 -1
  900. package/dist/funnel.d.cts +0 -155
  901. package/dist/funnel.d.cts.map +0 -1
  902. package/dist/funnel.d.ts +0 -155
  903. package/dist/funnel.d.ts.map +0 -1
  904. package/dist/funnel.lodash-debounce-with-cached-value.test.cjs +0 -1
  905. package/dist/funnel.lodash-debounce-with-cached-value.test.d.cts +0 -1
  906. package/dist/funnel.lodash-debounce-with-cached-value.test.d.ts +0 -1
  907. package/dist/funnel.lodash-debounce-with-cached-value.test.js +0 -2
  908. package/dist/funnel.lodash-debounce-with-cached-value.test.js.map +0 -1
  909. package/dist/funnel.lodash-debounce.test.cjs +0 -1
  910. package/dist/funnel.lodash-debounce.test.d.cts +0 -1
  911. package/dist/funnel.lodash-debounce.test.d.ts +0 -1
  912. package/dist/funnel.lodash-debounce.test.js +0 -2
  913. package/dist/funnel.lodash-debounce.test.js.map +0 -1
  914. package/dist/funnel.lodash-throttle-with-cached-value.test.cjs +0 -1
  915. package/dist/funnel.lodash-throttle-with-cached-value.test.d.cts +0 -1
  916. package/dist/funnel.lodash-throttle-with-cached-value.test.d.ts +0 -1
  917. package/dist/funnel.lodash-throttle-with-cached-value.test.js +0 -2
  918. package/dist/funnel.lodash-throttle-with-cached-value.test.js.map +0 -1
  919. package/dist/funnel.lodash-throttle.test.cjs +0 -1
  920. package/dist/funnel.lodash-throttle.test.d.cts +0 -1
  921. package/dist/funnel.lodash-throttle.test.d.ts +0 -1
  922. package/dist/funnel.lodash-throttle.test.js +0 -2
  923. package/dist/funnel.lodash-throttle.test.js.map +0 -1
  924. package/dist/funnel.perkakas-debounce.test.cjs +0 -1
  925. package/dist/funnel.perkakas-debounce.test.d.cts +0 -1
  926. package/dist/funnel.perkakas-debounce.test.d.ts +0 -1
  927. package/dist/funnel.perkakas-debounce.test.js +0 -2
  928. package/dist/funnel.perkakas-debounce.test.js.map +0 -1
  929. package/dist/funnel.reference-batch.test.cjs +0 -1
  930. package/dist/funnel.reference-batch.test.d.cts +0 -1
  931. package/dist/funnel.reference-batch.test.d.ts +0 -1
  932. package/dist/funnel.reference-batch.test.js +0 -2
  933. package/dist/funnel.reference-batch.test.js.map +0 -1
  934. package/dist/funnel.test-d.cjs +0 -1
  935. package/dist/funnel.test-d.d.cts +0 -1
  936. package/dist/funnel.test-d.d.ts +0 -1
  937. package/dist/funnel.test-d.js +0 -2
  938. package/dist/funnel.test-d.js.map +0 -1
  939. package/dist/funnel.test.cjs +0 -1
  940. package/dist/funnel.test.d.cts +0 -1
  941. package/dist/funnel.test.d.ts +0 -1
  942. package/dist/funnel.test.js +0 -2
  943. package/dist/funnel.test.js.map +0 -1
  944. package/dist/group-by-prop.d.cts +0 -89
  945. package/dist/group-by-prop.d.cts.map +0 -1
  946. package/dist/group-by-prop.d.ts +0 -89
  947. package/dist/group-by-prop.d.ts.map +0 -1
  948. package/dist/group-by.d.cts +0 -69
  949. package/dist/group-by.d.cts.map +0 -1
  950. package/dist/group-by.d.ts +0 -69
  951. package/dist/group-by.d.ts.map +0 -1
  952. package/dist/has-at-least-BXwOPLQK.cjs +0 -1
  953. package/dist/has-at-least-Coy9sM-B.js +0 -2
  954. package/dist/has-at-least-Coy9sM-B.js.map +0 -1
  955. package/dist/has-at-least.d.cts +0 -59
  956. package/dist/has-at-least.d.cts.map +0 -1
  957. package/dist/has-at-least.d.ts +0 -59
  958. package/dist/has-at-least.d.ts.map +0 -1
  959. package/dist/has-sub-object.d.cts +0 -44
  960. package/dist/has-sub-object.d.cts.map +0 -1
  961. package/dist/has-sub-object.d.ts +0 -44
  962. package/dist/has-sub-object.d.ts.map +0 -1
  963. package/dist/heap-BhpfhYWj.js +0 -2
  964. package/dist/heap-BhpfhYWj.js.map +0 -1
  965. package/dist/heap-DWDhbxfx.cjs +0 -1
  966. package/dist/human-readable-file-size.d.cts +0 -17
  967. package/dist/human-readable-file-size.d.cts.map +0 -1
  968. package/dist/human-readable-file-size.d.ts +0 -17
  969. package/dist/human-readable-file-size.d.ts.map +0 -1
  970. package/dist/identity.d.cts +0 -22
  971. package/dist/identity.d.cts.map +0 -1
  972. package/dist/identity.d.ts +0 -22
  973. package/dist/identity.d.ts.map +0 -1
  974. package/dist/index-by.d.cts +0 -53
  975. package/dist/index-by.d.cts.map +0 -1
  976. package/dist/index-by.d.ts +0 -53
  977. package/dist/index-by.d.ts.map +0 -1
  978. package/dist/int-range-inclusive-BlGXX6Cz.d.ts +0 -15
  979. package/dist/int-range-inclusive-BlGXX6Cz.d.ts.map +0 -1
  980. package/dist/int-range-inclusive-KocNpK0p.d.cts +0 -15
  981. package/dist/int-range-inclusive-KocNpK0p.d.cts.map +0 -1
  982. package/dist/intersection-with.d.cts +0 -54
  983. package/dist/intersection-with.d.cts.map +0 -1
  984. package/dist/intersection-with.d.ts +0 -54
  985. package/dist/intersection-with.d.ts.map +0 -1
  986. package/dist/intersection.d.cts +0 -37
  987. package/dist/intersection.d.cts.map +0 -1
  988. package/dist/intersection.d.ts +0 -37
  989. package/dist/intersection.d.ts.map +0 -1
  990. package/dist/invert.d.cts +0 -33
  991. package/dist/invert.d.cts.map +0 -1
  992. package/dist/invert.d.ts +0 -33
  993. package/dist/invert.d.ts.map +0 -1
  994. package/dist/is-array.d.cts +0 -21
  995. package/dist/is-array.d.cts.map +0 -1
  996. package/dist/is-array.d.ts +0 -21
  997. package/dist/is-array.d.ts.map +0 -1
  998. package/dist/is-big-int.d.cts +0 -22
  999. package/dist/is-big-int.d.cts.map +0 -1
  1000. package/dist/is-big-int.d.ts +0 -22
  1001. package/dist/is-big-int.d.ts.map +0 -1
  1002. package/dist/is-boolean.d.cts +0 -21
  1003. package/dist/is-boolean.d.cts.map +0 -1
  1004. package/dist/is-boolean.d.ts +0 -21
  1005. package/dist/is-boolean.d.ts.map +0 -1
  1006. package/dist/is-bounded-record-Bx4n8QB0.d.ts +0 -34
  1007. package/dist/is-bounded-record-Bx4n8QB0.d.ts.map +0 -1
  1008. package/dist/is-bounded-record-DV6ZQk9H.d.cts +0 -34
  1009. package/dist/is-bounded-record-DV6ZQk9H.d.cts.map +0 -1
  1010. package/dist/is-date.d.cts +0 -17
  1011. package/dist/is-date.d.cts.map +0 -1
  1012. package/dist/is-date.d.ts +0 -17
  1013. package/dist/is-date.d.ts.map +0 -1
  1014. package/dist/is-deep-equal.d.cts +0 -71
  1015. package/dist/is-deep-equal.d.cts.map +0 -1
  1016. package/dist/is-deep-equal.d.ts +0 -71
  1017. package/dist/is-deep-equal.d.ts.map +0 -1
  1018. package/dist/is-defined.d.cts +0 -19
  1019. package/dist/is-defined.d.cts.map +0 -1
  1020. package/dist/is-defined.d.ts +0 -19
  1021. package/dist/is-defined.d.ts.map +0 -1
  1022. package/dist/is-empty.d.cts +0 -35
  1023. package/dist/is-empty.d.cts.map +0 -1
  1024. package/dist/is-empty.d.ts +0 -35
  1025. package/dist/is-empty.d.ts.map +0 -1
  1026. package/dist/is-emptyish-9tX94IVx.d.cts +0 -73
  1027. package/dist/is-emptyish-9tX94IVx.d.cts.map +0 -1
  1028. package/dist/is-emptyish-DVFGJe-T.d.ts +0 -73
  1029. package/dist/is-emptyish-DVFGJe-T.d.ts.map +0 -1
  1030. package/dist/is-emptyish.d.cts +0 -2
  1031. package/dist/is-emptyish.d.ts +0 -2
  1032. package/dist/is-emptyish.test-d.cjs +0 -1
  1033. package/dist/is-emptyish.test-d.d.cts +0 -8
  1034. package/dist/is-emptyish.test-d.d.cts.map +0 -1
  1035. package/dist/is-emptyish.test-d.d.ts +0 -8
  1036. package/dist/is-emptyish.test-d.d.ts.map +0 -1
  1037. package/dist/is-emptyish.test-d.js +0 -2
  1038. package/dist/is-emptyish.test-d.js.map +0 -1
  1039. package/dist/is-emptyish.test.cjs +0 -1
  1040. package/dist/is-emptyish.test.d.cts +0 -1
  1041. package/dist/is-emptyish.test.d.ts +0 -1
  1042. package/dist/is-emptyish.test.js +0 -2
  1043. package/dist/is-emptyish.test.js.map +0 -1
  1044. package/dist/is-error.d.cts +0 -18
  1045. package/dist/is-error.d.cts.map +0 -1
  1046. package/dist/is-error.d.ts +0 -18
  1047. package/dist/is-error.d.ts.map +0 -1
  1048. package/dist/is-function.d.cts +0 -21
  1049. package/dist/is-function.d.cts.map +0 -1
  1050. package/dist/is-function.d.ts +0 -21
  1051. package/dist/is-function.d.ts.map +0 -1
  1052. package/dist/is-included-in.d.cts +0 -109
  1053. package/dist/is-included-in.d.cts.map +0 -1
  1054. package/dist/is-included-in.d.ts +0 -109
  1055. package/dist/is-included-in.d.ts.map +0 -1
  1056. package/dist/is-non-null.d.cts +0 -19
  1057. package/dist/is-non-null.d.cts.map +0 -1
  1058. package/dist/is-non-null.d.ts +0 -19
  1059. package/dist/is-non-null.d.ts.map +0 -1
  1060. package/dist/is-non-nullish.d.cts +0 -20
  1061. package/dist/is-non-nullish.d.cts.map +0 -1
  1062. package/dist/is-non-nullish.d.ts +0 -20
  1063. package/dist/is-non-nullish.d.ts.map +0 -1
  1064. package/dist/is-not.d.cts +0 -19
  1065. package/dist/is-not.d.cts.map +0 -1
  1066. package/dist/is-not.d.ts +0 -19
  1067. package/dist/is-not.d.ts.map +0 -1
  1068. package/dist/is-nullish.d.cts +0 -23
  1069. package/dist/is-nullish.d.cts.map +0 -1
  1070. package/dist/is-nullish.d.ts +0 -23
  1071. package/dist/is-nullish.d.ts.map +0 -1
  1072. package/dist/is-number.d.cts +0 -22
  1073. package/dist/is-number.d.cts.map +0 -1
  1074. package/dist/is-number.d.ts +0 -22
  1075. package/dist/is-number.d.ts.map +0 -1
  1076. package/dist/is-object-type.d.cts +0 -35
  1077. package/dist/is-object-type.d.cts.map +0 -1
  1078. package/dist/is-object-type.d.ts +0 -35
  1079. package/dist/is-object-type.d.ts.map +0 -1
  1080. package/dist/is-plain-object.d.cts +0 -33
  1081. package/dist/is-plain-object.d.cts.map +0 -1
  1082. package/dist/is-plain-object.d.ts +0 -33
  1083. package/dist/is-plain-object.d.ts.map +0 -1
  1084. package/dist/is-promise.d.cts +0 -18
  1085. package/dist/is-promise.d.cts.map +0 -1
  1086. package/dist/is-promise.d.ts +0 -18
  1087. package/dist/is-promise.d.ts.map +0 -1
  1088. package/dist/is-shallow-equal.d.cts +0 -71
  1089. package/dist/is-shallow-equal.d.cts.map +0 -1
  1090. package/dist/is-shallow-equal.d.ts +0 -71
  1091. package/dist/is-shallow-equal.d.ts.map +0 -1
  1092. package/dist/is-strict-equal.d.cts +0 -67
  1093. package/dist/is-strict-equal.d.cts.map +0 -1
  1094. package/dist/is-strict-equal.d.ts +0 -67
  1095. package/dist/is-strict-equal.d.ts.map +0 -1
  1096. package/dist/is-string.d.cts +0 -20
  1097. package/dist/is-string.d.cts.map +0 -1
  1098. package/dist/is-string.d.ts +0 -20
  1099. package/dist/is-string.d.ts.map +0 -1
  1100. package/dist/is-symbol.d.cts +0 -20
  1101. package/dist/is-symbol.d.cts.map +0 -1
  1102. package/dist/is-symbol.d.ts +0 -20
  1103. package/dist/is-symbol.d.ts.map +0 -1
  1104. package/dist/is-truthy.d.cts +0 -21
  1105. package/dist/is-truthy.d.cts.map +0 -1
  1106. package/dist/is-truthy.d.ts +0 -21
  1107. package/dist/is-truthy.d.ts.map +0 -1
  1108. package/dist/iterable-container-1TN3AJ3s.d.cts +0 -17
  1109. package/dist/iterable-container-1TN3AJ3s.d.cts.map +0 -1
  1110. package/dist/iterable-container-Dv5vSKht.d.ts +0 -17
  1111. package/dist/iterable-container-Dv5vSKht.d.ts.map +0 -1
  1112. package/dist/join.d.cts +0 -46
  1113. package/dist/join.d.cts.map +0 -1
  1114. package/dist/join.d.ts +0 -46
  1115. package/dist/join.d.ts.map +0 -1
  1116. package/dist/key-codes.d.cts +0 -29
  1117. package/dist/key-codes.d.cts.map +0 -1
  1118. package/dist/key-codes.d.ts +0 -29
  1119. package/dist/key-codes.d.ts.map +0 -1
  1120. package/dist/keys.d.cts +0 -38
  1121. package/dist/keys.d.cts.map +0 -1
  1122. package/dist/keys.d.ts +0 -38
  1123. package/dist/keys.d.ts.map +0 -1
  1124. package/dist/last.d.cts +0 -37
  1125. package/dist/last.d.cts.map +0 -1
  1126. package/dist/last.d.ts +0 -37
  1127. package/dist/last.d.ts.map +0 -1
  1128. package/dist/lazy-data-last-impl-D4kLybyP.cjs +0 -1
  1129. package/dist/lazy-data-last-impl-R05wr4K6.js +0 -2
  1130. package/dist/lazy-data-last-impl-R05wr4K6.js.map +0 -1
  1131. package/dist/length.d.cts +0 -28
  1132. package/dist/length.d.cts.map +0 -1
  1133. package/dist/length.d.ts +0 -28
  1134. package/dist/length.d.ts.map +0 -1
  1135. package/dist/magic-string.es-94aXgwpn.js +0 -15
  1136. package/dist/magic-string.es-94aXgwpn.js.map +0 -1
  1137. package/dist/magic-string.es-CGYIWauW.cjs +0 -15
  1138. package/dist/map-keys.d.cts +0 -34
  1139. package/dist/map-keys.d.cts.map +0 -1
  1140. package/dist/map-keys.d.ts +0 -34
  1141. package/dist/map-keys.d.ts.map +0 -1
  1142. package/dist/map-to-obj.d.cts +0 -68
  1143. package/dist/map-to-obj.d.cts.map +0 -1
  1144. package/dist/map-to-obj.d.ts +0 -68
  1145. package/dist/map-to-obj.d.ts.map +0 -1
  1146. package/dist/map-values.d.cts +0 -42
  1147. package/dist/map-values.d.cts.map +0 -1
  1148. package/dist/map-values.d.ts +0 -42
  1149. package/dist/map-values.d.ts.map +0 -1
  1150. package/dist/map-with-feedback.d.cts +0 -54
  1151. package/dist/map-with-feedback.d.cts.map +0 -1
  1152. package/dist/map-with-feedback.d.ts +0 -54
  1153. package/dist/map-with-feedback.d.ts.map +0 -1
  1154. package/dist/map.d.cts +0 -47
  1155. package/dist/map.d.cts.map +0 -1
  1156. package/dist/map.d.ts +0 -47
  1157. package/dist/map.d.ts.map +0 -1
  1158. package/dist/mapped-BbrC9t3s.d.ts +0 -7
  1159. package/dist/mapped-BbrC9t3s.d.ts.map +0 -1
  1160. package/dist/mapped-CkRNfTnY.d.cts +0 -7
  1161. package/dist/mapped-CkRNfTnY.d.cts.map +0 -1
  1162. package/dist/mean-by.d.cts +0 -35
  1163. package/dist/mean-by.d.cts.map +0 -1
  1164. package/dist/mean-by.d.ts +0 -35
  1165. package/dist/mean-by.d.ts.map +0 -1
  1166. package/dist/merge-all-CISawx-J.d.cts +0 -42
  1167. package/dist/merge-all-CISawx-J.d.cts.map +0 -1
  1168. package/dist/merge-all-DJ6n7R1b.d.ts +0 -42
  1169. package/dist/merge-all-DJ6n7R1b.d.ts.map +0 -1
  1170. package/dist/merge-all.d.cts +0 -2
  1171. package/dist/merge-all.d.ts +0 -2
  1172. package/dist/merge-deep.d.cts +0 -37
  1173. package/dist/merge-deep.d.cts.map +0 -1
  1174. package/dist/merge-deep.d.ts +0 -37
  1175. package/dist/merge-deep.d.ts.map +0 -1
  1176. package/dist/merge.d.cts +0 -57
  1177. package/dist/merge.d.cts.map +0 -1
  1178. package/dist/merge.d.ts +0 -57
  1179. package/dist/merge.d.ts.map +0 -1
  1180. package/dist/multiply.d.cts +0 -33
  1181. package/dist/multiply.d.cts.map +0 -1
  1182. package/dist/multiply.d.ts +0 -33
  1183. package/dist/multiply.d.ts.map +0 -1
  1184. package/dist/n-tuple-BkMobYQ9.d.cts +0 -12
  1185. package/dist/n-tuple-BkMobYQ9.d.cts.map +0 -1
  1186. package/dist/n-tuple-zo5g_mSL.d.ts +0 -12
  1187. package/dist/n-tuple-zo5g_mSL.d.ts.map +0 -1
  1188. package/dist/narrowed-to-B7tkuY2k.d.ts +0 -15
  1189. package/dist/narrowed-to-B7tkuY2k.d.ts.map +0 -1
  1190. package/dist/narrowed-to-D_6H-aZW.d.cts +0 -15
  1191. package/dist/narrowed-to-D_6H-aZW.d.cts.map +0 -1
  1192. package/dist/non-empty-array-DHAKSw6t.d.ts +0 -5
  1193. package/dist/non-empty-array-DHAKSw6t.d.ts.map +0 -1
  1194. package/dist/non-empty-array-NDjbHRjk.d.cts +0 -5
  1195. package/dist/non-empty-array-NDjbHRjk.d.cts.map +0 -1
  1196. package/dist/nth-by-Bby4vIbZ.cjs +0 -1
  1197. package/dist/nth-by-JP3-Htbo.js +0 -2
  1198. package/dist/nth-by-JP3-Htbo.js.map +0 -1
  1199. package/dist/nth-by.d.cts +0 -42
  1200. package/dist/nth-by.d.cts.map +0 -1
  1201. package/dist/nth-by.d.ts +0 -42
  1202. package/dist/nth-by.d.ts.map +0 -1
  1203. package/dist/obj-of.d.cts +0 -27
  1204. package/dist/obj-of.d.cts.map +0 -1
  1205. package/dist/obj-of.d.ts +0 -27
  1206. package/dist/obj-of.d.ts.map +0 -1
  1207. package/dist/omit-DI8DRDHj.d.ts +0 -71
  1208. package/dist/omit-DI8DRDHj.d.ts.map +0 -1
  1209. package/dist/omit-DQiCiWAg.d.cts +0 -71
  1210. package/dist/omit-DQiCiWAg.d.cts.map +0 -1
  1211. package/dist/omit-by.d.cts +0 -52
  1212. package/dist/omit-by.d.cts.map +0 -1
  1213. package/dist/omit-by.d.ts +0 -52
  1214. package/dist/omit-by.d.ts.map +0 -1
  1215. package/dist/omit.d.cts +0 -2
  1216. package/dist/omit.d.ts +0 -2
  1217. package/dist/once.d.cts +0 -17
  1218. package/dist/once.d.cts.map +0 -1
  1219. package/dist/once.d.ts +0 -17
  1220. package/dist/once.d.ts.map +0 -1
  1221. package/dist/only.d.cts +0 -34
  1222. package/dist/only.d.cts.map +0 -1
  1223. package/dist/only.d.ts +0 -34
  1224. package/dist/only.d.ts.map +0 -1
  1225. package/dist/optional-options-with-defaults-BFaBSKkF.d.ts +0 -12
  1226. package/dist/optional-options-with-defaults-BFaBSKkF.d.ts.map +0 -1
  1227. package/dist/optional-options-with-defaults-BZVW8GfC.d.cts +0 -12
  1228. package/dist/optional-options-with-defaults-BZVW8GfC.d.cts.map +0 -1
  1229. package/dist/partial-array-CQF5oggb.d.cts +0 -12
  1230. package/dist/partial-array-CQF5oggb.d.cts.map +0 -1
  1231. package/dist/partial-array-DU-2Vkyx.d.ts +0 -12
  1232. package/dist/partial-array-DU-2Vkyx.d.ts.map +0 -1
  1233. package/dist/partition-by-union-BztEpKVh.d.cts +0 -20
  1234. package/dist/partition-by-union-BztEpKVh.d.cts.map +0 -1
  1235. package/dist/partition-by-union-DnfiiEMU.d.ts +0 -20
  1236. package/dist/partition-by-union-DnfiiEMU.d.ts.map +0 -1
  1237. package/dist/partition.d.cts +0 -51
  1238. package/dist/partition.d.cts.map +0 -1
  1239. package/dist/partition.d.ts +0 -51
  1240. package/dist/partition.d.ts.map +0 -1
  1241. package/dist/path-or.d.cts +0 -87
  1242. package/dist/path-or.d.cts.map +0 -1
  1243. package/dist/path-or.d.ts +0 -87
  1244. package/dist/path-or.d.ts.map +0 -1
  1245. package/dist/perkakas-type-error-B9ULNhW0.d.ts +0 -19
  1246. package/dist/perkakas-type-error-B9ULNhW0.d.ts.map +0 -1
  1247. package/dist/perkakas-type-error-ClCCHBW1.d.cts +0 -19
  1248. package/dist/perkakas-type-error-ClCCHBW1.d.cts.map +0 -1
  1249. package/dist/pick-by.d.cts +0 -68
  1250. package/dist/pick-by.d.cts.map +0 -1
  1251. package/dist/pick-by.d.ts +0 -68
  1252. package/dist/pick-by.d.ts.map +0 -1
  1253. package/dist/pick.d.cts +0 -55
  1254. package/dist/pick.d.cts.map +0 -1
  1255. package/dist/pick.d.ts +0 -55
  1256. package/dist/pick.d.ts.map +0 -1
  1257. package/dist/pipe-CB7Lufqv.cjs +0 -1
  1258. package/dist/pipe-CZKusDA-.js +0 -2
  1259. package/dist/pipe-CZKusDA-.js.map +0 -1
  1260. package/dist/pipe.d.cts +0 -106
  1261. package/dist/pipe.d.cts.map +0 -1
  1262. package/dist/pipe.d.ts +0 -106
  1263. package/dist/pipe.d.ts.map +0 -1
  1264. package/dist/piped.d.cts +0 -31
  1265. package/dist/piped.d.cts.map +0 -1
  1266. package/dist/piped.d.ts +0 -31
  1267. package/dist/piped.d.ts.map +0 -1
  1268. package/dist/product.d.cts +0 -52
  1269. package/dist/product.d.cts.map +0 -1
  1270. package/dist/product.d.ts +0 -52
  1271. package/dist/product.d.ts.map +0 -1
  1272. package/dist/prop-D-4cFXSd.d.cts +0 -85
  1273. package/dist/prop-D-4cFXSd.d.cts.map +0 -1
  1274. package/dist/prop-DL-oRBeN.d.ts +0 -85
  1275. package/dist/prop-DL-oRBeN.d.ts.map +0 -1
  1276. package/dist/prop.d.cts +0 -2
  1277. package/dist/prop.d.ts +0 -2
  1278. package/dist/pull-object.d.cts +0 -70
  1279. package/dist/pull-object.d.cts.map +0 -1
  1280. package/dist/pull-object.d.ts +0 -70
  1281. package/dist/pull-object.d.ts.map +0 -1
  1282. package/dist/random-integer.d.cts +0 -23
  1283. package/dist/random-integer.d.cts.map +0 -1
  1284. package/dist/random-integer.d.ts +0 -23
  1285. package/dist/random-integer.d.ts.map +0 -1
  1286. package/dist/random-string.d.cts +0 -29
  1287. package/dist/random-string.d.cts.map +0 -1
  1288. package/dist/random-string.d.ts +0 -29
  1289. package/dist/random-string.d.ts.map +0 -1
  1290. package/dist/range.d.cts +0 -27
  1291. package/dist/range.d.cts.map +0 -1
  1292. package/dist/range.d.ts +0 -27
  1293. package/dist/range.d.ts.map +0 -1
  1294. package/dist/rank-by.d.cts +0 -45
  1295. package/dist/rank-by.d.cts.map +0 -1
  1296. package/dist/rank-by.d.ts +0 -45
  1297. package/dist/rank-by.d.ts.map +0 -1
  1298. package/dist/reduce.d.cts +0 -53
  1299. package/dist/reduce.d.cts.map +0 -1
  1300. package/dist/reduce.d.ts +0 -53
  1301. package/dist/reduce.d.ts.map +0 -1
  1302. package/dist/reordered-array-BWG6tVSK.d.ts +0 -7
  1303. package/dist/reordered-array-BWG6tVSK.d.ts.map +0 -1
  1304. package/dist/reordered-array-CmReuxDi.d.cts +0 -7
  1305. package/dist/reordered-array-CmReuxDi.d.cts.map +0 -1
  1306. package/dist/reverse.d.cts +0 -29
  1307. package/dist/reverse.d.cts.map +0 -1
  1308. package/dist/reverse.d.ts +0 -29
  1309. package/dist/reverse.d.ts.map +0 -1
  1310. package/dist/round.d.cts +0 -39
  1311. package/dist/round.d.cts.map +0 -1
  1312. package/dist/round.d.ts +0 -39
  1313. package/dist/round.d.ts.map +0 -1
  1314. package/dist/sample.d.cts +0 -69
  1315. package/dist/sample.d.cts.map +0 -1
  1316. package/dist/sample.d.ts +0 -69
  1317. package/dist/sample.d.ts.map +0 -1
  1318. package/dist/set-path.d.cts +0 -47
  1319. package/dist/set-path.d.cts.map +0 -1
  1320. package/dist/set-path.d.ts +0 -47
  1321. package/dist/set-path.d.ts.map +0 -1
  1322. package/dist/set.d.cts +0 -40
  1323. package/dist/set.d.cts.map +0 -1
  1324. package/dist/set.d.ts +0 -40
  1325. package/dist/set.d.ts.map +0 -1
  1326. package/dist/shuffle.d.cts +0 -31
  1327. package/dist/shuffle.d.cts.map +0 -1
  1328. package/dist/shuffle.d.ts +0 -31
  1329. package/dist/shuffle.d.ts.map +0 -1
  1330. package/dist/sleep.d.cts +0 -16
  1331. package/dist/sleep.d.cts.map +0 -1
  1332. package/dist/sleep.d.ts +0 -16
  1333. package/dist/sleep.d.ts.map +0 -1
  1334. package/dist/slice-string.d.cts +0 -41
  1335. package/dist/slice-string.d.cts.map +0 -1
  1336. package/dist/slice-string.d.ts +0 -41
  1337. package/dist/slice-string.d.ts.map +0 -1
  1338. package/dist/slugify.d.cts +0 -15
  1339. package/dist/slugify.d.cts.map +0 -1
  1340. package/dist/slugify.d.ts +0 -15
  1341. package/dist/slugify.d.ts.map +0 -1
  1342. package/dist/sort-by.d.cts +0 -88
  1343. package/dist/sort-by.d.cts.map +0 -1
  1344. package/dist/sort-by.d.ts +0 -88
  1345. package/dist/sort-by.d.ts.map +0 -1
  1346. package/dist/sort.d.cts +0 -39
  1347. package/dist/sort.d.cts.map +0 -1
  1348. package/dist/sort.d.ts +0 -39
  1349. package/dist/sort.d.ts.map +0 -1
  1350. package/dist/sorted-index-by.d.cts +0 -70
  1351. package/dist/sorted-index-by.d.cts.map +0 -1
  1352. package/dist/sorted-index-by.d.ts +0 -70
  1353. package/dist/sorted-index-by.d.ts.map +0 -1
  1354. package/dist/sorted-index-with.d.cts +0 -72
  1355. package/dist/sorted-index-with.d.cts.map +0 -1
  1356. package/dist/sorted-index-with.d.ts +0 -72
  1357. package/dist/sorted-index-with.d.ts.map +0 -1
  1358. package/dist/sorted-index.d.cts +0 -45
  1359. package/dist/sorted-index.d.cts.map +0 -1
  1360. package/dist/sorted-index.d.ts +0 -45
  1361. package/dist/sorted-index.d.ts.map +0 -1
  1362. package/dist/sorted-last-index-by.d.cts +0 -72
  1363. package/dist/sorted-last-index-by.d.cts.map +0 -1
  1364. package/dist/sorted-last-index-by.d.ts +0 -72
  1365. package/dist/sorted-last-index-by.d.ts.map +0 -1
  1366. package/dist/sorted-last-index.d.cts +0 -45
  1367. package/dist/sorted-last-index.d.cts.map +0 -1
  1368. package/dist/sorted-last-index.d.ts +0 -45
  1369. package/dist/sorted-last-index.d.ts.map +0 -1
  1370. package/dist/splice.d.cts +0 -35
  1371. package/dist/splice.d.cts.map +0 -1
  1372. package/dist/splice.d.ts +0 -35
  1373. package/dist/splice.d.ts.map +0 -1
  1374. package/dist/split-at.d.cts +0 -31
  1375. package/dist/split-at.d.cts.map +0 -1
  1376. package/dist/split-at.d.ts +0 -31
  1377. package/dist/split-at.d.ts.map +0 -1
  1378. package/dist/split-when.d.cts +0 -29
  1379. package/dist/split-when.d.cts.map +0 -1
  1380. package/dist/split-when.d.ts +0 -29
  1381. package/dist/split-when.d.ts.map +0 -1
  1382. package/dist/split.d.cts +0 -62
  1383. package/dist/split.d.cts.map +0 -1
  1384. package/dist/split.d.ts +0 -62
  1385. package/dist/split.d.ts.map +0 -1
  1386. package/dist/strict-function-BBgKFNUw.d.ts +0 -26
  1387. package/dist/strict-function-BBgKFNUw.d.ts.map +0 -1
  1388. package/dist/strict-function-CPTwDgnZ.d.cts +0 -26
  1389. package/dist/strict-function-CPTwDgnZ.d.cts.map +0 -1
  1390. package/dist/string-to-path.d.cts +0 -39
  1391. package/dist/string-to-path.d.cts.map +0 -1
  1392. package/dist/string-to-path.d.ts +0 -39
  1393. package/dist/string-to-path.d.ts.map +0 -1
  1394. package/dist/subtract.d.cts +0 -35
  1395. package/dist/subtract.d.cts.map +0 -1
  1396. package/dist/subtract.d.ts +0 -35
  1397. package/dist/subtract.d.ts.map +0 -1
  1398. package/dist/sum-by.d.cts +0 -57
  1399. package/dist/sum-by.d.cts.map +0 -1
  1400. package/dist/sum-by.d.ts +0 -57
  1401. package/dist/sum-by.d.ts.map +0 -1
  1402. package/dist/sum.d.cts +0 -50
  1403. package/dist/sum.d.cts.map +0 -1
  1404. package/dist/sum.d.ts +0 -50
  1405. package/dist/sum.d.ts.map +0 -1
  1406. package/dist/swap-in-place-BHkB_mvV.cjs +0 -1
  1407. package/dist/swap-in-place-C_jXKHuD.js +0 -2
  1408. package/dist/swap-in-place-C_jXKHuD.js.map +0 -1
  1409. package/dist/swap-indices.d.cts +0 -61
  1410. package/dist/swap-indices.d.cts.map +0 -1
  1411. package/dist/swap-indices.d.ts +0 -61
  1412. package/dist/swap-indices.d.ts.map +0 -1
  1413. package/dist/swap-props.d.cts +0 -34
  1414. package/dist/swap-props.d.cts.map +0 -1
  1415. package/dist/swap-props.d.ts +0 -34
  1416. package/dist/swap-props.d.ts.map +0 -1
  1417. package/dist/take-first-by.d.cts +0 -41
  1418. package/dist/take-first-by.d.cts.map +0 -1
  1419. package/dist/take-first-by.d.ts +0 -41
  1420. package/dist/take-first-by.d.ts.map +0 -1
  1421. package/dist/take-last-while.d.cts +0 -36
  1422. package/dist/take-last-while.d.cts.map +0 -1
  1423. package/dist/take-last-while.d.ts +0 -36
  1424. package/dist/take-last-while.d.ts.map +0 -1
  1425. package/dist/take-last.d.cts +0 -32
  1426. package/dist/take-last.d.cts.map +0 -1
  1427. package/dist/take-last.d.ts +0 -32
  1428. package/dist/take-last.d.ts.map +0 -1
  1429. package/dist/take-while.d.cts +0 -34
  1430. package/dist/take-while.d.cts.map +0 -1
  1431. package/dist/take-while.d.ts +0 -34
  1432. package/dist/take-while.d.ts.map +0 -1
  1433. package/dist/take.d.cts +0 -34
  1434. package/dist/take.d.cts.map +0 -1
  1435. package/dist/take.d.ts +0 -34
  1436. package/dist/take.d.ts.map +0 -1
  1437. package/dist/tap.d.cts +0 -42
  1438. package/dist/tap.d.cts.map +0 -1
  1439. package/dist/tap.d.ts +0 -42
  1440. package/dist/tap.d.ts.map +0 -1
  1441. package/dist/times.d.cts +0 -48
  1442. package/dist/times.d.cts.map +0 -1
  1443. package/dist/times.d.ts +0 -48
  1444. package/dist/times.d.ts.map +0 -1
  1445. package/dist/to-camel-case.d.cts +0 -84
  1446. package/dist/to-camel-case.d.cts.map +0 -1
  1447. package/dist/to-camel-case.d.ts +0 -84
  1448. package/dist/to-camel-case.d.ts.map +0 -1
  1449. package/dist/to-kebab-case.d.cts +0 -60
  1450. package/dist/to-kebab-case.d.cts.map +0 -1
  1451. package/dist/to-kebab-case.d.ts +0 -60
  1452. package/dist/to-kebab-case.d.ts.map +0 -1
  1453. package/dist/to-lower-case.d.cts +0 -51
  1454. package/dist/to-lower-case.d.cts.map +0 -1
  1455. package/dist/to-lower-case.d.ts +0 -51
  1456. package/dist/to-lower-case.d.ts.map +0 -1
  1457. package/dist/to-single-BKYbBic-.js +0 -2
  1458. package/dist/to-single-BKYbBic-.js.map +0 -1
  1459. package/dist/to-single-Chq_hKEk.cjs +0 -1
  1460. package/dist/to-snake-case.d.cts +0 -60
  1461. package/dist/to-snake-case.d.cts.map +0 -1
  1462. package/dist/to-snake-case.d.ts +0 -60
  1463. package/dist/to-snake-case.d.ts.map +0 -1
  1464. package/dist/to-string-DkC3zRUJ.d.cts +0 -13
  1465. package/dist/to-string-DkC3zRUJ.d.cts.map +0 -1
  1466. package/dist/to-string-YIFx2KS6.d.ts +0 -13
  1467. package/dist/to-string-YIFx2KS6.d.ts.map +0 -1
  1468. package/dist/to-title-case.d.cts +0 -86
  1469. package/dist/to-title-case.d.cts.map +0 -1
  1470. package/dist/to-title-case.d.ts +0 -86
  1471. package/dist/to-title-case.d.ts.map +0 -1
  1472. package/dist/to-upper-case.d.cts +0 -51
  1473. package/dist/to-upper-case.d.cts.map +0 -1
  1474. package/dist/to-upper-case.d.ts +0 -51
  1475. package/dist/to-upper-case.d.ts.map +0 -1
  1476. package/dist/tuple-parts-BYI4o8Vk.d.ts +0 -89
  1477. package/dist/tuple-parts-BYI4o8Vk.d.ts.map +0 -1
  1478. package/dist/tuple-parts-CzQQupgi.d.cts +0 -89
  1479. package/dist/tuple-parts-CzQQupgi.d.cts.map +0 -1
  1480. package/dist/type.helpers.d.cts +0 -5
  1481. package/dist/type.helpers.d.cts.map +0 -1
  1482. package/dist/type.helpers.d.ts +0 -5
  1483. package/dist/type.helpers.d.ts.map +0 -1
  1484. package/dist/uncapitalize.d.cts +0 -51
  1485. package/dist/uncapitalize.d.cts.map +0 -1
  1486. package/dist/uncapitalize.d.ts +0 -51
  1487. package/dist/uncapitalize.d.ts.map +0 -1
  1488. package/dist/unique-by.d.cts +0 -44
  1489. package/dist/unique-by.d.cts.map +0 -1
  1490. package/dist/unique-by.d.ts +0 -44
  1491. package/dist/unique-by.d.ts.map +0 -1
  1492. package/dist/unique-with.d.cts +0 -46
  1493. package/dist/unique-with.d.cts.map +0 -1
  1494. package/dist/unique-with.d.ts +0 -46
  1495. package/dist/unique-with.d.ts.map +0 -1
  1496. package/dist/unique.d.cts +0 -39
  1497. package/dist/unique.d.cts.map +0 -1
  1498. package/dist/unique.d.ts +0 -39
  1499. package/dist/unique.d.ts.map +0 -1
  1500. package/dist/upsert-prop-0hwik6JJ.d.cts +0 -8
  1501. package/dist/upsert-prop-0hwik6JJ.d.cts.map +0 -1
  1502. package/dist/upsert-prop-_NpaZwm4.d.ts +0 -8
  1503. package/dist/upsert-prop-_NpaZwm4.d.ts.map +0 -1
  1504. package/dist/utility-evaluators-Boc-TMbq.js +0 -2
  1505. package/dist/utility-evaluators-Boc-TMbq.js.map +0 -1
  1506. package/dist/utility-evaluators-CAbODbuk.cjs +0 -1
  1507. package/dist/values.d.cts +0 -38
  1508. package/dist/values.d.cts.map +0 -1
  1509. package/dist/values.d.ts +0 -38
  1510. package/dist/values.d.ts.map +0 -1
  1511. package/dist/with-precision-CQ90Walk.js +0 -2
  1512. package/dist/with-precision-CQ90Walk.js.map +0 -1
  1513. package/dist/with-precision-dQAYLrgr.cjs +0 -1
  1514. package/dist/words-DQCM5umD.js +0 -3
  1515. package/dist/words-DQCM5umD.js.map +0 -1
  1516. package/dist/words-DRQKxzLU.cjs +0 -2
  1517. package/dist/zip-with.d.cts +0 -50
  1518. package/dist/zip-with.d.cts.map +0 -1
  1519. package/dist/zip-with.d.ts +0 -50
  1520. package/dist/zip-with.d.ts.map +0 -1
  1521. package/dist/zip.d.cts +0 -38
  1522. package/dist/zip.d.cts.map +0 -1
  1523. package/dist/zip.d.ts +0 -38
  1524. package/dist/zip.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-CTEJD5TX.js","names":[],"sources":["../src/internal/curry-on.ts","../src/conditional.ts"],"sourcesContent":["/**\n * Utility for currying functions based on a predicate for the first argument.\n *\n * This is useful for currying functions with a variadic argument list.\n */\nexport function curryOn<T>(\n isArg: (firstArg: unknown) => firstArg is T,\n implementation: (\n data: unknown,\n firstArg: T,\n // eslint-disable-next-line ts/no-explicit-any -- Function inference in typescript relies on `any` to work, it doesn't work with `unknown`\n ...args: any\n ) => unknown,\n args: ReadonlyArray<unknown>,\n): unknown {\n return isArg(args[0])\n ? // @ts-expect-error [ts2556] - This is a low-level function that assumes the function declaration and setup is correct and won't result in typing issues when called dynamically.\n (data: unknown) => implementation(data, ...args)\n : // @ts-expect-error [ts2556] - This is a low-level function that assumes the function declaration and setup is correct and won't result in typing issues when called dynamically.\n implementation(...args);\n}\n","/* eslint-disable jsdoc/check-param-names --\n * We don't document each `case` param, instead we document the concept more\n * generally, but these eslint rules can't detect that.\n */\n\nimport type { GuardType } from './internal/types/guard-type';\nimport { curryOn } from './internal/curry-on';\n\ntype Case<\n In,\n Out,\n When extends (x: In) => boolean = (x: In) => boolean,\n> = readonly [when: When, then: (x: GuardType<When, In> & In) => Out];\n\ntype DefaultCase<In, Out> = (x: In) => Out;\n\n/**\n * Executes a transformer function based on the first matching predicate,\n * functioning like a series of `if...else if...` statements. It sequentially\n * evaluates each case and, upon finding a truthy predicate, runs the\n * corresponding transformer, and returns, ignoring any further cases, even if\n * they would match.\n *\n * NOTE*: Some type-predicates may fail to narrow the param type of their\n * transformer; in such cases wrap your type-predicate in an anonymous arrow\n * function: e.g., instead of\n * `conditional(..., [myTypePredicate, myTransformer], ...)`, use\n * `conditional(..., [($) => myTypePredicate($), myTransformer], ...)`.\n *\n * To add a a default, catch-all, case you can provide a single callback\n * function (instead of a 2-tuple) as the last case. This is equivalent to\n * adding a case with a trivial always-true predicate as it's condition (see\n * example).\n *\n * For simpler cases you should also consider using `when` instead.\n *\n * Due to TypeScript's inability to infer the result of negating a type-\n * predicate we can't refine the types used in subsequent cases based on\n * previous conditions. Using a `switch (true)` statement or ternary operators\n * is recommended for more precise type control when such type narrowing is\n * needed.\n *\n * !IMPORTANT! - Unlike similar implementations in Lodash and Ramda, this\n * implementation **doesn't** implicitly return `undefined` as a fallback when\n * when none of the cases match; and instead **throws** an exception in those\n * cases! You have to explicitly provide a default case, and can use\n * `constant(undefined)` as your last case to replicate that behavior.\n *\n * @param cases - A list of (up to 10) cases. Each case can be either:\n * - A 2-tuple consisting of a predicate (or type-predicate) and a transformer\n * function that processes the data if the predicate matches.\n * - A single callback function that acts as a default fallback case.\n * @returns The output of the matched transformer. If no cases match, an\n * exception is thrown. The return type is a union of the return types of all\n * provided transformers.\n * @signature\n * conditional(...cases)(data);\n * @example\n * const nameOrId = 3 as string | number | boolean;\n *\n * pipe(\n * nameOrId,\n * conditional(\n * [isString, (name) => `Hello ${name}`],\n * [isNumber, (id) => `Hello ID: ${id}`],\n * ),\n * ); //=> 'Hello ID: 3' (typed as `string`), can throw!.\n *\n * pipe(\n * nameOrId,\n * conditional(\n * [isString, (name) => `Hello ${name}`],\n * [isNumber, (id) => `Hello ID: ${id}`],\n * constant(undefined),\n * ),\n * ); //=> 'Hello ID: 3' (typed as `string | undefined`), won't throw.\n *\n * pipe(\n * nameOrId,\n * conditional(\n * [isString, (name) => `Hello ${name}`],\n * [isNumber, (id) => `Hello ID: ${id}`],\n * (something) => `Hello something (${JSON.stringify(something)})`,\n * ),\n * ); //=> 'Hello ID: 3' (typed as `string`), won't throw.\n * @dataLast\n * @category Function\n */\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Return0,\n Fallback = never,\n>(\n // TODO [>2]: TypeScript has problems inferring narrowed types within the case tuples, making it hard to work with this utility. Removing the tuple wrappers solves these issues without impacting the API too much.\n case0: Case<T, Return0, Fn0>,\n fallback?: DefaultCase<T, Fallback>,\n): (data: T) => Return0 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n // TODO [>2]: Exclude previous guarded types from the next functions in the chain. Although this isn't a prefect solution, it's the common approach to compute the \"negation\" of a type-predicate, and would provide a more comfortable API for bigger chains for cases like discriminated unions. This TODO is at the first occurrence where it is relevant, but it should be applied to **all** subsequent overloads. p.s. don't forget to update the docs too!\n Fn1 extends (x: T) => boolean,\n Return0,\n Return1,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n fallback?: DefaultCase<T, Fallback>,\n): (data: T) => Return0 | Return1 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n fallback?: DefaultCase<T, Fallback>,\n): (data: T) => Return0 | Return1 | Return2 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n fallback?: DefaultCase<T, Fallback>,\n): (data: T) => Return0 | Return1 | Return2 | Return3 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n fallback?: DefaultCase<T, Fallback>,\n): (data: T) => Return0 | Return1 | Return2 | Return3 | Return4 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n fallback?: DefaultCase<T, Fallback>,\n): (\n data: T,\n) => Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n fallback?: DefaultCase<T, Fallback>,\n): (\n data: T,\n) =>\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Fn7 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Return7,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n case7: Case<T, Return7, Fn7>,\n fallback?: DefaultCase<T, Fallback>,\n): (\n data: T,\n) =>\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Return7\n | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Fn7 extends (x: T) => boolean,\n Fn8 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Return7,\n Return8,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n case7: Case<T, Return7, Fn7>,\n case8: Case<T, Return8, Fn8>,\n fallback?: DefaultCase<T, Fallback>,\n): (\n data: T,\n) =>\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Return7\n | Return8\n | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Fn7 extends (x: T) => boolean,\n Fn8 extends (x: T) => boolean,\n Fn9 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Return7,\n Return8,\n Return9,\n Fallback = never,\n>(\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n case7: Case<T, Return7, Fn7>,\n case8: Case<T, Return8, Fn8>,\n case9: Case<T, Return9, Fn9>,\n fallback?: DefaultCase<T, Fallback>,\n): (\n data: T,\n) =>\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Return7\n | Return8\n | Return9\n | Fallback;\n\n/**\n * Executes a transformer function based on the first matching predicate,\n * functioning like a series of `if...else if...` statements. It sequentially\n * evaluates each case and, upon finding a truthy predicate, runs the\n * corresponding transformer, and returns, ignoring any further cases, even if\n * they would match.\n *\n * NOTE*: Some type-predicates may fail to narrow the param type of their\n * transformer; in such cases wrap your type-predicate in an anonymous arrow\n * function: e.g., instead of\n * `conditional(..., [myTypePredicate, myTransformer], ...)`, use\n * `conditional(..., [($) => myTypePredicate($), myTransformer], ...)`.\n *\n * To add a a default, catch-all, case you can provide a single callback\n * function (instead of a 2-tuple) as the last case. This is equivalent to\n * adding a case with a trivial always-true predicate as it's condition (see\n * example).\n *\n * For simpler cases you should also consider using `when` instead.\n *\n * Due to TypeScript's inability to infer the result of negating a type-\n * predicate we can't refine the types used in subsequent cases based on\n * previous conditions. Using a `switch (true)` statement or ternary operators\n * is recommended for more precise type control when such type narrowing is\n * needed.\n *\n * !IMPORTANT! - Unlike similar implementations in Lodash and Ramda, this\n * implementation **doesn't** implicitly return `undefined` as a fallback when\n * when none of the cases match; and instead **throws** an exception in those\n * cases! You have to explicitly provide a default case, and can use\n * `constant(undefined)` as your last case to replicate that behavior.\n *\n * @param data - The input data to be evaluated against the provided cases.\n * @param cases - A list of (up to 10) cases. Each case can be either:\n * - A 2-tuple consisting of a predicate (or type-predicate) and a transformer\n * function that processes the data if the predicate matches.\n * - A single callback function that acts as a default fallback case.\n * @returns The output of the matched transformer. If no cases match, an\n * exception is thrown. The return type is a union of the return types of all\n * provided transformers.\n * @signature\n * conditional(data, ...cases);\n * @example\n * const nameOrId = 3 as string | number | boolean;\n *\n * conditional(\n * nameOrId,\n * [isString, (name) => `Hello ${name}`],\n * [isNumber, (id) => `Hello ID: ${id}`],\n * ); //=> 'Hello ID: 3' (typed as `string`), can throw!.\n *\n * conditional(\n * nameOrId,\n * [isString, (name) => `Hello ${name}`],\n * [isNumber, (id) => `Hello ID: ${id}`],\n * constant(undefined),\n * ); //=> 'Hello ID: 3' (typed as `string | undefined`), won't throw.\n *\n * conditional(\n * nameOrId,\n * [isString, (name) => `Hello ${name}`],\n * [isNumber, (id) => `Hello ID: ${id}`],\n * (something) => `Hello something (${JSON.stringify(something)})`,\n * ); //=> 'Hello ID: 3' (typed as `string`), won't throw.\n * @dataFirst\n * @category Function\n */\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Return0,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n fallback?: DefaultCase<T, Fallback>,\n): Return0 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Return0,\n Return1,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n fallback?: DefaultCase<T, Fallback>,\n): Return0 | Return1 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n fallback?: DefaultCase<T, Fallback>,\n): Return0 | Return1 | Return2 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n fallback?: DefaultCase<T, Fallback>,\n): Return0 | Return1 | Return2 | Return3 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n fallback?: DefaultCase<T, Fallback>,\n): Return0 | Return1 | Return2 | Return3 | Return4 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n fallback?: DefaultCase<T, Fallback>,\n): Return0 | Return1 | Return2 | Return3 | Return4 | Return5 | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n fallback?: DefaultCase<T, Fallback>,\n):\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Fn7 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Return7,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n case7: Case<T, Return7, Fn7>,\n fallback?: DefaultCase<T, Fallback>,\n):\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Return7\n | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Fn7 extends (x: T) => boolean,\n Fn8 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Return7,\n Return8,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n case7: Case<T, Return7, Fn7>,\n case8: Case<T, Return8, Fn8>,\n fallback?: DefaultCase<T, Fallback>,\n):\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Return7\n | Return8\n | Fallback;\n\nexport function conditional<\n T,\n Fn0 extends (x: T) => boolean,\n Fn1 extends (x: T) => boolean,\n Fn2 extends (x: T) => boolean,\n Fn3 extends (x: T) => boolean,\n Fn4 extends (x: T) => boolean,\n Fn5 extends (x: T) => boolean,\n Fn6 extends (x: T) => boolean,\n Fn7 extends (x: T) => boolean,\n Fn8 extends (x: T) => boolean,\n Fn9 extends (x: T) => boolean,\n Return0,\n Return1,\n Return2,\n Return3,\n Return4,\n Return5,\n Return6,\n Return7,\n Return8,\n Return9,\n Fallback = never,\n>(\n data: T,\n case0: Case<T, Return0, Fn0>,\n case1: Case<T, Return1, Fn1>,\n case2: Case<T, Return2, Fn2>,\n case3: Case<T, Return3, Fn3>,\n case4: Case<T, Return4, Fn4>,\n case5: Case<T, Return5, Fn5>,\n case6: Case<T, Return6, Fn6>,\n case7: Case<T, Return7, Fn7>,\n case8: Case<T, Return8, Fn8>,\n case9: Case<T, Return9, Fn9>,\n fallback?: DefaultCase<T, Fallback>,\n):\n | Return0\n | Return1\n | Return2\n | Return3\n | Return4\n | Return5\n | Return6\n | Return7\n | Return8\n | Return9\n | Fallback;\n\nexport function conditional(...args: ReadonlyArray<unknown>): unknown {\n return curryOn(isCase, conditionalImplementation, args);\n}\n\nfunction conditionalImplementation<In, Out>(\n data: In,\n ...cases: ReadonlyArray<Case<In, Out> | DefaultCase<In, Out>>\n): Out {\n for (const current of cases) {\n if (typeof current === 'function') {\n return current(data);\n }\n\n const [when, then] = current;\n if (when(data)) {\n return then(data);\n }\n }\n\n // TODO [>2]: When we built this function originally we didn't want to have to always return `undefined` and force users to always have to handle that case even when they knew it would never happen. In hindsight that was wrong and we can support this at the type-level without throwing. If users want to throw they can always have an explicit fallback that does that (and we might add a throw utility in v3 too!).\n throw new Error('conditional: data failed for all cases');\n}\n\nfunction isCase(maybeCase: unknown): maybeCase is Case<unknown, unknown> {\n if (!Array.isArray(maybeCase)) {\n return false;\n }\n\n const [when, then, ...rest] = maybeCase as ReadonlyArray<unknown>;\n return (\n typeof when === 'function'\n && when.length <= 1\n && typeof then === 'function'\n && then.length <= 1\n && rest.length === 0\n );\n}\n"],"mappings":"AAKA,SAAgB,EACd,EACA,EAMA,EACS,CACT,OAAO,EAAM,EAAK,GAAG,CAEhB,GAAkB,EAAe,EAAM,GAAG,EAAK,CAEhD,EAAe,GAAG,EAAK,CCgsB7B,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAAQ,EAAQ,EAA2B,EAAK,CAGzD,SAAS,EACP,EACA,GAAG,EACE,CACL,IAAK,IAAM,KAAW,EAAO,CAC3B,GAAI,OAAO,GAAY,WACrB,OAAO,EAAQ,EAAK,CAGtB,GAAM,CAAC,EAAM,GAAQ,EACrB,GAAI,EAAK,EAAK,CACZ,OAAO,EAAK,EAAK,CAKrB,MAAU,MAAM,yCAAyC,CAG3D,SAAS,EAAO,EAAyD,CACvE,GAAI,CAAC,MAAM,QAAQ,EAAU,CAC3B,MAAO,GAGT,GAAM,CAAC,EAAM,EAAM,GAAG,GAAQ,EAC9B,OACE,OAAO,GAAS,YACb,EAAK,QAAU,GACf,OAAO,GAAS,YAChB,EAAK,QAAU,GACf,EAAK,SAAW"}
@@ -1 +1 @@
1
- const e=require(`./conditional-6ff4g8Sy.cjs`);exports.conditional=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./conditional-3wcaMG9k.cjs`);exports.conditional=e.t;
@@ -1 +1 @@
1
- import{t as e}from"./conditional-WbmvQs8H.js";export{e as conditional};
1
+ import{t as e}from"./conditional-CTEJD5TX.js";export{e as conditional};
package/dist/constant.cjs CHANGED
@@ -1 +1,2 @@
1
- function e(e){return()=>e}exports.constant=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return()=>e}exports.constant=e;
2
+ //# sourceMappingURL=constant.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constant.cjs","names":[],"sources":["../src/constant.ts"],"sourcesContent":["/**\n * A function that takes any arguments and returns the provided `value` on every\n * invocation. This is useful to provide trivial implementations for APIs or in\n * combination with a ternary or other conditional execution to allow to short-\n * circuit more complex implementations for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `doNothing` - A function that doesn't return anything.\n * `identity` - A function that returns the first argument it receives.\n *\n * @param value - The constant value that would be returned on every invocation.\n * The value is not copied/cloned on every invocation so care should be taken\n * with mutable objects (like arrays, objects, Maps, etc...).\n * @signature\n * constant(value);\n * @example\n * map([1, 2, 3], constant('a')); // => ['a', 'a', 'a']\n * map(\n * [1, 2, 3],\n * isDemoMode ? add(1) : constant(0),\n * ); // => [2, 3, 4] or [0, 0, 0]\n * @dataLast\n * @category Function\n */\nexport function constant<const T>(\n value: T,\n): // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters -- There is no other way to make typescript infer the function arguments \"backwards\" in data-last invocations without the Args type parameter. @see: https://github.com/typescript-eslint/typescript-eslint/issues/9887\n<Args extends ReadonlyArray<unknown>>(...args: Args) => T {\n return () => value;\n}\n"],"mappings":"mEA2BA,SAAgB,EACd,EAEwD,CACxD,UAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"constant.js","names":[],"sources":["../src/constant.ts"],"sourcesContent":["/**\n * A function that takes any arguments and returns the provided `value` on every\n * invocation. This is useful to provide trivial implementations for APIs or in\n * combination with a ternary or other conditional execution to allow to short-\n * circuit more complex implementations for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `doNothing` - A function that doesn't return anything.\n * `identity` - A function that returns the first argument it receives.\n *\n * @param value - The constant value that would be returned on every invocation.\n * The value is not copied/cloned on every invocation so care should be taken\n * with mutable objects (like arrays, objects, Maps, etc...).\n * @signature\n * P.constant(value);\n * @example\n * P.map([1, 2, 3], P.constant('a')); // => ['a', 'a', 'a']\n * P.map(\n * [1, 2, 3],\n * isDemoMode ? P.add(1) : P.constant(0),\n * ); // => [2, 3, 4] or [0, 0, 0]\n * @dataLast\n * @category Function\n */\nexport function constant<const T>(\n value: T,\n): <Args extends ReadonlyArray<unknown>>(...args: Args) => T {\n return () => value;\n}\n"],"mappings":"AA2BA,SAAgB,EACd,EAC2D,CAC3D,UAAa"}
1
+ {"version":3,"file":"constant.js","names":[],"sources":["../src/constant.ts"],"sourcesContent":["/**\n * A function that takes any arguments and returns the provided `value` on every\n * invocation. This is useful to provide trivial implementations for APIs or in\n * combination with a ternary or other conditional execution to allow to short-\n * circuit more complex implementations for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `doNothing` - A function that doesn't return anything.\n * `identity` - A function that returns the first argument it receives.\n *\n * @param value - The constant value that would be returned on every invocation.\n * The value is not copied/cloned on every invocation so care should be taken\n * with mutable objects (like arrays, objects, Maps, etc...).\n * @signature\n * constant(value);\n * @example\n * map([1, 2, 3], constant('a')); // => ['a', 'a', 'a']\n * map(\n * [1, 2, 3],\n * isDemoMode ? add(1) : constant(0),\n * ); // => [2, 3, 4] or [0, 0, 0]\n * @dataLast\n * @category Function\n */\nexport function constant<const T>(\n value: T,\n): // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters -- There is no other way to make typescript infer the function arguments \"backwards\" in data-last invocations without the Args type parameter. @see: https://github.com/typescript-eslint/typescript-eslint/issues/9887\n<Args extends ReadonlyArray<unknown>>(...args: Args) => T {\n return () => value;\n}\n"],"mappings":"AA2BA,SAAgB,EACd,EAEwD,CACxD,UAAa"}
package/dist/count-by.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);function t(...t){return e.t(n,t)}function n(e,t){let n=new Map;for(let[r,i]of e.entries()){let a=t(i,r,e);if(a!==void 0){let e=n.get(a);e===void 0?n.set(a,1):n.set(a,e+1)}}return Object.fromEntries(n)}exports.countBy=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){let n=new Map;for(let[r,i]of e.entries()){let a=t(i,r,e);if(a!==void 0){let e=n.get(a);e===void 0?n.set(a,1):n.set(a,e+1)}}return Object.fromEntries(n)}exports.countBy=t;
2
+ //# sourceMappingURL=count-by.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count-by.cjs","names":["curry"],"sources":["../src/count-by.ts"],"sourcesContent":["import type { BoundedPartial } from './internal/types/bounded-partial';\nimport { curry } from './curry';\n\n/**\n * Categorize and count elements in an array using a defined callback function.\n * The callback function is applied to each element in the array to determine\n * its category and then counts how many elements fall into each category.\n *\n * @param data - The array.\n * @param categorizationFn - The categorization function.\n * @signature\n * countBy(data, categorizationFn)\n * @example\n * countBy(\n * [\"a\", \"b\", \"c\", \"B\", \"A\", \"a\"],\n * toLowerCase()\n * ); //=> { a: 3, b: 2, c: 1 }\n * @dataFirst\n * @category Array\n */\nexport function countBy<T, K extends PropertyKey>(\n data: ReadonlyArray<T>,\n categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n ) => K | undefined,\n): BoundedPartial<Record<K, number>>;\n\n/**\n * Categorize and count elements in an array using a defined callback function.\n * The callback function is applied to each element in the array to determine\n * its category and then counts how many elements fall into each category.\n *\n * @param categorizationFn - The categorization function.\n * @signature\n * countBy(categorizationFn)(data)\n * @example\n * pipe(\n * [\"a\", \"b\", \"c\", \"B\", \"A\", \"a\"],\n * countBy(toLowerCase()),\n * ); //=> { a: 3, b: 2, c: 1 }\n * @dataLast\n * @category Array\n */\nexport function countBy<T, K extends PropertyKey>(\n categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n ) => K | undefined,\n): (data: ReadonlyArray<T>) => BoundedPartial<Record<K, number>>;\n\nexport function countBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(countByImplementation, args);\n}\n\nfunction countByImplementation<T>(data: ReadonlyArray<T>, categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n) => PropertyKey | undefined): BoundedPartial<Record<PropertyKey, number>> {\n const out = new Map<PropertyKey, number>();\n\n for (const [index, item] of data.entries()) {\n const category = categorizationFn(item, index, data);\n if (category !== undefined) {\n const count = out.get(category);\n if (count === undefined) {\n out.set(category, 1);\n } else {\n out.set(category, count + 1);\n }\n }\n }\n\n return Object.fromEntries(out);\n}\n"],"mappings":"kGAqDA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAOA,EAAAA,MAAM,EAAuB,EAAK,CAG3C,SAAS,EAAyB,EAAwB,EAIiB,CACzE,IAAM,EAAM,IAAI,IAEhB,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,IAAM,EAAW,EAAiB,EAAM,EAAO,EAAK,CACpD,GAAI,IAAa,IAAA,GAAW,CAC1B,IAAM,EAAQ,EAAI,IAAI,EAAS,CAC3B,IAAU,IAAA,GACZ,EAAI,IAAI,EAAU,EAAE,CAEpB,EAAI,IAAI,EAAU,EAAQ,EAAE,EAKlC,OAAO,OAAO,YAAY,EAAI"}
package/dist/count-by.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./curry-NmniqyJ0.js";function t(...t){return e(n,t)}function n(e,t){let n=new Map;for(let[r,i]of e.entries()){let a=t(i,r,e);if(a!==void 0){let e=n.get(a);e===void 0?n.set(a,1):n.set(a,e+1)}}return Object.fromEntries(n)}export{t as countBy};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){let n=new Map;for(let[r,i]of e.entries()){let a=t(i,r,e);if(a!==void 0){let e=n.get(a);e===void 0?n.set(a,1):n.set(a,e+1)}}return Object.fromEntries(n)}export{t as countBy};
2
2
  //# sourceMappingURL=count-by.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"count-by.js","names":[],"sources":["../src/count-by.ts"],"sourcesContent":["import type { BoundedPartial } from './internal/types/bounded-partial';\nimport { curry } from './curry';\n\n/**\n * Categorize and count elements in an array using a defined callback function.\n * The callback function is applied to each element in the array to determine\n * its category and then counts how many elements fall into each category.\n *\n * @param data - The array.\n * @param categorizationFn - The categorization function.\n * @signature\n * P.countBy(data, categorizationFn)\n * @example\n * P.countBy(\n * [\"a\", \"b\", \"c\", \"B\", \"A\", \"a\"],\n * toLowerCase\n * ); //=> { a: 3, b: 2, c: 1 }\n * @dataFirst\n * @category Array\n */\nexport function countBy<T, K extends PropertyKey>(\n data: ReadonlyArray<T>,\n categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n ) => K | undefined,\n): BoundedPartial<Record<K, number>>;\n\n/**\n * Categorize and count elements in an array using a defined callback function.\n * The callback function is applied to each element in the array to determine\n * its category and then counts how many elements fall into each category.\n *\n * @param categorizationFn - The categorization function.\n * @signature\n * P.countBy(categorizationFn)(data)\n * @example\n * P.pipe(\n * [\"a\", \"b\", \"c\", \"B\", \"A\", \"a\"],\n * P.countBy(toLowerCase),\n * ); //=> { a: 3, b: 2, c: 1 }\n * @dataLast\n * @category Array\n */\nexport function countBy<T, K extends PropertyKey>(\n categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n ) => K | undefined,\n): (data: ReadonlyArray<T>) => BoundedPartial<Record<K, number>>;\n\nexport function countBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(countByImplementation, args);\n}\n\nfunction countByImplementation<T>(data: ReadonlyArray<T>, categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n) => PropertyKey | undefined): BoundedPartial<Record<PropertyKey, number>> {\n const out = new Map<PropertyKey, number>();\n\n for (const [index, item] of data.entries()) {\n const category = categorizationFn(item, index, data);\n if (category !== undefined) {\n const count = out.get(category);\n if (count === undefined) {\n out.set(category, 1);\n } else {\n out.set(category, count + 1);\n }\n }\n }\n\n return Object.fromEntries(out);\n}\n"],"mappings":"wCAqDA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,EAAK,CAG3C,SAAS,EAAyB,EAAwB,EAIiB,CACzE,IAAM,EAAM,IAAI,IAEhB,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,IAAM,EAAW,EAAiB,EAAM,EAAO,EAAK,CACpD,GAAI,IAAa,IAAA,GAAW,CAC1B,IAAM,EAAQ,EAAI,IAAI,EAAS,CAC3B,IAAU,IAAA,GACZ,EAAI,IAAI,EAAU,EAAE,CAEpB,EAAI,IAAI,EAAU,EAAQ,EAAE,EAKlC,OAAO,OAAO,YAAY,EAAI"}
1
+ {"version":3,"file":"count-by.js","names":[],"sources":["../src/count-by.ts"],"sourcesContent":["import type { BoundedPartial } from './internal/types/bounded-partial';\nimport { curry } from './curry';\n\n/**\n * Categorize and count elements in an array using a defined callback function.\n * The callback function is applied to each element in the array to determine\n * its category and then counts how many elements fall into each category.\n *\n * @param data - The array.\n * @param categorizationFn - The categorization function.\n * @signature\n * countBy(data, categorizationFn)\n * @example\n * countBy(\n * [\"a\", \"b\", \"c\", \"B\", \"A\", \"a\"],\n * toLowerCase()\n * ); //=> { a: 3, b: 2, c: 1 }\n * @dataFirst\n * @category Array\n */\nexport function countBy<T, K extends PropertyKey>(\n data: ReadonlyArray<T>,\n categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n ) => K | undefined,\n): BoundedPartial<Record<K, number>>;\n\n/**\n * Categorize and count elements in an array using a defined callback function.\n * The callback function is applied to each element in the array to determine\n * its category and then counts how many elements fall into each category.\n *\n * @param categorizationFn - The categorization function.\n * @signature\n * countBy(categorizationFn)(data)\n * @example\n * pipe(\n * [\"a\", \"b\", \"c\", \"B\", \"A\", \"a\"],\n * countBy(toLowerCase()),\n * ); //=> { a: 3, b: 2, c: 1 }\n * @dataLast\n * @category Array\n */\nexport function countBy<T, K extends PropertyKey>(\n categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n ) => K | undefined,\n): (data: ReadonlyArray<T>) => BoundedPartial<Record<K, number>>;\n\nexport function countBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(countByImplementation, args);\n}\n\nfunction countByImplementation<T>(data: ReadonlyArray<T>, categorizationFn: (\n value: T,\n index: number,\n data: ReadonlyArray<T>,\n) => PropertyKey | undefined): BoundedPartial<Record<PropertyKey, number>> {\n const out = new Map<PropertyKey, number>();\n\n for (const [index, item] of data.entries()) {\n const category = categorizationFn(item, index, data);\n if (category !== undefined) {\n const count = out.get(category);\n if (count === undefined) {\n out.set(category, 1);\n } else {\n out.set(category, count + 1);\n }\n }\n }\n\n return Object.fromEntries(out);\n}\n"],"mappings":"mCAqDA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,EAAK,CAG3C,SAAS,EAAyB,EAAwB,EAIiB,CACzE,IAAM,EAAM,IAAI,IAEhB,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,IAAM,EAAW,EAAiB,EAAM,EAAO,EAAK,CACpD,GAAI,IAAa,IAAA,GAAW,CAC1B,IAAM,EAAQ,EAAI,IAAI,EAAS,CAC3B,IAAU,IAAA,GACZ,EAAI,IAAI,EAAU,EAAE,CAEpB,EAAI,IAAI,EAAU,EAAQ,EAAE,EAKlC,OAAO,OAAO,YAAY,EAAI"}
@@ -0,0 +1,2 @@
1
+ const e=require(`./pipe.cjs`);function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e.pipe(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e.pipe(t,r),r)}throw Error(`Wrong number of arguments`)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
2
+ //# sourceMappingURL=curry-from-lazy-BvN_VKlH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry-from-lazy-BvN_VKlH.cjs","names":["pipe"],"sources":["../src/internal/curry-from-lazy.ts"],"sourcesContent":["import type { LazyDefinition } from './types/lazy-definition';\nimport type { LazyEvaluator } from './types/lazy-evaluator';\nimport { pipe } from '../pipe';\n\n/**\n * A version of `curry` for cases where the only meaningful implementation is a\n * lazy one. This is useful for functions that don't have a built-in\n * implementation already, and that can't be optimized to take advantage of\n * having the complete array upfront.\n *\n * Under the hood the function uses `pipe` to utilize it's built-in lazy logic\n * and wraps the pipe with the required invocations to allow using the function\n * outside of pipes too.\n *\n * @param lazy - The main lazy implementation, it assumes that data is an\n * iterable (array-like).\n * @param args - The arguments passed to the overloaded invocation.\n * @see curry\n * @see pipe\n */\nexport function curryFromLazy(\n // eslint-disable-next-line ts/no-explicit-any\n lazy: (...args: any) => LazyEvaluator,\n args: ReadonlyArray<unknown>,\n): unknown {\n const diff = args.length - lazy.length;\n\n if (diff === 1) {\n // dataFirst\n const [data, ...rest] = args;\n const lazyDefinition = { lazy, lazyArgs: rest } satisfies LazyDefinition;\n\n // @ts-expect-error [ts2353] - Pipe expects a function which *might* also have a lazy definition. We are tricking pipe here to take our lazyDefinition without any function attached to it.\n return pipe(data, lazyDefinition);\n }\n\n if (diff === 0) {\n const lazyDefinition = { lazy, lazyArgs: args } satisfies LazyDefinition;\n\n // @ts-expect-error [ts2353] - Pipe expects a function which *might* also have a lazy definition. We are tricking pipe here to take our lazyDefinition without any function attached to it.\n const dataLast = (data: unknown): unknown => pipe(data, lazyDefinition);\n return Object.assign(dataLast, lazyDefinition);\n }\n\n throw new Error('Wrong number of arguments');\n}\n"],"mappings":"8BAoBA,SAAgB,EAEd,EACA,EACS,CACT,IAAM,EAAO,EAAK,OAAS,EAAK,OAEhC,GAAI,IAAS,EAAG,CAEd,GAAM,CAAC,EAAM,GAAG,GAAQ,EAIxB,OAAOA,EAAAA,KAAK,EAHW,CAAE,OAAM,SAAU,EAAM,CAGd,CAGnC,GAAI,IAAS,EAAG,CACd,IAAM,EAAiB,CAAE,OAAM,SAAU,EAAM,CAI/C,OAAO,OAAO,OADI,GAA2BA,EAAAA,KAAK,EAAM,EAAe,CACxC,EAAe,CAGhD,MAAU,MAAM,4BAA4B"}
@@ -0,0 +1,2 @@
1
+ import{pipe as e}from"./pipe.js";function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e(t,r),r)}throw Error(`Wrong number of arguments`)}export{t};
2
+ //# sourceMappingURL=curry-from-lazy-CtH1dp14.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry-from-lazy-CtH1dp14.js","names":[],"sources":["../src/internal/curry-from-lazy.ts"],"sourcesContent":["import type { LazyDefinition } from './types/lazy-definition';\nimport type { LazyEvaluator } from './types/lazy-evaluator';\nimport { pipe } from '../pipe';\n\n/**\n * A version of `curry` for cases where the only meaningful implementation is a\n * lazy one. This is useful for functions that don't have a built-in\n * implementation already, and that can't be optimized to take advantage of\n * having the complete array upfront.\n *\n * Under the hood the function uses `pipe` to utilize it's built-in lazy logic\n * and wraps the pipe with the required invocations to allow using the function\n * outside of pipes too.\n *\n * @param lazy - The main lazy implementation, it assumes that data is an\n * iterable (array-like).\n * @param args - The arguments passed to the overloaded invocation.\n * @see curry\n * @see pipe\n */\nexport function curryFromLazy(\n // eslint-disable-next-line ts/no-explicit-any\n lazy: (...args: any) => LazyEvaluator,\n args: ReadonlyArray<unknown>,\n): unknown {\n const diff = args.length - lazy.length;\n\n if (diff === 1) {\n // dataFirst\n const [data, ...rest] = args;\n const lazyDefinition = { lazy, lazyArgs: rest } satisfies LazyDefinition;\n\n // @ts-expect-error [ts2353] - Pipe expects a function which *might* also have a lazy definition. We are tricking pipe here to take our lazyDefinition without any function attached to it.\n return pipe(data, lazyDefinition);\n }\n\n if (diff === 0) {\n const lazyDefinition = { lazy, lazyArgs: args } satisfies LazyDefinition;\n\n // @ts-expect-error [ts2353] - Pipe expects a function which *might* also have a lazy definition. We are tricking pipe here to take our lazyDefinition without any function attached to it.\n const dataLast = (data: unknown): unknown => pipe(data, lazyDefinition);\n return Object.assign(dataLast, lazyDefinition);\n }\n\n throw new Error('Wrong number of arguments');\n}\n"],"mappings":"iCAoBA,SAAgB,EAEd,EACA,EACS,CACT,IAAM,EAAO,EAAK,OAAS,EAAK,OAEhC,GAAI,IAAS,EAAG,CAEd,GAAM,CAAC,EAAM,GAAG,GAAQ,EAIxB,OAAO,EAAK,EAHW,CAAE,OAAM,SAAU,EAAM,CAGd,CAGnC,GAAI,IAAS,EAAG,CACd,IAAM,EAAiB,CAAE,OAAM,SAAU,EAAM,CAI/C,OAAO,OAAO,OADI,GAA2B,EAAK,EAAM,EAAe,CACxC,EAAe,CAGhD,MAAU,MAAM,4BAA4B"}
@@ -0,0 +1,2 @@
1
+ const e={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function t(e,t){let[n,...a]=t;if(!i(n))return e(n,r(...a));let o=r(n,...a);return t=>e(t,o)}function n(e,[n,r,...a]){let o,s;return i(r)?(o=n,s=[r,...a]):(o=r,s=[n,...a]),t((...t)=>e(...t,o),s)}function r(t,n,...i){let a=typeof t==`function`?t:t[0],o=typeof t==`function`?`asc`:t[1],{[o]:s}=e,c=n===void 0?void 0:r(n,...i);return(e,t)=>{let n=a(e),r=a(t);return s(n,r)?1:s(r,n)?-1:c?.(e,t)??0}}function i(t){if(a(t))return!0;if(typeof t!=`object`||!Array.isArray(t))return!1;let[n,r,...i]=t;return a(n)&&typeof r==`string`&&r in e&&i.length===0}function a(e){return typeof e==`function`&&e.length===1}export{n,t};
2
+ //# sourceMappingURL=curry-order-rules-BLyCSMdZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry-order-rules-BLyCSMdZ.js","names":[],"sources":["../src/internal/curry-order-rules.ts"],"sourcesContent":["import type { CompareFunction } from './types/compare-function';\nimport type { NonEmptyArray } from './types/non-empty-array';\n\n// We define the comparators in a global const so that they are only\n// instantiated once, and so we can couple a label (string) for them that could\n// be used in runtime to refer to them (e.g. \"asc\", \"desc\").\nconst COMPARATORS = {\n asc: <T>(x: T, y: T) => x > y,\n desc: <T>(x: T, y: T) => x < y,\n} as const;\n\n/**\n * An order rule defines a projection/extractor that returns a comparable from\n * the data being compared. It would be run on each item being compared, and a\n * comparator would then be used on the results to determine the order.\n *\n * There are 2 forms of the order rule, a simple one which only provides the\n * projection function and assumes ordering is ascending, and a 2-tuple where\n * the first element is the projection function and the second is the direction;\n * this allows changing the direction without defining a more complex projection\n * to simply negate the value (e.g. `(x) => -x`).\n *\n * We rely on the javascript implementation of `<` and `>` for comparison, which\n * will attempt to transform both operands into a primitive comparable value via\n * the built in `valueOf` function (and then `toString`). It's up to the caller\n * to make sure that the projection is returning a value that makes sense for\n * this logic.\n *\n * It's important to note that there is no built-in caching/memoization of\n * projection function and therefore no guarantee that it would only be called\n * once.\n */\nexport type OrderRule<T>\n = | Projection<T>\n | readonly [projection: Projection<T>, direction: keyof typeof COMPARATORS];\n\ntype Projection<T> = (x: T) => Comparable;\n\n// We define the Comparable based on how JS coerces values into primitives when\n// used with the `<` and `>` operators.\n// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#type_coercion\ntype Comparable\n = | ComparablePrimitive\n | { [Symbol.toPrimitive]: (hint: string) => ComparablePrimitive }\n | { toString: () => string }\n | { valueOf: () => ComparablePrimitive };\n\n// Notice that `boolean` is special in that it is coerced as a number (0 for\n// `false`, 1 for `true`) implicitly.\ntype ComparablePrimitive = bigint | boolean | number | string;\n\n/**\n * Allows functions that want to handle a variadic number of order rules a\n * a simplified API that hides most of the implementation details. The only\n * thing users of this function need to do is provide a function that would take\n * the data, and a compare function that can be used to determine the order\n * between the items of the array.\n * This functions takes care of the rest; it will parse rules, built the\n * comparer, and manage the currying of the input arguments.\n */\nexport function curryOrderRules<T>(\n func: (data: ReadonlyArray<T>, compareFn: CompareFunction<T>) => unknown,\n inputArgs: ReadonlyArray<unknown>,\n): unknown {\n // We rely on casting blindly here, but we rely on casting blindly everywhere\n // else when we call curry so it's fine...\n const [dataOrRule, ...rules] = inputArgs as\n | Readonly<NonEmptyArray<OrderRule<T>>>\n | [\n data: OrderRule<T> | ReadonlyArray<T>,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>,\n ];\n\n if (!isOrderRule<T>(dataOrRule)) {\n // dataFirst!\n\n // @ts-expect-error [ts2556]: Typescript is failing to infer the type of rules\n // correctly here after the type refinement above, rules should be non-empty\n // when we get here.\n const compareFn = orderRuleComparer(...rules);\n return func(dataOrRule, compareFn);\n }\n\n // dataLast!\n\n // Important: initialize the comparer outside of the returned function so it\n // it's constructed and shared everywhere (it's stateless so should be safe\n // if used multiple times).\n const compareFn = orderRuleComparer(dataOrRule, ...rules);\n return (data: ReadonlyArray<T>) => func(data, compareFn);\n}\n\n/**\n * Some functions need an extra number argument, this helps facilitate that.\n */\nexport function curryOrderRulesWithArgument(\n func: <T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n // eslint-disable-next-line ts/no-explicit-any -- Function inference in typescript relies on `any` to work, it doesn't work with `unknown`\n arg: any,\n ) => unknown,\n [first, second, ...rest]: ReadonlyArray<unknown>,\n): unknown {\n // We need to pull the `n` argument out to make it work with curryOrderRules.\n let arg: unknown;\n let argRemoved: ReadonlyArray<unknown>;\n if (isOrderRule(second)) {\n // dataLast!\n arg = first;\n argRemoved = [second, ...rest];\n } else {\n // dataFirst!\n arg = second;\n argRemoved = [first, ...rest];\n }\n\n return curryOrderRules((...args) => func(...args, arg), argRemoved);\n}\n\nfunction orderRuleComparer<T>(\n primaryRule: OrderRule<T>,\n secondaryRule?: OrderRule<T>,\n ...otherRules: ReadonlyArray<OrderRule<T>>\n): (a: T, b: T) => number {\n const projector\n = typeof primaryRule === 'function' ? primaryRule : primaryRule[0];\n\n const direction = typeof primaryRule === 'function' ? 'asc' : primaryRule[1];\n const { [direction]: comparator } = COMPARATORS;\n\n const nextComparer\n = secondaryRule === undefined\n ? undefined\n : orderRuleComparer(secondaryRule, ...otherRules);\n\n return (a, b) => {\n const projectedA = projector(a);\n const projectedB = projector(b);\n\n if (comparator(projectedA, projectedB)) {\n return 1;\n }\n\n if (comparator(projectedB, projectedA)) {\n return -1;\n }\n\n // The elements are equal base on the current comparator and projection. So\n // we need to check the elements using the next comparer, if one exists,\n // otherwise we consider them as true equal (returning 0).\n return nextComparer?.(a, b) ?? 0;\n };\n}\n\nfunction isOrderRule<T>(x: unknown): x is OrderRule<T> {\n if (isProjection(x)) {\n return true;\n }\n\n if (typeof x !== 'object' || !Array.isArray(x)) {\n return false;\n }\n\n const [maybeProjection, maybeDirection, ...rest] = x as ReadonlyArray<unknown>;\n\n return (\n isProjection(maybeProjection)\n && typeof maybeDirection === 'string'\n && maybeDirection in COMPARATORS\n // Has to be a 2-tuple\n && rest.length === 0\n );\n}\n\nfunction isProjection<T>(x: unknown): x is Projection<T> {\n return typeof x === 'function' && x.length === 1;\n}\n"],"mappings":"AAMA,MAAM,EAAc,CAClB,KAAS,EAAM,IAAS,EAAI,EAC5B,MAAU,EAAM,IAAS,EAAI,EAC9B,CAmDD,SAAgB,EACd,EACA,EACS,CAGT,GAAM,CAAC,EAAY,GAAG,GAAS,EAO/B,GAAI,CAAC,EAAe,EAAW,CAO7B,OAAO,EAAK,EADM,EAAkB,GAAG,EAAM,CACX,CAQpC,IAAM,EAAY,EAAkB,EAAY,GAAG,EAAM,CACzD,MAAQ,IAA2B,EAAK,EAAM,EAAU,CAM1D,SAAgB,EACd,EAMA,CAAC,EAAO,EAAQ,GAAG,GACV,CAET,IAAI,EACA,EAWJ,OAVI,EAAY,EAAO,EAErB,EAAM,EACN,EAAa,CAAC,EAAQ,GAAG,EAAK,GAG9B,EAAM,EACN,EAAa,CAAC,EAAO,GAAG,EAAK,EAGxB,GAAiB,GAAG,IAAS,EAAK,GAAG,EAAM,EAAI,CAAE,EAAW,CAGrE,SAAS,EACP,EACA,EACA,GAAG,EACqB,CACxB,IAAM,EACF,OAAO,GAAgB,WAAa,EAAc,EAAY,GAE5D,EAAY,OAAO,GAAgB,WAAa,MAAQ,EAAY,GACpE,EAAG,GAAY,GAAe,EAE9B,EACF,IAAkB,IAAA,GAChB,IAAA,GACA,EAAkB,EAAe,GAAG,EAAW,CAErD,OAAQ,EAAG,IAAM,CACf,IAAM,EAAa,EAAU,EAAE,CACzB,EAAa,EAAU,EAAE,CAa/B,OAXI,EAAW,EAAY,EAAW,CAC7B,EAGL,EAAW,EAAY,EAAW,CAC7B,GAMF,IAAe,EAAG,EAAE,EAAI,GAInC,SAAS,EAAe,EAA+B,CACrD,GAAI,EAAa,EAAE,CACjB,MAAO,GAGT,GAAI,OAAO,GAAM,UAAY,CAAC,MAAM,QAAQ,EAAE,CAC5C,MAAO,GAGT,GAAM,CAAC,EAAiB,EAAgB,GAAG,GAAQ,EAEnD,OACE,EAAa,EAAgB,EAC1B,OAAO,GAAmB,UAC1B,KAAkB,GAElB,EAAK,SAAW,EAIvB,SAAS,EAAgB,EAAgC,CACvD,OAAO,OAAO,GAAM,YAAc,EAAE,SAAW"}
@@ -0,0 +1,2 @@
1
+ const e={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function t(e,t){let[n,...a]=t;if(!i(n))return e(n,r(...a));let o=r(n,...a);return t=>e(t,o)}function n(e,[n,r,...a]){let o,s;return i(r)?(o=n,s=[r,...a]):(o=r,s=[n,...a]),t((...t)=>e(...t,o),s)}function r(t,n,...i){let a=typeof t==`function`?t:t[0],o=typeof t==`function`?`asc`:t[1],{[o]:s}=e,c=n===void 0?void 0:r(n,...i);return(e,t)=>{let n=a(e),r=a(t);return s(n,r)?1:s(r,n)?-1:c?.(e,t)??0}}function i(t){if(a(t))return!0;if(typeof t!=`object`||!Array.isArray(t))return!1;let[n,r,...i]=t;return a(n)&&typeof r==`string`&&r in e&&i.length===0}function a(e){return typeof e==`function`&&e.length===1}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
2
+ //# sourceMappingURL=curry-order-rules-DsJSy3gX.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry-order-rules-DsJSy3gX.cjs","names":[],"sources":["../src/internal/curry-order-rules.ts"],"sourcesContent":["import type { CompareFunction } from './types/compare-function';\nimport type { NonEmptyArray } from './types/non-empty-array';\n\n// We define the comparators in a global const so that they are only\n// instantiated once, and so we can couple a label (string) for them that could\n// be used in runtime to refer to them (e.g. \"asc\", \"desc\").\nconst COMPARATORS = {\n asc: <T>(x: T, y: T) => x > y,\n desc: <T>(x: T, y: T) => x < y,\n} as const;\n\n/**\n * An order rule defines a projection/extractor that returns a comparable from\n * the data being compared. It would be run on each item being compared, and a\n * comparator would then be used on the results to determine the order.\n *\n * There are 2 forms of the order rule, a simple one which only provides the\n * projection function and assumes ordering is ascending, and a 2-tuple where\n * the first element is the projection function and the second is the direction;\n * this allows changing the direction without defining a more complex projection\n * to simply negate the value (e.g. `(x) => -x`).\n *\n * We rely on the javascript implementation of `<` and `>` for comparison, which\n * will attempt to transform both operands into a primitive comparable value via\n * the built in `valueOf` function (and then `toString`). It's up to the caller\n * to make sure that the projection is returning a value that makes sense for\n * this logic.\n *\n * It's important to note that there is no built-in caching/memoization of\n * projection function and therefore no guarantee that it would only be called\n * once.\n */\nexport type OrderRule<T>\n = | Projection<T>\n | readonly [projection: Projection<T>, direction: keyof typeof COMPARATORS];\n\ntype Projection<T> = (x: T) => Comparable;\n\n// We define the Comparable based on how JS coerces values into primitives when\n// used with the `<` and `>` operators.\n// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#type_coercion\ntype Comparable\n = | ComparablePrimitive\n | { [Symbol.toPrimitive]: (hint: string) => ComparablePrimitive }\n | { toString: () => string }\n | { valueOf: () => ComparablePrimitive };\n\n// Notice that `boolean` is special in that it is coerced as a number (0 for\n// `false`, 1 for `true`) implicitly.\ntype ComparablePrimitive = bigint | boolean | number | string;\n\n/**\n * Allows functions that want to handle a variadic number of order rules a\n * a simplified API that hides most of the implementation details. The only\n * thing users of this function need to do is provide a function that would take\n * the data, and a compare function that can be used to determine the order\n * between the items of the array.\n * This functions takes care of the rest; it will parse rules, built the\n * comparer, and manage the currying of the input arguments.\n */\nexport function curryOrderRules<T>(\n func: (data: ReadonlyArray<T>, compareFn: CompareFunction<T>) => unknown,\n inputArgs: ReadonlyArray<unknown>,\n): unknown {\n // We rely on casting blindly here, but we rely on casting blindly everywhere\n // else when we call curry so it's fine...\n const [dataOrRule, ...rules] = inputArgs as\n | Readonly<NonEmptyArray<OrderRule<T>>>\n | [\n data: OrderRule<T> | ReadonlyArray<T>,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>,\n ];\n\n if (!isOrderRule<T>(dataOrRule)) {\n // dataFirst!\n\n // @ts-expect-error [ts2556]: Typescript is failing to infer the type of rules\n // correctly here after the type refinement above, rules should be non-empty\n // when we get here.\n const compareFn = orderRuleComparer(...rules);\n return func(dataOrRule, compareFn);\n }\n\n // dataLast!\n\n // Important: initialize the comparer outside of the returned function so it\n // it's constructed and shared everywhere (it's stateless so should be safe\n // if used multiple times).\n const compareFn = orderRuleComparer(dataOrRule, ...rules);\n return (data: ReadonlyArray<T>) => func(data, compareFn);\n}\n\n/**\n * Some functions need an extra number argument, this helps facilitate that.\n */\nexport function curryOrderRulesWithArgument(\n func: <T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n // eslint-disable-next-line ts/no-explicit-any -- Function inference in typescript relies on `any` to work, it doesn't work with `unknown`\n arg: any,\n ) => unknown,\n [first, second, ...rest]: ReadonlyArray<unknown>,\n): unknown {\n // We need to pull the `n` argument out to make it work with curryOrderRules.\n let arg: unknown;\n let argRemoved: ReadonlyArray<unknown>;\n if (isOrderRule(second)) {\n // dataLast!\n arg = first;\n argRemoved = [second, ...rest];\n } else {\n // dataFirst!\n arg = second;\n argRemoved = [first, ...rest];\n }\n\n return curryOrderRules((...args) => func(...args, arg), argRemoved);\n}\n\nfunction orderRuleComparer<T>(\n primaryRule: OrderRule<T>,\n secondaryRule?: OrderRule<T>,\n ...otherRules: ReadonlyArray<OrderRule<T>>\n): (a: T, b: T) => number {\n const projector\n = typeof primaryRule === 'function' ? primaryRule : primaryRule[0];\n\n const direction = typeof primaryRule === 'function' ? 'asc' : primaryRule[1];\n const { [direction]: comparator } = COMPARATORS;\n\n const nextComparer\n = secondaryRule === undefined\n ? undefined\n : orderRuleComparer(secondaryRule, ...otherRules);\n\n return (a, b) => {\n const projectedA = projector(a);\n const projectedB = projector(b);\n\n if (comparator(projectedA, projectedB)) {\n return 1;\n }\n\n if (comparator(projectedB, projectedA)) {\n return -1;\n }\n\n // The elements are equal base on the current comparator and projection. So\n // we need to check the elements using the next comparer, if one exists,\n // otherwise we consider them as true equal (returning 0).\n return nextComparer?.(a, b) ?? 0;\n };\n}\n\nfunction isOrderRule<T>(x: unknown): x is OrderRule<T> {\n if (isProjection(x)) {\n return true;\n }\n\n if (typeof x !== 'object' || !Array.isArray(x)) {\n return false;\n }\n\n const [maybeProjection, maybeDirection, ...rest] = x as ReadonlyArray<unknown>;\n\n return (\n isProjection(maybeProjection)\n && typeof maybeDirection === 'string'\n && maybeDirection in COMPARATORS\n // Has to be a 2-tuple\n && rest.length === 0\n );\n}\n\nfunction isProjection<T>(x: unknown): x is Projection<T> {\n return typeof x === 'function' && x.length === 1;\n}\n"],"mappings":"AAMA,MAAM,EAAc,CAClB,KAAS,EAAM,IAAS,EAAI,EAC5B,MAAU,EAAM,IAAS,EAAI,EAC9B,CAmDD,SAAgB,EACd,EACA,EACS,CAGT,GAAM,CAAC,EAAY,GAAG,GAAS,EAO/B,GAAI,CAAC,EAAe,EAAW,CAO7B,OAAO,EAAK,EADM,EAAkB,GAAG,EAAM,CACX,CAQpC,IAAM,EAAY,EAAkB,EAAY,GAAG,EAAM,CACzD,MAAQ,IAA2B,EAAK,EAAM,EAAU,CAM1D,SAAgB,EACd,EAMA,CAAC,EAAO,EAAQ,GAAG,GACV,CAET,IAAI,EACA,EAWJ,OAVI,EAAY,EAAO,EAErB,EAAM,EACN,EAAa,CAAC,EAAQ,GAAG,EAAK,GAG9B,EAAM,EACN,EAAa,CAAC,EAAO,GAAG,EAAK,EAGxB,GAAiB,GAAG,IAAS,EAAK,GAAG,EAAM,EAAI,CAAE,EAAW,CAGrE,SAAS,EACP,EACA,EACA,GAAG,EACqB,CACxB,IAAM,EACF,OAAO,GAAgB,WAAa,EAAc,EAAY,GAE5D,EAAY,OAAO,GAAgB,WAAa,MAAQ,EAAY,GACpE,EAAG,GAAY,GAAe,EAE9B,EACF,IAAkB,IAAA,GAChB,IAAA,GACA,EAAkB,EAAe,GAAG,EAAW,CAErD,OAAQ,EAAG,IAAM,CACf,IAAM,EAAa,EAAU,EAAE,CACzB,EAAa,EAAU,EAAE,CAa/B,OAXI,EAAW,EAAY,EAAW,CAC7B,EAGL,EAAW,EAAY,EAAW,CAC7B,GAMF,IAAe,EAAG,EAAE,EAAI,GAInC,SAAS,EAAe,EAA+B,CACrD,GAAI,EAAa,EAAE,CACjB,MAAO,GAGT,GAAI,OAAO,GAAM,UAAY,CAAC,MAAM,QAAQ,EAAE,CAC5C,MAAO,GAGT,GAAM,CAAC,EAAiB,EAAgB,GAAG,GAAQ,EAEnD,OACE,EAAa,EAAgB,EAC1B,OAAO,GAAmB,UAC1B,KAAkB,GAElB,EAAK,SAAW,EAIvB,SAAS,EAAgB,EAAgC,CACvD,OAAO,OAAO,GAAM,YAAc,EAAE,SAAW"}
package/dist/curry.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);exports.curry=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./lazy-data-last-impl-B05ZpguF.cjs`);function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e.t(t,n,r);throw Error(`Wrong number of arguments`)}exports.curry=t;
2
+ //# sourceMappingURL=curry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry.cjs","names":["lazyDataLastImpl"],"sources":["../src/curry.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { StrictFunction } from './internal/types/strict-function';\nimport { lazyDataLastImpl } from './internal/lazy-data-last-impl';\n\n/**\n * Creates a function with `dataFirst` and `dataLast` signatures.\n *\n * `curry` is a dynamic function and it's not type safe. It should be wrapped by\n * a function that have proper typings. Refer to the example below for correct\n * usage.\n *\n * !IMPORTANT: functions that simply call `curry` and return the result (like\n * almost all functions in this library) should return `unknown` themselves if\n * an explicit return type is required. This is because we currently don't\n * provide a generic return type that is built from the input function, and\n * crafting one manually isn't worthwhile as we rely on function declaration\n * overloading to combine the types for dataFirst and dataLast invocations!\n *\n * @param fn - The function to curry.\n * @param args - The arguments.\n * @param lazy - A lazy version of the function to curry.\n * @signature curry(fn, args);\n * @example\n * function _findIndex(array, fn) {\n * for (let i = 0; i < array.length; i++) {\n * if (fn(array[i])) {\n * return i;\n * }\n * }\n * return -1;\n * }\n *\n * // data-first\n * function findIndex<T>(array: T[], fn: (item: T) => boolean): number;\n *\n * // data-last\n * function findIndex<T>(fn: (item: T) => boolean): (array: T[]) => number;\n *\n * function findIndex(...args: unknown[]) {\n * return curry(_findIndex, args);\n * }\n * @category Function\n */\nexport function curry(\n fn: StrictFunction,\n args: ReadonlyArray<unknown>,\n lazy?: (...args: any) => LazyEvaluator,\n): unknown {\n const diff = fn.length - args.length;\n if (diff === 0) {\n // @ts-expect-error [ts2345] -- This error is accurate because we don't know\n // anything about `fn` so can't ensure that we are passing the correct\n // arguments to it, we just have to trust that the caller knows what they\n // are doing.\n return fn(...args);\n }\n\n if (diff === 1) {\n return lazyDataLastImpl(fn, args, lazy);\n }\n\n throw new Error('Wrong number of arguments');\n}\n"],"mappings":"yHA6CA,SAAgB,EACd,EACA,EACA,EACS,CACT,IAAM,EAAO,EAAG,OAAS,EAAK,OAC9B,GAAI,IAAS,EAKX,OAAO,EAAG,GAAG,EAAK,CAGpB,GAAI,IAAS,EACX,OAAOA,EAAAA,EAAiB,EAAI,EAAM,EAAK,CAGzC,MAAU,MAAM,4BAA4B"}
package/dist/curry.js CHANGED
@@ -1 +1,2 @@
1
- import{t as e}from"./curry-NmniqyJ0.js";export{e as curry};
1
+ import{t as e}from"./lazy-data-last-impl-Vt_M0l7X.js";function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}export{t as curry};
2
+ //# sourceMappingURL=curry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry.js","names":[],"sources":["../src/curry.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { StrictFunction } from './internal/types/strict-function';\nimport { lazyDataLastImpl } from './internal/lazy-data-last-impl';\n\n/**\n * Creates a function with `dataFirst` and `dataLast` signatures.\n *\n * `curry` is a dynamic function and it's not type safe. It should be wrapped by\n * a function that have proper typings. Refer to the example below for correct\n * usage.\n *\n * !IMPORTANT: functions that simply call `curry` and return the result (like\n * almost all functions in this library) should return `unknown` themselves if\n * an explicit return type is required. This is because we currently don't\n * provide a generic return type that is built from the input function, and\n * crafting one manually isn't worthwhile as we rely on function declaration\n * overloading to combine the types for dataFirst and dataLast invocations!\n *\n * @param fn - The function to curry.\n * @param args - The arguments.\n * @param lazy - A lazy version of the function to curry.\n * @signature curry(fn, args);\n * @example\n * function _findIndex(array, fn) {\n * for (let i = 0; i < array.length; i++) {\n * if (fn(array[i])) {\n * return i;\n * }\n * }\n * return -1;\n * }\n *\n * // data-first\n * function findIndex<T>(array: T[], fn: (item: T) => boolean): number;\n *\n * // data-last\n * function findIndex<T>(fn: (item: T) => boolean): (array: T[]) => number;\n *\n * function findIndex(...args: unknown[]) {\n * return curry(_findIndex, args);\n * }\n * @category Function\n */\nexport function curry(\n fn: StrictFunction,\n args: ReadonlyArray<unknown>,\n lazy?: (...args: any) => LazyEvaluator,\n): unknown {\n const diff = fn.length - args.length;\n if (diff === 0) {\n // @ts-expect-error [ts2345] -- This error is accurate because we don't know\n // anything about `fn` so can't ensure that we are passing the correct\n // arguments to it, we just have to trust that the caller knows what they\n // are doing.\n return fn(...args);\n }\n\n if (diff === 1) {\n return lazyDataLastImpl(fn, args, lazy);\n }\n\n throw new Error('Wrong number of arguments');\n}\n"],"mappings":"sDA6CA,SAAgB,EACd,EACA,EACA,EACS,CACT,IAAM,EAAO,EAAG,OAAS,EAAK,OAC9B,GAAI,IAAS,EAKX,OAAO,EAAG,GAAG,EAAK,CAGpB,GAAI,IAAS,EACX,OAAO,EAAiB,EAAI,EAAM,EAAK,CAGzC,MAAU,MAAM,4BAA4B"}
package/dist/debounce.cjs CHANGED
@@ -1 +1,2 @@
1
- function e(e,{waitMs:t,timing:n=`trailing`,maxWaitMs:r}){if(r!==void 0&&t!==void 0&&r<t)throw Error(`debounce: maxWaitMs (${r}) cannot be less than waitMs (${t})`);let i,a,o,s;function c(){if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}if(o===void 0)throw Error(`PERKAKAS[debounce]: latestCallArgs was unexpectedly undefined.`);let t=o;o=void 0,s=e(...t)}function l(){if(i===void 0)return;let e=i;i=void 0,clearTimeout(e),o!==void 0&&c()}function u(e){o=e,r!==void 0&&a===void 0&&(a=setTimeout(c,r))}return{call:(...a)=>{if(i===void 0)n===`trailing`?u(a):s=e(...a);else{n!==`leading`&&u(a);let e=i;i=void 0,clearTimeout(e)}return i=setTimeout(l,t??r??0),s},cancel:()=>{if(i!==void 0){let e=i;i=void 0,clearTimeout(e)}if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}o=void 0},flush:()=>(l(),s),get isPending(){return i!==void 0},get cachedValue(){return s}}}exports.debounce=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,{waitMs:t,timing:n=`trailing`,maxWaitMs:r}){if(r!==void 0&&t!==void 0&&r<t)throw Error(`debounce: maxWaitMs (${r.toString()}) cannot be less than waitMs (${t.toString()})`);let i,a,o,s,c=()=>{if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}if(o===void 0)throw Error(`Perkakas[debounce]: latestCallArgs was unexpectedly undefined.`);let t=o;o=void 0,s=e(...t)},l=()=>{if(i===void 0)return;let e=i;i=void 0,clearTimeout(e),o!==void 0&&c()},u=e=>{o=e,r!==void 0&&a===void 0&&(a=setTimeout(c,r))};return{call:(...a)=>{if(i===void 0)n===`trailing`?u(a):s=e(...a);else{n!==`leading`&&u(a);let e=i;i=void 0,clearTimeout(e)}return i=setTimeout(l,t??r??0),s},cancel:()=>{if(i!==void 0){let e=i;i=void 0,clearTimeout(e)}if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}o=void 0},flush:()=>(l(),s),get isPending(){return i!==void 0},get cachedValue(){return s}}}exports.debounce=e;
2
+ //# sourceMappingURL=debounce.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.cjs","names":[],"sources":["../src/debounce.ts"],"sourcesContent":["import type { StrictFunction } from './internal/types/strict-function';\n\ninterface Debouncer<F extends StrictFunction, IsNullable extends boolean = true> {\n /**\n * Invoke the debounced function.\n *\n * @param args - Same as the args for the debounced function.\n * @returns The last computed value of the debounced function with the\n * latest args provided to it. If `timing` does not include `leading` then the\n * the function would return `undefined` until the first cool-down period is\n * over, otherwise the function would always return the return type of the\n * debounced function.\n */\n readonly call: (\n ...args: Parameters<F>\n ) => ReturnType<F> | (true extends IsNullable ? undefined : never);\n\n /**\n * Cancels any debounced functions without calling them, effectively resetting\n * the debouncer to the same state it is when initially created.\n */\n readonly cancel: () => void;\n\n /**\n * Similar to `cancel`, but would also trigger the `trailing` invocation if\n * the debouncer would run one at the end of the cool-down period.\n */\n readonly flush: () => ReturnType<F> | undefined;\n\n /**\n * Is `true` when there is an active cool-down period currently debouncing\n * invocations.\n */\n readonly isPending: boolean;\n\n /**\n * The last computed value of the debounced function.\n */\n readonly cachedValue: ReturnType<F> | undefined;\n}\n\ninterface DebounceOptions {\n readonly waitMs?: number;\n readonly maxWaitMs?: number;\n}\n\n/**\n * Wraps `func` with a debouncer object that \"debounces\" (delays) invocations of the function during a defined cool-down period (`waitMs`). It can be configured to invoke the function either at the start of the cool-down period, the end of it, or at both ends (`timing`).\n * It can also be configured to allow invocations during the cool-down period (`maxWaitMs`).\n * It stores the latest call's arguments so they could be used at the end of the cool-down period when invoking `func` (if configured to invoke the function at the end of the cool-down period).\n * It stores the value returned by `func` whenever its invoked. This value is returned on every call, and is accessible via the `cachedValue` property of the debouncer. Its important to note that the value might be different from the value that would be returned from running `func` with the current arguments as it is a cached value from a previous invocation.\n * **Important**: The cool-down period defines the minimum between two invocations, and not the maximum. The period will be **extended** each time a call is made until a full cool-down period has elapsed without any additional calls.\n *\n *! **DEPRECATED**: This implementation of debounce is known to have issues and might not behave as expected. It should be replaced with the `funnel` utility instead.\n *\n * @param func - The function to debounce, the returned `call` function will have\n * the exact same signature.\n * @param options - An object allowing further customization of the debouncer:\n * - `timing?: 'leading' | 'trailing' |'both'`. The default is `'trailing'`.\n * `leading` would result in the function being invoked at the start of the\n * cool-down period; `trailing` would result in the function being invoked at\n * the end of the cool-down period (using the args from the last call to the\n * debouncer). When `both` is selected the `trailing` invocation would only\n * take place if there were more than one call to the debouncer during the\n * cool-down period. **DEFAULT: 'trailing'**\n * - `waitMs?: number`. The length of the cool-down period in milliseconds. The\n * debouncer would wait until this amount of time has passed without **any**\n * additional calls to the debouncer before triggering the end-of-cool-down-\n * period event. When this happens, the function would be invoked (if `timing`\n * isn't `'leading'`) and the debouncer state would be reset. **DEFAULT: 0**\n * - `maxWaitMs?: number`. The length of time since a debounced call (a call\n * that the debouncer prevented from being invoked) was made until it would be\n * invoked. Because the debouncer can be continually triggered and thus never\n * reach the end of the cool-down period, this allows the function to still\n * be invoked occasionally. IMPORTANT: This param is ignored when `timing` is\n * `'leading'`.\n * @returns A debouncer object. The main function is `call`. In addition to it\n * the debouncer comes with the following additional functions and properties:\n * - `cancel` method to cancel delayed `func` invocations\n * - `flush` method to end the cool-down period immediately.\n * - `cachedValue` the latest return value of an invocation (if one occurred).\n * - `isPending` flag to check if there is an inflight cool-down window.\n * @signature\n * debounce(func, options);\n * @example\n * const debouncer = debounce(identity(), { timing: 'trailing', waitMs: 1000 });\n * const result1 = debouncer.call(1); // => undefined\n * const result2 = debouncer.call(2); // => undefined\n * // after 1 second\n * const result3 = debouncer.call(3); // => 2\n * // after 1 second\n * debouncer.cachedValue; // => 3\n * @dataFirst\n * @category Function\n * @deprecated This implementation of debounce is known to have issues and might\n * not behave as expected. It should be replaced with the `funnel` utility\n * instead.\n * @see https://css-tricks.com/debouncing-throttling-explained-examples/\n */\nexport function debounce<F extends StrictFunction>(\n func: F,\n options: DebounceOptions & { readonly timing?: 'trailing' },\n): Debouncer<F>;\nexport function debounce<F extends StrictFunction>(\n func: F,\n options:\n | (DebounceOptions & { readonly timing: 'both' })\n | (Omit<DebounceOptions, 'maxWaitMs'> & { readonly timing: 'leading' }),\n): Debouncer<F, false>;\n\nexport function debounce<F extends StrictFunction>(\n func: F,\n {\n waitMs,\n timing = 'trailing',\n maxWaitMs,\n }: DebounceOptions & {\n readonly timing?: 'both' | 'leading' | 'trailing';\n },\n): Debouncer<F> {\n if (maxWaitMs !== undefined && waitMs !== undefined && maxWaitMs < waitMs) {\n throw new Error(\n `debounce: maxWaitMs (${maxWaitMs.toString()}) cannot be less than waitMs (${waitMs.toString()})`,\n );\n }\n\n // All these are part of the debouncer runtime state:\n\n // The timeout is the main object we use to tell if there's an active cool-\n // down period or not.\n let coolDownTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // We use an additional timeout to track how long the last debounced call is\n // waiting.\n let maxWaitTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // For 'trailing' invocations we need to keep the args around until we\n // actually invoke the function.\n let latestCallArgs: Parameters<F> | undefined;\n\n // To make any value of the debounced function we need to be able to return a\n // value. For any invocation except the first one when 'leading' is enabled we\n // will return this cached value.\n let result: ReturnType<F> | undefined;\n\n const handleInvoke = (): void => {\n if (maxWaitTimeoutId !== undefined) {\n // We are invoking the function so the wait is over...\n const timeoutId = maxWaitTimeoutId;\n maxWaitTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n /* v8 ignore if -- This protects us against changes to the logic, there is no known flow we can simulate to reach this condition. It can only happen if a previous timeout isn't cleared (or faces a race condition clearing). @preserve */\n if (latestCallArgs === undefined) {\n // If you see this error pop up when using this function please report\n // it on the github page!\n throw new Error(\n 'Perkakas[debounce]: latestCallArgs was unexpectedly undefined.',\n );\n }\n\n const args = latestCallArgs;\n // Make sure the args aren't accidentally used again, this is mainly\n // relevant for the check above where we'll fail a subsequent call to\n // 'trailingEdge'.\n latestCallArgs = undefined;\n\n // Invoke the function and store the results locally.\n // @ts-expect-error [ts2345, ts2322] -- TypeScript infers the generic sub-\n // types too eagerly, making itself blind to the fact that the types match\n // here.\n result = func(...args);\n };\n\n const handleCoolDownEnd = (): void => {\n if (coolDownTimeoutId === undefined) {\n // It's rare to get here, it should only happen when `flush` is called\n // when the cool-down window isn't active.\n return;\n }\n\n // Make sure there are no more timers running.\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n // Then reset state so a new cool-down window can begin on the next call.\n\n if (latestCallArgs !== undefined) {\n // If we have a debounced call waiting to be invoked at the end of the\n // cool-down period we need to invoke it now.\n handleInvoke();\n }\n };\n\n const handleDebouncedCall = (args: Parameters<F>): void => {\n // We save the latest call args so that (if and) when we invoke the function\n // in the future, we have args to invoke it with.\n latestCallArgs = args;\n\n if (maxWaitMs !== undefined && maxWaitTimeoutId === undefined) {\n // We only need to start the maxWait timeout once, on the first debounced\n // call that is now being delayed.\n maxWaitTimeoutId = setTimeout(handleInvoke, maxWaitMs);\n }\n };\n\n return {\n call: (...args) => {\n if (coolDownTimeoutId === undefined) {\n // This call is starting a new cool-down window!\n\n if (timing === 'trailing') {\n // Only when the timing is \"trailing\" is the first call \"debounced\".\n handleDebouncedCall(args);\n } else {\n // Otherwise for \"leading\" and \"both\" the first call is actually\n // called directly and not via a timeout.\n // @ts-expect-error [ts2345, ts2322] -- TypeScript infers the generic\n // sub-types too eagerly, making itself blind to the fact that the\n // types match here.\n result = func(...args);\n }\n } else {\n // There's an inflight cool-down window.\n\n if (timing !== 'leading') {\n // When the timing is 'leading' all following calls are just ignored\n // until the cool-down period ends. But for the other timings the call\n // is \"debounced\".\n handleDebouncedCall(args);\n }\n\n // The current timeout is no longer relevant because we need to wait the\n // full `waitMs` time from this call.\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n coolDownTimeoutId = setTimeout(\n handleCoolDownEnd,\n // If waitMs is not defined but maxWaitMs *is* it means the user is only\n // interested in the leaky-bucket nature of the debouncer which is\n // achieved by setting waitMs === maxWaitMs. If both are not defined we\n // default to 0 which would wait until the end of the execution frame.\n waitMs ?? maxWaitMs ?? 0,\n );\n\n // Return the last computed result while we \"debounce\" further calls.\n return result;\n },\n\n cancel: () => {\n // Reset all \"in-flight\" state of the debouncer. Notice that we keep the\n // cached value!\n\n if (coolDownTimeoutId !== undefined) {\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n if (maxWaitTimeoutId !== undefined) {\n const timeoutId = maxWaitTimeoutId;\n maxWaitTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n latestCallArgs = undefined;\n },\n\n flush: () => {\n // Flush is just a manual way to trigger the end of the cool-down window.\n handleCoolDownEnd();\n return result;\n },\n\n get isPending() {\n return coolDownTimeoutId !== undefined;\n },\n\n get cachedValue() {\n return result;\n },\n };\n}\n"],"mappings":"mEA8GA,SAAgB,EACd,EACA,CACE,SACA,SAAS,WACT,aAIY,CACd,GAAI,IAAc,IAAA,IAAa,IAAW,IAAA,IAAa,EAAY,EACjE,MAAU,MACR,wBAAwB,EAAU,UAAU,CAAC,gCAAgC,EAAO,UAAU,CAAC,GAChG,CAOH,IAAI,EAIA,EAIA,EAKA,EAEE,MAA2B,CAC/B,GAAI,IAAqB,IAAA,GAAW,CAElC,IAAM,EAAY,EAClB,EAAmB,IAAA,GACnB,aAAa,EAAU,CAIzB,GAAI,IAAmB,IAAA,GAGrB,MAAU,MACR,iEACD,CAGH,IAAM,EAAO,EAIb,EAAiB,IAAA,GAMjB,EAAS,EAAK,GAAG,EAAK,EAGlB,MAAgC,CACpC,GAAI,IAAsB,IAAA,GAGxB,OAIF,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAGnB,IAAmB,IAAA,IAGrB,GAAc,EAIZ,EAAuB,GAA8B,CAGzD,EAAiB,EAEb,IAAc,IAAA,IAAa,IAAqB,IAAA,KAGlD,EAAmB,WAAW,EAAc,EAAU,GAI1D,MAAO,CACL,MAAO,GAAG,IAAS,CACjB,GAAI,IAAsB,IAAA,GAGpB,IAAW,WAEb,EAAoB,EAAK,CAOzB,EAAS,EAAK,GAAG,EAAK,KAEnB,CAGD,IAAW,WAIb,EAAoB,EAAK,CAK3B,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAazB,MAVA,GAAoB,WAClB,EAKA,GAAU,GAAa,EACxB,CAGM,GAGT,WAAc,CAIZ,GAAI,IAAsB,IAAA,GAAW,CACnC,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAGzB,GAAI,IAAqB,IAAA,GAAW,CAClC,IAAM,EAAY,EAClB,EAAmB,IAAA,GACnB,aAAa,EAAU,CAGzB,EAAiB,IAAA,IAGnB,WAEE,GAAmB,CACZ,GAGT,IAAI,WAAY,CACd,OAAO,IAAsB,IAAA,IAG/B,IAAI,aAAc,CAChB,OAAO,GAEV"}
package/dist/debounce.js CHANGED
@@ -1,2 +1,2 @@
1
- function e(e,{waitMs:t,timing:n=`trailing`,maxWaitMs:r}){if(r!==void 0&&t!==void 0&&r<t)throw Error(`debounce: maxWaitMs (${r}) cannot be less than waitMs (${t})`);let i,a,o,s;function c(){if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}if(o===void 0)throw Error(`PERKAKAS[debounce]: latestCallArgs was unexpectedly undefined.`);let t=o;o=void 0,s=e(...t)}function l(){if(i===void 0)return;let e=i;i=void 0,clearTimeout(e),o!==void 0&&c()}function u(e){o=e,r!==void 0&&a===void 0&&(a=setTimeout(c,r))}return{call:(...a)=>{if(i===void 0)n===`trailing`?u(a):s=e(...a);else{n!==`leading`&&u(a);let e=i;i=void 0,clearTimeout(e)}return i=setTimeout(l,t??r??0),s},cancel:()=>{if(i!==void 0){let e=i;i=void 0,clearTimeout(e)}if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}o=void 0},flush:()=>(l(),s),get isPending(){return i!==void 0},get cachedValue(){return s}}}export{e as debounce};
1
+ function e(e,{waitMs:t,timing:n=`trailing`,maxWaitMs:r}){if(r!==void 0&&t!==void 0&&r<t)throw Error(`debounce: maxWaitMs (${r.toString()}) cannot be less than waitMs (${t.toString()})`);let i,a,o,s,c=()=>{if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}if(o===void 0)throw Error(`Perkakas[debounce]: latestCallArgs was unexpectedly undefined.`);let t=o;o=void 0,s=e(...t)},l=()=>{if(i===void 0)return;let e=i;i=void 0,clearTimeout(e),o!==void 0&&c()},u=e=>{o=e,r!==void 0&&a===void 0&&(a=setTimeout(c,r))};return{call:(...a)=>{if(i===void 0)n===`trailing`?u(a):s=e(...a);else{n!==`leading`&&u(a);let e=i;i=void 0,clearTimeout(e)}return i=setTimeout(l,t??r??0),s},cancel:()=>{if(i!==void 0){let e=i;i=void 0,clearTimeout(e)}if(a!==void 0){let e=a;a=void 0,clearTimeout(e)}o=void 0},flush:()=>(l(),s),get isPending(){return i!==void 0},get cachedValue(){return s}}}export{e as debounce};
2
2
  //# sourceMappingURL=debounce.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.js","names":["coolDownTimeoutId: ReturnType<typeof setTimeout> | undefined","maxWaitTimeoutId: ReturnType<typeof setTimeout> | undefined","latestCallArgs: Parameters<F> | undefined","result: ReturnType<F> | undefined"],"sources":["../src/debounce.ts"],"sourcesContent":["/* eslint-disable ts/consistent-type-definitions --\n * Function inference doesn't work when `unknown` is used as the parameters\n * generic type, it **has** to be `any`.\n */\n\nimport type { StrictFunction } from './internal/types/strict-function';\n\ntype Debouncer<F extends StrictFunction, IsNullable extends boolean = true> = {\n /**\n * Invoke the debounced function.\n *\n * @param args - Same as the args for the debounced function.\n * @returns The last computed value of the debounced function with the\n * latest args provided to it. If `timing` does not include `leading` then the\n * the function would return `undefined` until the first cool-down period is\n * over, otherwise the function would always return the return type of the\n * debounced function.\n */\n readonly call: (\n ...args: Parameters<F>\n ) => ReturnType<F> | (true extends IsNullable ? undefined : never);\n\n /**\n * Cancels any debounced functions without calling them, effectively resetting\n * the debouncer to the same state it is when initially created.\n */\n readonly cancel: () => void;\n\n /**\n * Similar to `cancel`, but would also trigger the `trailing` invocation if\n * the debouncer would run one at the end of the cool-down period.\n */\n readonly flush: () => ReturnType<F> | undefined;\n\n /**\n * Is `true` when there is an active cool-down period currently debouncing\n * invocations.\n */\n readonly isPending: boolean;\n\n /**\n * The last computed value of the debounced function.\n */\n readonly cachedValue: ReturnType<F> | undefined;\n};\n\ntype DebounceOptions = {\n readonly waitMs?: number;\n readonly maxWaitMs?: number;\n};\n\n/**\n * Wraps `func` with a debouncer object that \"debounces\" (delays) invocations of the function during a defined cool-down period (`waitMs`). It can be configured to invoke the function either at the start of the cool-down period, the end of it, or at both ends (`timing`).\n * It can also be configured to allow invocations during the cool-down period (`maxWaitMs`).\n * It stores the latest call's arguments so they could be used at the end of the cool-down period when invoking `func` (if configured to invoke the function at the end of the cool-down period).\n * It stores the value returned by `func` whenever its invoked. This value is returned on every call, and is accessible via the `cachedValue` property of the debouncer. Its important to note that the value might be different from the value that would be returned from running `func` with the current arguments as it is a cached value from a previous invocation.\n * **Important**: The cool-down period defines the minimum between two invocations, and not the maximum. The period will be **extended** each time a call is made until a full cool-down period has elapsed without any additional calls.\n *\n * @param func - The function to debounce, the returned `call` function will have\n * the exact same signature.\n * @param options - An object allowing further customization of the debouncer:\n * - `timing?: 'leading' | 'trailing' |'both'`. The default is `'trailing'`.\n * `leading` would result in the function being invoked at the start of the\n * cool-down period; `trailing` would result in the function being invoked at\n * the end of the cool-down period (using the args from the last call to the\n * debouncer). When `both` is selected the `trailing` invocation would only\n * take place if there were more than one call to the debouncer during the\n * cool-down period. **DEFAULT: 'trailing'**\n * - `waitMs?: number`. The length of the cool-down period in milliseconds. The\n * debouncer would wait until this amount of time has passed without **any**\n * additional calls to the debouncer before triggering the end-of-cool-down-\n * period event. When this happens, the function would be invoked (if `timing`\n * isn't `'leading'`) and the debouncer state would be reset. **DEFAULT: 0**\n * - `maxWaitMs?: number`. The length of time since a debounced call (a call\n * that the debouncer prevented from being invoked) was made until it would be\n * invoked. Because the debouncer can be continually triggered and thus never\n * reach the end of the cool-down period, this allows the function to still\n * be invoked occasionally. IMPORTANT: This param is ignored when `timing` is\n * `'leading'`.\n * @returns A debouncer object. The main function is `call`. In addition to it\n * the debouncer comes with the following additional functions and properties:\n * - `cancel` method to cancel delayed `func` invocations\n * - `flush` method to end the cool-down period immediately.\n * - `cachedValue` the latest return value of an invocation (if one occurred).\n * - `isPending` flag to check if there is an inflight cool-down window.\n * @signature\n * P.debounce(func, options);\n * @example\n * const debouncer = debounce(identity(), { timing: 'trailing', waitMs: 1000 });\n * const result1 = debouncer.call(1); // => undefined\n * const result2 = debouncer.call(2); // => undefined\n * // after 1 second\n * const result3 = debouncer.call(3); // => 2\n * // after 1 second\n * debouncer.cachedValue; // => 3\n * @dataFirst\n * @category Function\n * @see https://css-tricks.com/debouncing-throttling-explained-examples/\n */\nexport function debounce<F extends StrictFunction>(\n func: F,\n options: DebounceOptions & { readonly timing?: 'trailing' },\n): Debouncer<F>;\nexport function debounce<F extends StrictFunction>(\n func: F,\n options:\n | (DebounceOptions & { readonly timing: 'both' })\n | (Omit<DebounceOptions, 'maxWaitMs'> & { readonly timing: 'leading' }),\n): Debouncer<F, false>;\n\nexport function debounce<F extends StrictFunction>(\n func: F,\n\n {\n waitMs,\n timing = 'trailing',\n maxWaitMs,\n }: DebounceOptions & {\n readonly timing?: 'both' | 'leading' | 'trailing';\n },\n): Debouncer<F> {\n if (maxWaitMs !== undefined && waitMs !== undefined && maxWaitMs < waitMs) {\n throw new Error(\n `debounce: maxWaitMs (${maxWaitMs}) cannot be less than waitMs (${waitMs})`,\n );\n }\n\n // All these are part of the debouncer runtime state:\n\n // The timeout is the main object we use to tell if there's an active cool-\n // down period or not.\n let coolDownTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // We use an additional timeout to track how long the last debounced call is\n // waiting.\n let maxWaitTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // For 'trailing' invocations we need to keep the args around until we\n // actually invoke the function.\n let latestCallArgs: Parameters<F> | undefined;\n\n // To make any value of the debounced function we need to be able to return a\n // value. For any invocation except the first one when 'leading' is enabled we\n // will return this cached value.\n let result: ReturnType<F> | undefined;\n\n function handleInvoke(): void {\n if (maxWaitTimeoutId !== undefined) {\n // We are invoking the function so the wait is over...\n const timeoutId = maxWaitTimeoutId;\n maxWaitTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n /* v8 ignore next 7 -- This protects us against changes to the logic, there is no known flow we can simulate to reach this condition. It can only happen if a previous timeout isn't cleared (or faces a race condition clearing). */\n if (latestCallArgs === undefined) {\n throw new Error(\n 'PERKAKAS[debounce]: latestCallArgs was unexpectedly undefined.',\n );\n }\n\n const args = latestCallArgs;\n // Make sure the args aren't accidentally used again, this is mainly\n // relevant for the check above where we'll fail a subsequent call to\n // 'trailingEdge'.\n latestCallArgs = undefined;\n\n // Invoke the function and store the results locally.\n // @ts-expect-error [ts2345, ts2322] -- TypeScript infers the generic sub-\n // types too eagerly, making itself blind to the fact that the types match\n // here.\n result = func(...args);\n };\n\n function handleCoolDownEnd(): void {\n if (coolDownTimeoutId === undefined) {\n // It's rare to get here, it should only happen when `flush` is called\n // when the cool-down window isn't active.\n return;\n }\n\n // Make sure there are no more timers running.\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n // Then reset state so a new cool-down window can begin on the next call.\n\n if (latestCallArgs !== undefined) {\n // If we have a debounced call waiting to be invoked at the end of the\n // cool-down period we need to invoke it now.\n handleInvoke();\n }\n };\n\n function handleDebouncedCall(args: Parameters<F>): void {\n // We save the latest call args so that (if and) when we invoke the function\n // in the future, we have args to invoke it with.\n latestCallArgs = args;\n\n if (maxWaitMs !== undefined && maxWaitTimeoutId === undefined) {\n // We only need to start the maxWait timeout once, on the first debounced\n // call that is now being delayed.\n maxWaitTimeoutId = setTimeout(handleInvoke, maxWaitMs);\n }\n };\n\n return {\n call: (...args) => {\n if (coolDownTimeoutId === undefined) {\n // This call is starting a new cool-down window!\n\n if (timing === 'trailing') {\n // Only when the timing is \"trailing\" is the first call \"debounced\".\n handleDebouncedCall(args);\n } else {\n // Otherwise for \"leading\" and \"both\" the first call is actually\n // called directly and not via a timeout.\n // @ts-expect-error [ts2345, ts2322] -- TypeScript infers the generic sub-\n // types too eagerly, making itself blind to the fact that the types match\n // here.\n result = func(...args);\n }\n } else {\n // There's an inflight cool-down window.\n\n if (timing !== 'leading') {\n // When the timing is 'leading' all following calls are just ignored\n // until the cool-down period ends. But for the other timings the call\n // is \"debounced\".\n handleDebouncedCall(args);\n }\n\n // The current timeout is no longer relevant because we need to wait the\n // full `waitMs` time from this call.\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n coolDownTimeoutId = setTimeout(\n handleCoolDownEnd,\n // If waitMs is not defined but maxWaitMs *is* it means the user is only\n // interested in the leaky-bucket nature of the debouncer which is\n // achieved by setting waitMs === maxWaitMs. If both are not defined we\n // default to 0 which would wait until the end of the execution frame.\n waitMs ?? maxWaitMs ?? 0,\n );\n\n // Return the last computed result while we \"debounce\" further calls.\n return result;\n },\n\n cancel: () => {\n // Reset all \"in-flight\" state of the debouncer. Notice that we keep the\n // cached value!\n\n if (coolDownTimeoutId !== undefined) {\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n if (maxWaitTimeoutId !== undefined) {\n const timeoutId = maxWaitTimeoutId;\n maxWaitTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n latestCallArgs = undefined;\n },\n\n flush: () => {\n // Flush is just a manual way to trigger the end of the cool-down window.\n handleCoolDownEnd();\n return result;\n },\n\n get isPending() {\n return coolDownTimeoutId !== undefined;\n },\n\n get cachedValue() {\n return result;\n },\n };\n}\n"],"mappings":"AA8GA,SAAgB,EACd,EAEA,CACE,SACA,SAAS,WACT,aAIY,CACd,GAAI,IAAc,IAAA,IAAa,IAAW,IAAA,IAAa,EAAY,EACjE,MAAU,MACR,wBAAwB,EAAU,gCAAgC,EAAO,GAC1E,CAOH,IAAIA,EAIAC,EAIAC,EAKAC,EAEJ,SAAS,GAAqB,CAC5B,GAAI,IAAqB,IAAA,GAAW,CAElC,IAAM,EAAY,EAClB,EAAmB,IAAA,GACnB,aAAa,EAAU,CAIzB,GAAI,IAAmB,IAAA,GACrB,MAAU,MACR,iEACD,CAGH,IAAM,EAAO,EAIb,EAAiB,IAAA,GAMjB,EAAS,EAAK,GAAG,EAAK,CAGxB,SAAS,GAA0B,CACjC,GAAI,IAAsB,IAAA,GAGxB,OAIF,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAGnB,IAAmB,IAAA,IAGrB,GAAc,CAIlB,SAAS,EAAoB,EAA2B,CAGtD,EAAiB,EAEb,IAAc,IAAA,IAAa,IAAqB,IAAA,KAGlD,EAAmB,WAAW,EAAc,EAAU,EAI1D,MAAO,CACL,MAAO,GAAG,IAAS,CACjB,GAAI,IAAsB,IAAA,GAGpB,IAAW,WAEb,EAAoB,EAAK,CAOzB,EAAS,EAAK,GAAG,EAAK,KAEnB,CAGD,IAAW,WAIb,EAAoB,EAAK,CAK3B,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAazB,MAVA,GAAoB,WAClB,EAKA,GAAU,GAAa,EACxB,CAGM,GAGT,WAAc,CAIZ,GAAI,IAAsB,IAAA,GAAW,CACnC,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAGzB,GAAI,IAAqB,IAAA,GAAW,CAClC,IAAM,EAAY,EAClB,EAAmB,IAAA,GACnB,aAAa,EAAU,CAGzB,EAAiB,IAAA,IAGnB,WAEE,GAAmB,CACZ,GAGT,IAAI,WAAY,CACd,OAAO,IAAsB,IAAA,IAG/B,IAAI,aAAc,CAChB,OAAO,GAEV"}
1
+ {"version":3,"file":"debounce.js","names":[],"sources":["../src/debounce.ts"],"sourcesContent":["import type { StrictFunction } from './internal/types/strict-function';\n\ninterface Debouncer<F extends StrictFunction, IsNullable extends boolean = true> {\n /**\n * Invoke the debounced function.\n *\n * @param args - Same as the args for the debounced function.\n * @returns The last computed value of the debounced function with the\n * latest args provided to it. If `timing` does not include `leading` then the\n * the function would return `undefined` until the first cool-down period is\n * over, otherwise the function would always return the return type of the\n * debounced function.\n */\n readonly call: (\n ...args: Parameters<F>\n ) => ReturnType<F> | (true extends IsNullable ? undefined : never);\n\n /**\n * Cancels any debounced functions without calling them, effectively resetting\n * the debouncer to the same state it is when initially created.\n */\n readonly cancel: () => void;\n\n /**\n * Similar to `cancel`, but would also trigger the `trailing` invocation if\n * the debouncer would run one at the end of the cool-down period.\n */\n readonly flush: () => ReturnType<F> | undefined;\n\n /**\n * Is `true` when there is an active cool-down period currently debouncing\n * invocations.\n */\n readonly isPending: boolean;\n\n /**\n * The last computed value of the debounced function.\n */\n readonly cachedValue: ReturnType<F> | undefined;\n}\n\ninterface DebounceOptions {\n readonly waitMs?: number;\n readonly maxWaitMs?: number;\n}\n\n/**\n * Wraps `func` with a debouncer object that \"debounces\" (delays) invocations of the function during a defined cool-down period (`waitMs`). It can be configured to invoke the function either at the start of the cool-down period, the end of it, or at both ends (`timing`).\n * It can also be configured to allow invocations during the cool-down period (`maxWaitMs`).\n * It stores the latest call's arguments so they could be used at the end of the cool-down period when invoking `func` (if configured to invoke the function at the end of the cool-down period).\n * It stores the value returned by `func` whenever its invoked. This value is returned on every call, and is accessible via the `cachedValue` property of the debouncer. Its important to note that the value might be different from the value that would be returned from running `func` with the current arguments as it is a cached value from a previous invocation.\n * **Important**: The cool-down period defines the minimum between two invocations, and not the maximum. The period will be **extended** each time a call is made until a full cool-down period has elapsed without any additional calls.\n *\n *! **DEPRECATED**: This implementation of debounce is known to have issues and might not behave as expected. It should be replaced with the `funnel` utility instead.\n *\n * @param func - The function to debounce, the returned `call` function will have\n * the exact same signature.\n * @param options - An object allowing further customization of the debouncer:\n * - `timing?: 'leading' | 'trailing' |'both'`. The default is `'trailing'`.\n * `leading` would result in the function being invoked at the start of the\n * cool-down period; `trailing` would result in the function being invoked at\n * the end of the cool-down period (using the args from the last call to the\n * debouncer). When `both` is selected the `trailing` invocation would only\n * take place if there were more than one call to the debouncer during the\n * cool-down period. **DEFAULT: 'trailing'**\n * - `waitMs?: number`. The length of the cool-down period in milliseconds. The\n * debouncer would wait until this amount of time has passed without **any**\n * additional calls to the debouncer before triggering the end-of-cool-down-\n * period event. When this happens, the function would be invoked (if `timing`\n * isn't `'leading'`) and the debouncer state would be reset. **DEFAULT: 0**\n * - `maxWaitMs?: number`. The length of time since a debounced call (a call\n * that the debouncer prevented from being invoked) was made until it would be\n * invoked. Because the debouncer can be continually triggered and thus never\n * reach the end of the cool-down period, this allows the function to still\n * be invoked occasionally. IMPORTANT: This param is ignored when `timing` is\n * `'leading'`.\n * @returns A debouncer object. The main function is `call`. In addition to it\n * the debouncer comes with the following additional functions and properties:\n * - `cancel` method to cancel delayed `func` invocations\n * - `flush` method to end the cool-down period immediately.\n * - `cachedValue` the latest return value of an invocation (if one occurred).\n * - `isPending` flag to check if there is an inflight cool-down window.\n * @signature\n * debounce(func, options);\n * @example\n * const debouncer = debounce(identity(), { timing: 'trailing', waitMs: 1000 });\n * const result1 = debouncer.call(1); // => undefined\n * const result2 = debouncer.call(2); // => undefined\n * // after 1 second\n * const result3 = debouncer.call(3); // => 2\n * // after 1 second\n * debouncer.cachedValue; // => 3\n * @dataFirst\n * @category Function\n * @deprecated This implementation of debounce is known to have issues and might\n * not behave as expected. It should be replaced with the `funnel` utility\n * instead.\n * @see https://css-tricks.com/debouncing-throttling-explained-examples/\n */\nexport function debounce<F extends StrictFunction>(\n func: F,\n options: DebounceOptions & { readonly timing?: 'trailing' },\n): Debouncer<F>;\nexport function debounce<F extends StrictFunction>(\n func: F,\n options:\n | (DebounceOptions & { readonly timing: 'both' })\n | (Omit<DebounceOptions, 'maxWaitMs'> & { readonly timing: 'leading' }),\n): Debouncer<F, false>;\n\nexport function debounce<F extends StrictFunction>(\n func: F,\n {\n waitMs,\n timing = 'trailing',\n maxWaitMs,\n }: DebounceOptions & {\n readonly timing?: 'both' | 'leading' | 'trailing';\n },\n): Debouncer<F> {\n if (maxWaitMs !== undefined && waitMs !== undefined && maxWaitMs < waitMs) {\n throw new Error(\n `debounce: maxWaitMs (${maxWaitMs.toString()}) cannot be less than waitMs (${waitMs.toString()})`,\n );\n }\n\n // All these are part of the debouncer runtime state:\n\n // The timeout is the main object we use to tell if there's an active cool-\n // down period or not.\n let coolDownTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // We use an additional timeout to track how long the last debounced call is\n // waiting.\n let maxWaitTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // For 'trailing' invocations we need to keep the args around until we\n // actually invoke the function.\n let latestCallArgs: Parameters<F> | undefined;\n\n // To make any value of the debounced function we need to be able to return a\n // value. For any invocation except the first one when 'leading' is enabled we\n // will return this cached value.\n let result: ReturnType<F> | undefined;\n\n const handleInvoke = (): void => {\n if (maxWaitTimeoutId !== undefined) {\n // We are invoking the function so the wait is over...\n const timeoutId = maxWaitTimeoutId;\n maxWaitTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n /* v8 ignore if -- This protects us against changes to the logic, there is no known flow we can simulate to reach this condition. It can only happen if a previous timeout isn't cleared (or faces a race condition clearing). @preserve */\n if (latestCallArgs === undefined) {\n // If you see this error pop up when using this function please report\n // it on the github page!\n throw new Error(\n 'Perkakas[debounce]: latestCallArgs was unexpectedly undefined.',\n );\n }\n\n const args = latestCallArgs;\n // Make sure the args aren't accidentally used again, this is mainly\n // relevant for the check above where we'll fail a subsequent call to\n // 'trailingEdge'.\n latestCallArgs = undefined;\n\n // Invoke the function and store the results locally.\n // @ts-expect-error [ts2345, ts2322] -- TypeScript infers the generic sub-\n // types too eagerly, making itself blind to the fact that the types match\n // here.\n result = func(...args);\n };\n\n const handleCoolDownEnd = (): void => {\n if (coolDownTimeoutId === undefined) {\n // It's rare to get here, it should only happen when `flush` is called\n // when the cool-down window isn't active.\n return;\n }\n\n // Make sure there are no more timers running.\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n // Then reset state so a new cool-down window can begin on the next call.\n\n if (latestCallArgs !== undefined) {\n // If we have a debounced call waiting to be invoked at the end of the\n // cool-down period we need to invoke it now.\n handleInvoke();\n }\n };\n\n const handleDebouncedCall = (args: Parameters<F>): void => {\n // We save the latest call args so that (if and) when we invoke the function\n // in the future, we have args to invoke it with.\n latestCallArgs = args;\n\n if (maxWaitMs !== undefined && maxWaitTimeoutId === undefined) {\n // We only need to start the maxWait timeout once, on the first debounced\n // call that is now being delayed.\n maxWaitTimeoutId = setTimeout(handleInvoke, maxWaitMs);\n }\n };\n\n return {\n call: (...args) => {\n if (coolDownTimeoutId === undefined) {\n // This call is starting a new cool-down window!\n\n if (timing === 'trailing') {\n // Only when the timing is \"trailing\" is the first call \"debounced\".\n handleDebouncedCall(args);\n } else {\n // Otherwise for \"leading\" and \"both\" the first call is actually\n // called directly and not via a timeout.\n // @ts-expect-error [ts2345, ts2322] -- TypeScript infers the generic\n // sub-types too eagerly, making itself blind to the fact that the\n // types match here.\n result = func(...args);\n }\n } else {\n // There's an inflight cool-down window.\n\n if (timing !== 'leading') {\n // When the timing is 'leading' all following calls are just ignored\n // until the cool-down period ends. But for the other timings the call\n // is \"debounced\".\n handleDebouncedCall(args);\n }\n\n // The current timeout is no longer relevant because we need to wait the\n // full `waitMs` time from this call.\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n coolDownTimeoutId = setTimeout(\n handleCoolDownEnd,\n // If waitMs is not defined but maxWaitMs *is* it means the user is only\n // interested in the leaky-bucket nature of the debouncer which is\n // achieved by setting waitMs === maxWaitMs. If both are not defined we\n // default to 0 which would wait until the end of the execution frame.\n waitMs ?? maxWaitMs ?? 0,\n );\n\n // Return the last computed result while we \"debounce\" further calls.\n return result;\n },\n\n cancel: () => {\n // Reset all \"in-flight\" state of the debouncer. Notice that we keep the\n // cached value!\n\n if (coolDownTimeoutId !== undefined) {\n const timeoutId = coolDownTimeoutId;\n coolDownTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n if (maxWaitTimeoutId !== undefined) {\n const timeoutId = maxWaitTimeoutId;\n maxWaitTimeoutId = undefined;\n clearTimeout(timeoutId);\n }\n\n latestCallArgs = undefined;\n },\n\n flush: () => {\n // Flush is just a manual way to trigger the end of the cool-down window.\n handleCoolDownEnd();\n return result;\n },\n\n get isPending() {\n return coolDownTimeoutId !== undefined;\n },\n\n get cachedValue() {\n return result;\n },\n };\n}\n"],"mappings":"AA8GA,SAAgB,EACd,EACA,CACE,SACA,SAAS,WACT,aAIY,CACd,GAAI,IAAc,IAAA,IAAa,IAAW,IAAA,IAAa,EAAY,EACjE,MAAU,MACR,wBAAwB,EAAU,UAAU,CAAC,gCAAgC,EAAO,UAAU,CAAC,GAChG,CAOH,IAAI,EAIA,EAIA,EAKA,EAEE,MAA2B,CAC/B,GAAI,IAAqB,IAAA,GAAW,CAElC,IAAM,EAAY,EAClB,EAAmB,IAAA,GACnB,aAAa,EAAU,CAIzB,GAAI,IAAmB,IAAA,GAGrB,MAAU,MACR,iEACD,CAGH,IAAM,EAAO,EAIb,EAAiB,IAAA,GAMjB,EAAS,EAAK,GAAG,EAAK,EAGlB,MAAgC,CACpC,GAAI,IAAsB,IAAA,GAGxB,OAIF,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAGnB,IAAmB,IAAA,IAGrB,GAAc,EAIZ,EAAuB,GAA8B,CAGzD,EAAiB,EAEb,IAAc,IAAA,IAAa,IAAqB,IAAA,KAGlD,EAAmB,WAAW,EAAc,EAAU,GAI1D,MAAO,CACL,MAAO,GAAG,IAAS,CACjB,GAAI,IAAsB,IAAA,GAGpB,IAAW,WAEb,EAAoB,EAAK,CAOzB,EAAS,EAAK,GAAG,EAAK,KAEnB,CAGD,IAAW,WAIb,EAAoB,EAAK,CAK3B,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAazB,MAVA,GAAoB,WAClB,EAKA,GAAU,GAAa,EACxB,CAGM,GAGT,WAAc,CAIZ,GAAI,IAAsB,IAAA,GAAW,CACnC,IAAM,EAAY,EAClB,EAAoB,IAAA,GACpB,aAAa,EAAU,CAGzB,GAAI,IAAqB,IAAA,GAAW,CAClC,IAAM,EAAY,EAClB,EAAmB,IAAA,GACnB,aAAa,EAAU,CAGzB,EAAiB,IAAA,IAGnB,WAEE,GAAmB,CACZ,GAGT,IAAI,WAAY,CACd,OAAO,IAAsB,IAAA,IAG/B,IAAI,aAAc,CAChB,OAAO,GAEV"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){return e??t}exports.defaultTo=t;
2
+ //# sourceMappingURL=default-to.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-to.cjs","names":["curry"],"sources":["../src/default-to.ts"],"sourcesContent":["import type { IsEqual } from 'type-fest';\nimport type { PerkakasTypeError } from './internal/types/perkakas-type-error';\nimport { curry } from './curry';\n\ntype FallbackOf<T>\n = IsEqual<T, NonNullable<T>> extends true\n ? PerkakasTypeError<\n 'defaultTo',\n 'no unnecessary fallback',\n // The type is `never` because it will never be used ;)\n { type: never; metadata: T }\n >\n : T;\n\n/**\n * A stricter wrapper around the [Nullish coalescing operator `??`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator)\n * that ensures that the fallback matches the type of the data. Only works\n * when data can be `null` or `undefined`.\n *\n * Notice that `Number.NaN` is not nullish and would not result in returning the\n * fallback!\n *\n * @param data - A nullish value.\n * @param fallback - A value of the same type as `data` that would be returned\n * when `data` is nullish.\n * @signature\n * defaultTo(data, fallback);\n * @example\n * defaultTo(\"hello\" as string | undefined, \"world\"); //=> \"hello\"\n * defaultTo(undefined as string | undefined, \"world\"); //=> \"world\"\n * @dataFirst\n * @category Other\n */\nexport function defaultTo<T, const Fallback extends FallbackOf<T>>(\n data: T,\n fallback: Fallback,\n): NonNullable<T> | Fallback;\n\n/**\n * A stricter wrapper around the [Nullish coalescing operator `??`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator)\n * that ensures that the fallback matches the type of the data, and that the\n * data is nullish (`null` or `undefined`).\n *\n * Notice that `Number.NaN` is not nullish and would not result in returning the\n * fallback!\n *\n * @param fallback - A value of the same type as `data` that would be returned\n * when `data` is nullish.\n * @signature\n * defaultTo(fallback)(data);\n * @example\n * pipe(\"hello\" as string | undefined, defaultTo(\"world\")); //=> \"hello\"\n * pipe(undefined as string | undefined, defaultTo(\"world\")); //=> \"world\"\n * @dataLast\n * @category Other\n */\nexport function defaultTo<T, const Fallback extends FallbackOf<T>>(\n fallback: Fallback,\n): (data: T) => NonNullable<T> | Fallback;\n\nexport function defaultTo(...args: ReadonlyArray<unknown>): unknown {\n return curry(defaultToImplementation, args);\n}\n\nfunction defaultToImplementation<T, Fallback extends FallbackOf<T>>(data: T, fallback: Fallback): NonNullable<T> | Fallback {\n return data ?? fallback;\n}\n"],"mappings":"kGA4DA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,EAAK,CAG7C,SAAS,EAA2D,EAAS,EAA+C,CAC1H,OAAO,GAAQ"}
@@ -0,0 +1,2 @@
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){return e??t}export{t as defaultTo};
2
+ //# sourceMappingURL=default-to.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-to.js","names":[],"sources":["../src/default-to.ts"],"sourcesContent":["import type { IsEqual } from 'type-fest';\nimport type { PerkakasTypeError } from './internal/types/perkakas-type-error';\nimport { curry } from './curry';\n\ntype FallbackOf<T>\n = IsEqual<T, NonNullable<T>> extends true\n ? PerkakasTypeError<\n 'defaultTo',\n 'no unnecessary fallback',\n // The type is `never` because it will never be used ;)\n { type: never; metadata: T }\n >\n : T;\n\n/**\n * A stricter wrapper around the [Nullish coalescing operator `??`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator)\n * that ensures that the fallback matches the type of the data. Only works\n * when data can be `null` or `undefined`.\n *\n * Notice that `Number.NaN` is not nullish and would not result in returning the\n * fallback!\n *\n * @param data - A nullish value.\n * @param fallback - A value of the same type as `data` that would be returned\n * when `data` is nullish.\n * @signature\n * defaultTo(data, fallback);\n * @example\n * defaultTo(\"hello\" as string | undefined, \"world\"); //=> \"hello\"\n * defaultTo(undefined as string | undefined, \"world\"); //=> \"world\"\n * @dataFirst\n * @category Other\n */\nexport function defaultTo<T, const Fallback extends FallbackOf<T>>(\n data: T,\n fallback: Fallback,\n): NonNullable<T> | Fallback;\n\n/**\n * A stricter wrapper around the [Nullish coalescing operator `??`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator)\n * that ensures that the fallback matches the type of the data, and that the\n * data is nullish (`null` or `undefined`).\n *\n * Notice that `Number.NaN` is not nullish and would not result in returning the\n * fallback!\n *\n * @param fallback - A value of the same type as `data` that would be returned\n * when `data` is nullish.\n * @signature\n * defaultTo(fallback)(data);\n * @example\n * pipe(\"hello\" as string | undefined, defaultTo(\"world\")); //=> \"hello\"\n * pipe(undefined as string | undefined, defaultTo(\"world\")); //=> \"world\"\n * @dataLast\n * @category Other\n */\nexport function defaultTo<T, const Fallback extends FallbackOf<T>>(\n fallback: Fallback,\n): (data: T) => NonNullable<T> | Fallback;\n\nexport function defaultTo(...args: ReadonlyArray<unknown>): unknown {\n return curry(defaultToImplementation, args);\n}\n\nfunction defaultToImplementation<T, Fallback extends FallbackOf<T>>(data: T, fallback: Fallback): NonNullable<T> | Fallback {\n return data ?? fallback;\n}\n"],"mappings":"mCA4DA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,EAAK,CAG7C,SAAS,EAA2D,EAAS,EAA+C,CAC1H,OAAO,GAAQ"}
@@ -1 +1,2 @@
1
- const e=require(`./utility-evaluators-CAbODbuk.cjs`),t=require(`./curry-from-lazy-BCGvmhyS.cjs`);function n(...e){return t.t(r,e)}function r(t,n){return r=>t.every(e=>!n(r,e))?{done:!1,hasNext:!0,next:r}:e.t}exports.differenceWith=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utility-evaluators-C8koSp9T.cjs`),t=require(`./curry-from-lazy-BvN_VKlH.cjs`);function n(...e){return t.t(r,e)}function r(t,n){return r=>t.every(e=>!n(r,e))?{done:!1,hasNext:!0,next:r}:e.t}exports.differenceWith=n;
2
+ //# sourceMappingURL=difference-with.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"difference-with.cjs","names":["curryFromLazy","SKIP_ITEM"],"sources":["../src/difference-with.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\ntype IsEqual<T, Other> = (data: T, other: Other) => boolean;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param data - The source array.\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(data, other, isEqual)\n * @example\n * differenceWith(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }],\n * [2, 5, 3],\n * ({ a }, b) => a === b,\n * ); //=> [{ a: 1 }, { a: 4 }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): Array<T>;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(other, isEqual)(data)\n * @example\n * pipe(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }, { a: 5 }, { a: 6 }],\n * differenceWith([2, 3], ({ a }, b) => a === b),\n * ); //=> [{ a: 1 }, { a: 4 }, { a: 5 }, { a: 6 }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function differenceWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, Other>(other: ReadonlyArray<Other>, isEqual: IsEqual<T, Other>): LazyEvaluator<T> {\n return (value) =>\n other.every((otherValue) => !isEqual(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"oKAqDA,SAAgB,EAAe,GAAG,EAAuC,CACvE,OAAOA,EAAAA,EAAc,EAAoB,EAAK,CAGhD,SAAS,EAA6B,EAA6B,EAA8C,CAC/G,MAAQ,IACN,EAAM,MAAO,GAAe,CAAC,EAAQ,EAAO,EAAW,CAAC,CACpD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,EAAO,CAC3CC,EAAAA"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./utility-evaluators-Boc-TMbq.js";import{t}from"./curry-from-lazy-PQ0BbG-7.js";function n(...e){return t(r,e)}function r(t,n){return r=>t.every(e=>!n(r,e))?{done:!1,hasNext:!0,next:r}:e}export{n as differenceWith};
1
+ import{t as e}from"./utility-evaluators-ZAaUtL2Z.js";import{t}from"./curry-from-lazy-CtH1dp14.js";function n(...e){return t(r,e)}function r(t,n){return r=>t.every(e=>!n(r,e))?{done:!1,hasNext:!0,next:r}:e}export{n as differenceWith};
2
2
  //# sourceMappingURL=difference-with.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"difference-with.js","names":[],"sources":["../src/difference-with.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\n\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\ntype IsEquals<TFirst, TSecond> = (a: TFirst, b: TSecond) => boolean;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param array - The source array.\n * @param other - The values to exclude.\n * @param isEquals - The comparator.\n * @signature\n * P.differenceWith(array, other, isEquals)\n * @example\n * P.differenceWith(\n * [{a: 1}, {a: 2}, {a: 3}, {a: 4}],\n * [{a: 2}, {a: 5}, {a: 3}],\n * P.equals,\n * ) // => [{a: 1}, {a: 4}]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function differenceWith<TFirst, TSecond>(\n array: ReadonlyArray<TFirst>,\n other: ReadonlyArray<TSecond>,\n isEquals: IsEquals<TFirst, TSecond>,\n): Array<TFirst>;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param other - The values to exclude.\n * @param isEquals - The comparator.\n * @signature\n * P.differenceWith(other, isEquals)(array)\n * @example\n * P.differenceWith(\n * [{a: 2}, {a: 5}, {a: 3}],\n * P.equals,\n * )([{a: 1}, {a: 2}, {a: 3}, {a: 4}]) // => [{a: 1}, {a: 4}]\n * P.pipe(\n * [{a: 1}, {a: 2}, {a: 3}, {a: 4}, {a: 5}, {a: 6}], // only 4 iterations\n * P.differenceWith([{a: 2}, {a: 3}], P.equals),\n * P.take(2),\n * ) // => [{a: 1}, {a: 4}]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function differenceWith<TFirst, TSecond>(\n other: ReadonlyArray<TSecond>,\n isEquals: IsEquals<TFirst, TSecond>,\n): (array: ReadonlyArray<TFirst>) => Array<TFirst>;\n\nexport function differenceWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<TFirst, TSecond>(\n other: ReadonlyArray<TSecond>,\n isEquals: IsEquals<TFirst, TSecond>,\n): LazyEvaluator<TFirst> {\n return (value) =>\n other.every((otherValue) => !isEquals(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"kGA2DA,SAAgB,EAAe,GAAG,EAAuC,CACvE,OAAO,EAAc,EAAoB,EAAK,CAGhD,SAAS,EACP,EACA,EACuB,CACvB,MAAQ,IACN,EAAM,MAAO,GAAe,CAAC,EAAS,EAAO,EAAW,CAAC,CACrD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,EAAO,CAC3C"}
1
+ {"version":3,"file":"difference-with.js","names":[],"sources":["../src/difference-with.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\ntype IsEqual<T, Other> = (data: T, other: Other) => boolean;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param data - The source array.\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(data, other, isEqual)\n * @example\n * differenceWith(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }],\n * [2, 5, 3],\n * ({ a }, b) => a === b,\n * ); //=> [{ a: 1 }, { a: 4 }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): Array<T>;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(other, isEqual)(data)\n * @example\n * pipe(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }, { a: 5 }, { a: 6 }],\n * differenceWith([2, 3], ({ a }, b) => a === b),\n * ); //=> [{ a: 1 }, { a: 4 }, { a: 5 }, { a: 6 }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function differenceWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, Other>(other: ReadonlyArray<Other>, isEqual: IsEqual<T, Other>): LazyEvaluator<T> {\n return (value) =>\n other.every((otherValue) => !isEqual(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"kGAqDA,SAAgB,EAAe,GAAG,EAAuC,CACvE,OAAO,EAAc,EAAoB,EAAK,CAGhD,SAAS,EAA6B,EAA6B,EAA8C,CAC/G,MAAQ,IACN,EAAM,MAAO,GAAe,CAAC,EAAQ,EAAO,EAAW,CAAC,CACpD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,EAAO,CAC3C"}
@@ -1 +1,2 @@
1
- const e=require(`./utility-evaluators-CAbODbuk.cjs`),t=require(`./curry-from-lazy-BCGvmhyS.cjs`);function n(...e){return t.t(r,e)}function r(t){if(t.length===0)return e.r;let n=new Map;for(let e of t)n.set(e,(n.get(e)??0)+1);return t=>{let r=n.get(t);return r===void 0||r===0?{done:!1,hasNext:!0,next:t}:(n.set(t,r-1),e.t)}}exports.difference=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utility-evaluators-C8koSp9T.cjs`),t=require(`./curry-from-lazy-BvN_VKlH.cjs`);function n(...e){return t.t(r,e)}function r(t){if(t.length===0)return e.r;let n=new Map;for(let e of t)n.set(e,(n.get(e)??0)+1);return t=>{let r=n.get(t);return r===void 0||r===0?{done:!1,hasNext:!0,next:t}:(n.set(t,r-1),e.t)}}exports.difference=n;
2
+ //# sourceMappingURL=difference.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"difference.cjs","names":["curryFromLazy","lazyIdentityEvaluator","SKIP_ITEM"],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * difference(data, other)\n * @example\n * difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(data: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * difference(other)(data)\n * @example\n * pipe([1, 2, 3, 4], difference([2, 5, 3])); // => [1, 4]\n * pipe([1, 1, 2, 2], difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(other: ReadonlyArray<T>): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"oKAuCA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAOA,EAAAA,EAAc,EAAoB,EAAK,CAGhD,SAAS,EAAsB,EAA2C,CACxE,GAAI,EAAM,SAAW,EACnB,OAAOC,EAAAA,EAKT,IAAM,EAAY,IAAI,IACtB,IAAK,IAAM,KAAS,EAClB,EAAU,IAAI,GAAQ,EAAU,IAAI,EAAM,EAAI,GAAK,EAAE,CAGvD,MAAQ,IAAU,CAChB,IAAM,EAAS,EAAU,IAAI,EAAM,CAYnC,OAVI,IAAW,IAAA,IAAa,IAAW,EAG9B,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,EAAO,EAMpD,EAAU,IAAI,EAAO,EAAS,EAAE,CACzBC,EAAAA"}
@@ -1,2 +1,2 @@
1
- import{r as e,t}from"./utility-evaluators-Boc-TMbq.js";import{t as n}from"./curry-from-lazy-PQ0BbG-7.js";function r(...e){return n(i,e)}function i(n){if(n.length===0)return e;let r=new Map;for(let e of n)r.set(e,(r.get(e)??0)+1);return e=>{let n=r.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(r.set(e,n-1),t)}}export{r as difference};
1
+ import{r as e,t}from"./utility-evaluators-ZAaUtL2Z.js";import{t as n}from"./curry-from-lazy-CtH1dp14.js";function r(...e){return n(i,e)}function i(n){if(n.length===0)return e;let r=new Map;for(let e of n)r.set(e,(r.get(e)??0)+1);return e=>{let n=r.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(r.set(e,n-1),t)}}export{r as difference};
2
2
  //# sourceMappingURL=difference.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"difference.js","names":[],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\n\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * P.difference(data, other)\n * @example\n * P.difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * P.difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<T>,\n): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * P.difference(other)(data)\n * @example\n * P.pipe([1, 2, 3, 4], P.difference([2, 5, 3])); // => [1, 4]\n * P.pipe([1, 1, 2, 2], P.difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(\n other: ReadonlyArray<T>,\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"yGA6CA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAO,EAAc,EAAoB,EAAK,CAGhD,SAAS,EAAsB,EAA2C,CACxE,GAAI,EAAM,SAAW,EACnB,OAAO,EAKT,IAAM,EAAY,IAAI,IACtB,IAAK,IAAM,KAAS,EAClB,EAAU,IAAI,GAAQ,EAAU,IAAI,EAAM,EAAI,GAAK,EAAE,CAGvD,MAAQ,IAAU,CAChB,IAAM,EAAS,EAAU,IAAI,EAAM,CAYnC,OAVI,IAAW,IAAA,IAAa,IAAW,EAG9B,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,EAAO,EAMpD,EAAU,IAAI,EAAO,EAAS,EAAE,CACzB"}
1
+ {"version":3,"file":"difference.js","names":[],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * difference(data, other)\n * @example\n * difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(data: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * difference(other)(data)\n * @example\n * pipe([1, 2, 3, 4], difference([2, 5, 3])); // => [1, 4]\n * pipe([1, 1, 2, 2], difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(other: ReadonlyArray<T>): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"yGAuCA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAO,EAAc,EAAoB,EAAK,CAGhD,SAAS,EAAsB,EAA2C,CACxE,GAAI,EAAM,SAAW,EACnB,OAAO,EAKT,IAAM,EAAY,IAAI,IACtB,IAAK,IAAM,KAAS,EAClB,EAAU,IAAI,GAAQ,EAAU,IAAI,EAAM,EAAI,GAAK,EAAE,CAGvD,MAAQ,IAAU,CAChB,IAAM,EAAS,EAAU,IAAI,EAAM,CAYnC,OAVI,IAAW,IAAA,IAAa,IAAW,EAG9B,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,EAAO,EAMpD,EAAU,IAAI,EAAO,EAAS,EAAE,CACzB"}
package/dist/divide.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);function t(...t){return e.t(n,t)}function n(e,t){return e/t}exports.divide=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){return e/t}exports.divide=t;
2
+ //# sourceMappingURL=divide.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divide.cjs","names":["curry"],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(value, divisor);\n * @example\n * divide(12, 3) // => 4\n * reduce([1, 2, 3, 4], divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(divisor)(value);\n * @example\n * divide(3)(12) // => 4\n * map([2, 4, 6, 8], divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\n// The implementation only uses `number` types, but that's just because it's\n// hard to tell typescript that both value and divisor would be of the same\n// type.\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"kGAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,EAAK,CAM1C,SAAS,EAAqB,EAAe,EAAyB,CACpE,OAAO,EAAQ"}
package/dist/divide.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./curry-NmniqyJ0.js";function t(...t){return e(n,t)}function n(e,t){return e/t}export{t as divide};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){return e/t}export{t as divide};
2
2
  //# sourceMappingURL=divide.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"divide.js","names":[],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * P.divide(value, divisor);\n * @example\n * P.divide(12, 3) // => 4\n * P.reduce([1, 2, 3, 4], P.divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * P.divide(divisor)(value);\n * @example\n * P.divide(3)(12) // => 4\n * P.map([2, 4, 6, 8], P.divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"wCAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,EAAK,CAG1C,SAAS,EAAqB,EAAe,EAAyB,CACpE,OAAO,EAAQ"}
1
+ {"version":3,"file":"divide.js","names":[],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(value, divisor);\n * @example\n * divide(12, 3) // => 4\n * reduce([1, 2, 3, 4], divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(divisor)(value);\n * @example\n * divide(3)(12) // => 4\n * map([2, 4, 6, 8], divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\n// The implementation only uses `number` types, but that's just because it's\n// hard to tell typescript that both value and divisor would be of the same\n// type.\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"mCAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,EAAK,CAM1C,SAAS,EAAqB,EAAe,EAAyB,CACpE,OAAO,EAAQ"}
@@ -1 +1,2 @@
1
- function e(){return t}function t(...e){}exports.doNothing=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(){return t}function t(...e){}exports.doNothing=e;
2
+ //# sourceMappingURL=do-nothing.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"do-nothing.cjs","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: doNothing() });\n * myApi({ onSuccess: isDemoMode ? doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n // Notice that the exported identity function is just the \"factory\" for the\n // function. We do it this way so that all \"Function\" utilities have a similar\n // API where the function is called, and not just used \"headless\". e.g.\n // `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void {\n /* do nothing */\n}\n"],"mappings":"mEAsBA,SAAgB,GAAgC,CAK9C,OAAO,EAGT,SAAS,EAAiD,GAAG,EAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"do-nothing.js","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * P.doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: P.doNothing() });\n * myApi({ onSuccess: isDemoMode ? P.doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n /**\n * Notice that the exported identity function is just the \"factory\" for the\n * function. We do it this way so that all \"Function\" utilities have a similar\n * API where the function is called, and not just used \"headless\". e.g.\n * `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n */\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(\n ..._args: Args\n): void {\n /* do nothing */\n}\n"],"mappings":"AAsBA,SAAgB,GAAgC,CAO9C,OAAO,EAGT,SAAS,EACP,GAAG,EACG"}
1
+ {"version":3,"file":"do-nothing.js","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: doNothing() });\n * myApi({ onSuccess: isDemoMode ? doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n // Notice that the exported identity function is just the \"factory\" for the\n // function. We do it this way so that all \"Function\" utilities have a similar\n // API where the function is called, and not just used \"headless\". e.g.\n // `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void {\n /* do nothing */\n}\n"],"mappings":"AAsBA,SAAgB,GAAgC,CAK9C,OAAO,EAGT,SAAS,EAAiD,GAAG,EAAmB"}
@@ -1 +1,2 @@
1
- const e=require(`./curry-order-rules-ClqHrs8_.cjs`),t=require(`./heap-DWDhbxfx.cjs`);function n(...t){return e.n(r,t)}function r(e,n,r){if(r>=e.length)return[];if(r<=0)return[...e];let i=e.slice(0,r);t.n(i,n);let a=[],o=e.slice(r);for(let e of o){let r=t.t(i,n,e);a.push(r??e)}return a}exports.dropFirstBy=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry-order-rules-DsJSy3gX.cjs`),t=require(`./heap-C0zPQGC0.cjs`);function n(...t){return e.n(r,t)}function r(e,n,r){if(r>=e.length)return[];if(r<=0)return[...e];let i=e.slice(0,r);t.n(i,n);let a=[],o=e.slice(r);for(let e of o){let r=t.t(i,n,e);a.push(r??e)}return a}exports.dropFirstBy=n;
2
+ //# sourceMappingURL=drop-first-by.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-first-by.cjs","names":["curryOrderRulesWithArgument","heapMaybeInsert"],"sources":["../src/drop-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(data, n, ...rules);\n * @example\n * dropFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aaaa', 'aaa']\n * @dataFirst\n * @category Array\n */\nexport function dropFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], dropFirstBy(2, x => x.length)); // => ['aaaa', 'aaa']\n * @dataLast\n * @category Array\n */\nexport function dropFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function dropFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(dropFirstByImplementation, args);\n}\n\nfunction dropFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n >= data.length) {\n return [];\n }\n\n if (n <= 0) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const out = [];\n\n const rest = data.slice(n);\n for (const item of rest) {\n const previousHead = heapMaybeInsert(heap, compareFn, item);\n out.push(previousHead ?? item);\n }\n\n return out;\n}\n"],"mappings":"wJAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,EAA4B,EAA2B,EAAK,CAGrE,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EAAK,OACZ,MAAO,EAAE,CAGX,GAAI,GAAK,EACP,MAAO,CAAC,GAAG,EAAK,CAGlB,IAAM,EAAO,EAAK,MAAM,EAAG,EAAE,CAC7B,EAAA,EAAQ,EAAM,EAAU,CAExB,IAAM,EAAM,EAAE,CAER,EAAO,EAAK,MAAM,EAAE,CAC1B,IAAK,IAAM,KAAQ,EAAM,CACvB,IAAM,EAAeC,EAAAA,EAAgB,EAAM,EAAW,EAAK,CAC3D,EAAI,KAAK,GAAgB,EAAK,CAGhC,OAAO"}
@@ -1,2 +1,2 @@
1
- import{n as e}from"./curry-order-rules-DwrF-_P1.js";import{n as t,t as n}from"./heap-BhpfhYWj.js";function r(...t){return e(i,t)}function i(e,r,i){if(i>=e.length)return[];if(i<=0)return[...e];let a=e.slice(0,i);t(a,r);let o=[],s=e.slice(i);for(let e of s){let t=n(a,r,e);o.push(t??e)}return o}export{r as dropFirstBy};
1
+ import{n as e}from"./curry-order-rules-BLyCSMdZ.js";import{n as t,t as n}from"./heap-M6D40vkc.js";function r(...t){return e(i,t)}function i(e,r,i){if(i>=e.length)return[];if(i<=0)return[...e];let a=e.slice(0,i);t(a,r);let o=[],s=e.slice(i);for(let e of s){let t=n(a,r,e);o.push(t??e)}return o}export{r as dropFirstBy};
2
2
  //# sourceMappingURL=drop-first-by.js.map