@vinicunca/perkakas 1.13.2 → 1.15.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-B9lX8euz.js +3 -0
  670. package/dist/words-B9lX8euz.js.map +1 -0
  671. package/dist/words-_h74qi45.cjs +3 -0
  672. package/dist/words-_h74qi45.cjs.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":"product.cjs","names":["curry"],"sources":["../src/product.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Product<T extends IterableContainer<bigint> | IterableContainer<number>>\n // Empty arrays would always result in a product of (a non-bigint) 1\n = T extends readonly []\n ? 1\n : // Non-empty bigint arrays will always result in a bigint product.\n T extends readonly [bigint, ...(ReadonlyArray<unknown>)]\n ? bigint\n : // But an empty bigint array would result in a non-bigint 1.\n T[number] extends bigint\n ? bigint | 1\n : // Non-bigint arrays are always handled correctly.\n number;\n\n/**\n * Compute the product of the numbers in the array, or return 1 for an empty\n * array.\n *\n * Works for both `number` and `bigint` arrays, but not arrays that contain both\n * types.\n *\n * IMPORTANT: The result for empty arrays would be 1 (`number`) regardless of\n * the type of the array; to avoid adding this to the return type for cases\n * where the array is known to be non-empty you can use `hasAtLeast` or\n * `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * product(data);\n * @example\n * product([1, 2, 3]); // => 6\n * product([1n, 2n, 3n]); // => 6n\n * product([]); // => 1\n * @dataFirst\n * @category Number\n */\nexport function product<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): Product<T>;\n\n/**\n * Compute the product of the numbers in the array, or return 1 for an empty\n * array.\n *\n * Works for both `number` and `bigint` arrays, but not arrays that contain both\n * types.\n *\n * IMPORTANT: The result for empty arrays would be 1 (`number`) regardless of\n * the type of the array; to avoid adding this to the return type for cases\n * where the array is known to be non-empty you can use `hasAtLeast` or\n * `isEmpty` to guard against this case.\n *\n * @signature\n * product()(data);\n * @example\n * pipe([1, 2, 3], product()); // => 6\n * pipe([1n, 2n, 3n], product()); // => 6n\n * pipe([], product()); // => 1\n * @dataLast\n * @category Number\n */\nexport function product(): <\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(\n data: T,\n) => Product<T>;\n\nexport function product(...args: ReadonlyArray<unknown>): unknown {\n return curry(productImplementation, args);\n}\n\nfunction productImplementation<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): T[number] {\n let out = typeof data[0] === 'bigint' ? 1n : 1;\n for (const value of data) {\n // @ts-expect-error [ts2365] -- Typescript can't infer that all elements will be a number of the same type.\n out *= value;\n }\n return out;\n}\n"],"mappings":"kGAqEA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAOA,EAAAA,MAAM,EAAuB,EAAK,CAG3C,SAAS,EAEP,EAAoB,CACpB,IAAI,EAAM,OAAO,EAAK,IAAO,SAAW,GAAK,EAC7C,IAAK,IAAM,KAAS,EAElB,GAAO,EAET,OAAO"}
package/dist/product.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){let t=typeof e[0]==`bigint`?1n:1;for(let n of e)t*=n;return t}export{t as product};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e){let t=typeof e[0]==`bigint`?1n:1;for(let n of e)t*=n;return t}export{t as product};
2
2
  //# sourceMappingURL=product.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.js","names":[],"sources":["../src/product.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\n\nimport { curry } from './curry';\n\ntype Product<T extends IterableContainer<bigint> | IterableContainer<number>>\n // Empty arrays would always result in a product of (a non-bigint) 1\n = T extends readonly []\n ? 1\n // Non-empty bigint arrays will always result in a bigint product.\n : T extends readonly [bigint, ...ReadonlyArray<unknown>]\n ? bigint\n // But an empty bigint array would result in a non-bigint 1.\n : T[number] extends bigint\n ? 1 | bigint\n // Non-bigint arrays are always handled correctly.\n : number;\n\n/**\n * Compute the product of the numbers in the array, or return 1 for an empty\n * array.\n *\n * Works for both `number` and `bigint` arrays, but not arrays that contain both\n * types.\n *\n * IMPORTANT: The result for empty arrays would be 1 (`number`) regardless of\n * the type of the array; to avoid adding this to the return type for cases\n * where the array is known to be non-empty you can use `hasAtLeast` or\n * `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * P.product(data);\n * @example\n * P.product([1, 2, 3]); // => 6\n * P.product([1n, 2n, 3n]); // => 6n\n * P.product([]); // => 1\n * @dataFirst\n * @category Number\n */\nexport function product<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): Product<T>;\n\n/**\n * Compute the product of the numbers in the array, or return 1 for an empty\n * array.\n *\n * Works for both `number` and `bigint` arrays, but not arrays that contain both\n * types.\n *\n * IMPORTANT: The result for empty arrays would be 1 (`number`) regardless of\n * the type of the array; to avoid adding this to the return type for cases\n * where the array is known to be non-empty you can use `hasAtLeast` or\n * `isEmpty` to guard against this case.\n *\n * @signature\n * P.product()(data);\n * @example\n * P.pipe([1, 2, 3], P.product()); // => 6\n * P.pipe([1n, 2n, 3n], P.product()); // => 6n\n * P.pipe([], P.product()); // => 1\n * @dataLast\n * @category Number\n */\nexport function product(): <\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(\n data: T,\n) => Product<T>;\n\nexport function product(...args: ReadonlyArray<unknown>): unknown {\n return curry(productImplementation, args);\n}\n\nfunction productImplementation<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): T[number] {\n let out = typeof data[0] === 'bigint' ? 1n : 1;\n for (const value of data) {\n // @ts-expect-error [ts2365] -- Typescript can't infer that all elements will be a number of the same type.\n out *= value;\n }\n return out;\n}\n"],"mappings":"wCAsEA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,EAAK,CAG3C,SAAS,EAEP,EAAoB,CACpB,IAAI,EAAM,OAAO,EAAK,IAAO,SAAW,GAAK,EAC7C,IAAK,IAAM,KAAS,EAElB,GAAO,EAET,OAAO"}
1
+ {"version":3,"file":"product.js","names":[],"sources":["../src/product.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Product<T extends IterableContainer<bigint> | IterableContainer<number>>\n // Empty arrays would always result in a product of (a non-bigint) 1\n = T extends readonly []\n ? 1\n : // Non-empty bigint arrays will always result in a bigint product.\n T extends readonly [bigint, ...(ReadonlyArray<unknown>)]\n ? bigint\n : // But an empty bigint array would result in a non-bigint 1.\n T[number] extends bigint\n ? bigint | 1\n : // Non-bigint arrays are always handled correctly.\n number;\n\n/**\n * Compute the product of the numbers in the array, or return 1 for an empty\n * array.\n *\n * Works for both `number` and `bigint` arrays, but not arrays that contain both\n * types.\n *\n * IMPORTANT: The result for empty arrays would be 1 (`number`) regardless of\n * the type of the array; to avoid adding this to the return type for cases\n * where the array is known to be non-empty you can use `hasAtLeast` or\n * `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * product(data);\n * @example\n * product([1, 2, 3]); // => 6\n * product([1n, 2n, 3n]); // => 6n\n * product([]); // => 1\n * @dataFirst\n * @category Number\n */\nexport function product<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): Product<T>;\n\n/**\n * Compute the product of the numbers in the array, or return 1 for an empty\n * array.\n *\n * Works for both `number` and `bigint` arrays, but not arrays that contain both\n * types.\n *\n * IMPORTANT: The result for empty arrays would be 1 (`number`) regardless of\n * the type of the array; to avoid adding this to the return type for cases\n * where the array is known to be non-empty you can use `hasAtLeast` or\n * `isEmpty` to guard against this case.\n *\n * @signature\n * product()(data);\n * @example\n * pipe([1, 2, 3], product()); // => 6\n * pipe([1n, 2n, 3n], product()); // => 6n\n * pipe([], product()); // => 1\n * @dataLast\n * @category Number\n */\nexport function product(): <\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(\n data: T,\n) => Product<T>;\n\nexport function product(...args: ReadonlyArray<unknown>): unknown {\n return curry(productImplementation, args);\n}\n\nfunction productImplementation<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): T[number] {\n let out = typeof data[0] === 'bigint' ? 1n : 1;\n for (const value of data) {\n // @ts-expect-error [ts2365] -- Typescript can't infer that all elements will be a number of the same type.\n out *= value;\n }\n return out;\n}\n"],"mappings":"mCAqEA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,EAAK,CAG3C,SAAS,EAEP,EAAoB,CACpB,IAAI,EAAM,OAAO,EAAK,IAAO,SAAW,GAAK,EAC7C,IAAK,IAAM,KAAS,EAElB,GAAO,EAET,OAAO"}
package/dist/prop.cjs CHANGED
@@ -1 +1,2 @@
1
- function e(e,...n){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?r=>t(r,e,...n):t(e,...n)}function t(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}exports.prop=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,...n){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?r=>t(r,e,...n):t(e,...n)}function t(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}exports.prop=e;
2
+ //# sourceMappingURL=prop.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop.cjs","names":[],"sources":["../src/prop.ts"],"sourcesContent":["import type { KeysOfUnion } from 'type-fest';\nimport type { ArrayAt } from './internal/types/array-at';\n\n// Computes all possible keys of `T` at `Path` spread over unions, allowing\n// keys from any of the results, not just those **shared** by all of them.\ntype KeysDeep<T, Path extends ReadonlyArray<unknown>> = KeysOfUnion<\n PropDeep<T, Path>\n>;\n\n// Recursively run `Prop` over `Path` to extract the deeply nested type.\ntype PropDeep<T, Path extends ReadonlyArray<unknown>> = Path extends readonly [\n infer Key,\n ...infer Rest,\n]\n ? PropDeep<Prop<T, Key>, Rest>\n : // Keys is a fixed tuple so we know we reach here only when we've reached\n// the output object.\n T;\n\n// Expanding on the built-in `T[Key]` operator to support arrays and unions.\ntype Prop<T, Key>\n // Distribute the union to support unions of keys.\n = T extends unknown\n ? // In a distributed union some of the union members might not be keys of a\n // specific object within a union of objects, those cases don't contribute\n // to the output type.\n Key extends keyof T\n ? T extends ReadonlyArray<unknown>\n ? ArrayAt<T, Key>\n : T[Key]\n : undefined\n : never;\n\n// Currying relies on us being able to differentiate between data-first and\n// data-last invocations at runtime, but because the function takes a variadic\n// array of keys we can't rely on it's shape or length to do that. Instead, we\n// can limit the types we accept for `data` so that looking at the first\n// parameter's type is enough to make the call. From a practical standpoint\n// this means we accept in any `object`, `null,` or `undefined`, and that we\n// don't accept `string`. All other types (`boolean` and `bigint`) don't\n// have properties, so are incompatible with our `key` parameters anyway.\ntype NonPropertyKey = object | null | undefined;\n\n/**\n * Gets the value of the given property from an object. Nested properties can\n * be accessed by providing a variadic array of keys that define the path from\n * the root to the desired property. Arrays can be accessed by using numeric\n * keys. Unions and optional properties are handled gracefully by returning\n * `undefined` early for any non-existing property on the path. Paths are\n * validated against the object type to provide stronger type safety, better\n * compile-time errors, and to enable autocompletion in IDEs.\n *\n * @param data - The object or array to access.\n * @param key - The key(s) for the property to extract.\n * @signature\n * prop(data, ...keys);\n * @example\n * prop({ foo: { bar: 'baz' } }, 'foo'); //=> { bar: 'baz' }\n * prop({ foo: { bar: 'baz' } }, 'foo', 'bar'); //=> 'baz'\n * prop([\"cat\", \"dog\"], 1); //=> 'dog'\n * @dataFirst\n * @category Object\n */\nexport function prop<T extends NonPropertyKey, Key extends KeysDeep<T, []>>(\n data: T,\n key: Key,\n): NoInfer<Prop<T, Key>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n>(data: T, key0: Key0, key1: Key1): NoInfer<PropDeep<T, [Key0, Key1]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n Key9 extends KeysDeep<\n T,\n [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]\n >,\n AdditionalKeys extends ReadonlyArray<PropertyKey> = [],\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n key9: Key9,\n ...additionalKeys: AdditionalKeys\n): NoInfer<\n PropDeep<\n T,\n [\n Key0,\n Key1,\n Key2,\n Key3,\n Key4,\n Key5,\n Key6,\n Key7,\n Key8,\n Key9,\n ...AdditionalKeys,\n ]\n >\n>;\n\n/**\n * Gets the value of the given property from an object. Nested properties can\n * be accessed by providing a variadic array of keys that define the path from\n * the root to the desired property. Arrays can be accessed by using numeric\n * keys. Unions and optional properties are handled gracefully by returning\n * `undefined` early for any non-existing property on the path. Paths are\n * validated against the object type to provide stronger type safety, better\n * compile-time errors, and to enable autocompletion in IDEs.\n *\n * @param key - The key(s) for the property to extract.\n * @signature\n * prop(...keys)(data);\n * @example\n * pipe({ foo: { bar: 'baz' } }, prop('foo')); //=> { bar: 'baz' }\n * pipe({ foo: { bar: 'baz' } }, prop('foo', 'bar')); //=> 'baz'\n * pipe([\"cat\", \"dog\"], prop(1)); //=> 'dog'\n * @dataLast\n * @category Object\n */\nexport function prop<T extends NonPropertyKey, Key extends KeysOfUnion<T>>(\n key: Key,\n): (data: T) => NoInfer<Prop<T, Key>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n>(key0: Key0, key1: Key1): (data: T) => NoInfer<PropDeep<T, [Key0, Key1]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n): (\n data: T,\n) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n): (\n data: T,\n) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n): (\n data: T,\n) => NoInfer<\n PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>\n>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n Key9 extends KeysDeep<\n T,\n [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]\n >,\n AdditionalKeys extends ReadonlyArray<PropertyKey> = [],\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n key9: Key9,\n ...additionalKeys: AdditionalKeys\n): (\n data: T,\n) => NoInfer<\n PropDeep<\n T,\n [\n Key0,\n Key1,\n Key2,\n Key3,\n Key4,\n Key5,\n Key6,\n Key7,\n Key8,\n Key9,\n ...AdditionalKeys,\n ]\n >\n>;\n\nexport function prop<K extends PropertyKey>(\n key: K,\n): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];\n\nexport function prop(\n maybeData: NonPropertyKey | PropertyKey,\n ...args: ReadonlyArray<PropertyKey>\n): unknown {\n return typeof maybeData === 'string'\n || typeof maybeData === 'number'\n || typeof maybeData === 'symbol'\n ? (data: NonPropertyKey) => propImplementation(data, maybeData, ...args)\n : propImplementation(maybeData, ...args);\n}\n\nfunction propImplementation(\n data: NonPropertyKey,\n ...keys: ReadonlyArray<PropertyKey>\n): unknown {\n let output: unknown = data;\n for (const key of keys) {\n if (output === undefined || output === null) {\n return undefined;\n }\n // @ts-expect-error [ts7053] -- This is fine, the types are really dynamic\n // here and TypeScript doesn't have a chance to infer them correctly.\n output = output[key];\n }\n return output;\n}\n"],"mappings":"mEAubA,SAAgB,EACd,EACA,GAAG,EACM,CACT,OAAO,OAAO,GAAc,UACvB,OAAO,GAAc,UACrB,OAAO,GAAc,SACrB,GAAyB,EAAmB,EAAM,EAAW,GAAG,EAAK,CACtE,EAAmB,EAAW,GAAG,EAAK,CAG5C,SAAS,EACP,EACA,GAAG,EACM,CACT,IAAI,EAAkB,EACtB,IAAK,IAAM,KAAO,EAAM,CACtB,GAAI,GAAmC,KACrC,OAIF,EAAS,EAAO,GAElB,OAAO"}
package/dist/prop.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"prop.js","names":["output: unknown"],"sources":["../src/prop.ts"],"sourcesContent":["import type { KeysOfUnion } from 'type-fest';\nimport type { ArrayAt } from './internal/types/array-at';\n\n// Computes all possible keys of `T` at `Path` spread over unions, allowing\n// keys from any of the results, not just those **shared** by all of them.\ntype KeysDeep<T, Path extends ReadonlyArray<unknown>> = KeysOfUnion<\n PropDeep<T, Path>\n>;\n\n// Recursively run `Prop` over `Path` to extract the deeply nested type.\ntype PropDeep<T, Path extends ReadonlyArray<unknown>> = Path extends readonly [\n infer Key,\n ...infer Rest,\n]\n ? PropDeep<Prop<T, Key>, Rest>\n // Keys is a fixed tuple so we know we reach here only when we've reached\n // the output object.\n : T;\n\n// Expanding on the built-in `T[Key]` operator to support arrays and unions.\ntype Prop<T, Key>\n // Distribute the union to support unions of keys.\n = T extends unknown\n // In a distributed union some of the union members might not be keys of a\n // specific object within a union of objects, those cases don't contribute\n // to the output type.\n ? Key extends keyof T\n ? T extends ReadonlyArray<unknown>\n ? ArrayAt<T, Key>\n : T[Key]\n : undefined\n : never;\n\n// Currying relies on us being able to differentiate between data-first and\n// data-last invocations at runtime, but because the function takes a variadic\n// array of keys we can't rely on it's shape or length to do that. Instead, we\n// can limit the types we accept for `data` so that looking at the first\n// parameter's type is enough to make the call. From a practical standpoint\n// this means we accept in any `object`, `null,` or `undefined`, and that we\n// don't accept `string`. All other types (`boolean` and `bigint`) don't\n// have properties, so are incompatible with our `key` parameters anyway.\ntype NonPropertyKey = object | null | undefined;\n\n/**\n * Gets the value of the given property from an object. Nested properties can\n * be accessed by providing a variadic array of keys that define the path from\n * the root to the desired property. Arrays can be accessed by using numeric\n * keys. Unions and optional properties are handled gracefully by returning\n * `undefined` early for any non-existing property on the path. Paths are\n * validated against the object type to provide stronger type safety, better\n * compile-time errors, and to enable autocompletion in IDEs.\n *\n * @param data - The object or array to access.\n * @param key - The key(s) for the property to extract.\n * @signature\n * P.prop(data, ...keys);\n * @example\n * P.prop({ foo: { bar: 'baz' } }, 'foo'); //=> { bar: 'baz' }\n * P.prop({ foo: { bar: 'baz' } }, 'foo', 'bar'); //=> 'baz'\n * P.prop([\"cat\", \"dog\"], 1); //=> 'dog'\n * @dataFirst\n * @category Object\n */\nexport function prop<T extends NonPropertyKey, Key extends KeysDeep<T, []>>(\n data: T,\n key: Key,\n): NoInfer<Prop<T, Key>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n>(data: T, key0: Key0, key1: Key1): NoInfer<PropDeep<T, [Key0, Key1]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n Key9 extends KeysDeep<\n T,\n [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]\n >,\n AdditionalKeys extends ReadonlyArray<PropertyKey> = [],\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n key9: Key9,\n ...additionalKeys: AdditionalKeys\n): NoInfer<\n PropDeep<\n T,\n [\n Key0,\n Key1,\n Key2,\n Key3,\n Key4,\n Key5,\n Key6,\n Key7,\n Key8,\n Key9,\n ...AdditionalKeys,\n ]\n >\n>;\n\n/**\n * Gets the value of the given property from an object. Nested properties can\n * be accessed by providing a variadic array of keys that define the path from\n * the root to the desired property. Arrays can be accessed by using numeric\n * keys. Unions and optional properties are handled gracefully by returning\n * `undefined` early for any non-existing property on the path. Paths are\n * validated against the object type to provide stronger type safety, better\n * compile-time errors, and to enable autocompletion in IDEs.\n *\n * @param key - The key(s) for the property to extract.\n * @signature\n * P.prop(...keys)(data);\n * @example\n * P.pipe({ foo: { bar: 'baz' } }, P.prop('foo')); //=> { bar: 'baz' }\n * P.pipe({ foo: { bar: 'baz' } }, P.prop('foo', 'bar')); //=> 'baz'\n * P.pipe([\"cat\", \"dog\"], P.prop(1)); //=> 'dog'\n * @dataLast\n * @category Object\n */\nexport function prop<T extends NonPropertyKey, Key extends KeysOfUnion<T>>(\n key: Key,\n): (data: T) => NoInfer<Prop<T, Key>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n>(key0: Key0, key1: Key1): (data: T) => NoInfer<PropDeep<T, [Key0, Key1]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n): (\n data: T,\n) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n): (\n data: T,\n) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n): (\n data: T,\n) => NoInfer<\n PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>\n>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n Key9 extends KeysDeep<\n T,\n [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]\n >,\n AdditionalKeys extends ReadonlyArray<PropertyKey> = [],\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n key9: Key9,\n ...additionalKeys: AdditionalKeys\n): (\n data: T,\n) => NoInfer<\n PropDeep<\n T,\n [\n Key0,\n Key1,\n Key2,\n Key3,\n Key4,\n Key5,\n Key6,\n Key7,\n Key8,\n Key9,\n ...AdditionalKeys,\n ]\n >\n>;\n\nexport function prop<K extends PropertyKey>(\n key: K,\n): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];\n\nexport function prop(\n maybeData: NonPropertyKey | PropertyKey,\n ...args: ReadonlyArray<PropertyKey>\n): unknown {\n return typeof maybeData === 'string'\n || typeof maybeData === 'number'\n || typeof maybeData === 'symbol'\n ? (data: NonPropertyKey) => propImplementation(data, maybeData, ...args)\n : propImplementation(maybeData, ...args);\n}\n\nfunction propImplementation(\n data: NonPropertyKey,\n ...keys: ReadonlyArray<PropertyKey>\n): unknown {\n let output: unknown = data;\n for (const key of keys) {\n if (output === undefined || output === null) {\n return undefined;\n }\n // @ts-expect-error [ts7053] -- This is fine, the types are really dynamic\n // here and TypeScript doesn't have a chance to infer them correctly.\n output = output[key];\n }\n return output;\n}\n"],"mappings":"AAubA,SAAgB,EACd,EACA,GAAG,EACM,CACT,OAAO,OAAO,GAAc,UACvB,OAAO,GAAc,UACrB,OAAO,GAAc,SACrB,GAAyB,EAAmB,EAAM,EAAW,GAAG,EAAK,CACtE,EAAmB,EAAW,GAAG,EAAK,CAG5C,SAAS,EACP,EACA,GAAG,EACM,CACT,IAAIA,EAAkB,EACtB,IAAK,IAAM,KAAO,EAAM,CACtB,GAAI,GAAmC,KACrC,OAIF,EAAS,EAAO,GAElB,OAAO"}
1
+ {"version":3,"file":"prop.js","names":[],"sources":["../src/prop.ts"],"sourcesContent":["import type { KeysOfUnion } from 'type-fest';\nimport type { ArrayAt } from './internal/types/array-at';\n\n// Computes all possible keys of `T` at `Path` spread over unions, allowing\n// keys from any of the results, not just those **shared** by all of them.\ntype KeysDeep<T, Path extends ReadonlyArray<unknown>> = KeysOfUnion<\n PropDeep<T, Path>\n>;\n\n// Recursively run `Prop` over `Path` to extract the deeply nested type.\ntype PropDeep<T, Path extends ReadonlyArray<unknown>> = Path extends readonly [\n infer Key,\n ...infer Rest,\n]\n ? PropDeep<Prop<T, Key>, Rest>\n : // Keys is a fixed tuple so we know we reach here only when we've reached\n// the output object.\n T;\n\n// Expanding on the built-in `T[Key]` operator to support arrays and unions.\ntype Prop<T, Key>\n // Distribute the union to support unions of keys.\n = T extends unknown\n ? // In a distributed union some of the union members might not be keys of a\n // specific object within a union of objects, those cases don't contribute\n // to the output type.\n Key extends keyof T\n ? T extends ReadonlyArray<unknown>\n ? ArrayAt<T, Key>\n : T[Key]\n : undefined\n : never;\n\n// Currying relies on us being able to differentiate between data-first and\n// data-last invocations at runtime, but because the function takes a variadic\n// array of keys we can't rely on it's shape or length to do that. Instead, we\n// can limit the types we accept for `data` so that looking at the first\n// parameter's type is enough to make the call. From a practical standpoint\n// this means we accept in any `object`, `null,` or `undefined`, and that we\n// don't accept `string`. All other types (`boolean` and `bigint`) don't\n// have properties, so are incompatible with our `key` parameters anyway.\ntype NonPropertyKey = object | null | undefined;\n\n/**\n * Gets the value of the given property from an object. Nested properties can\n * be accessed by providing a variadic array of keys that define the path from\n * the root to the desired property. Arrays can be accessed by using numeric\n * keys. Unions and optional properties are handled gracefully by returning\n * `undefined` early for any non-existing property on the path. Paths are\n * validated against the object type to provide stronger type safety, better\n * compile-time errors, and to enable autocompletion in IDEs.\n *\n * @param data - The object or array to access.\n * @param key - The key(s) for the property to extract.\n * @signature\n * prop(data, ...keys);\n * @example\n * prop({ foo: { bar: 'baz' } }, 'foo'); //=> { bar: 'baz' }\n * prop({ foo: { bar: 'baz' } }, 'foo', 'bar'); //=> 'baz'\n * prop([\"cat\", \"dog\"], 1); //=> 'dog'\n * @dataFirst\n * @category Object\n */\nexport function prop<T extends NonPropertyKey, Key extends KeysDeep<T, []>>(\n data: T,\n key: Key,\n): NoInfer<Prop<T, Key>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n>(data: T, key0: Key0, key1: Key1): NoInfer<PropDeep<T, [Key0, Key1]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n Key9 extends KeysDeep<\n T,\n [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]\n >,\n AdditionalKeys extends ReadonlyArray<PropertyKey> = [],\n>(\n data: T,\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n key9: Key9,\n ...additionalKeys: AdditionalKeys\n): NoInfer<\n PropDeep<\n T,\n [\n Key0,\n Key1,\n Key2,\n Key3,\n Key4,\n Key5,\n Key6,\n Key7,\n Key8,\n Key9,\n ...AdditionalKeys,\n ]\n >\n>;\n\n/**\n * Gets the value of the given property from an object. Nested properties can\n * be accessed by providing a variadic array of keys that define the path from\n * the root to the desired property. Arrays can be accessed by using numeric\n * keys. Unions and optional properties are handled gracefully by returning\n * `undefined` early for any non-existing property on the path. Paths are\n * validated against the object type to provide stronger type safety, better\n * compile-time errors, and to enable autocompletion in IDEs.\n *\n * @param key - The key(s) for the property to extract.\n * @signature\n * prop(...keys)(data);\n * @example\n * pipe({ foo: { bar: 'baz' } }, prop('foo')); //=> { bar: 'baz' }\n * pipe({ foo: { bar: 'baz' } }, prop('foo', 'bar')); //=> 'baz'\n * pipe([\"cat\", \"dog\"], prop(1)); //=> 'dog'\n * @dataLast\n * @category Object\n */\nexport function prop<T extends NonPropertyKey, Key extends KeysOfUnion<T>>(\n key: Key,\n): (data: T) => NoInfer<Prop<T, Key>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n>(key0: Key0, key1: Key1): (data: T) => NoInfer<PropDeep<T, [Key0, Key1]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n): (\n data: T,\n) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n): (\n data: T,\n) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n): (\n data: T,\n) => NoInfer<\n PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>\n>;\nexport function prop<\n T extends NonPropertyKey,\n Key0 extends KeysDeep<T, []>,\n Key1 extends KeysDeep<T, [Key0]>,\n Key2 extends KeysDeep<T, [Key0, Key1]>,\n Key3 extends KeysDeep<T, [Key0, Key1, Key2]>,\n Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>,\n Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>,\n Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>,\n Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>,\n Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>,\n Key9 extends KeysDeep<\n T,\n [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]\n >,\n AdditionalKeys extends ReadonlyArray<PropertyKey> = [],\n>(\n key0: Key0,\n key1: Key1,\n key2: Key2,\n key3: Key3,\n key4: Key4,\n key5: Key5,\n key6: Key6,\n key7: Key7,\n key8: Key8,\n key9: Key9,\n ...additionalKeys: AdditionalKeys\n): (\n data: T,\n) => NoInfer<\n PropDeep<\n T,\n [\n Key0,\n Key1,\n Key2,\n Key3,\n Key4,\n Key5,\n Key6,\n Key7,\n Key8,\n Key9,\n ...AdditionalKeys,\n ]\n >\n>;\n\nexport function prop<K extends PropertyKey>(\n key: K,\n): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];\n\nexport function prop(\n maybeData: NonPropertyKey | PropertyKey,\n ...args: ReadonlyArray<PropertyKey>\n): unknown {\n return typeof maybeData === 'string'\n || typeof maybeData === 'number'\n || typeof maybeData === 'symbol'\n ? (data: NonPropertyKey) => propImplementation(data, maybeData, ...args)\n : propImplementation(maybeData, ...args);\n}\n\nfunction propImplementation(\n data: NonPropertyKey,\n ...keys: ReadonlyArray<PropertyKey>\n): unknown {\n let output: unknown = data;\n for (const key of keys) {\n if (output === undefined || output === null) {\n return undefined;\n }\n // @ts-expect-error [ts7053] -- This is fine, the types are really dynamic\n // here and TypeScript doesn't have a chance to infer them correctly.\n output = output[key];\n }\n return output;\n}\n"],"mappings":"AAubA,SAAgB,EACd,EACA,GAAG,EACM,CACT,OAAO,OAAO,GAAc,UACvB,OAAO,GAAc,UACrB,OAAO,GAAc,SACrB,GAAyB,EAAmB,EAAM,EAAW,GAAG,EAAK,CACtE,EAAmB,EAAW,GAAG,EAAK,CAG5C,SAAS,EACP,EACA,GAAG,EACM,CACT,IAAI,EAAkB,EACtB,IAAK,IAAM,KAAO,EAAM,CACtB,GAAI,GAAmC,KACrC,OAIF,EAAS,EAAO,GAElB,OAAO"}
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);function t(...t){return e.t(n,t)}function n(e,t,n){let r={};for(let[i,a]of e.entries()){let o=t(a,i,e);r[o]=n(a,i,e)}return r}exports.pullObject=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,n){let r={};for(let[i,a]of e.entries()){let o=t(a,i,e);r[o]=n(a,i,e)}return r}exports.pullObject=t;
2
+ //# sourceMappingURL=pull-object.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull-object.cjs","names":["curry"],"sources":["../src/pull-object.ts"],"sourcesContent":["import type { BoundedPartial } from './internal/types/bounded-partial';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Creates an object that maps the result of `valueExtractor` with a key\n * resulting from running `keyExtractor` on each item in `data`. Duplicate keys\n * are overwritten, guaranteeing that the extractor functions are run on each\n * item in `data`.\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * `fromKeys` - Builds an object from an array of *keys* and a mapper for values.\n * `indexBy` - Builds an object from an array of *values* and a mapper for keys.\n * `fromEntries` - Builds an object from an array of key-value pairs.\n * Refer to the docs for more details.\n *\n * @param data - The items used to pull/extract the keys and values from.\n * @param keyExtractor - Computes the key for item.\n * @param valueExtractor - Computes the value for the item.\n * @signature\n * pullObject(data, keyExtractor, valueExtractor);\n * @example\n * pullObject(\n * [\n * { name: \"john\", email: \"john@perkakas.com\" },\n * { name: \"jane\", email: \"jane@perkakas.com\" }\n * ],\n * prop(\"name\"),\n * prop(\"email\"),\n * ); // => { john: \"john@perkakas.com\", jane: \"jane@perkakas.com\" }\n * @dataFirst\n * @category Object\n */\nexport function pullObject<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n data: T,\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): BoundedPartial<Record<K, V>>;\n\n/**\n * Creates an object that maps the result of `valueExtractor` with a key\n * resulting from running `keyExtractor` on each item in `data`. Duplicate keys\n * are overwritten, guaranteeing that the extractor functions are run on each\n * item in `data`.\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * `fromKeys` - Builds an object from an array of *keys* and a mapper for values.\n * `indexBy` - Builds an object from an array of *values* and a mapper for keys.\n * `fromEntries` - Builds an object from an array of key-value pairs.\n * Refer to the docs for more details.\n *\n * @param keyExtractor - Computes the key for item.\n * @param valueExtractor - Computes the value for the item.\n * @signature\n * pullObject(keyExtractor, valueExtractor)(data);\n * @example\n * pipe(\n * [\n * { name: \"john\", email: \"john@perkakas.com\" },\n * { name: \"jane\", email: \"jane@perkakas.com\" }\n * ],\n * pullObject(prop(\"name\"), prop(\"email\")),\n * ); // => { john: \"john@perkakas.com\", jane: \"jane@perkakas.com\" }\n * @dataLast\n * @category Object\n */\nexport function pullObject<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): (data: T) => BoundedPartial<Record<K, V>>;\n\nexport function pullObject(...args: ReadonlyArray<unknown>): unknown {\n return curry(pullObjectImplementation, args);\n}\n\nfunction pullObjectImplementation<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n data: T,\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): Partial<Record<K, V>> {\n const result: Partial<Record<K, V>> = {};\n\n for (const [index, item] of data.entries()) {\n const key = keyExtractor(item, index, data);\n const value = valueExtractor(item, index, data);\n result[key] = value;\n }\n\n return result;\n}\n"],"mappings":"kGAiFA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAOA,EAAAA,MAAM,EAA0B,EAAK,CAG9C,SAAS,EAKP,EACA,EACA,EACuB,CACvB,IAAM,EAAgC,EAAE,CAExC,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,IAAM,EAAM,EAAa,EAAM,EAAO,EAAK,CAE3C,EAAO,GADO,EAAe,EAAM,EAAO,EAAK,CAIjD,OAAO"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./curry-NmniqyJ0.js";function t(...t){return e(n,t)}function n(e,t,n){let r={};for(let[i,a]of e.entries()){let o=t(a,i,e);r[o]=n(a,i,e)}return r}export{t as pullObject};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t,n){let r={};for(let[i,a]of e.entries()){let o=t(a,i,e);r[o]=n(a,i,e)}return r}export{t as pullObject};
2
2
  //# sourceMappingURL=pull-object.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pull-object.js","names":["result: Partial<Record<K, V>>"],"sources":["../src/pull-object.ts"],"sourcesContent":["import type { BoundedPartial } from './internal/types/bounded-partial';\n\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Creates an object that maps the result of `valueExtractor` with a key\n * resulting from running `keyExtractor` on each item in `data`. Duplicate keys\n * are overwritten, guaranteeing that the extractor functions are run on each\n * item in `data`.\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * `fromKeys` - Builds an object from an array of *keys* and a mapper for values.\n * `indexBy` - Builds an object from an array of *values* and a mapper for keys.\n * `fromEntries` - Builds an object from an array of key-value pairs.\n * `mapToObj` - Builds an object from an array of items and a single mapper for key-value pairs.\n * Refer to the docs for more details.\n *\n * @param data - The items used to pull/extract the keys and values from.\n * @param keyExtractor - Computes the key for item.\n * @param valueExtractor - Computes the value for the item.\n * @signature\n * P.pullObject(data, keyExtractor, valueExtractor);\n * @example\n * P.pullObject(\n * [\n * { name: \"john\", email: \"john@bebedag.com\" },\n * { name: \"jane\", email: \"jane@bebedag.com\" }\n * ],\n * P.prop(\"name\"),\n * P.prop(\"email\"),\n * ); // => { john: \"john@bebedag.com\", jane: \"jane@bebedag.com\" }\n * @dataFirst\n * @category Object\n */\nexport function pullObject<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n data: T,\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): BoundedPartial<Record<K, V>>;\n\n/**\n * Creates an object that maps the result of `valueExtractor` with a key\n * resulting from running `keyExtractor` on each item in `data`. Duplicate keys\n * are overwritten, guaranteeing that the extractor functions are run on each\n * item in `data`.\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * `fromKeys` - Builds an object from an array of *keys* and a mapper for values.\n * `indexBy` - Builds an object from an array of *values* and a mapper for keys.\n * `fromEntries` - Builds an object from an array of key-value pairs.\n * `mapToObj` - Builds an object from an array of items and a single mapper for key-value pairs.\n * Refer to the docs for more details.\n *\n * @param keyExtractor - Computes the key for item.\n * @param valueExtractor - Computes the value for the item.\n * @signature\n * P.pullObject(keyExtractor, valueExtractor)(data);\n * @example\n * P.pipe(\n * [\n * { name: \"john\", email: \"john@bebedag.com\" },\n * { name: \"jane\", email: \"jane@bebedag.com\" }\n * ],\n * P.pullObject(P.prop(\"email\"), P.prop(\"name\")),\n * ); // => { john: \"john@bebedag.com\", jane: \"jane@bebedag.com\" }\n * @dataLast\n * @category Object\n */\nexport function pullObject<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): (data: T) => BoundedPartial<Record<K, V>>;\n\nexport function pullObject(...args: ReadonlyArray<unknown>): unknown {\n return curry(pullObjectImplementation, args);\n}\n\nfunction pullObjectImplementation<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n data: T,\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): Partial<Record<K, V>> {\n const result: Partial<Record<K, V>> = {};\n\n for (const [index, item] of data.entries()) {\n const key = keyExtractor(item, index, data);\n const value = valueExtractor(item, index, data);\n result[key] = value;\n }\n\n return result;\n}\n"],"mappings":"wCAoFA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAO,EAAM,EAA0B,EAAK,CAG9C,SAAS,EAKP,EACA,EACA,EACuB,CACvB,IAAMA,EAAgC,EAAE,CAExC,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,IAAM,EAAM,EAAa,EAAM,EAAO,EAAK,CAE3C,EAAO,GADO,EAAe,EAAM,EAAO,EAAK,CAIjD,OAAO"}
1
+ {"version":3,"file":"pull-object.js","names":[],"sources":["../src/pull-object.ts"],"sourcesContent":["import type { BoundedPartial } from './internal/types/bounded-partial';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Creates an object that maps the result of `valueExtractor` with a key\n * resulting from running `keyExtractor` on each item in `data`. Duplicate keys\n * are overwritten, guaranteeing that the extractor functions are run on each\n * item in `data`.\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * `fromKeys` - Builds an object from an array of *keys* and a mapper for values.\n * `indexBy` - Builds an object from an array of *values* and a mapper for keys.\n * `fromEntries` - Builds an object from an array of key-value pairs.\n * Refer to the docs for more details.\n *\n * @param data - The items used to pull/extract the keys and values from.\n * @param keyExtractor - Computes the key for item.\n * @param valueExtractor - Computes the value for the item.\n * @signature\n * pullObject(data, keyExtractor, valueExtractor);\n * @example\n * pullObject(\n * [\n * { name: \"john\", email: \"john@perkakas.com\" },\n * { name: \"jane\", email: \"jane@perkakas.com\" }\n * ],\n * prop(\"name\"),\n * prop(\"email\"),\n * ); // => { john: \"john@perkakas.com\", jane: \"jane@perkakas.com\" }\n * @dataFirst\n * @category Object\n */\nexport function pullObject<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n data: T,\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): BoundedPartial<Record<K, V>>;\n\n/**\n * Creates an object that maps the result of `valueExtractor` with a key\n * resulting from running `keyExtractor` on each item in `data`. Duplicate keys\n * are overwritten, guaranteeing that the extractor functions are run on each\n * item in `data`.\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * `fromKeys` - Builds an object from an array of *keys* and a mapper for values.\n * `indexBy` - Builds an object from an array of *values* and a mapper for keys.\n * `fromEntries` - Builds an object from an array of key-value pairs.\n * Refer to the docs for more details.\n *\n * @param keyExtractor - Computes the key for item.\n * @param valueExtractor - Computes the value for the item.\n * @signature\n * pullObject(keyExtractor, valueExtractor)(data);\n * @example\n * pipe(\n * [\n * { name: \"john\", email: \"john@perkakas.com\" },\n * { name: \"jane\", email: \"jane@perkakas.com\" }\n * ],\n * pullObject(prop(\"name\"), prop(\"email\")),\n * ); // => { john: \"john@perkakas.com\", jane: \"jane@perkakas.com\" }\n * @dataLast\n * @category Object\n */\nexport function pullObject<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): (data: T) => BoundedPartial<Record<K, V>>;\n\nexport function pullObject(...args: ReadonlyArray<unknown>): unknown {\n return curry(pullObjectImplementation, args);\n}\n\nfunction pullObjectImplementation<\n T extends IterableContainer,\n K extends PropertyKey,\n V,\n>(\n data: T,\n keyExtractor: (item: T[number], index: number, data: T) => K,\n valueExtractor: (item: T[number], index: number, data: T) => V,\n): Partial<Record<K, V>> {\n const result: Partial<Record<K, V>> = {};\n\n for (const [index, item] of data.entries()) {\n const key = keyExtractor(item, index, data);\n const value = valueExtractor(item, index, data);\n result[key] = value;\n }\n\n return result;\n}\n"],"mappings":"mCAiFA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAO,EAAM,EAA0B,EAAK,CAG9C,SAAS,EAKP,EACA,EACA,EACuB,CACvB,IAAM,EAAgC,EAAE,CAExC,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,IAAM,EAAM,EAAa,EAAM,EAAO,EAAK,CAE3C,EAAO,GADO,EAAe,EAAM,EAAO,EAAK,CAIjD,OAAO"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,r){if(r<e)throw RangeError(`randomBigInt: The range [${e.toString()},${r.toString()}] is empty.`);let i=r-e,{length:a}=i.toString(2),o=Math.ceil(a/8),s=BigInt(8-a%8);for(;;){let r=t(n(o))>>s;if(r<=i)return r+e}}function t(e){let t=0n;for(let n of e)t=(t<<8n)+BigInt(n);return t}function n(e){let t=new Uint8Array(e);if(typeof crypto>`u`)for(let n=0;n<e;n+=1)t[n]=Math.floor(Math.random()*256);else crypto.getRandomValues(t);return t}exports.randomBigInt=e;
2
+ //# sourceMappingURL=random-big-int.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-big-int.cjs","names":[],"sources":["../src/random-big-int.ts"],"sourcesContent":["/**\n * Generate a random `bigint` between `from` and `to` (inclusive).\n *\n * ! Important: In most environments this function uses\n * [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)\n * under-the-hood which **is** cryptographically strong. When the WebCrypto API\n * isn't available (Node 18) we fallback to an implementation that uses\n * [`Math.random()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\n * which is **NOT** cryptographically secure.\n *\n * @param from - The minimum value.\n * @param to - The maximum value.\n * @returns The random integer.\n * @signature\n * randomBigInt(from, to)\n * @example\n * randomBigInt(1n, 10n) // => 5n\n * @dataFirst\n * @category Number\n */\nexport function randomBigInt(from: bigint, to: bigint): bigint {\n if (to < from) {\n throw new RangeError(\n `randomBigInt: The range [${from.toString()},${to.toString()}] is empty.`,\n );\n }\n\n const range = to - from;\n\n // Get the max number of bits needed to encode the result. We will generate\n // this number of random bits. A radix of 2 would give us the binary\n // representation of the number.\n const { length: maxBits } = range.toString(2 /* radix */);\n\n // We can only generate random data in bytes, not bits, so we need to generate\n // enough bytes to cover the required number of bits.\n const maxBytes = Math.ceil(maxBits / 8);\n\n // The number of bits we need to ignore in the random bitmap we generate.\n const excessBits = BigInt(8 - (maxBits % 8));\n\n while (true) {\n // We use `crypto` for our RNG, it should be supported in all modern\n // environments we support.\n const randomBytes = random(maxBytes);\n\n const raw = asBigInt(randomBytes);\n\n // Shift the number back to our range, this effectively sets the excess bits\n // to 0.\n const result = raw >> excessBits;\n\n // The generated number might overflow when `range < 2 ** maxBits - 1`, so\n // it can't be returned. To ensure that all possible results have the same\n // probability, we ignore the value entirely and try again (instead of\n // trying to adapt it to the output range somehow).\n if (result <= range) {\n return result + from;\n }\n }\n}\n\nfunction asBigInt(bytes: Iterable<number>): bigint {\n let result = 0n;\n for (const byte of bytes) {\n // We build the bigint by shifting the current value by a byte, and putting\n // the next byte in that \"slot\".\n result = (result << 8n) + BigInt(byte);\n }\n return result;\n}\n\nfunction random(numBytes: number): Uint8Array {\n const output = new Uint8Array(numBytes);\n\n if (typeof crypto === 'undefined') {\n // Polyfill for environments without `crypto` support. The only env which\n // requires this and we support is Node 18; once we drop support for it we\n // can drop the polyfill.\n for (let index = 0; index < numBytes; index += 1) {\n output[index] = Math.floor(Math.random() * 256);\n }\n } else {\n crypto.getRandomValues(output);\n }\n\n return output;\n}\n"],"mappings":"mEAoBA,SAAgB,EAAa,EAAc,EAAoB,CAC7D,GAAI,EAAK,EACP,MAAU,WACR,4BAA4B,EAAK,UAAU,CAAC,GAAG,EAAG,UAAU,CAAC,aAC9D,CAGH,IAAM,EAAQ,EAAK,EAKb,CAAE,OAAQ,GAAY,EAAM,SAAS,EAAc,CAInD,EAAW,KAAK,KAAK,EAAU,EAAE,CAGjC,EAAa,OAAO,EAAK,EAAU,EAAG,CAE5C,OAAa,CASX,IAAM,EAJM,EAFQ,EAAO,EAAS,CAEH,EAIX,EAMtB,GAAI,GAAU,EACZ,OAAO,EAAS,GAKtB,SAAS,EAAS,EAAiC,CACjD,IAAI,EAAS,GACb,IAAK,IAAM,KAAQ,EAGjB,GAAU,GAAU,IAAM,OAAO,EAAK,CAExC,OAAO,EAGT,SAAS,EAAO,EAA8B,CAC5C,IAAM,EAAS,IAAI,WAAW,EAAS,CAEvC,GAAI,OAAO,OAAW,IAIpB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAU,GAAS,EAC7C,EAAO,GAAS,KAAK,MAAM,KAAK,QAAQ,CAAG,IAAI,MAGjD,OAAO,gBAAgB,EAAO,CAGhC,OAAO"}
@@ -0,0 +1,2 @@
1
+ function e(e,r){if(r<e)throw RangeError(`randomBigInt: The range [${e.toString()},${r.toString()}] is empty.`);let i=r-e,{length:a}=i.toString(2),o=Math.ceil(a/8),s=BigInt(8-a%8);for(;;){let r=t(n(o))>>s;if(r<=i)return r+e}}function t(e){let t=0n;for(let n of e)t=(t<<8n)+BigInt(n);return t}function n(e){let t=new Uint8Array(e);if(typeof crypto>`u`)for(let n=0;n<e;n+=1)t[n]=Math.floor(Math.random()*256);else crypto.getRandomValues(t);return t}export{e as randomBigInt};
2
+ //# sourceMappingURL=random-big-int.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-big-int.js","names":[],"sources":["../src/random-big-int.ts"],"sourcesContent":["/**\n * Generate a random `bigint` between `from` and `to` (inclusive).\n *\n * ! Important: In most environments this function uses\n * [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)\n * under-the-hood which **is** cryptographically strong. When the WebCrypto API\n * isn't available (Node 18) we fallback to an implementation that uses\n * [`Math.random()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\n * which is **NOT** cryptographically secure.\n *\n * @param from - The minimum value.\n * @param to - The maximum value.\n * @returns The random integer.\n * @signature\n * randomBigInt(from, to)\n * @example\n * randomBigInt(1n, 10n) // => 5n\n * @dataFirst\n * @category Number\n */\nexport function randomBigInt(from: bigint, to: bigint): bigint {\n if (to < from) {\n throw new RangeError(\n `randomBigInt: The range [${from.toString()},${to.toString()}] is empty.`,\n );\n }\n\n const range = to - from;\n\n // Get the max number of bits needed to encode the result. We will generate\n // this number of random bits. A radix of 2 would give us the binary\n // representation of the number.\n const { length: maxBits } = range.toString(2 /* radix */);\n\n // We can only generate random data in bytes, not bits, so we need to generate\n // enough bytes to cover the required number of bits.\n const maxBytes = Math.ceil(maxBits / 8);\n\n // The number of bits we need to ignore in the random bitmap we generate.\n const excessBits = BigInt(8 - (maxBits % 8));\n\n while (true) {\n // We use `crypto` for our RNG, it should be supported in all modern\n // environments we support.\n const randomBytes = random(maxBytes);\n\n const raw = asBigInt(randomBytes);\n\n // Shift the number back to our range, this effectively sets the excess bits\n // to 0.\n const result = raw >> excessBits;\n\n // The generated number might overflow when `range < 2 ** maxBits - 1`, so\n // it can't be returned. To ensure that all possible results have the same\n // probability, we ignore the value entirely and try again (instead of\n // trying to adapt it to the output range somehow).\n if (result <= range) {\n return result + from;\n }\n }\n}\n\nfunction asBigInt(bytes: Iterable<number>): bigint {\n let result = 0n;\n for (const byte of bytes) {\n // We build the bigint by shifting the current value by a byte, and putting\n // the next byte in that \"slot\".\n result = (result << 8n) + BigInt(byte);\n }\n return result;\n}\n\nfunction random(numBytes: number): Uint8Array {\n const output = new Uint8Array(numBytes);\n\n if (typeof crypto === 'undefined') {\n // Polyfill for environments without `crypto` support. The only env which\n // requires this and we support is Node 18; once we drop support for it we\n // can drop the polyfill.\n for (let index = 0; index < numBytes; index += 1) {\n output[index] = Math.floor(Math.random() * 256);\n }\n } else {\n crypto.getRandomValues(output);\n }\n\n return output;\n}\n"],"mappings":"AAoBA,SAAgB,EAAa,EAAc,EAAoB,CAC7D,GAAI,EAAK,EACP,MAAU,WACR,4BAA4B,EAAK,UAAU,CAAC,GAAG,EAAG,UAAU,CAAC,aAC9D,CAGH,IAAM,EAAQ,EAAK,EAKb,CAAE,OAAQ,GAAY,EAAM,SAAS,EAAc,CAInD,EAAW,KAAK,KAAK,EAAU,EAAE,CAGjC,EAAa,OAAO,EAAK,EAAU,EAAG,CAE5C,OAAa,CASX,IAAM,EAJM,EAFQ,EAAO,EAAS,CAEH,EAIX,EAMtB,GAAI,GAAU,EACZ,OAAO,EAAS,GAKtB,SAAS,EAAS,EAAiC,CACjD,IAAI,EAAS,GACb,IAAK,IAAM,KAAQ,EAGjB,GAAU,GAAU,IAAM,OAAO,EAAK,CAExC,OAAO,EAGT,SAAS,EAAO,EAA8B,CAC5C,IAAM,EAAS,IAAI,WAAW,EAAS,CAEvC,GAAI,OAAO,OAAW,IAIpB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAU,GAAS,EAC7C,EAAO,GAAS,KAAK,MAAM,KAAK,QAAQ,CAAG,IAAI,MAGjD,OAAO,gBAAgB,EAAO,CAGhC,OAAO"}
@@ -1 +1,2 @@
1
- function e(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInt: The range [${e},${t}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}exports.randomInteger=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}exports.randomInteger=e;
2
+ //# sourceMappingURL=random-integer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-integer.cjs","names":[],"sources":["../src/random-integer.ts"],"sourcesContent":["import type {\n GreaterThan,\n GreaterThanOrEqual,\n IsEqual,\n IsNever,\n NonNegativeInteger,\n Or,\n} from 'type-fest';\nimport type { IntRangeInclusive } from './internal/types/int-range-inclusive';\n\n// This limitation is defined by type-fest\ntype MaxLiteral = 1000;\n\ntype RandomInteger<From extends number, To extends number>\n = Or<\n IsNever<NonNegativeInteger<From>>,\n IsNever<NonNegativeInteger<To>>\n > extends true\n ? number\n : IsEqual<From, To> extends true\n ? From\n : GreaterThan<From, To> extends true\n ? never\n : GreaterThanOrEqual<To, MaxLiteral> extends true\n ? number\n : IntRangeInclusive<From, To>;\n\n/**\n * Generate a random integer between `from` and `to` (inclusive).\n *\n * !Important: This function uses [`Math.random()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) under-the-hood, which has two major limitations:\n * 1. It generates 2^52 possible values, so the bigger the range, the less\n * uniform the distribution of values would be, and at ranges larger than that\n * some values would never come up.\n * 2. It is not cryptographically secure and should not be used for security\n * scenarios.\n *\n * @param from - The minimum value.\n * @param to - The maximum value.\n * @returns The random integer.\n * @signature\n * randomInteger(from, to)\n * @example\n * randomInteger(1, 10) // => 5\n * randomInteger(1.5, 2.6) // => 2\n * @dataFirst\n * @category Number\n */\nexport function randomInteger<From extends number, To extends number>(\n from: From,\n to: To,\n): RandomInteger<From, To> {\n const fromCeiled = Math.ceil(from);\n const toFloored = Math.floor(to);\n\n if (toFloored < fromCeiled) {\n throw new RangeError(\n `randomInteger: The range [${from.toString()},${to.toString()}] contains no integer`,\n );\n }\n\n return Math.floor(\n Math.random() * (toFloored - fromCeiled + 1) + fromCeiled,\n ) as RandomInteger<From, To>;\n}\n"],"mappings":"mEAgDA,SAAgB,EACd,EACA,EACyB,CACzB,IAAM,EAAa,KAAK,KAAK,EAAK,CAC5B,EAAY,KAAK,MAAM,EAAG,CAEhC,GAAI,EAAY,EACd,MAAU,WACR,6BAA6B,EAAK,UAAU,CAAC,GAAG,EAAG,UAAU,CAAC,uBAC/D,CAGH,OAAO,KAAK,MACV,KAAK,QAAQ,EAAI,EAAY,EAAa,GAAK,EAChD"}
@@ -1,2 +1,2 @@
1
- function e(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInt: The range [${e},${t}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}export{e as randomInteger};
1
+ function e(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}export{e as randomInteger};
2
2
  //# sourceMappingURL=random-integer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"random-integer.js","names":[],"sources":["../src/random-integer.ts"],"sourcesContent":["import type {\n GreaterThan,\n GreaterThanOrEqual,\n IsEqual,\n IsNever,\n NonNegativeInteger,\n Or,\n} from 'type-fest';\nimport type { IntRangeInclusive } from './internal/types/int-range-inclusive';\n\ntype RandomInteger<From extends number, To extends number>\n = Or<\n IsNever<NonNegativeInteger<From>>,\n IsNever<NonNegativeInteger<To>>\n > extends true\n ? number\n : IsEqual<From, To> extends true\n ? From\n : GreaterThan<From, To> extends true\n ? never\n : GreaterThanOrEqual<To, 1000> extends true\n ? number\n : IntRangeInclusive<From, To>;\n\n/**\n * Generate a random integer between `from` and `to` (inclusive).\n *\n * @param from - The minimum value.\n * @param to - The maximum value.\n * @returns The random integer.\n * @signature\n * P.randomInt(from, to)\n * @example\n * P.randomInt(1, 10) // => 5\n * P.randomInt(1.5, 2.6) // => 2\n * @dataFirst\n * @category Number\n */\nexport function randomInteger<From extends number, To extends number>(\n from: From,\n to: To,\n): RandomInteger<From, To> {\n const fromCeiled = Math.ceil(from);\n const toFloored = Math.floor(to);\n\n if (toFloored < fromCeiled) {\n throw new RangeError(\n `randomInt: The range [${from},${to}] contains no integer`,\n );\n }\n\n return Math.floor(\n Math.random() * (toFloored - fromCeiled + 1) + fromCeiled,\n ) as RandomInteger<From, To>;\n}\n"],"mappings":"AAsCA,SAAgB,EACd,EACA,EACyB,CACzB,IAAM,EAAa,KAAK,KAAK,EAAK,CAC5B,EAAY,KAAK,MAAM,EAAG,CAEhC,GAAI,EAAY,EACd,MAAU,WACR,yBAAyB,EAAK,GAAG,EAAG,uBACrC,CAGH,OAAO,KAAK,MACV,KAAK,QAAQ,EAAI,EAAY,EAAa,GAAK,EAChD"}
1
+ {"version":3,"file":"random-integer.js","names":[],"sources":["../src/random-integer.ts"],"sourcesContent":["import type {\n GreaterThan,\n GreaterThanOrEqual,\n IsEqual,\n IsNever,\n NonNegativeInteger,\n Or,\n} from 'type-fest';\nimport type { IntRangeInclusive } from './internal/types/int-range-inclusive';\n\n// This limitation is defined by type-fest\ntype MaxLiteral = 1000;\n\ntype RandomInteger<From extends number, To extends number>\n = Or<\n IsNever<NonNegativeInteger<From>>,\n IsNever<NonNegativeInteger<To>>\n > extends true\n ? number\n : IsEqual<From, To> extends true\n ? From\n : GreaterThan<From, To> extends true\n ? never\n : GreaterThanOrEqual<To, MaxLiteral> extends true\n ? number\n : IntRangeInclusive<From, To>;\n\n/**\n * Generate a random integer between `from` and `to` (inclusive).\n *\n * !Important: This function uses [`Math.random()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) under-the-hood, which has two major limitations:\n * 1. It generates 2^52 possible values, so the bigger the range, the less\n * uniform the distribution of values would be, and at ranges larger than that\n * some values would never come up.\n * 2. It is not cryptographically secure and should not be used for security\n * scenarios.\n *\n * @param from - The minimum value.\n * @param to - The maximum value.\n * @returns The random integer.\n * @signature\n * randomInteger(from, to)\n * @example\n * randomInteger(1, 10) // => 5\n * randomInteger(1.5, 2.6) // => 2\n * @dataFirst\n * @category Number\n */\nexport function randomInteger<From extends number, To extends number>(\n from: From,\n to: To,\n): RandomInteger<From, To> {\n const fromCeiled = Math.ceil(from);\n const toFloored = Math.floor(to);\n\n if (toFloored < fromCeiled) {\n throw new RangeError(\n `randomInteger: The range [${from.toString()},${to.toString()}] contains no integer`,\n );\n }\n\n return Math.floor(\n Math.random() * (toFloored - fromCeiled + 1) + fromCeiled,\n ) as RandomInteger<From, To>;\n}\n"],"mappings":"AAgDA,SAAgB,EACd,EACA,EACyB,CACzB,IAAM,EAAa,KAAK,KAAK,EAAK,CAC5B,EAAY,KAAK,MAAM,EAAG,CAEhC,GAAI,EAAY,EACd,MAAU,WACR,6BAA6B,EAAK,UAAU,CAAC,GAAG,EAAG,UAAU,CAAC,uBAC/D,CAGH,OAAO,KAAK,MACV,KAAK,QAAQ,EAAI,EAAY,EAAa,GAAK,EAChD"}
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`;function n(...t){return e.t(r,t)}function r(e){let t=[];for(let n=0;n<e;n++){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];t.push(e)}return t.join(``)}exports.randomString=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e){let t=[];for(let n=0;n<e;n++){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];t.push(e)}return t.join(``)}exports.randomString=t;
2
+ //# sourceMappingURL=random-string.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-string.cjs","names":["curry"],"sources":["../src/random-string.ts"],"sourcesContent":["import { curry } from './curry';\n\nconst ALPHABET\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n/**\n * A [pseudo-random](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) [alpha-numeric](https://en.wikipedia.org/wiki/Alphanumericals)\n * [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).\n *\n * It is not [cryptographically secure](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator)!\n *\n * @param length - The length of the random string.\n * @returns The random string.\n * @signature\n * randomString(length)\n * @example\n * randomString(5) // => aB92J\n * @dataFirst\n * @category String\n */\nexport function randomString(length: number): string;\n\n/**\n * A [pseudo-random](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) [alpha-numeric](https://en.wikipedia.org/wiki/Alphanumericals)\n * [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).\n *\n * It is not [cryptographically secure](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator)!\n *\n * @returns The random string.\n * @signature\n * randomString()(length)\n * @example\n * pipe(5, randomString()) // => aB92J\n * @dataLast\n * @category String\n */\nexport function randomString(): (length: number) => string;\n\nexport function randomString(...args: ReadonlyArray<unknown>): unknown {\n return curry(randomStringImplementation, args);\n}\n\nfunction randomStringImplementation(length: number): string {\n const out: Array<string> = [];\n for (let iteration = 0; iteration < length; iteration++) {\n const randomChar = ALPHABET[Math.floor(Math.random() * ALPHABET.length)]!;\n out.push(randomChar);\n }\n return out.join('');\n}\n"],"mappings":"kGAsCA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAOA,EAAAA,MAAM,EAA4B,EAAK,CAGhD,SAAS,EAA2B,EAAwB,CAC1D,IAAM,EAAqB,EAAE,CAC7B,IAAK,IAAI,EAAY,EAAG,EAAY,EAAQ,IAAa,CACvD,IAAM,EAAa,iEAAS,KAAK,MAAM,KAAK,QAAQ,CAAG,GAAgB,EACvE,EAAI,KAAK,EAAW,CAEtB,OAAO,EAAI,KAAK,GAAG"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./curry-NmniqyJ0.js";function t(...t){return e(n,t)}function n(e){let t=[];for(let n=0;n<e;n++){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];t.push(e)}return t.join(``)}export{t as randomString};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e){let t=[];for(let n=0;n<e;n++){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];t.push(e)}return t.join(``)}export{t as randomString};
2
2
  //# sourceMappingURL=random-string.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"random-string.js","names":["out: Array<string>"],"sources":["../src/random-string.ts"],"sourcesContent":["import { curry } from './curry';\n\nconst ALPHABET\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n/**\n * Random a non-cryptographic random string from characters a-zA-Z0-9.\n *\n * @param length - The length of the random string.\n * @returns The random string.\n * @signature\n * P.randomString(length)\n * @example\n * P.randomString(5) // => aB92J\n * @dataFirst\n * @category String\n */\nexport function randomString(length: number): string;\n\n/**\n * Random a non-cryptographic random string from characters a-zA-Z0-9.\n *\n * @returns The random string.\n * @signature\n * P.randomString()(length)\n * @example\n * P.pipe(5, P.randomString()) // => aB92J\n * @dataLast\n * @category String\n */\nexport function randomString(): (length: number) => string;\n\nexport function randomString(...args: ReadonlyArray<unknown>): unknown {\n return curry(randomStringImplementation, args);\n}\n\nfunction randomStringImplementation(length: number): string {\n const out: Array<string> = [];\n for (let iteration = 0; iteration < length; iteration++) {\n const randomChar = ALPHABET[Math.floor(Math.random() * ALPHABET.length)]!;\n out.push(randomChar);\n }\n return out.join('');\n}\n"],"mappings":"wCAgCA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAO,EAAM,EAA4B,EAAK,CAGhD,SAAS,EAA2B,EAAwB,CAC1D,IAAMA,EAAqB,EAAE,CAC7B,IAAK,IAAI,EAAY,EAAG,EAAY,EAAQ,IAAa,CACvD,IAAM,EAAa,iEAAS,KAAK,MAAM,KAAK,QAAQ,CAAG,GAAgB,EACvE,EAAI,KAAK,EAAW,CAEtB,OAAO,EAAI,KAAK,GAAG"}
1
+ {"version":3,"file":"random-string.js","names":[],"sources":["../src/random-string.ts"],"sourcesContent":["import { curry } from './curry';\n\nconst ALPHABET\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n/**\n * A [pseudo-random](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) [alpha-numeric](https://en.wikipedia.org/wiki/Alphanumericals)\n * [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).\n *\n * It is not [cryptographically secure](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator)!\n *\n * @param length - The length of the random string.\n * @returns The random string.\n * @signature\n * randomString(length)\n * @example\n * randomString(5) // => aB92J\n * @dataFirst\n * @category String\n */\nexport function randomString(length: number): string;\n\n/**\n * A [pseudo-random](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) [alpha-numeric](https://en.wikipedia.org/wiki/Alphanumericals)\n * [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).\n *\n * It is not [cryptographically secure](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator)!\n *\n * @returns The random string.\n * @signature\n * randomString()(length)\n * @example\n * pipe(5, randomString()) // => aB92J\n * @dataLast\n * @category String\n */\nexport function randomString(): (length: number) => string;\n\nexport function randomString(...args: ReadonlyArray<unknown>): unknown {\n return curry(randomStringImplementation, args);\n}\n\nfunction randomStringImplementation(length: number): string {\n const out: Array<string> = [];\n for (let iteration = 0; iteration < length; iteration++) {\n const randomChar = ALPHABET[Math.floor(Math.random() * ALPHABET.length)]!;\n out.push(randomChar);\n }\n return out.join('');\n}\n"],"mappings":"mCAsCA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAO,EAAM,EAA4B,EAAK,CAGhD,SAAS,EAA2B,EAAwB,CAC1D,IAAM,EAAqB,EAAE,CAC7B,IAAK,IAAI,EAAY,EAAG,EAAY,EAAQ,IAAa,CACvD,IAAM,EAAa,iEAAS,KAAK,MAAM,KAAK,QAAQ,CAAG,GAAgB,EACvE,EAAI,KAAK,EAAW,CAEtB,OAAO,EAAI,KAAK,GAAG"}
package/dist/range.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=[];for(let r=e;r<t;r++)n.push(r);return n}exports.range=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=typeof t==`object`?t.step:1;if(n===0)throw RangeError(`range: step cannot be zero (0)!`);let i=r(((typeof t==`object`?t.end:t)-e)/n);return i<=0?[]:Array.from({length:i},(t,r)=>r===0?e:e+r*n)}function r(e){if(e===0)return 0;let t=Math.round(e);return Math.abs(e-t)/Math.abs(e)<1e-12?t:Math.ceil(e)}exports.range=t;
2
+ //# sourceMappingURL=range.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range.cjs","names":["curry"],"sources":["../src/range.ts"],"sourcesContent":["import { curry } from './curry';\n\nconst DEFAULT_STEP = 1;\n\n// Relative tolerance for snapping a near-integer division result to the nearest\n// integer, preventing Math.ceil from inflating the length by one due to\n// floating-point error in the numerator or denominator.\nconst SNAP_TOLERANCE = 1e-12;\n\ninterface RangeOptions {\n readonly end: number;\n readonly step: number;\n}\n\n// TODO [>2]: Change the signature so that range takes a required \"end\" parameter and an optional Options object with `start` and `step` defaulting to `0` and `1` respectively to better align with how `range` works in other libraries and languages.\n/**\n * Returns a sequence of numbers from `start` (inclusive) to `end` (exclusive),\n * adding `step` (default is `1`) to each number in the sequence.\n *\n * @param start - The first number in the sequence.\n * @param endOrOptions - The end number **or** an object which is used to\n * **also** define a step size.\n * @param endOrOptions.end - The non-inclusive end of the range.\n * @param endOrOptions.step - The gap between consecutive numbers.\n * @signature\n * range(start, end)\n * range(start, { end, step })\n * @example\n * range(1, 5); //=> [1, 2, 3, 4]\n * range(1, { end: 5, step: 2 }); //=> [1, 3]\n * @dataFirst\n * @category Array\n */\nexport function range(\n start: number,\n endOrOptions: number | RangeOptions,\n): Array<number>;\n\n/**\n * Returns a sequence of numbers from `start` (inclusive) to `end` (exclusive),\n * adding `step` (default is `1`) to each number in the sequence.\n *\n * @param endOrOptions - The end number **or** an object which is used to\n * **also** define a step size.\n * @param endOrOptions.end - The non-inclusive end of the range.\n * @param endOrOptions.step - The gap between consecutive numbers.\n * @signature\n * range(end)(start)\n * range({ end, step })(start)\n * @example\n * pipe(1, range(5)); //=> [1, 2, 3, 4]\n * pipe(1, range({ end: 5, step: 2 })); //=> [1, 3]\n * @dataLast\n * @category Array\n */\nexport function range(\n endOrOptions: number | RangeOptions,\n): (start: number) => Array<number>;\n\nexport function range(...args: ReadonlyArray<unknown>): unknown {\n return curry(rangeImplementation, args);\n}\n\nfunction rangeImplementation(\n start: number,\n endOrOptions: number | RangeOptions,\n): Array<number> {\n const step\n = typeof endOrOptions === 'object' ? endOrOptions.step : DEFAULT_STEP;\n if (step === 0) {\n throw new RangeError('range: step cannot be zero (0)!');\n }\n\n const end\n = typeof endOrOptions === 'object' ? endOrOptions.end : endOrOptions;\n const length = ceilingWithSnap((end - start) / step);\n if (length <= 0) {\n return [];\n }\n\n return Array.from({ length }, (_, i) => (i === 0 ? start : start + i * step));\n}\n\n// JS's floating-point math can create numbers that are slightly larger than\n// the true mathematical result (e.g. `0.1 + 0.2 > 0.3`). This error would\n// propagate into more complex calculations, and specifically can cause\n// the built-in `Math.ceil` to round up a number that is effectively an\n// integer (e.g. `Math.ceil(0.1 + 0.2 - 0.3) === 1`). To work around this we\n// need an error margin where ceiling would ignore very small floating point\n// artifacts so that it effectively \"rounds\" down instead of up.\nfunction ceilingWithSnap(raw: number): number {\n if (raw === 0) {\n return 0;\n }\n\n const rounded = Math.round(raw);\n return Math.abs(raw - rounded) / Math.abs(raw) < SNAP_TOLERANCE\n ? rounded\n : Math.ceil(raw);\n}\n"],"mappings":"kGA2DA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAOA,EAAAA,MAAM,EAAqB,EAAK,CAGzC,SAAS,EACP,EACA,EACe,CACf,IAAM,EACF,OAAO,GAAiB,SAAW,EAAa,KAAO,EAC3D,GAAI,IAAS,EACX,MAAU,WAAW,kCAAkC,CAKzD,IAAM,EAAS,IADX,OAAO,GAAiB,SAAW,EAAa,IAAM,GACpB,GAAS,EAAK,CAKpD,OAJI,GAAU,EACL,EAAE,CAGJ,MAAM,KAAK,CAAE,SAAQ,EAAG,EAAG,IAAO,IAAM,EAAI,EAAQ,EAAQ,EAAI,EAAM,CAU/E,SAAS,EAAgB,EAAqB,CAC5C,GAAI,IAAQ,EACV,MAAO,GAGT,IAAM,EAAU,KAAK,MAAM,EAAI,CAC/B,OAAO,KAAK,IAAI,EAAM,EAAQ,CAAG,KAAK,IAAI,EAAI,CAAG,MAC7C,EACA,KAAK,KAAK,EAAI"}
package/dist/range.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=[];for(let r=e;r<t;r++)n.push(r);return n}export{t as range};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){let n=typeof t==`object`?t.step:1;if(n===0)throw RangeError(`range: step cannot be zero (0)!`);let i=r(((typeof t==`object`?t.end:t)-e)/n);return i<=0?[]:Array.from({length:i},(t,r)=>r===0?e:e+r*n)}function r(e){if(e===0)return 0;let t=Math.round(e);return Math.abs(e-t)/Math.abs(e)<1e-12?t:Math.ceil(e)}export{t as range};
2
2
  //# sourceMappingURL=range.js.map
package/dist/range.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"range.js","names":["ret: Array<number>"],"sources":["../src/range.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Returns a list of numbers from `start` (inclusive) to `end` (exclusive).\n *\n * @param start - The start number.\n * @param end - The end number.\n * @signature range(start, end)\n * @example\n * P.range(1, 5) // => [1, 2, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function range(start: number, end: number): Array<number>;\n\n/**\n * Returns a list of numbers from `start` (inclusive) to `end` (exclusive).\n *\n * @param end - The end number.\n * @signature range(end)(start)\n * @example\n * P.range(5)(1) // => [1, 2, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function range(end: number): (start: number) => Array<number>;\n\nexport function range(...args: ReadonlyArray<unknown>): unknown {\n return curry(rangeImplementation, args);\n}\n\nfunction rangeImplementation(start: number, end: number): Array<number> {\n const ret: Array<number> = [];\n for (let i = start; i < end; i++) {\n ret.push(i);\n }\n return ret;\n}\n"],"mappings":"wCA2BA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAO,EAAM,EAAqB,EAAK,CAGzC,SAAS,EAAoB,EAAe,EAA4B,CACtE,IAAMA,EAAqB,EAAE,CAC7B,IAAK,IAAI,EAAI,EAAO,EAAI,EAAK,IAC3B,EAAI,KAAK,EAAE,CAEb,OAAO"}
1
+ {"version":3,"file":"range.js","names":[],"sources":["../src/range.ts"],"sourcesContent":["import { curry } from './curry';\n\nconst DEFAULT_STEP = 1;\n\n// Relative tolerance for snapping a near-integer division result to the nearest\n// integer, preventing Math.ceil from inflating the length by one due to\n// floating-point error in the numerator or denominator.\nconst SNAP_TOLERANCE = 1e-12;\n\ninterface RangeOptions {\n readonly end: number;\n readonly step: number;\n}\n\n// TODO [>2]: Change the signature so that range takes a required \"end\" parameter and an optional Options object with `start` and `step` defaulting to `0` and `1` respectively to better align with how `range` works in other libraries and languages.\n/**\n * Returns a sequence of numbers from `start` (inclusive) to `end` (exclusive),\n * adding `step` (default is `1`) to each number in the sequence.\n *\n * @param start - The first number in the sequence.\n * @param endOrOptions - The end number **or** an object which is used to\n * **also** define a step size.\n * @param endOrOptions.end - The non-inclusive end of the range.\n * @param endOrOptions.step - The gap between consecutive numbers.\n * @signature\n * range(start, end)\n * range(start, { end, step })\n * @example\n * range(1, 5); //=> [1, 2, 3, 4]\n * range(1, { end: 5, step: 2 }); //=> [1, 3]\n * @dataFirst\n * @category Array\n */\nexport function range(\n start: number,\n endOrOptions: number | RangeOptions,\n): Array<number>;\n\n/**\n * Returns a sequence of numbers from `start` (inclusive) to `end` (exclusive),\n * adding `step` (default is `1`) to each number in the sequence.\n *\n * @param endOrOptions - The end number **or** an object which is used to\n * **also** define a step size.\n * @param endOrOptions.end - The non-inclusive end of the range.\n * @param endOrOptions.step - The gap between consecutive numbers.\n * @signature\n * range(end)(start)\n * range({ end, step })(start)\n * @example\n * pipe(1, range(5)); //=> [1, 2, 3, 4]\n * pipe(1, range({ end: 5, step: 2 })); //=> [1, 3]\n * @dataLast\n * @category Array\n */\nexport function range(\n endOrOptions: number | RangeOptions,\n): (start: number) => Array<number>;\n\nexport function range(...args: ReadonlyArray<unknown>): unknown {\n return curry(rangeImplementation, args);\n}\n\nfunction rangeImplementation(\n start: number,\n endOrOptions: number | RangeOptions,\n): Array<number> {\n const step\n = typeof endOrOptions === 'object' ? endOrOptions.step : DEFAULT_STEP;\n if (step === 0) {\n throw new RangeError('range: step cannot be zero (0)!');\n }\n\n const end\n = typeof endOrOptions === 'object' ? endOrOptions.end : endOrOptions;\n const length = ceilingWithSnap((end - start) / step);\n if (length <= 0) {\n return [];\n }\n\n return Array.from({ length }, (_, i) => (i === 0 ? start : start + i * step));\n}\n\n// JS's floating-point math can create numbers that are slightly larger than\n// the true mathematical result (e.g. `0.1 + 0.2 > 0.3`). This error would\n// propagate into more complex calculations, and specifically can cause\n// the built-in `Math.ceil` to round up a number that is effectively an\n// integer (e.g. `Math.ceil(0.1 + 0.2 - 0.3) === 1`). To work around this we\n// need an error margin where ceiling would ignore very small floating point\n// artifacts so that it effectively \"rounds\" down instead of up.\nfunction ceilingWithSnap(raw: number): number {\n if (raw === 0) {\n return 0;\n }\n\n const rounded = Math.round(raw);\n return Math.abs(raw - rounded) / Math.abs(raw) < SNAP_TOLERANCE\n ? rounded\n : Math.ceil(raw);\n}\n"],"mappings":"mCA2DA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAO,EAAM,EAAqB,EAAK,CAGzC,SAAS,EACP,EACA,EACe,CACf,IAAM,EACF,OAAO,GAAiB,SAAW,EAAa,KAAO,EAC3D,GAAI,IAAS,EACX,MAAU,WAAW,kCAAkC,CAKzD,IAAM,EAAS,IADX,OAAO,GAAiB,SAAW,EAAa,IAAM,GACpB,GAAS,EAAK,CAKpD,OAJI,GAAU,EACL,EAAE,CAGJ,MAAM,KAAK,CAAE,SAAQ,EAAG,EAAG,IAAO,IAAM,EAAI,EAAQ,EAAQ,EAAI,EAAM,CAU/E,SAAS,EAAgB,EAAqB,CAC5C,GAAI,IAAQ,EACV,MAAO,GAGT,IAAM,EAAU,KAAK,MAAM,EAAI,CAC/B,OAAO,KAAK,IAAI,EAAM,EAAQ,CAAG,KAAK,IAAI,EAAI,CAAG,MAC7C,EACA,KAAK,KAAK,EAAI"}
package/dist/rank-by.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-order-rules-ClqHrs8_.cjs`);function t(...t){return e.n(n,t)}function n(e,t,n){let r=0;for(let i of e)t(n,i)>0&&(r+=1);return r}exports.rankBy=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry-order-rules-DsJSy3gX.cjs`);function t(...t){return e.n(n,t)}function n(e,t,n){let r=0;for(let i of e)t(n,i)>0&&(r+=1);return r}exports.rankBy=t;
2
+ //# sourceMappingURL=rank-by.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rank-by.cjs","names":["curryOrderRulesWithArgument"],"sources":["../src/rank-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';\n\n/**\n * Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.\n *\n * @param data - The input array.\n * @param item - The item whose rank is to be determined.\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 The rank of the item in the sorted array in the range [0..data.length].\n * @signature\n * rankBy(data, item, ...rules)\n * @example\n * const DATA = [{ a: 5 }, { a: 1 }, { a: 3 }] as const;\n * rankBy(DATA, 0, prop('a')) // => 0\n * rankBy(DATA, 1, prop('a')) // => 1\n * rankBy(DATA, 2, prop('a')) // => 1\n * rankBy(DATA, 3, prop('a')) // => 2\n * @dataFirst\n * @category Array\n */\nexport function rankBy<T>(\n data: ReadonlyArray<T>,\n item: T,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): number;\n\n/**\n * Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.\n *\n * @param item - The item whose rank is to be determined.\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 The rank of the item in the sorted array in the range [0..data.length].\n * @signature\n * rankBy(item, ...rules)(data)\n * @example\n * const DATA = [{ a: 5 }, { a: 1 }, { a: 3 }] as const;\n * pipe(DATA, rankBy(0, prop('a'))) // => 0\n * pipe(DATA, rankBy(1, prop('a'))) // => 1\n * pipe(DATA, rankBy(2, prop('a'))) // => 1\n * pipe(DATA, rankBy(3, prop('a'))) // => 2\n * @dataLast\n * @category Array\n */\nexport function rankBy<T>(\n item: T,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => number;\n\nexport function rankBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(rankByImplementation, args);\n}\n\nfunction rankByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n targetItem: T,\n): number {\n let rank = 0;\n for (const item of data) {\n if (compareFn(targetItem, item) > 0) {\n // The rank of the item is equivalent to the number of items that would\n // come before it if the array was sorted. We assume that the\n rank += 1;\n }\n }\n return rank;\n}\n"],"mappings":"uHAsDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,EAA4B,EAAsB,EAAK,CAGhE,SAAS,EACP,EACA,EACA,EACQ,CACR,IAAI,EAAO,EACX,IAAK,IAAM,KAAQ,EACb,EAAU,EAAY,EAAK,CAAG,IAGhC,GAAQ,GAGZ,OAAO"}
package/dist/rank-by.js CHANGED
@@ -1,2 +1,2 @@
1
- import{n as e}from"./curry-order-rules-DwrF-_P1.js";function t(...t){return e(n,t)}function n(e,t,n){let r=0;for(let i of e)t(n,i)>0&&(r+=1);return r}export{t as rankBy};
1
+ import{n as e}from"./curry-order-rules-BLyCSMdZ.js";function t(...t){return e(n,t)}function n(e,t,n){let r=0;for(let i of e)t(n,i)>0&&(r+=1);return r}export{t as rankBy};
2
2
  //# sourceMappingURL=rank-by.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rank-by.js","names":[],"sources":["../src/rank-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';\n\n/**\n * Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.\n *\n * @param data - The input array.\n * @param item - The item whose rank is to be determined.\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 The rank of the item in the sorted array in the range [0..data.length].\n * @signature\n * P.rankBy(data, item, ...rules)\n * @example\n * const DATA = [{ a: 5 }, { a: 1 }, { a: 3 }] as const;\n * P.rankBy(DATA, 0, P.prop('a')) // => 0\n * P.rankBy(DATA, 1, P.prop('a')) // => 1\n * P.rankBy(DATA, 2, P.prop('a')) // => 1\n * P.rankBy(DATA, 3, P.prop('a')) // => 2\n * @dataFirst\n * @category Array\n */\nexport function rankBy<T>(\n data: ReadonlyArray<T>,\n item: T,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): number;\n\n/**\n * Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.\n *\n * @param item - The item whose rank is to be determined.\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 The rank of the item in the sorted array in the range [0..data.length].\n * @signature\n * P.rankBy(item, ...rules)(data)\n * @example\n * const DATA = [{ a: 5 }, { a: 1 }, { a: 3 }] as const;\n * P.pipe(DATA, P.rankBy(0, P.prop('a'))) // => 0\n * P.pipe(DATA, P.rankBy(1, P.prop('a'))) // => 1\n * P.pipe(DATA, P.rankBy(2, P.prop('a'))) // => 1\n * P.pipe(DATA, P.rankBy(3, P.prop('a'))) // => 2\n * @dataLast\n * @category Array\n */\nexport function rankBy<T>(\n item: T,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => number;\n\nexport function rankBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(rankByImplementation, args);\n}\n\nfunction rankByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n targetItem: T,\n): number {\n let rank = 0;\n for (const item of data) {\n if (compareFn(targetItem, item) > 0) {\n // The rank of the item is equivalent to the number of items that would\n // come before it if the array was sorted. We assume that the\n rank += 1;\n }\n }\n return rank;\n}\n"],"mappings":"oDAsDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAA4B,EAAsB,EAAK,CAGhE,SAAS,EACP,EACA,EACA,EACQ,CACR,IAAI,EAAO,EACX,IAAK,IAAM,KAAQ,EACb,EAAU,EAAY,EAAK,CAAG,IAGhC,GAAQ,GAGZ,OAAO"}
1
+ {"version":3,"file":"rank-by.js","names":[],"sources":["../src/rank-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';\n\n/**\n * Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.\n *\n * @param data - The input array.\n * @param item - The item whose rank is to be determined.\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 The rank of the item in the sorted array in the range [0..data.length].\n * @signature\n * rankBy(data, item, ...rules)\n * @example\n * const DATA = [{ a: 5 }, { a: 1 }, { a: 3 }] as const;\n * rankBy(DATA, 0, prop('a')) // => 0\n * rankBy(DATA, 1, prop('a')) // => 1\n * rankBy(DATA, 2, prop('a')) // => 1\n * rankBy(DATA, 3, prop('a')) // => 2\n * @dataFirst\n * @category Array\n */\nexport function rankBy<T>(\n data: ReadonlyArray<T>,\n item: T,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): number;\n\n/**\n * Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.\n *\n * @param item - The item whose rank is to be determined.\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 The rank of the item in the sorted array in the range [0..data.length].\n * @signature\n * rankBy(item, ...rules)(data)\n * @example\n * const DATA = [{ a: 5 }, { a: 1 }, { a: 3 }] as const;\n * pipe(DATA, rankBy(0, prop('a'))) // => 0\n * pipe(DATA, rankBy(1, prop('a'))) // => 1\n * pipe(DATA, rankBy(2, prop('a'))) // => 1\n * pipe(DATA, rankBy(3, prop('a'))) // => 2\n * @dataLast\n * @category Array\n */\nexport function rankBy<T>(\n item: T,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => number;\n\nexport function rankBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(rankByImplementation, args);\n}\n\nfunction rankByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n targetItem: T,\n): number {\n let rank = 0;\n for (const item of data) {\n if (compareFn(targetItem, item) > 0) {\n // The rank of the item is equivalent to the number of items that would\n // come before it if the array was sorted. We assume that the\n rank += 1;\n }\n }\n return rank;\n}\n"],"mappings":"oDAsDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAA4B,EAAsB,EAAK,CAGhE,SAAS,EACP,EACA,EACA,EACQ,CACR,IAAI,EAAO,EACX,IAAK,IAAM,KAAQ,EACb,EAAU,EAAY,EAAK,CAAG,IAGhC,GAAQ,GAGZ,OAAO"}
package/dist/reduce.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);function t(...t){return e.t(n,t)}function n(e,t,n){return e.reduce(t,n)}exports.reduce=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,n){return e.reduce(t,n)}exports.reduce=t;
2
+ //# sourceMappingURL=reduce.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reduce.cjs","names":["curry"],"sources":["../src/reduce.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Executes a user-supplied \"reducer\" callback function on each element of the\n * array, in order, passing in the return value from the calculation on the\n * preceding element. The final result of running the reducer across all\n * elements of the array is a single value. Equivalent to\n * `Array.prototype.reduce`.\n *\n * @param data - The items to reduce.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value becomes the value of the accumulator parameter on the next\n * invocation of callbackFn. For the last invocation, the return value becomes\n * the return value of reduce().\n * @param initialValue - A value to which accumulator is initialized the first\n * time the callback is called. CallbackFn starts executing with the first value\n * in the array as currentValue.\n * @returns The value that results from running the \"reducer\" callback function\n * to completion over the entire array.\n * @signature\n * reduce(data, callbackfn, initialValue)\n * @example\n * reduce([1, 2, 3, 4, 5], (acc, x) => acc + x, 100) // => 115\n * @dataFirst\n * @category Array\n */\nexport function reduce<T, U>(\n data: ReadonlyArray<T>,\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): U;\n\n/**\n * Executes a user-supplied \"reducer\" callback function on each element of the\n * array, in order, passing in the return value from the calculation on the\n * preceding element. The final result of running the reducer across all\n * elements of the array is a single value. Equivalent to\n * `Array.prototype.reduce`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value becomes the value of the accumulator parameter on the next\n * invocation of callbackFn. For the last invocation, the return value becomes\n * the return value of reduce().\n * @param initialValue - A value to which accumulator is initialized the first\n * time the callback is called. CallbackFn starts executing with the first value\n * in the array as currentValue.\n * @returns The value that results from running the \"reducer\" callback function\n * to completion over the entire array.\n * @signature\n * reduce(fn, initialValue)(array)\n * @example\n * pipe([1, 2, 3, 4, 5], reduce((acc, x) => acc + x, 100)) // => 115\n * @dataLast\n * @category Array\n */\nexport function reduce<T, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): (data: ReadonlyArray<T>) => U;\n\nexport function reduce(...args: ReadonlyArray<unknown>): unknown {\n return curry(reduceImplementation, args);\n}\n\nfunction reduceImplementation<T, U>(data: ReadonlyArray<T>, callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n) => U, initialValue: U): U {\n return data.reduce(callbackfn, initialValue);\n}\n"],"mappings":"kGAsEA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,EAAK,CAG1C,SAAS,EAA2B,EAAwB,EAKpD,EAAoB,CAC1B,OAAO,EAAK,OAAO,EAAY,EAAa"}
package/dist/reduce.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,n){return e.reduce(t,n)}export{t as reduce};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t,n){return e.reduce(t,n)}export{t as reduce};
2
2
  //# sourceMappingURL=reduce.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reduce.js","names":[],"sources":["../src/reduce.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Executes a user-supplied \"reducer\" callback function on each element of the\n * array, in order, passing in the return value from the calculation on the\n * preceding element. The final result of running the reducer across all\n * elements of the array is a single value. Equivalent to\n * `Array.prototype.reduce`.\n *\n * @param data - The items to reduce.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value becomes the value of the accumulator parameter on the next\n * invocation of callbackFn. For the last invocation, the return value becomes\n * the return value of reduce().\n * @param initialValue - A value to which accumulator is initialized the first\n * time the callback is called. CallbackFn starts executing with the first value\n * in the array as currentValue.\n * @returns The value that results from running the \"reducer\" callback function\n * to completion over the entire array.\n * @signature\n * P.reduce(data, callbackfn, initialValue)\n * @example\n * P.reduce([1, 2, 3, 4, 5], (acc, x) => acc + x, 100) // => 115\n * @dataFirst\n * @category Array\n */\nexport function reduce<T, U>(\n data: ReadonlyArray<T>,\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): U;\n\n/**\n * Executes a user-supplied \"reducer\" callback function on each element of the\n * array, in order, passing in the return value from the calculation on the\n * preceding element. The final result of running the reducer across all\n * elements of the array is a single value. Equivalent to\n * `Array.prototype.reduce`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value becomes the value of the accumulator parameter on the next\n * invocation of callbackFn. For the last invocation, the return value becomes\n * the return value of reduce().\n * @param initialValue - A value to which accumulator is initialized the first\n * time the callback is called. CallbackFn starts executing with the first value\n * in the array as currentValue.\n * @returns The value that results from running the \"reducer\" callback function\n * to completion over the entire array.\n * @signature\n * P.reduce(fn, initialValue)(array)\n * @example\n * P.pipe([1, 2, 3, 4, 5], P.reduce((acc, x) => acc + x, 100)) // => 115\n * @dataLast\n * @category Array\n */\nexport function reduce<T, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): (data: ReadonlyArray<T>) => U;\n\nexport function reduce(...args: ReadonlyArray<unknown>): unknown {\n return curry(reduceImplementation, args);\n}\n\nfunction reduceImplementation<T, U>(\n data: ReadonlyArray<T>,\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): U {\n return data.reduce(callbackfn, initialValue);\n}\n"],"mappings":"wCAsEA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,EAAK,CAG1C,SAAS,EACP,EACA,EAMA,EACG,CACH,OAAO,EAAK,OAAO,EAAY,EAAa"}
1
+ {"version":3,"file":"reduce.js","names":[],"sources":["../src/reduce.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Executes a user-supplied \"reducer\" callback function on each element of the\n * array, in order, passing in the return value from the calculation on the\n * preceding element. The final result of running the reducer across all\n * elements of the array is a single value. Equivalent to\n * `Array.prototype.reduce`.\n *\n * @param data - The items to reduce.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value becomes the value of the accumulator parameter on the next\n * invocation of callbackFn. For the last invocation, the return value becomes\n * the return value of reduce().\n * @param initialValue - A value to which accumulator is initialized the first\n * time the callback is called. CallbackFn starts executing with the first value\n * in the array as currentValue.\n * @returns The value that results from running the \"reducer\" callback function\n * to completion over the entire array.\n * @signature\n * reduce(data, callbackfn, initialValue)\n * @example\n * reduce([1, 2, 3, 4, 5], (acc, x) => acc + x, 100) // => 115\n * @dataFirst\n * @category Array\n */\nexport function reduce<T, U>(\n data: ReadonlyArray<T>,\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): U;\n\n/**\n * Executes a user-supplied \"reducer\" callback function on each element of the\n * array, in order, passing in the return value from the calculation on the\n * preceding element. The final result of running the reducer across all\n * elements of the array is a single value. Equivalent to\n * `Array.prototype.reduce`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value becomes the value of the accumulator parameter on the next\n * invocation of callbackFn. For the last invocation, the return value becomes\n * the return value of reduce().\n * @param initialValue - A value to which accumulator is initialized the first\n * time the callback is called. CallbackFn starts executing with the first value\n * in the array as currentValue.\n * @returns The value that results from running the \"reducer\" callback function\n * to completion over the entire array.\n * @signature\n * reduce(fn, initialValue)(array)\n * @example\n * pipe([1, 2, 3, 4, 5], reduce((acc, x) => acc + x, 100)) // => 115\n * @dataLast\n * @category Array\n */\nexport function reduce<T, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n ) => U,\n initialValue: U,\n): (data: ReadonlyArray<T>) => U;\n\nexport function reduce(...args: ReadonlyArray<unknown>): unknown {\n return curry(reduceImplementation, args);\n}\n\nfunction reduceImplementation<T, U>(data: ReadonlyArray<T>, callbackfn: (\n previousValue: U,\n currentValue: T,\n currentIndex: number,\n data: ReadonlyArray<T>,\n) => U, initialValue: U): U {\n return data.reduce(callbackfn, initialValue);\n}\n"],"mappings":"mCAsEA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,EAAK,CAG1C,SAAS,EAA2B,EAAwB,EAKpD,EAAoB,CAC1B,OAAO,EAAK,OAAO,EAAY,EAAa"}
package/dist/reverse.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);function t(...t){return e.t(n,t)}function n(e){return[...e].reverse()}exports.reverse=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){return[...e].reverse()}exports.reverse=t;
2
+ //# sourceMappingURL=reverse.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reverse.cjs","names":["curry"],"sources":["../src/reverse.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Reverse<\n T extends ReadonlyArray<unknown>,\n R extends ReadonlyArray<unknown> = [],\n> = ReturnType<\n T extends IsNoTuple<T>\n ? () => [...T, ...R]\n : T extends readonly [infer F, ...infer L]\n ? () => Reverse<L, [F, ...R]>\n : () => R\n>;\n\ntype IsNoTuple<T> = T extends readonly [unknown, ...Array<unknown>] ? never : T;\n\n/**\n * Reverses array.\n *\n * @param array - The array.\n * @signature\n * reverse(arr);\n * @example\n * reverse([1, 2, 3]) // [3, 2, 1]\n * @dataFirst\n * @category Array\n */\nexport function reverse<T extends ReadonlyArray<unknown>>(array: T): Reverse<T>;\n\n/**\n * Reverses array.\n *\n * @signature\n * reverse()(array);\n * @example\n * reverse()([1, 2, 3]) // [3, 2, 1]\n * @dataLast\n * @category Array\n */\nexport function reverse<T extends ReadonlyArray<unknown>>(): (\n array: T,\n) => Reverse<T>;\n\nexport function reverse(...args: ReadonlyArray<unknown>): unknown {\n return curry(reverseImplementation, args);\n}\n\nfunction reverseImplementation<T>(array: ReadonlyArray<T>): Array<T> {\n // TODO [>2]: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toReversed` here.\n\n return [...array].reverse();\n}\n"],"mappings":"kGA0CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAOA,EAAAA,MAAM,EAAuB,EAAK,CAG3C,SAAS,EAAyB,EAAmC,CAGnE,MAAO,CAAC,GAAG,EAAM,CAAC,SAAS"}
package/dist/reverse.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){return[...e].reverse()}export{t as reverse};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e){return[...e].reverse()}export{t as reverse};
2
2
  //# sourceMappingURL=reverse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reverse.js","names":[],"sources":["../src/reverse.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Reverse<\n T extends ReadonlyArray<unknown>,\n R extends ReadonlyArray<unknown> = [],\n> = ReturnType<\n T extends IsNoTuple<T>\n ? () => [...T, ...R]\n : T extends readonly [infer F, ...infer L]\n ? () => Reverse<L, [F, ...R]>\n : () => R\n>;\n\ntype IsNoTuple<T> = T extends readonly [unknown, ...Array<unknown>] ? never : T;\n\n/**\n * Reverses array.\n *\n * @param array - The array.\n * @signature\n * P.reverse(arr);\n * @example\n * P.reverse([1, 2, 3]) // [3, 2, 1]\n * @dataFirst\n * @category Array\n */\nexport function reverse<T extends ReadonlyArray<unknown>>(array: T): Reverse<T>;\n\n/**\n * Reverses array.\n *\n * @signature\n * P.reverse()(array);\n * @example\n * P.reverse()([1, 2, 3]) // [3, 2, 1]\n * @dataLast\n * @category Array\n */\nexport function reverse<T extends ReadonlyArray<unknown>>(): (\n array: T,\n) => Reverse<T>;\n\nexport function reverse(...args: ReadonlyArray<unknown>): unknown {\n return curry(reverseImplementation, args);\n}\n\nfunction reverseImplementation<T>(array: ReadonlyArray<T>): Array<T> {\n // TODO: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toReversed` here.\n return [...array].reverse();\n}\n"],"mappings":"wCA0CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,EAAK,CAG3C,SAAS,EAAyB,EAAmC,CAEnE,MAAO,CAAC,GAAG,EAAM,CAAC,SAAS"}
1
+ {"version":3,"file":"reverse.js","names":[],"sources":["../src/reverse.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Reverse<\n T extends ReadonlyArray<unknown>,\n R extends ReadonlyArray<unknown> = [],\n> = ReturnType<\n T extends IsNoTuple<T>\n ? () => [...T, ...R]\n : T extends readonly [infer F, ...infer L]\n ? () => Reverse<L, [F, ...R]>\n : () => R\n>;\n\ntype IsNoTuple<T> = T extends readonly [unknown, ...Array<unknown>] ? never : T;\n\n/**\n * Reverses array.\n *\n * @param array - The array.\n * @signature\n * reverse(arr);\n * @example\n * reverse([1, 2, 3]) // [3, 2, 1]\n * @dataFirst\n * @category Array\n */\nexport function reverse<T extends ReadonlyArray<unknown>>(array: T): Reverse<T>;\n\n/**\n * Reverses array.\n *\n * @signature\n * reverse()(array);\n * @example\n * reverse()([1, 2, 3]) // [3, 2, 1]\n * @dataLast\n * @category Array\n */\nexport function reverse<T extends ReadonlyArray<unknown>>(): (\n array: T,\n) => Reverse<T>;\n\nexport function reverse(...args: ReadonlyArray<unknown>): unknown {\n return curry(reverseImplementation, args);\n}\n\nfunction reverseImplementation<T>(array: ReadonlyArray<T>): Array<T> {\n // TODO [>2]: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toReversed` here.\n\n return [...array].reverse();\n}\n"],"mappings":"mCA0CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,EAAK,CAG3C,SAAS,EAAyB,EAAmC,CAGnE,MAAO,CAAC,GAAG,EAAM,CAAC,SAAS"}
package/dist/round.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`),t=require(`./with-precision-dQAYLrgr.cjs`);function n(...n){return e.t(t.t(Math.round),n)}exports.round=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`),t=require(`./with-precision-DVi9325n.cjs`);function n(...n){return e.curry(t.t(Math.round),n)}exports.round=n;
2
+ //# sourceMappingURL=round.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"round.cjs","names":["curry","withPrecision"],"sources":["../src/round.ts"],"sourcesContent":["import { curry } from './curry';\nimport { withPrecision } from './internal/with-precision';\n\n/**\n * Rounds a given number to a specific precision.\n * If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),\n * use `Math.round` instead, as it won't incur the additional library overhead.\n *\n * @param value - The number to round.\n * @param precision - The precision to round to. Must be an integer between -15 and 15.\n * @signature\n * round(value, precision);\n * @example\n * round(123.9876, 3) // => 123.988\n * round(483.22243, 1) // => 483.2\n * round(8541, -1) // => 8540\n * round(456789, -3) // => 457000\n * @dataFirst\n * @category Number\n */\nexport function round(value: number, precision: number): number;\n\n/**\n * Rounds a given number to a specific precision.\n * If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),\n * use `Math.round` instead, as it won't incur the additional library overhead.\n *\n * @param precision - The precision to round to. Must be an integer between -15 and 15.\n * @signature\n * round(precision)(value);\n * @example\n * round(3)(123.9876) // => 123.988\n * round(1)(483.22243) // => 483.2\n * round(-1)(8541) // => 8540\n * round(-3)(456789) // => 457000\n * @dataLast\n * @category Number\n */\nexport function round(precision: number): (value: number) => number;\n\nexport function round(...args: ReadonlyArray<unknown>): unknown {\n return curry(withPrecision(Math.round), args);\n}\n"],"mappings":"6IAwCA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAOA,EAAAA,MAAMC,EAAAA,EAAc,KAAK,MAAM,CAAE,EAAK"}
package/dist/round.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./curry-NmniqyJ0.js";import{t}from"./with-precision-CQ90Walk.js";function n(...n){return e(t(Math.round),n)}export{n as round};
1
+ import{curry as e}from"./curry.js";import{t}from"./with-precision-CgRuf7Wl.js";function n(...n){return e(t(Math.round),n)}export{n as round};
2
2
  //# sourceMappingURL=round.js.map
package/dist/round.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"round.js","names":[],"sources":["../src/round.ts"],"sourcesContent":["import { curry } from './curry';\nimport { withPrecision } from './internal/with-precision';\n\n/**\n * Rounds a given number to a specific precision.\n * If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),\n * use `Math.round` instead, as it won't incur the additional library overhead.\n *\n * @param value - The number to round.\n * @param precision - The precision to round to. Must be an integer between -15 and 15.\n * @signature\n * P.round(value, precision);\n * @example\n * P.round(123.9876, 3) // => 123.988\n * P.round(483.22243, 1) // => 483.2\n * P.round(8541, -1) // => 8540\n * P.round(456789, -3) // => 457000\n * @dataFirst\n * @category Number\n */\nexport function round(value: number, precision: number): number;\n\n/**\n * Rounds a given number to a specific precision.\n * If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),\n * use `Math.round` instead, as it won't incur the additional library overhead.\n *\n * @param precision - The precision to round to. Must be an integer between -15 and 15.\n * @signature\n * P.round(precision)(value);\n * @example\n * P.round(3)(123.9876) // => 123.988\n * P.round(1)(483.22243) // => 483.2\n * P.round(-1)(8541) // => 8540\n * P.round(-3)(456789) // => 457000\n * @dataLast\n * @category Number\n */\nexport function round(precision: number): (value: number) => number;\n\nexport function round(...args: ReadonlyArray<unknown>): unknown {\n return curry(withPrecision(Math.round), args);\n}\n"],"mappings":"oFAwCA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAO,EAAM,EAAc,KAAK,MAAM,CAAE,EAAK"}
1
+ {"version":3,"file":"round.js","names":[],"sources":["../src/round.ts"],"sourcesContent":["import { curry } from './curry';\nimport { withPrecision } from './internal/with-precision';\n\n/**\n * Rounds a given number to a specific precision.\n * If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),\n * use `Math.round` instead, as it won't incur the additional library overhead.\n *\n * @param value - The number to round.\n * @param precision - The precision to round to. Must be an integer between -15 and 15.\n * @signature\n * round(value, precision);\n * @example\n * round(123.9876, 3) // => 123.988\n * round(483.22243, 1) // => 483.2\n * round(8541, -1) // => 8540\n * round(456789, -3) // => 457000\n * @dataFirst\n * @category Number\n */\nexport function round(value: number, precision: number): number;\n\n/**\n * Rounds a given number to a specific precision.\n * If you'd like to round to an integer (i.e. use this function with constant `precision === 0`),\n * use `Math.round` instead, as it won't incur the additional library overhead.\n *\n * @param precision - The precision to round to. Must be an integer between -15 and 15.\n * @signature\n * round(precision)(value);\n * @example\n * round(3)(123.9876) // => 123.988\n * round(1)(483.22243) // => 483.2\n * round(-1)(8541) // => 8540\n * round(-3)(456789) // => 457000\n * @dataLast\n * @category Number\n */\nexport function round(precision: number): (value: number) => number;\n\nexport function round(...args: ReadonlyArray<unknown>): unknown {\n return curry(withPrecision(Math.round), args);\n}\n"],"mappings":"+EAwCA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAO,EAAM,EAAc,KAAK,MAAM,CAAE,EAAK"}
package/dist/sample.cjs CHANGED
@@ -1 +1,2 @@
1
- const e=require(`./curry-BsY0Z8jH.cjs`);function t(...t){return e.t(n,t)}function n(e,t){if(t<=0)return[];if(t>=e.length)return[...e];let n=Math.min(t,e.length-t),r=new Set;for(;r.size<n;){let t=Math.floor(Math.random()*e.length);r.add(t)}return t===n?[...r].sort((e,t)=>e-t).map(t=>e[t]):e.filter((e,t)=>!r.has(t))}exports.sample=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){if(t<=0)return[];if(t>=e.length)return[...e];let n=Math.min(t,e.length-t),r=new Set;for(;r.size<n;){let t=Math.floor(Math.random()*e.length);r.add(t)}return t===n?[...r].sort((e,t)=>e-t).map(t=>e[t]):e.filter((e,t)=>!r.has(t))}exports.sample=t;
2
+ //# sourceMappingURL=sample.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample.cjs","names":["curry"],"sources":["../src/sample.ts"],"sourcesContent":["import type {\n FixedLengthArray,\n IsEqual,\n IsNever,\n NonNegativeInteger,\n Or,\n Writable,\n} from 'type-fest';\nimport type { CoercedArray } from './internal/types/coerced-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { NTuple } from './internal/types/n-tuple';\nimport type { PartialArray } from './internal/types/partial-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\nimport { curry } from './curry';\n\ntype Sampled<T extends IterableContainer, N extends number>\n = Or<IsEqual<N, 0>, IsEqual<T['length'], 0>> extends true\n ? // Short-circuit on trivial inputs.\n []\n : IsNever<NonNegativeInteger<N>> extends true\n ? SampledPrimitive<T>\n : IsLongerThan<T, N> extends true\n ? SampledLiteral<T, N>\n : // If our tuple can never fulfil the sample size the only valid sample\n // is the whole input tuple. Because it's a shallow clone we also\n // strip any readonly-ness.\n Writable<T>;\n\n/**\n * When N is not a non-negative integer **literal** we can't use it in our\n * reconstructing logic so we fallback to a simpler definition of the output of\n * sample, which is any sub-tuple shape of T, of **any length**.\n */\ntype SampledPrimitive<T extends IterableContainer> = [\n ...FixedSubTuples<TupleParts<T>['required']>,\n // TODO: This might be accurate, but We currently have no tests that check optional elements!\n ...PartialArray<FixedSubTuples<TupleParts<T>['optional']>>,\n ...CoercedArray<TupleParts<T>['item']>,\n ...FixedSubTuples<TupleParts<T>['suffix']>,\n];\n\n/**\n * Knowing N is a non-negative literal integer we can construct all sub-tuples\n * of T that are exactly N elements long.\n */\ntype SampledLiteral<T extends IterableContainer, N extends number>\n = | Extract<\n FixedSubTuples<\n [\n ...TupleParts<T>['required'],\n // TODO: This deliberately ignores optional elements which we don't have tests for either. In order to handle optional elements we can treat the \"optional\" tuple-part as more required elements.\n // We add N elements of the `item` type to the tuple so that we\n // consider any combination possible of elements of the prefix items,\n // any amount of rest items, and suffix items.\n ...(IsNever<TupleParts<T>['item']> extends true\n ? []\n : NTuple<TupleParts<T>['item'], N>),\n ...TupleParts<T>['suffix'],\n ]\n >,\n // This is just [unknown, unknown, ..., unknown] with N elements.\n FixedLengthArray<unknown, N>\n >\n // In addition to all sub-tuples of length N, we also need to consider all\n // tuples where the input is shorter than N. This will contribute exactly\n // one sub-tuple at each length from the minimum length of T and up to N-1.\n | SubSampled<\n TupleParts<T>['required'],\n // TODO: This deliberately ignores optional elements which we don't have tests for either. In order to handle optional elements we can treat the \"optional\" tuple-part as more required elements.\n TupleParts<T>['item'],\n TupleParts<T>['suffix'],\n N\n >;\n\n// We want to create a union of all sub-tuples where we incrementally add an\n// additional element of the type of the rest element in the middle between the\n// prefix and suffix until we \"fill\" the tuple to size N.\ntype SubSampled<\n Prefix extends ReadonlyArray<unknown>,\n Item,\n Suffix extends ReadonlyArray<unknown>,\n N extends number,\n>\n = IsLongerThan<[...Prefix, ...Suffix], N> extends true\n ? // We need to prevent overflows in case Prefix and Suffix are already long\n // enough\n never\n : [...Prefix, ...Suffix]['length'] extends N\n ? never\n : [...Prefix, ...Suffix] | SubSampled<[...Prefix, Item], Item, Suffix, N>;\n\ntype IsLongerThan<T extends ReadonlyArray<unknown>, N extends number>\n // Checking for `undefined` is a neat trick to avoid needing to compare\n // integer literals because if N overflows the tuple then the type for that\n // element will be `undefined`. This only works for fixed tuples!\n = IsEqual<T[N], undefined> extends true ? false : true;\n\n// Assuming T is a fixed tuple we build all it's possible sub-tuples.\ntype FixedSubTuples<T> = T extends readonly [infer Head, ...infer Rest]\n ? // For each element we either take it or skip it, and recurse over the rest.\n FixedSubTuples<Rest> | [Head, ...FixedSubTuples<Rest>]\n : [];\n\n/**\n * Returns a random subset of size `sampleSize` from `array`.\n *\n * Maintains and infers most of the typing information that could be passed\n * along to the output. This means that when using tuples, the output will be\n * a tuple too, and when using literals, those literals would be preserved.\n *\n * The items in the result are kept in the same order as they are in the input.\n * If you need to get a shuffled response you can pipe the shuffle function\n * after this one.\n *\n * @param data - The array.\n * @param sampleSize - The number of elements to take.\n * @signature\n * sample(array, sampleSize)\n * @example\n * sample([\"hello\", \"world\"], 1); // => [\"hello\"] // typed string[]\n * sample([\"hello\", \"world\"] as const, 1); // => [\"world\"] // typed [\"hello\" | \"world\"]\n * @dataFirst\n * @category Array\n */\nexport function sample<const T extends IterableContainer, N extends number>(\n data: T,\n sampleSize: N,\n): Sampled<T, N>;\n\n/**\n * Returns a random subset of size `sampleSize` from `array`.\n *\n * Maintains and infers most of the typing information that could be passed\n * along to the output. This means that when using tuples, the output will be\n * a tuple too, and when using literals, those literals would be preserved.\n *\n * The items in the result are kept in the same order as they are in the input.\n * If you need to get a shuffled response you can pipe the shuffle function\n * after this one.\n *\n * @param sampleSize - The number of elements to take.\n * @signature\n * sample(sampleSize)(array)\n * @example\n * sample(1)([\"hello\", \"world\"]); // => [\"hello\"] // typed string[]\n * sample(1)([\"hello\", \"world\"] as const); // => [\"world\"] // typed [\"hello\" | \"world\"]\n * @dataLast\n * @category Array\n */\nexport function sample<const T extends IterableContainer, N extends number>(\n sampleSize: N,\n): (data: T) => Sampled<T, N>;\n\nexport function sample(...args: ReadonlyArray<unknown>): unknown {\n return curry(sampleImplementation, args);\n}\n\nfunction sampleImplementation<T>(data: ReadonlyArray<T>, sampleSize: number): Array<T> {\n if (sampleSize <= 0) {\n // Trivial\n return [];\n }\n\n if (sampleSize >= data.length) {\n // Trivial\n return [...data];\n }\n\n // We have 2 modes of sampling, depending on the size of the sample requested.\n // 1. If sampleSize is _small_, we generate indices that we then use to\n // *EXTRACT* individual elements from the array.\n // 2. If sampleSize is _large_, we instead generate indices to *EXCLUDE* from\n // a full scan of the input array (via filtering).\n //\n // This allows us 2 optimizations that are the core of how this function\n // works:\n // 1. It is hard to generate a large number of unique indices, as the more\n // indices we generate the more likely we are to generate one that is already\n // in the set, which would require more iterations of the generation loop.\n // Capping our effective sampleSize at n/2 would put an upper limit to the\n // average number of iterations required (as a function of n).\n // 2. If sample size is small enough, we never need to actually iterate over\n // the full input array at all; instead we simply project the values we need\n // via random access into the array. This means that for sampleSize (K) less\n // than n/2, we run at O(klogk). For large sampleSize we need to iterate over\n // the full input array, but we don't need to sort the indices because we can\n // use the Set's 'has' method, so we effectively run at O(n).\n const actualSampleSize = Math.min(sampleSize, data.length - sampleSize);\n\n const sampleIndices = new Set<number>();\n while (sampleIndices.size < actualSampleSize) {\n const randomIndex = Math.floor(Math.random() * data.length);\n sampleIndices.add(randomIndex);\n }\n\n if (sampleSize === actualSampleSize) {\n return [...sampleIndices]\n .sort((a, b) => a - b)\n .map((index) => data[index]!);\n }\n\n return data.filter((_, index) => !sampleIndices.has(index));\n}\n"],"mappings":"kGAyJA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,EAAK,CAG1C,SAAS,EAAwB,EAAwB,EAA8B,CACrF,GAAI,GAAc,EAEhB,MAAO,EAAE,CAGX,GAAI,GAAc,EAAK,OAErB,MAAO,CAAC,GAAG,EAAK,CAsBlB,IAAM,EAAmB,KAAK,IAAI,EAAY,EAAK,OAAS,EAAW,CAEjE,EAAgB,IAAI,IAC1B,KAAO,EAAc,KAAO,GAAkB,CAC5C,IAAM,EAAc,KAAK,MAAM,KAAK,QAAQ,CAAG,EAAK,OAAO,CAC3D,EAAc,IAAI,EAAY,CAShC,OANI,IAAe,EACV,CAAC,GAAG,EAAc,CACtB,MAAM,EAAG,IAAM,EAAI,EAAE,CACrB,IAAK,GAAU,EAAK,GAAQ,CAG1B,EAAK,QAAQ,EAAG,IAAU,CAAC,EAAc,IAAI,EAAM,CAAC"}
package/dist/sample.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){if(t<=0)return[];if(t>=e.length)return[...e];let n=Math.min(t,e.length-t),r=new Set;for(;r.size<n;){let t=Math.floor(Math.random()*e.length);r.add(t)}return t===n?[...r].sort((e,t)=>e-t).map(t=>e[t]):e.filter((e,t)=>!r.has(t))}export{t as sample};
1
+ import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){if(t<=0)return[];if(t>=e.length)return[...e];let n=Math.min(t,e.length-t),r=new Set;for(;r.size<n;){let t=Math.floor(Math.random()*e.length);r.add(t)}return t===n?[...r].sort((e,t)=>e-t).map(t=>e[t]):e.filter((e,t)=>!r.has(t))}export{t as sample};
2
2
  //# sourceMappingURL=sample.js.map