@vinicunca/perkakas 1.14.0 → 1.16.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 (563) hide show
  1. package/dist/add-prop.cjs +1 -1
  2. package/dist/add-prop.cjs.map +1 -1
  3. package/dist/add-prop.js.map +1 -1
  4. package/dist/add.cjs +1 -1
  5. package/dist/add.cjs.map +1 -1
  6. package/dist/add.js.map +1 -1
  7. package/dist/all-pass.cjs +1 -1
  8. package/dist/all-pass.cjs.map +1 -1
  9. package/dist/all-pass.js.map +1 -1
  10. package/dist/any-pass.cjs +1 -1
  11. package/dist/any-pass.cjs.map +1 -1
  12. package/dist/any-pass.js.map +1 -1
  13. package/dist/{binary-search-cutoff-index-TJlnoie4.js → binary-search-cutoff-index-CRPy-dOJ.js} +1 -1
  14. package/dist/{binary-search-cutoff-index-TJlnoie4.js.map → binary-search-cutoff-index-CRPy-dOJ.js.map} +1 -1
  15. package/dist/binary-search-cutoff-index-CdUUMUB1.cjs +2 -0
  16. package/dist/{binary-search-cutoff-index-CLFtXYPc.cjs.map → binary-search-cutoff-index-CdUUMUB1.cjs.map} +1 -1
  17. package/dist/capitalize.cjs +1 -1
  18. package/dist/capitalize.cjs.map +1 -1
  19. package/dist/capitalize.js.map +1 -1
  20. package/dist/ceil.cjs +1 -1
  21. package/dist/ceil.cjs.map +1 -1
  22. package/dist/ceil.js +1 -1
  23. package/dist/ceil.js.map +1 -1
  24. package/dist/chunk.cjs +1 -1
  25. package/dist/chunk.cjs.map +1 -1
  26. package/dist/chunk.js.map +1 -1
  27. package/dist/clamp.cjs +1 -1
  28. package/dist/clamp.cjs.map +1 -1
  29. package/dist/clamp.js.map +1 -1
  30. package/dist/clone.cjs +1 -1
  31. package/dist/clone.cjs.map +1 -1
  32. package/dist/clone.js.map +1 -1
  33. package/dist/concat.cjs +1 -1
  34. package/dist/concat.cjs.map +1 -1
  35. package/dist/concat.js.map +1 -1
  36. package/dist/conditional.cjs +2 -1
  37. package/dist/conditional.cjs.map +1 -0
  38. package/dist/conditional.js +2 -1
  39. package/dist/conditional.js.map +1 -0
  40. package/dist/constant.cjs.map +1 -1
  41. package/dist/constant.js.map +1 -1
  42. package/dist/count-by.cjs +1 -1
  43. package/dist/count-by.cjs.map +1 -1
  44. package/dist/count-by.js.map +1 -1
  45. package/dist/{curry-from-lazy-CtH1dp14.js → curry-from-lazy-BoPMn2L_.js} +1 -1
  46. package/dist/{curry-from-lazy-CtH1dp14.js.map → curry-from-lazy-BoPMn2L_.js.map} +1 -1
  47. package/dist/{curry-from-lazy-BvN_VKlH.cjs → curry-from-lazy-mdjeRP1g.cjs} +2 -2
  48. package/dist/{curry-from-lazy-BvN_VKlH.cjs.map → curry-from-lazy-mdjeRP1g.cjs.map} +1 -1
  49. package/dist/curry-on-Et2NUOHd.js +2 -0
  50. package/dist/curry-on-Et2NUOHd.js.map +1 -0
  51. package/dist/curry-on-wBH_q-mO.cjs +2 -0
  52. package/dist/curry-on-wBH_q-mO.cjs.map +1 -0
  53. package/dist/{curry-order-rules-DsJSy3gX.cjs → curry-order-rules-CacOTzfW.cjs} +2 -2
  54. package/dist/{curry-order-rules-DsJSy3gX.cjs.map → curry-order-rules-CacOTzfW.cjs.map} +1 -1
  55. package/dist/{curry-order-rules-BLyCSMdZ.js → curry-order-rules-Dage-BeC.js} +1 -1
  56. package/dist/{curry-order-rules-BLyCSMdZ.js.map → curry-order-rules-Dage-BeC.js.map} +1 -1
  57. package/dist/curry.cjs +1 -1
  58. package/dist/curry.cjs.map +1 -1
  59. package/dist/curry.js +1 -1
  60. package/dist/curry.js.map +1 -1
  61. package/dist/debounce.cjs.map +1 -1
  62. package/dist/debounce.js.map +1 -1
  63. package/dist/default-to.cjs +1 -1
  64. package/dist/default-to.cjs.map +1 -1
  65. package/dist/default-to.js.map +1 -1
  66. package/dist/difference-with.cjs +1 -1
  67. package/dist/difference-with.cjs.map +1 -1
  68. package/dist/difference-with.js +1 -1
  69. package/dist/difference-with.js.map +1 -1
  70. package/dist/difference.cjs +1 -1
  71. package/dist/difference.cjs.map +1 -1
  72. package/dist/difference.js +1 -1
  73. package/dist/difference.js.map +1 -1
  74. package/dist/divide.cjs +1 -1
  75. package/dist/divide.cjs.map +1 -1
  76. package/dist/divide.js.map +1 -1
  77. package/dist/do-nothing.cjs.map +1 -1
  78. package/dist/do-nothing.js.map +1 -1
  79. package/dist/drop-first-by.cjs +1 -1
  80. package/dist/drop-first-by.cjs.map +1 -1
  81. package/dist/drop-first-by.js +1 -1
  82. package/dist/drop-first-by.js.map +1 -1
  83. package/dist/drop-last-while.cjs +1 -1
  84. package/dist/drop-last-while.cjs.map +1 -1
  85. package/dist/drop-last-while.js.map +1 -1
  86. package/dist/drop-last.cjs +1 -1
  87. package/dist/drop-last.cjs.map +1 -1
  88. package/dist/drop-last.js.map +1 -1
  89. package/dist/drop-while.cjs +1 -1
  90. package/dist/drop-while.cjs.map +1 -1
  91. package/dist/drop-while.js.map +1 -1
  92. package/dist/drop.cjs +1 -1
  93. package/dist/drop.cjs.map +1 -1
  94. package/dist/drop.js +1 -1
  95. package/dist/drop.js.map +1 -1
  96. package/dist/ends-with.cjs +1 -1
  97. package/dist/ends-with.cjs.map +1 -1
  98. package/dist/ends-with.js.map +1 -1
  99. package/dist/entries.cjs +1 -1
  100. package/dist/entries.cjs.map +1 -1
  101. package/dist/entries.js.map +1 -1
  102. package/dist/evolve.cjs +1 -1
  103. package/dist/evolve.cjs.map +1 -1
  104. package/dist/evolve.js.map +1 -1
  105. package/dist/filter.cjs +1 -1
  106. package/dist/filter.cjs.map +1 -1
  107. package/dist/filter.js +1 -1
  108. package/dist/filter.js.map +1 -1
  109. package/dist/find-index.cjs +1 -1
  110. package/dist/find-index.cjs.map +1 -1
  111. package/dist/find-index.js.map +1 -1
  112. package/dist/find-last-index.cjs +1 -1
  113. package/dist/find-last-index.cjs.map +1 -1
  114. package/dist/find-last-index.js.map +1 -1
  115. package/dist/find-last.cjs +1 -1
  116. package/dist/find-last.cjs.map +1 -1
  117. package/dist/find-last.js.map +1 -1
  118. package/dist/find.cjs +1 -1
  119. package/dist/find.cjs.map +1 -1
  120. package/dist/find.js +1 -1
  121. package/dist/find.js.map +1 -1
  122. package/dist/first-by.cjs +1 -1
  123. package/dist/first-by.cjs.map +1 -1
  124. package/dist/first-by.js +1 -1
  125. package/dist/first-by.js.map +1 -1
  126. package/dist/first.cjs +1 -1
  127. package/dist/first.cjs.map +1 -1
  128. package/dist/first.js +1 -1
  129. package/dist/first.js.map +1 -1
  130. package/dist/flat-map.cjs +1 -1
  131. package/dist/flat-map.cjs.map +1 -1
  132. package/dist/flat-map.js.map +1 -1
  133. package/dist/flat.cjs +1 -1
  134. package/dist/flat.cjs.map +1 -1
  135. package/dist/flat.js +1 -1
  136. package/dist/flat.js.map +1 -1
  137. package/dist/floor.cjs +1 -1
  138. package/dist/floor.cjs.map +1 -1
  139. package/dist/floor.js +1 -1
  140. package/dist/floor.js.map +1 -1
  141. package/dist/for-each-obj.cjs +1 -1
  142. package/dist/for-each-obj.cjs.map +1 -1
  143. package/dist/for-each-obj.js.map +1 -1
  144. package/dist/for-each.cjs +1 -1
  145. package/dist/for-each.cjs.map +1 -1
  146. package/dist/for-each.js.map +1 -1
  147. package/dist/from-entries.cjs +1 -1
  148. package/dist/from-entries.cjs.map +1 -1
  149. package/dist/from-entries.js.map +1 -1
  150. package/dist/from-keys.cjs +1 -1
  151. package/dist/from-keys.cjs.map +1 -1
  152. package/dist/from-keys.js.map +1 -1
  153. package/dist/funnel.cjs.map +1 -1
  154. package/dist/funnel.js.map +1 -1
  155. package/dist/group-by-prop.cjs +1 -1
  156. package/dist/group-by-prop.cjs.map +1 -1
  157. package/dist/group-by-prop.js.map +1 -1
  158. package/dist/group-by.cjs +1 -1
  159. package/dist/group-by.cjs.map +1 -1
  160. package/dist/group-by.js.map +1 -1
  161. package/dist/has-at-least.cjs +1 -1
  162. package/dist/has-at-least.cjs.map +1 -1
  163. package/dist/has-at-least.js.map +1 -1
  164. package/dist/has-prop.cjs +2 -0
  165. package/dist/has-prop.cjs.map +1 -0
  166. package/dist/has-prop.js +2 -0
  167. package/dist/has-prop.js.map +1 -0
  168. package/dist/has-sub-object.cjs +1 -1
  169. package/dist/has-sub-object.cjs.map +1 -1
  170. package/dist/has-sub-object.js.map +1 -1
  171. package/dist/heap-BK0Y5t1Y.cjs +2 -0
  172. package/dist/{heap-C0zPQGC0.cjs.map → heap-BK0Y5t1Y.cjs.map} +1 -1
  173. package/dist/{heap-M6D40vkc.js → heap-CL5ahv5n.js} +2 -2
  174. package/dist/{heap-M6D40vkc.js.map → heap-CL5ahv5n.js.map} +1 -1
  175. package/dist/human-readable-file-size.cjs.map +1 -1
  176. package/dist/human-readable-file-size.js.map +1 -1
  177. package/dist/identity.cjs.map +1 -1
  178. package/dist/identity.js.map +1 -1
  179. package/dist/index-by.cjs +1 -1
  180. package/dist/index-by.cjs.map +1 -1
  181. package/dist/index-by.js.map +1 -1
  182. package/dist/index.cjs +1 -1
  183. package/dist/index.cjs.map +1 -1
  184. package/dist/index.d.cts +174 -202
  185. package/dist/index.d.cts.map +1 -1
  186. package/dist/index.d.ts +174 -202
  187. package/dist/index.d.ts.map +1 -1
  188. package/dist/index.js +1 -1
  189. package/dist/index.js.map +1 -1
  190. package/dist/intersection-with.cjs +1 -1
  191. package/dist/intersection-with.cjs.map +1 -1
  192. package/dist/intersection-with.js +1 -1
  193. package/dist/intersection-with.js.map +1 -1
  194. package/dist/intersection.cjs +1 -1
  195. package/dist/intersection.cjs.map +1 -1
  196. package/dist/intersection.js +1 -1
  197. package/dist/intersection.js.map +1 -1
  198. package/dist/invert.cjs +1 -1
  199. package/dist/invert.cjs.map +1 -1
  200. package/dist/invert.js.map +1 -1
  201. package/dist/is-array.cjs.map +1 -1
  202. package/dist/is-array.js.map +1 -1
  203. package/dist/is-big-int.cjs.map +1 -1
  204. package/dist/is-big-int.js.map +1 -1
  205. package/dist/is-boolean.cjs.map +1 -1
  206. package/dist/is-boolean.js.map +1 -1
  207. package/dist/is-date.cjs.map +1 -1
  208. package/dist/is-date.js.map +1 -1
  209. package/dist/is-deep-equal.cjs +1 -1
  210. package/dist/is-deep-equal.cjs.map +1 -1
  211. package/dist/is-deep-equal.js +1 -1
  212. package/dist/is-deep-equal.js.map +1 -1
  213. package/dist/is-defined.cjs.map +1 -1
  214. package/dist/is-defined.js.map +1 -1
  215. package/dist/is-empty.cjs.map +1 -1
  216. package/dist/is-empty.js.map +1 -1
  217. package/dist/is-emptyish.cjs.map +1 -1
  218. package/dist/is-emptyish.js.map +1 -1
  219. package/dist/is-error.cjs.map +1 -1
  220. package/dist/is-error.js.map +1 -1
  221. package/dist/is-function.cjs.map +1 -1
  222. package/dist/is-function.js.map +1 -1
  223. package/dist/is-included-in.cjs.map +1 -1
  224. package/dist/is-included-in.js.map +1 -1
  225. package/dist/is-non-null.cjs.map +1 -1
  226. package/dist/is-non-null.js.map +1 -1
  227. package/dist/is-non-nullish.cjs.map +1 -1
  228. package/dist/is-non-nullish.js.map +1 -1
  229. package/dist/is-not.cjs.map +1 -1
  230. package/dist/is-not.js.map +1 -1
  231. package/dist/is-nullish.cjs.map +1 -1
  232. package/dist/is-nullish.js.map +1 -1
  233. package/dist/is-number.cjs.map +1 -1
  234. package/dist/is-number.js.map +1 -1
  235. package/dist/is-object-type.cjs.map +1 -1
  236. package/dist/is-object-type.js.map +1 -1
  237. package/dist/is-plain-object.cjs.map +1 -1
  238. package/dist/is-plain-object.js.map +1 -1
  239. package/dist/is-promise.cjs.map +1 -1
  240. package/dist/is-promise.js.map +1 -1
  241. package/dist/is-shallow-equal.cjs +1 -1
  242. package/dist/is-shallow-equal.cjs.map +1 -1
  243. package/dist/is-shallow-equal.js.map +1 -1
  244. package/dist/is-strict-equal.cjs +1 -1
  245. package/dist/is-strict-equal.cjs.map +1 -1
  246. package/dist/is-strict-equal.js.map +1 -1
  247. package/dist/is-string.cjs.map +1 -1
  248. package/dist/is-string.js.map +1 -1
  249. package/dist/is-symbol.cjs.map +1 -1
  250. package/dist/is-symbol.js.map +1 -1
  251. package/dist/is-truthy.cjs.map +1 -1
  252. package/dist/is-truthy.js.map +1 -1
  253. package/dist/join.cjs +1 -1
  254. package/dist/join.cjs.map +1 -1
  255. package/dist/join.js.map +1 -1
  256. package/dist/key-codes.cjs.map +1 -1
  257. package/dist/key-codes.js.map +1 -1
  258. package/dist/keys.cjs +1 -1
  259. package/dist/keys.cjs.map +1 -1
  260. package/dist/keys.js.map +1 -1
  261. package/dist/last.cjs +1 -1
  262. package/dist/last.cjs.map +1 -1
  263. package/dist/last.js.map +1 -1
  264. package/dist/{lazy-data-last-impl-Vt_M0l7X.js → lazy-data-last-impl--3B10z3s.js} +1 -1
  265. package/dist/{lazy-data-last-impl-Vt_M0l7X.js.map → lazy-data-last-impl--3B10z3s.js.map} +1 -1
  266. package/dist/lazy-data-last-impl-Dd5zjCfU.cjs +2 -0
  267. package/dist/{lazy-data-last-impl-B05ZpguF.cjs.map → lazy-data-last-impl-Dd5zjCfU.cjs.map} +1 -1
  268. package/dist/length.cjs +1 -1
  269. package/dist/length.cjs.map +1 -1
  270. package/dist/length.js.map +1 -1
  271. package/dist/map-keys.cjs +1 -1
  272. package/dist/map-keys.cjs.map +1 -1
  273. package/dist/map-keys.js.map +1 -1
  274. package/dist/map-to-obj.cjs +1 -1
  275. package/dist/map-to-obj.cjs.map +1 -1
  276. package/dist/map-to-obj.js.map +1 -1
  277. package/dist/map-values.cjs +1 -1
  278. package/dist/map-values.cjs.map +1 -1
  279. package/dist/map-values.js.map +1 -1
  280. package/dist/map-with-feedback.cjs +1 -1
  281. package/dist/map-with-feedback.cjs.map +1 -1
  282. package/dist/map-with-feedback.js +1 -1
  283. package/dist/map-with-feedback.js.map +1 -1
  284. package/dist/map.cjs +1 -1
  285. package/dist/map.cjs.map +1 -1
  286. package/dist/map.js.map +1 -1
  287. package/dist/mean-by.cjs +1 -1
  288. package/dist/mean-by.cjs.map +1 -1
  289. package/dist/mean-by.js.map +1 -1
  290. package/dist/mean.cjs +1 -1
  291. package/dist/mean.cjs.map +1 -1
  292. package/dist/mean.js.map +1 -1
  293. package/dist/median.cjs +1 -1
  294. package/dist/median.cjs.map +1 -1
  295. package/dist/median.js.map +1 -1
  296. package/dist/merge-all.cjs.map +1 -1
  297. package/dist/merge-all.js.map +1 -1
  298. package/dist/merge-deep.cjs +1 -1
  299. package/dist/merge-deep.cjs.map +1 -1
  300. package/dist/merge-deep.js.map +1 -1
  301. package/dist/merge.cjs +1 -1
  302. package/dist/merge.cjs.map +1 -1
  303. package/dist/merge.js.map +1 -1
  304. package/dist/multiply.cjs +1 -1
  305. package/dist/multiply.cjs.map +1 -1
  306. package/dist/multiply.js.map +1 -1
  307. package/dist/{nth-by-zZ3RM-mR.cjs → nth-by-BrkoqeV2.cjs} +2 -2
  308. package/dist/{nth-by-zZ3RM-mR.cjs.map → nth-by-BrkoqeV2.cjs.map} +1 -1
  309. package/dist/{nth-by-DhfNV5xd.js → nth-by-DGcGGvJX.js} +2 -2
  310. package/dist/{nth-by-DhfNV5xd.js.map → nth-by-DGcGGvJX.js.map} +1 -1
  311. package/dist/nth-by.cjs +1 -1
  312. package/dist/nth-by.js +1 -1
  313. package/dist/obj-of.cjs +1 -1
  314. package/dist/obj-of.cjs.map +1 -1
  315. package/dist/obj-of.js.map +1 -1
  316. package/dist/omit-by.cjs +1 -1
  317. package/dist/omit-by.cjs.map +1 -1
  318. package/dist/omit-by.js.map +1 -1
  319. package/dist/omit.cjs +1 -1
  320. package/dist/omit.cjs.map +1 -1
  321. package/dist/omit.js.map +1 -1
  322. package/dist/once.cjs.map +1 -1
  323. package/dist/once.js.map +1 -1
  324. package/dist/only.cjs +1 -1
  325. package/dist/only.cjs.map +1 -1
  326. package/dist/only.js.map +1 -1
  327. package/dist/partial-bind.cjs.map +1 -1
  328. package/dist/partial-bind.js.map +1 -1
  329. package/dist/partial-last-bind.cjs.map +1 -1
  330. package/dist/partial-last-bind.js.map +1 -1
  331. package/dist/partition.cjs +1 -1
  332. package/dist/partition.cjs.map +1 -1
  333. package/dist/partition.js.map +1 -1
  334. package/dist/path-or.cjs +1 -1
  335. package/dist/path-or.cjs.map +1 -1
  336. package/dist/path-or.js.map +1 -1
  337. package/dist/pick-by.cjs +1 -1
  338. package/dist/pick-by.cjs.map +1 -1
  339. package/dist/pick-by.js.map +1 -1
  340. package/dist/pick.cjs +1 -1
  341. package/dist/pick.cjs.map +1 -1
  342. package/dist/pick.js.map +1 -1
  343. package/dist/pipe.cjs +1 -1
  344. package/dist/pipe.cjs.map +1 -1
  345. package/dist/pipe.js +1 -1
  346. package/dist/pipe.js.map +1 -1
  347. package/dist/piped.cjs +1 -1
  348. package/dist/piped.cjs.map +1 -1
  349. package/dist/piped.js.map +1 -1
  350. package/dist/product.cjs +1 -1
  351. package/dist/product.cjs.map +1 -1
  352. package/dist/product.js.map +1 -1
  353. package/dist/prop.cjs.map +1 -1
  354. package/dist/prop.js.map +1 -1
  355. package/dist/pull-object.cjs +1 -1
  356. package/dist/pull-object.cjs.map +1 -1
  357. package/dist/pull-object.js.map +1 -1
  358. package/dist/random-big-int.cjs.map +1 -1
  359. package/dist/random-big-int.js.map +1 -1
  360. package/dist/random-integer.cjs.map +1 -1
  361. package/dist/random-integer.js.map +1 -1
  362. package/dist/random-string.cjs +1 -1
  363. package/dist/random-string.cjs.map +1 -1
  364. package/dist/random-string.js.map +1 -1
  365. package/dist/range.cjs +1 -1
  366. package/dist/range.cjs.map +1 -1
  367. package/dist/range.js.map +1 -1
  368. package/dist/rank-by.cjs +1 -1
  369. package/dist/rank-by.cjs.map +1 -1
  370. package/dist/rank-by.js +1 -1
  371. package/dist/rank-by.js.map +1 -1
  372. package/dist/reduce.cjs +1 -1
  373. package/dist/reduce.cjs.map +1 -1
  374. package/dist/reduce.js.map +1 -1
  375. package/dist/reverse.cjs +1 -1
  376. package/dist/reverse.cjs.map +1 -1
  377. package/dist/reverse.js.map +1 -1
  378. package/dist/round.cjs +1 -1
  379. package/dist/round.cjs.map +1 -1
  380. package/dist/round.js +1 -1
  381. package/dist/round.js.map +1 -1
  382. package/dist/sample.cjs +1 -1
  383. package/dist/sample.cjs.map +1 -1
  384. package/dist/sample.js.map +1 -1
  385. package/dist/set-path.cjs +1 -1
  386. package/dist/set-path.cjs.map +1 -1
  387. package/dist/set-path.js.map +1 -1
  388. package/dist/set.cjs +1 -1
  389. package/dist/set.cjs.map +1 -1
  390. package/dist/set.js.map +1 -1
  391. package/dist/shuffle.cjs +1 -1
  392. package/dist/shuffle.cjs.map +1 -1
  393. package/dist/shuffle.js.map +1 -1
  394. package/dist/sleep.cjs.map +1 -1
  395. package/dist/sleep.js.map +1 -1
  396. package/dist/slice-string.cjs.map +1 -1
  397. package/dist/slice-string.js.map +1 -1
  398. package/dist/slugify.cjs.map +1 -1
  399. package/dist/slugify.js.map +1 -1
  400. package/dist/sort-by.cjs +1 -1
  401. package/dist/sort-by.cjs.map +1 -1
  402. package/dist/sort-by.js +1 -1
  403. package/dist/sort-by.js.map +1 -1
  404. package/dist/sort.cjs +1 -1
  405. package/dist/sort.cjs.map +1 -1
  406. package/dist/sort.js.map +1 -1
  407. package/dist/sorted-index-by.cjs +1 -1
  408. package/dist/sorted-index-by.cjs.map +1 -1
  409. package/dist/sorted-index-by.js +1 -1
  410. package/dist/sorted-index-by.js.map +1 -1
  411. package/dist/sorted-index-with.cjs +1 -1
  412. package/dist/sorted-index-with.cjs.map +1 -1
  413. package/dist/sorted-index-with.js +1 -1
  414. package/dist/sorted-index-with.js.map +1 -1
  415. package/dist/sorted-index.cjs +1 -1
  416. package/dist/sorted-index.cjs.map +1 -1
  417. package/dist/sorted-index.js +1 -1
  418. package/dist/sorted-index.js.map +1 -1
  419. package/dist/sorted-last-index-by.cjs +1 -1
  420. package/dist/sorted-last-index-by.cjs.map +1 -1
  421. package/dist/sorted-last-index-by.js +1 -1
  422. package/dist/sorted-last-index-by.js.map +1 -1
  423. package/dist/sorted-last-index.cjs +1 -1
  424. package/dist/sorted-last-index.cjs.map +1 -1
  425. package/dist/sorted-last-index.js +1 -1
  426. package/dist/sorted-last-index.js.map +1 -1
  427. package/dist/splice.cjs +1 -1
  428. package/dist/splice.cjs.map +1 -1
  429. package/dist/splice.js +1 -1
  430. package/dist/splice.js.map +1 -1
  431. package/dist/split-at.cjs +1 -1
  432. package/dist/split-at.cjs.map +1 -1
  433. package/dist/split-at.js.map +1 -1
  434. package/dist/split-when.cjs +1 -1
  435. package/dist/split-when.cjs.map +1 -1
  436. package/dist/split-when.js.map +1 -1
  437. package/dist/split.cjs.map +1 -1
  438. package/dist/split.js.map +1 -1
  439. package/dist/starts-with.cjs +1 -1
  440. package/dist/starts-with.cjs.map +1 -1
  441. package/dist/starts-with.js.map +1 -1
  442. package/dist/string-to-path.cjs.map +1 -1
  443. package/dist/string-to-path.js.map +1 -1
  444. package/dist/subtract.cjs +1 -1
  445. package/dist/subtract.cjs.map +1 -1
  446. package/dist/subtract.js.map +1 -1
  447. package/dist/sum-by.cjs +1 -1
  448. package/dist/sum-by.cjs.map +1 -1
  449. package/dist/sum-by.js.map +1 -1
  450. package/dist/sum.cjs +1 -1
  451. package/dist/sum.cjs.map +1 -1
  452. package/dist/sum.js.map +1 -1
  453. package/dist/swap-in-place-CllcD0HG.cjs +2 -0
  454. package/dist/{swap-in-place-D1vasegg.cjs.map → swap-in-place-CllcD0HG.cjs.map} +1 -1
  455. package/dist/{swap-in-place-BzNaxwB3.js → swap-in-place-ubtnp8en.js} +1 -1
  456. package/dist/{swap-in-place-BzNaxwB3.js.map → swap-in-place-ubtnp8en.js.map} +1 -1
  457. package/dist/swap-indices.cjs +1 -1
  458. package/dist/swap-indices.cjs.map +1 -1
  459. package/dist/swap-indices.js.map +1 -1
  460. package/dist/swap-props.cjs +1 -1
  461. package/dist/swap-props.cjs.map +1 -1
  462. package/dist/swap-props.js.map +1 -1
  463. package/dist/take-first-by.cjs +1 -1
  464. package/dist/take-first-by.cjs.map +1 -1
  465. package/dist/take-first-by.js +1 -1
  466. package/dist/take-first-by.js.map +1 -1
  467. package/dist/take-last-while.cjs +1 -1
  468. package/dist/take-last-while.cjs.map +1 -1
  469. package/dist/take-last-while.js.map +1 -1
  470. package/dist/take-last.cjs +1 -1
  471. package/dist/take-last.cjs.map +1 -1
  472. package/dist/take-last.js.map +1 -1
  473. package/dist/take-while.cjs +1 -1
  474. package/dist/take-while.cjs.map +1 -1
  475. package/dist/take-while.js.map +1 -1
  476. package/dist/take.cjs +1 -1
  477. package/dist/take.cjs.map +1 -1
  478. package/dist/take.js +1 -1
  479. package/dist/take.js.map +1 -1
  480. package/dist/tap.cjs +1 -1
  481. package/dist/tap.cjs.map +1 -1
  482. package/dist/tap.js.map +1 -1
  483. package/dist/times.cjs +1 -1
  484. package/dist/times.cjs.map +1 -1
  485. package/dist/times.js.map +1 -1
  486. package/dist/to-camel-case.cjs +1 -1
  487. package/dist/to-camel-case.cjs.map +1 -1
  488. package/dist/to-camel-case.js +1 -1
  489. package/dist/to-camel-case.js.map +1 -1
  490. package/dist/to-kebab-case.cjs +1 -1
  491. package/dist/to-kebab-case.cjs.map +1 -1
  492. package/dist/to-kebab-case.js +1 -1
  493. package/dist/to-kebab-case.js.map +1 -1
  494. package/dist/to-lower-case.cjs +1 -1
  495. package/dist/to-lower-case.cjs.map +1 -1
  496. package/dist/to-lower-case.js.map +1 -1
  497. package/dist/to-single-BOkjnmkm.cjs +2 -0
  498. package/dist/{to-single-BunGuk7o.cjs.map → to-single-BOkjnmkm.cjs.map} +1 -1
  499. package/dist/{to-single-XEXXW73e.js → to-single-D6t2BxVq.js} +1 -1
  500. package/dist/{to-single-XEXXW73e.js.map → to-single-D6t2BxVq.js.map} +1 -1
  501. package/dist/to-snake-case.cjs +1 -1
  502. package/dist/to-snake-case.cjs.map +1 -1
  503. package/dist/to-snake-case.js +1 -1
  504. package/dist/to-snake-case.js.map +1 -1
  505. package/dist/to-title-case.cjs +1 -1
  506. package/dist/to-title-case.cjs.map +1 -1
  507. package/dist/to-title-case.js +1 -1
  508. package/dist/to-title-case.js.map +1 -1
  509. package/dist/to-upper-case.cjs +1 -1
  510. package/dist/to-upper-case.cjs.map +1 -1
  511. package/dist/to-upper-case.js.map +1 -1
  512. package/dist/truncate.cjs.map +1 -1
  513. package/dist/truncate.js.map +1 -1
  514. package/dist/uncapitalize.cjs +1 -1
  515. package/dist/uncapitalize.cjs.map +1 -1
  516. package/dist/uncapitalize.js.map +1 -1
  517. package/dist/unique-by.cjs +1 -1
  518. package/dist/unique-by.cjs.map +1 -1
  519. package/dist/unique-by.js +1 -1
  520. package/dist/unique-by.js.map +1 -1
  521. package/dist/unique-with.cjs +1 -1
  522. package/dist/unique-with.cjs.map +1 -1
  523. package/dist/unique-with.js +1 -1
  524. package/dist/unique-with.js.map +1 -1
  525. package/dist/unique.cjs +1 -1
  526. package/dist/unique.cjs.map +1 -1
  527. package/dist/unique.js +1 -1
  528. package/dist/unique.js.map +1 -1
  529. package/dist/utility-evaluators-BGM19SpK.cjs +2 -0
  530. package/dist/{utility-evaluators-C8koSp9T.cjs.map → utility-evaluators-BGM19SpK.cjs.map} +1 -1
  531. package/dist/{utility-evaluators-ZAaUtL2Z.js → utility-evaluators-DDW55xeL.js} +1 -1
  532. package/dist/{utility-evaluators-ZAaUtL2Z.js.map → utility-evaluators-DDW55xeL.js.map} +1 -1
  533. package/dist/values.cjs +1 -1
  534. package/dist/values.cjs.map +1 -1
  535. package/dist/values.js.map +1 -1
  536. package/dist/when.cjs.map +1 -1
  537. package/dist/when.js.map +1 -1
  538. package/dist/{with-precision-CgRuf7Wl.js → with-precision-D-84B_By.js} +1 -1
  539. package/dist/{with-precision-CgRuf7Wl.js.map → with-precision-D-84B_By.js.map} +1 -1
  540. package/dist/{with-precision-DVi9325n.cjs → with-precision-Dy5W6bdk.cjs} +2 -2
  541. package/dist/{with-precision-DVi9325n.cjs.map → with-precision-Dy5W6bdk.cjs.map} +1 -1
  542. package/dist/{words-C8Rd_80F.cjs → words-B-9EXtsW.cjs} +2 -2
  543. package/dist/{words-C8Rd_80F.cjs.map → words-B-9EXtsW.cjs.map} +1 -1
  544. package/dist/{words-CYZ0Lyko.js → words-CN1Qil5U.js} +2 -2
  545. package/dist/{words-CYZ0Lyko.js.map → words-CN1Qil5U.js.map} +1 -1
  546. package/dist/zip-with.cjs +1 -1
  547. package/dist/zip-with.cjs.map +1 -1
  548. package/dist/zip-with.js +1 -1
  549. package/dist/zip-with.js.map +1 -1
  550. package/dist/zip.cjs +1 -1
  551. package/dist/zip.cjs.map +1 -1
  552. package/dist/zip.js.map +1 -1
  553. package/package.json +11 -11
  554. package/dist/binary-search-cutoff-index-CLFtXYPc.cjs +0 -2
  555. package/dist/conditional-3wcaMG9k.cjs +0 -2
  556. package/dist/conditional-3wcaMG9k.cjs.map +0 -1
  557. package/dist/conditional-CTEJD5TX.js +0 -2
  558. package/dist/conditional-CTEJD5TX.js.map +0 -1
  559. package/dist/heap-C0zPQGC0.cjs +0 -2
  560. package/dist/lazy-data-last-impl-B05ZpguF.cjs +0 -2
  561. package/dist/swap-in-place-D1vasegg.cjs +0 -2
  562. package/dist/to-single-BunGuk7o.cjs +0 -2
  563. package/dist/utility-evaluators-C8koSp9T.cjs +0 -2
package/dist/sum.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sum.js","names":[],"sources":["../src/sum.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Sum<T extends IterableContainer<bigint> | IterableContainer<number>>\n // Empty arrays would always result in a sum of (a non-bigint) 0.\n = T extends readonly []\n ? 0\n : // Non-empty bigint arrays will always result in a bigint sum.\n T extends readonly [bigint, ...(ReadonlyArray<unknown>)]\n ? bigint\n : // But an empty bigint array would result in a non-bigint 0.\n T[number] extends bigint\n ? bigint | 0\n : // Non-bigint arrays are always handled correctly.\n number;\n\n/**\n * Sums the numbers in the array, or return 0 for an empty 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 0 (`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 * sum(data);\n * @example\n * sum([1, 2, 3]); // => 6\n * sum([1n, 2n, 3n]); // => 6n\n * sum([]); // => 0\n * @dataFirst\n * @category Number\n */\nexport function sum<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): Sum<T>;\n\n/**\n * Sums the numbers in the array, or return 0 for an empty 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 0 (`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 * sum()(data);\n * @example\n * pipe([1, 2, 3], sum()); // => 6\n * pipe([1n, 2n, 3n], sum()); // => 6n\n * pipe([], sum()); // => 0\n * @dataLast\n * @category Number\n */\nexport function sum(): <\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(\n data: T,\n) => Sum<T>;\n\nexport function sum(...args: ReadonlyArray<unknown>): unknown {\n return curry(sumImplementation, args);\n}\n\nfunction sumImplementation<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): T[number] {\n let out = typeof data[0] === 'bigint' ? 0n : 0;\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":"mCAmEA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAO,EAAM,EAAmB,EAAK,CAGvC,SAAS,EAEP,EAAoB,CACpB,IAAI,EAAM,OAAO,EAAK,IAAO,SAAW,GAAK,EAC7C,IAAK,IAAM,KAAS,EAElB,GAAO,EAET,OAAO"}
1
+ {"version":3,"file":"sum.js","names":[],"sources":["../src/sum.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Sum<T extends IterableContainer<bigint> | IterableContainer<number>>\n // Empty arrays would always result in a sum of (a non-bigint) 0.\n = T extends readonly []\n ? 0\n : // Non-empty bigint arrays will always result in a bigint sum.\n T extends readonly [bigint, ...(ReadonlyArray<unknown>)]\n ? bigint\n : // But an empty bigint array would result in a non-bigint 0.\n T[number] extends bigint\n ? bigint | 0\n : // Non-bigint arrays are always handled correctly.\n number;\n\n/**\n * Sums the numbers in the array, or return 0 for an empty 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 0 (`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 * sum(data);\n * @example\n * sum([1, 2, 3]); // => 6\n * sum([1n, 2n, 3n]); // => 6n\n * sum([]); // => 0\n * @dataFirst\n * @category Number\n */\nexport function sum<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): Sum<T>;\n\n/**\n * Sums the numbers in the array, or return 0 for an empty 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 0 (`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 * sum()(data);\n * @example\n * pipe([1, 2, 3], sum()); // => 6\n * pipe([1n, 2n, 3n], sum()); // => 6n\n * pipe([], sum()); // => 0\n * @dataLast\n * @category Number\n */\nexport function sum(): <\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(\n data: T,\n) => Sum<T>;\n\nexport function sum(...args: ReadonlyArray<unknown>): unknown {\n return curry(sumImplementation, args);\n}\n\nfunction sumImplementation<\n T extends IterableContainer<bigint> | IterableContainer<number>,\n>(data: T): T[number] {\n let out = typeof data[0] === 'bigint' ? 0n : 0;\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":"mCAmEA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAO,EAAM,EAAmB,CAAI,CACtC,CAEA,SAAS,EAEP,EAAoB,CACpB,IAAI,EAAM,OAAO,EAAK,IAAO,SAAW,GAAK,EAC7C,IAAK,IAAM,KAAS,EAElB,GAAO,EAET,OAAO,CACT"}
@@ -0,0 +1,2 @@
1
+ function e(e,t,n){[e[t],e[n]]=[e[n],e[t]]}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
2
+ //# sourceMappingURL=swap-in-place-CllcD0HG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap-in-place-D1vasegg.cjs","names":[],"sources":["../src/internal/swap-in-place.ts"],"sourcesContent":["/**\n * An efficient hack to swap the values at two indices in an array *in-place*.\n */\nexport function swapInPlace(\n data: Array<unknown>,\n i: number,\n j: number,\n): void {\n // We use destructuring to perform an in-place swap *without* needing a\n // temporary variable\n [data[i], data[j]] = [data[j], data[i]];\n}\n"],"mappings":"AAGA,SAAgB,EACd,EACA,EACA,EACM,CAGN,CAAC,EAAK,GAAI,EAAK,IAAM,CAAC,EAAK,GAAI,EAAK,GAAG"}
1
+ {"version":3,"file":"swap-in-place-CllcD0HG.cjs","names":[],"sources":["../src/internal/swap-in-place.ts"],"sourcesContent":["/**\n * An efficient hack to swap the values at two indices in an array *in-place*.\n */\nexport function swapInPlace(\n data: Array<unknown>,\n i: number,\n j: number,\n): void {\n // We use destructuring to perform an in-place swap *without* needing a\n // temporary variable\n [data[i], data[j]] = [data[j], data[i]];\n}\n"],"mappings":"AAGA,SAAgB,EACd,EACA,EACA,EACM,CAGN,CAAC,EAAK,GAAI,EAAK,IAAM,CAAC,EAAK,GAAI,EAAK,EAAE,CACxC"}
@@ -1,2 +1,2 @@
1
1
  function e(e,t,n){[e[t],e[n]]=[e[n],e[t]]}export{e as t};
2
- //# sourceMappingURL=swap-in-place-BzNaxwB3.js.map
2
+ //# sourceMappingURL=swap-in-place-ubtnp8en.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap-in-place-BzNaxwB3.js","names":[],"sources":["../src/internal/swap-in-place.ts"],"sourcesContent":["/**\n * An efficient hack to swap the values at two indices in an array *in-place*.\n */\nexport function swapInPlace(\n data: Array<unknown>,\n i: number,\n j: number,\n): void {\n // We use destructuring to perform an in-place swap *without* needing a\n // temporary variable\n [data[i], data[j]] = [data[j], data[i]];\n}\n"],"mappings":"AAGA,SAAgB,EACd,EACA,EACA,EACM,CAGN,CAAC,EAAK,GAAI,EAAK,IAAM,CAAC,EAAK,GAAI,EAAK,GAAG"}
1
+ {"version":3,"file":"swap-in-place-ubtnp8en.js","names":[],"sources":["../src/internal/swap-in-place.ts"],"sourcesContent":["/**\n * An efficient hack to swap the values at two indices in an array *in-place*.\n */\nexport function swapInPlace(\n data: Array<unknown>,\n i: number,\n j: number,\n): void {\n // We use destructuring to perform an in-place swap *without* needing a\n // temporary variable\n [data[i], data[j]] = [data[j], data[i]];\n}\n"],"mappings":"AAGA,SAAgB,EACd,EACA,EACA,EACM,CAGN,CAAC,EAAK,GAAI,EAAK,IAAM,CAAC,EAAK,GAAI,EAAK,EAAE,CACxC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t,n){return typeof e==`string`?r([...e],t,n).join(``):r(e,t,n)}function r(e,t,n){let r=[...e];if(Number.isNaN(t)||Number.isNaN(n))return r;let i=t<0?e.length+t:t,a=n<0?e.length+n:n;return i<0||i>e.length||a<0||a>e.length?r:(r[i]=e[a],r[a]=e[i],r)}exports.swapIndices=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 typeof e==`string`?r([...e],t,n).join(``):r(e,t,n)}function r(e,t,n){let r=[...e];if(Number.isNaN(t)||Number.isNaN(n))return r;let i=t<0?e.length+t:t,a=n<0?e.length+n:n;return i<0||i>e.length||a<0||a>e.length?r:(r[i]=e[a],r[a]=e[i],r)}exports.swapIndices=t;
2
2
  //# sourceMappingURL=swap-indices.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap-indices.cjs","names":["curry"],"sources":["../src/swap-indices.ts"],"sourcesContent":["import type { And, IsEqual, Join } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Difference<A extends number, B extends number>\n = TupleOfLength<A> extends [...infer U, ...TupleOfLength<B>]\n ? U['length']\n : never;\n\ntype isLessThan<A extends number, B extends number>\n = IsEqual<A, B> extends true\n ? false\n : 0 extends A\n ? true\n : 0 extends B\n ? false\n : isLessThan<Difference<A, 1>, Difference<B, 1>>;\n\ntype TupleOfLength<\n L extends number,\n T extends IterableContainer = [],\n> = T['length'] extends L ? T : TupleOfLength<L, [...T, unknown]>;\n\ntype IsNonNegative<T extends number> = number extends T\n ? false\n : `${T}` extends `-${string}`\n ? false\n : true;\n\ntype CharactersTuple<T extends string> = string extends T\n ? Array<string>\n : T extends `${infer C}${infer R}`\n ? [C, ...CharactersTuple<R>]\n : [];\n\ntype SwapArrayInternal<\n T extends IterableContainer,\n Index1 extends number,\n Index2 extends number,\n Position extends ReadonlyArray<unknown> = [],\n Original extends IterableContainer = T,\n> = T extends readonly [infer AtPosition, ...infer Rest]\n ? [\n Position['length'] extends Index1\n ? Original[Index2]\n : Position['length'] extends Index2\n ? Original[Index1]\n : AtPosition,\n ...SwapArrayInternal<\n Rest,\n Index1,\n Index2,\n [unknown, ...Position],\n Original\n >,\n ]\n : T;\n\ntype SwapString<T extends string, K1 extends number, K2 extends number> = Join<\n SwapArray<CharactersTuple<T>, K1, K2>,\n ''\n>;\n\ntype SwapArray<\n T extends IterableContainer,\n K1 extends number,\n K2 extends number,\n>\n = And<IsNonNegative<K1>, IsNonNegative<K2>> extends true\n ? And<isLessThan<K1, T['length']>, isLessThan<K2, T['length']>> extends true\n ? SwapArrayInternal<T, K1, K2>\n : // If the indices are not within the input arrays range the result would\n // be trivially the same as the input array.\n T\n :\n Array<T[number]>;\n\ntype SwappedIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n> = T extends string\n ? SwapString<T, K1, K2>\n : T extends IterableContainer\n ? SwapArray<T, K1, K2>\n : never;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * @param data - The item to be manipulated. This can be an array, or a string.\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(data, index1, index2)\n * @example\n * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']\n * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']\n * swapIndices('abc', 0, 1) // => 'bac'\n * @dataFirst\n * @category Array\n */\nexport function swapIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n>(data: T, index1: K1, index2: K2): SwappedIndices<T, K1, K2>;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(index1, index2)(data)\n * @example\n * swapIndices(0, 1)(['a', 'b', 'c']) // => ['b', 'a', 'c']\n * swapIndices(0, -1)('abc') // => 'cba'\n * @dataLast\n * @category Array\n */\nexport function swapIndices<K1 extends number, K2 extends number>(\n index1: K1,\n index2: K2,\n): <T extends IterableContainer | string>(data: T) => SwappedIndices<T, K1, K2>;\n\nexport function swapIndices(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapIndicesImplementation, args);\n}\n\nfunction swapIndicesImplementation(data: IterableContainer | string, index1: number, index2: number): unknown {\n return typeof data === 'string'\n ? swapArray([...data], index1, index2).join('')\n : swapArray(data, index1, index2);\n}\n\nfunction swapArray(\n data: ReadonlyArray<unknown>,\n index1: number,\n index2: number,\n): Array<unknown> {\n const result = [...data];\n\n if (Number.isNaN(index1) || Number.isNaN(index2)) {\n return result;\n }\n\n const positiveIndexA = index1 < 0 ? data.length + index1 : index1;\n const positiveIndexB = index2 < 0 ? data.length + index2 : index2;\n\n if (positiveIndexA < 0 || positiveIndexA > data.length) {\n return result;\n }\n\n if (positiveIndexB < 0 || positiveIndexB > data.length) {\n return result;\n }\n\n result[positiveIndexA] = data[positiveIndexB];\n result[positiveIndexB] = data[positiveIndexA];\n\n return result;\n}\n"],"mappings":"kGAwIA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,MAAM,EAA2B,EAAK,CAG/C,SAAS,EAA0B,EAAkC,EAAgB,EAAyB,CAC5G,OAAO,OAAO,GAAS,SACnB,EAAU,CAAC,GAAG,EAAK,CAAE,EAAQ,EAAO,CAAC,KAAK,GAAG,CAC7C,EAAU,EAAM,EAAQ,EAAO,CAGrC,SAAS,EACP,EACA,EACA,EACgB,CAChB,IAAM,EAAS,CAAC,GAAG,EAAK,CAExB,GAAI,OAAO,MAAM,EAAO,EAAI,OAAO,MAAM,EAAO,CAC9C,OAAO,EAGT,IAAM,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EACrD,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EAa3D,OAXI,EAAiB,GAAK,EAAiB,EAAK,QAI5C,EAAiB,GAAK,EAAiB,EAAK,OACvC,GAGT,EAAO,GAAkB,EAAK,GAC9B,EAAO,GAAkB,EAAK,GAEvB"}
1
+ {"version":3,"file":"swap-indices.cjs","names":["curry"],"sources":["../src/swap-indices.ts"],"sourcesContent":["import type { IsEqual, Join } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Difference<A extends number, B extends number>\n = TupleOfLength<A> extends [...infer U, ...TupleOfLength<B>]\n ? U['length']\n : never;\n\ntype isLessThan<A extends number, B extends number>\n = IsEqual<A, B> extends true\n ? false\n : 0 extends A\n ? true\n : 0 extends B\n ? false\n : isLessThan<Difference<A, 1>, Difference<B, 1>>;\n\ntype TupleOfLength<\n L extends number,\n T extends IterableContainer = [],\n> = T['length'] extends L ? T : TupleOfLength<L, [...T, unknown]>;\n\ntype IsNonNegative<T extends number> = number extends T\n ? false\n : `${T}` extends `-${string}`\n ? false\n : true;\n\ntype CharactersTuple<T extends string> = string extends T\n ? Array<string>\n : T extends `${infer C}${infer R}`\n ? [C, ...CharactersTuple<R>]\n : [];\n\ntype SwapArrayInternal<\n T extends IterableContainer,\n Index1 extends number,\n Index2 extends number,\n Position extends ReadonlyArray<unknown> = [],\n Original extends IterableContainer = T,\n> = T extends readonly [infer AtPosition, ...infer Rest]\n ? [\n Position['length'] extends Index1\n ? Original[Index2]\n : Position['length'] extends Index2\n ? Original[Index1]\n : AtPosition,\n ...SwapArrayInternal<\n Rest,\n Index1,\n Index2,\n [unknown, ...Position],\n Original\n >,\n ]\n : T;\n\ntype SwapString<T extends string, K1 extends number, K2 extends number> = Join<\n SwapArray<CharactersTuple<T>, K1, K2>,\n ''\n>;\n\ntype SwapArray<\n T extends IterableContainer,\n K1 extends number,\n K2 extends number,\n>\n = IsNonNegative<K1> extends true\n ? IsNonNegative<K2> extends true\n ? isLessThan<K1, T['length']> extends true\n ? isLessThan<K2, T['length']> extends true\n ? SwapArrayInternal<T, K1, K2>\n : // If the indices are not within the input arrays range the result\n // would be trivially the same as the input array.\n T\n : T\n : // TODO [>3]: Because of limitations on the typescript version used in Remeda we can't build a proper Absolute number type so we can't implement proper typing for negative indices and have to opt for a less-strict type instead. Check out the history for the PR that introduced this TODO to see how it could be implemented.\n Array<T[number]>\n : Array<T[number]>;\n\ntype SwappedIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n> = T extends string\n ? SwapString<T, K1, K2>\n : T extends IterableContainer\n ? SwapArray<T, K1, K2>\n : never;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * Related operations:\n * - `splice` - for more general positional edits (remove a slice, insert at an index).\n *\n * @param data - The item to be manipulated. This can be an array, or a string.\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(data, index1, index2)\n * @example\n * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']\n * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']\n * swapIndices('abc', 0, 1) // => 'bac'\n * @dataFirst\n * @category Array\n */\nexport function swapIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n>(data: T, index1: K1, index2: K2): SwappedIndices<T, K1, K2>;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * Related operations:\n * - `splice` - for more general positional edits (remove a slice, insert at an index).\n *\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(index1, index2)(data)\n * @example\n * swapIndices(0, 1)(['a', 'b', 'c']) // => ['b', 'a', 'c']\n * swapIndices(0, -1)('abc') // => 'cba'\n * @dataLast\n * @category Array\n */\nexport function swapIndices<K1 extends number, K2 extends number>(\n index1: K1,\n index2: K2,\n): <T extends IterableContainer | string>(data: T) => SwappedIndices<T, K1, K2>;\n\nexport function swapIndices(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapIndicesImplementation, args);\n}\n\nfunction swapIndicesImplementation(data: IterableContainer | string, index1: number, index2: number): unknown {\n return typeof data === 'string'\n ? swapArray([...data], index1, index2).join('')\n : swapArray(data, index1, index2);\n}\n\nfunction swapArray(\n data: ReadonlyArray<unknown>,\n index1: number,\n index2: number,\n): Array<unknown> {\n const result = [...data];\n\n if (Number.isNaN(index1) || Number.isNaN(index2)) {\n return result;\n }\n\n const positiveIndexA = index1 < 0 ? data.length + index1 : index1;\n const positiveIndexB = index2 < 0 ? data.length + index2 : index2;\n\n if (positiveIndexA < 0 || positiveIndexA > data.length) {\n return result;\n }\n\n if (positiveIndexB < 0 || positiveIndexB > data.length) {\n return result;\n }\n\n result[positiveIndexA] = data[positiveIndexB];\n result[positiveIndexB] = data[positiveIndexA];\n\n return result;\n}\n"],"mappings":"kGAkJA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,MAAM,EAA2B,CAAI,CAC9C,CAEA,SAAS,EAA0B,EAAkC,EAAgB,EAAyB,CAC5G,OAAO,OAAO,GAAS,SACnB,EAAU,CAAC,GAAG,CAAI,EAAG,EAAQ,CAAM,CAAC,CAAC,KAAK,EAAE,EAC5C,EAAU,EAAM,EAAQ,CAAM,CACpC,CAEA,SAAS,EACP,EACA,EACA,EACgB,CAChB,IAAM,EAAS,CAAC,GAAG,CAAI,EAEvB,GAAI,OAAO,MAAM,CAAM,GAAK,OAAO,MAAM,CAAM,EAC7C,OAAO,EAGT,IAAM,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EACrD,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EAa3D,OAXI,EAAiB,GAAK,EAAiB,EAAK,QAI5C,EAAiB,GAAK,EAAiB,EAAK,OACvC,GAGT,EAAO,GAAkB,EAAK,GAC9B,EAAO,GAAkB,EAAK,GAEvB,EACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"swap-indices.js","names":[],"sources":["../src/swap-indices.ts"],"sourcesContent":["import type { And, IsEqual, Join } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Difference<A extends number, B extends number>\n = TupleOfLength<A> extends [...infer U, ...TupleOfLength<B>]\n ? U['length']\n : never;\n\ntype isLessThan<A extends number, B extends number>\n = IsEqual<A, B> extends true\n ? false\n : 0 extends A\n ? true\n : 0 extends B\n ? false\n : isLessThan<Difference<A, 1>, Difference<B, 1>>;\n\ntype TupleOfLength<\n L extends number,\n T extends IterableContainer = [],\n> = T['length'] extends L ? T : TupleOfLength<L, [...T, unknown]>;\n\ntype IsNonNegative<T extends number> = number extends T\n ? false\n : `${T}` extends `-${string}`\n ? false\n : true;\n\ntype CharactersTuple<T extends string> = string extends T\n ? Array<string>\n : T extends `${infer C}${infer R}`\n ? [C, ...CharactersTuple<R>]\n : [];\n\ntype SwapArrayInternal<\n T extends IterableContainer,\n Index1 extends number,\n Index2 extends number,\n Position extends ReadonlyArray<unknown> = [],\n Original extends IterableContainer = T,\n> = T extends readonly [infer AtPosition, ...infer Rest]\n ? [\n Position['length'] extends Index1\n ? Original[Index2]\n : Position['length'] extends Index2\n ? Original[Index1]\n : AtPosition,\n ...SwapArrayInternal<\n Rest,\n Index1,\n Index2,\n [unknown, ...Position],\n Original\n >,\n ]\n : T;\n\ntype SwapString<T extends string, K1 extends number, K2 extends number> = Join<\n SwapArray<CharactersTuple<T>, K1, K2>,\n ''\n>;\n\ntype SwapArray<\n T extends IterableContainer,\n K1 extends number,\n K2 extends number,\n>\n = And<IsNonNegative<K1>, IsNonNegative<K2>> extends true\n ? And<isLessThan<K1, T['length']>, isLessThan<K2, T['length']>> extends true\n ? SwapArrayInternal<T, K1, K2>\n : // If the indices are not within the input arrays range the result would\n // be trivially the same as the input array.\n T\n :\n Array<T[number]>;\n\ntype SwappedIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n> = T extends string\n ? SwapString<T, K1, K2>\n : T extends IterableContainer\n ? SwapArray<T, K1, K2>\n : never;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * @param data - The item to be manipulated. This can be an array, or a string.\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(data, index1, index2)\n * @example\n * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']\n * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']\n * swapIndices('abc', 0, 1) // => 'bac'\n * @dataFirst\n * @category Array\n */\nexport function swapIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n>(data: T, index1: K1, index2: K2): SwappedIndices<T, K1, K2>;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(index1, index2)(data)\n * @example\n * swapIndices(0, 1)(['a', 'b', 'c']) // => ['b', 'a', 'c']\n * swapIndices(0, -1)('abc') // => 'cba'\n * @dataLast\n * @category Array\n */\nexport function swapIndices<K1 extends number, K2 extends number>(\n index1: K1,\n index2: K2,\n): <T extends IterableContainer | string>(data: T) => SwappedIndices<T, K1, K2>;\n\nexport function swapIndices(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapIndicesImplementation, args);\n}\n\nfunction swapIndicesImplementation(data: IterableContainer | string, index1: number, index2: number): unknown {\n return typeof data === 'string'\n ? swapArray([...data], index1, index2).join('')\n : swapArray(data, index1, index2);\n}\n\nfunction swapArray(\n data: ReadonlyArray<unknown>,\n index1: number,\n index2: number,\n): Array<unknown> {\n const result = [...data];\n\n if (Number.isNaN(index1) || Number.isNaN(index2)) {\n return result;\n }\n\n const positiveIndexA = index1 < 0 ? data.length + index1 : index1;\n const positiveIndexB = index2 < 0 ? data.length + index2 : index2;\n\n if (positiveIndexA < 0 || positiveIndexA > data.length) {\n return result;\n }\n\n if (positiveIndexB < 0 || positiveIndexB > data.length) {\n return result;\n }\n\n result[positiveIndexA] = data[positiveIndexB];\n result[positiveIndexB] = data[positiveIndexA];\n\n return result;\n}\n"],"mappings":"mCAwIA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAAM,EAA2B,EAAK,CAG/C,SAAS,EAA0B,EAAkC,EAAgB,EAAyB,CAC5G,OAAO,OAAO,GAAS,SACnB,EAAU,CAAC,GAAG,EAAK,CAAE,EAAQ,EAAO,CAAC,KAAK,GAAG,CAC7C,EAAU,EAAM,EAAQ,EAAO,CAGrC,SAAS,EACP,EACA,EACA,EACgB,CAChB,IAAM,EAAS,CAAC,GAAG,EAAK,CAExB,GAAI,OAAO,MAAM,EAAO,EAAI,OAAO,MAAM,EAAO,CAC9C,OAAO,EAGT,IAAM,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EACrD,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EAa3D,OAXI,EAAiB,GAAK,EAAiB,EAAK,QAI5C,EAAiB,GAAK,EAAiB,EAAK,OACvC,GAGT,EAAO,GAAkB,EAAK,GAC9B,EAAO,GAAkB,EAAK,GAEvB"}
1
+ {"version":3,"file":"swap-indices.js","names":[],"sources":["../src/swap-indices.ts"],"sourcesContent":["import type { IsEqual, Join } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Difference<A extends number, B extends number>\n = TupleOfLength<A> extends [...infer U, ...TupleOfLength<B>]\n ? U['length']\n : never;\n\ntype isLessThan<A extends number, B extends number>\n = IsEqual<A, B> extends true\n ? false\n : 0 extends A\n ? true\n : 0 extends B\n ? false\n : isLessThan<Difference<A, 1>, Difference<B, 1>>;\n\ntype TupleOfLength<\n L extends number,\n T extends IterableContainer = [],\n> = T['length'] extends L ? T : TupleOfLength<L, [...T, unknown]>;\n\ntype IsNonNegative<T extends number> = number extends T\n ? false\n : `${T}` extends `-${string}`\n ? false\n : true;\n\ntype CharactersTuple<T extends string> = string extends T\n ? Array<string>\n : T extends `${infer C}${infer R}`\n ? [C, ...CharactersTuple<R>]\n : [];\n\ntype SwapArrayInternal<\n T extends IterableContainer,\n Index1 extends number,\n Index2 extends number,\n Position extends ReadonlyArray<unknown> = [],\n Original extends IterableContainer = T,\n> = T extends readonly [infer AtPosition, ...infer Rest]\n ? [\n Position['length'] extends Index1\n ? Original[Index2]\n : Position['length'] extends Index2\n ? Original[Index1]\n : AtPosition,\n ...SwapArrayInternal<\n Rest,\n Index1,\n Index2,\n [unknown, ...Position],\n Original\n >,\n ]\n : T;\n\ntype SwapString<T extends string, K1 extends number, K2 extends number> = Join<\n SwapArray<CharactersTuple<T>, K1, K2>,\n ''\n>;\n\ntype SwapArray<\n T extends IterableContainer,\n K1 extends number,\n K2 extends number,\n>\n = IsNonNegative<K1> extends true\n ? IsNonNegative<K2> extends true\n ? isLessThan<K1, T['length']> extends true\n ? isLessThan<K2, T['length']> extends true\n ? SwapArrayInternal<T, K1, K2>\n : // If the indices are not within the input arrays range the result\n // would be trivially the same as the input array.\n T\n : T\n : // TODO [>3]: Because of limitations on the typescript version used in Remeda we can't build a proper Absolute number type so we can't implement proper typing for negative indices and have to opt for a less-strict type instead. Check out the history for the PR that introduced this TODO to see how it could be implemented.\n Array<T[number]>\n : Array<T[number]>;\n\ntype SwappedIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n> = T extends string\n ? SwapString<T, K1, K2>\n : T extends IterableContainer\n ? SwapArray<T, K1, K2>\n : never;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * Related operations:\n * - `splice` - for more general positional edits (remove a slice, insert at an index).\n *\n * @param data - The item to be manipulated. This can be an array, or a string.\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(data, index1, index2)\n * @example\n * swapIndices(['a', 'b', 'c'], 0, 1) // => ['b', 'a', 'c']\n * swapIndices(['a', 'b', 'c'], 1, -1) // => ['a', 'c', 'b']\n * swapIndices('abc', 0, 1) // => 'bac'\n * @dataFirst\n * @category Array\n */\nexport function swapIndices<\n T extends IterableContainer | string,\n K1 extends number,\n K2 extends number,\n>(data: T, index1: K1, index2: K2): SwappedIndices<T, K1, K2>;\n\n/**\n * Swaps the positions of two elements in an array or string at the provided indices.\n *\n * Negative indices are supported and would be treated as an offset from the end of the array. The resulting type thought would be less strict than when using positive indices.\n *\n * If either index is out of bounds the result would be a shallow copy of the input, as-is.\n *\n * Related operations:\n * - `splice` - for more general positional edits (remove a slice, insert at an index).\n *\n * @param index1 - The first index.\n * @param index2 - The second index.\n * @returns Returns the manipulated array or string.\n * @signature\n * swapIndices(index1, index2)(data)\n * @example\n * swapIndices(0, 1)(['a', 'b', 'c']) // => ['b', 'a', 'c']\n * swapIndices(0, -1)('abc') // => 'cba'\n * @dataLast\n * @category Array\n */\nexport function swapIndices<K1 extends number, K2 extends number>(\n index1: K1,\n index2: K2,\n): <T extends IterableContainer | string>(data: T) => SwappedIndices<T, K1, K2>;\n\nexport function swapIndices(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapIndicesImplementation, args);\n}\n\nfunction swapIndicesImplementation(data: IterableContainer | string, index1: number, index2: number): unknown {\n return typeof data === 'string'\n ? swapArray([...data], index1, index2).join('')\n : swapArray(data, index1, index2);\n}\n\nfunction swapArray(\n data: ReadonlyArray<unknown>,\n index1: number,\n index2: number,\n): Array<unknown> {\n const result = [...data];\n\n if (Number.isNaN(index1) || Number.isNaN(index2)) {\n return result;\n }\n\n const positiveIndexA = index1 < 0 ? data.length + index1 : index1;\n const positiveIndexB = index2 < 0 ? data.length + index2 : index2;\n\n if (positiveIndexA < 0 || positiveIndexA > data.length) {\n return result;\n }\n\n if (positiveIndexB < 0 || positiveIndexB > data.length) {\n return result;\n }\n\n result[positiveIndexA] = data[positiveIndexB];\n result[positiveIndexB] = data[positiveIndexA];\n\n return result;\n}\n"],"mappings":"mCAkJA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAAM,EAA2B,CAAI,CAC9C,CAEA,SAAS,EAA0B,EAAkC,EAAgB,EAAyB,CAC5G,OAAO,OAAO,GAAS,SACnB,EAAU,CAAC,GAAG,CAAI,EAAG,EAAQ,CAAM,CAAC,CAAC,KAAK,EAAE,EAC5C,EAAU,EAAM,EAAQ,CAAM,CACpC,CAEA,SAAS,EACP,EACA,EACA,EACgB,CAChB,IAAM,EAAS,CAAC,GAAG,CAAI,EAEvB,GAAI,OAAO,MAAM,CAAM,GAAK,OAAO,MAAM,CAAM,EAC7C,OAAO,EAGT,IAAM,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EACrD,EAAiB,EAAS,EAAI,EAAK,OAAS,EAAS,EAa3D,OAXI,EAAiB,GAAK,EAAiB,EAAK,QAI5C,EAAiB,GAAK,EAAiB,EAAK,OACvC,GAGT,EAAO,GAAkB,EAAK,GAC9B,EAAO,GAAkB,EAAK,GAEvB,EACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t,n){let{[t]:r,[n]:i}=e;return{...e,[t]:i,[n]:r}}exports.swapProps=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{[t]:r,[n]:i}=e;return{...e,[t]:i,[n]:r}}exports.swapProps=t;
2
2
  //# sourceMappingURL=swap-props.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap-props.cjs","names":["curry"],"sources":["../src/swap-props.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype SwappedProps<T, K1 extends keyof T, K2 extends keyof T> = {\n [K in keyof T]: T[K1 extends K ? K2 : K2 extends K ? K1 : K];\n};\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param data - The object to be manipulated.\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(data, key1, key2)\n * @example\n * swapProps({a: 1, b: 2, c: 3}, 'a', 'b') // => {a: 2, b: 1, c: 3}\n * @dataFirst\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(data: T, key1: K1, key2: K2): SwappedProps<T, K1, K2>;\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(key1, key2)(data)\n * @example\n * swapProps('a', 'b')({a: 1, b: 2, c: 3}) // => {a: 2, b: 1, c: 3}\n * @dataLast\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(key1: K1, key2: K2): (data: T) => SwappedProps<T, K1, K2>;\n\nexport function swapProps(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapPropsImplementation, args);\n}\n\nfunction swapPropsImplementation<T extends object>(\n obj: T,\n key1: keyof T,\n key2: keyof T,\n): Record<PropertyKey, unknown> {\n const { [key1]: value1, [key2]: value2 } = obj;\n return {\n ...obj,\n [key1]: value2,\n [key2]: value1,\n };\n}\n"],"mappings":"kGA6CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,EAAK,CAG7C,SAAS,EACP,EACA,EACA,EAC8B,CAC9B,GAAM,EAAG,GAAO,GAAS,GAAO,GAAW,EAC3C,MAAO,CACL,GAAG,GACF,GAAO,GACP,GAAO,EACT"}
1
+ {"version":3,"file":"swap-props.cjs","names":["curry"],"sources":["../src/swap-props.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype SwappedProps<T, K1 extends keyof T, K2 extends keyof T> = {\n [K in keyof T]: T[K1 extends K ? K2 : K2 extends K ? K1 : K];\n};\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param data - The object to be manipulated.\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(data, key1, key2)\n * @example\n * swapProps({a: 1, b: 2, c: 3}, 'a', 'b') // => {a: 2, b: 1, c: 3}\n * @dataFirst\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(data: T, key1: K1, key2: K2): SwappedProps<T, K1, K2>;\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(key1, key2)(data)\n * @example\n * swapProps('a', 'b')({a: 1, b: 2, c: 3}) // => {a: 2, b: 1, c: 3}\n * @dataLast\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(key1: K1, key2: K2): (data: T) => SwappedProps<T, K1, K2>;\n\nexport function swapProps(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapPropsImplementation, args);\n}\n\nfunction swapPropsImplementation<T extends object>(\n obj: T,\n key1: keyof T,\n key2: keyof T,\n): Record<PropertyKey, unknown> {\n const { [key1]: value1, [key2]: value2 } = obj;\n return {\n ...obj,\n [key1]: value2,\n [key2]: value1,\n };\n}\n"],"mappings":"kGA6CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACA,EAC8B,CAC9B,GAAM,EAAG,GAAO,GAAS,GAAO,GAAW,EAC3C,MAAO,CACL,GAAG,GACF,GAAO,GACP,GAAO,CACV,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"swap-props.js","names":[],"sources":["../src/swap-props.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype SwappedProps<T, K1 extends keyof T, K2 extends keyof T> = {\n [K in keyof T]: T[K1 extends K ? K2 : K2 extends K ? K1 : K];\n};\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param data - The object to be manipulated.\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(data, key1, key2)\n * @example\n * swapProps({a: 1, b: 2, c: 3}, 'a', 'b') // => {a: 2, b: 1, c: 3}\n * @dataFirst\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(data: T, key1: K1, key2: K2): SwappedProps<T, K1, K2>;\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(key1, key2)(data)\n * @example\n * swapProps('a', 'b')({a: 1, b: 2, c: 3}) // => {a: 2, b: 1, c: 3}\n * @dataLast\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(key1: K1, key2: K2): (data: T) => SwappedProps<T, K1, K2>;\n\nexport function swapProps(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapPropsImplementation, args);\n}\n\nfunction swapPropsImplementation<T extends object>(\n obj: T,\n key1: keyof T,\n key2: keyof T,\n): Record<PropertyKey, unknown> {\n const { [key1]: value1, [key2]: value2 } = obj;\n return {\n ...obj,\n [key1]: value2,\n [key2]: value1,\n };\n}\n"],"mappings":"mCA6CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,EAAK,CAG7C,SAAS,EACP,EACA,EACA,EAC8B,CAC9B,GAAM,EAAG,GAAO,GAAS,GAAO,GAAW,EAC3C,MAAO,CACL,GAAG,GACF,GAAO,GACP,GAAO,EACT"}
1
+ {"version":3,"file":"swap-props.js","names":[],"sources":["../src/swap-props.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype SwappedProps<T, K1 extends keyof T, K2 extends keyof T> = {\n [K in keyof T]: T[K1 extends K ? K2 : K2 extends K ? K1 : K];\n};\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param data - The object to be manipulated.\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(data, key1, key2)\n * @example\n * swapProps({a: 1, b: 2, c: 3}, 'a', 'b') // => {a: 2, b: 1, c: 3}\n * @dataFirst\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(data: T, key1: K1, key2: K2): SwappedProps<T, K1, K2>;\n\n/**\n * Swaps the values of two properties in an object based on the provided keys.\n *\n * @param key1 - The first property key.\n * @param key2 - The second property key.\n * @returns Returns the manipulated object.\n * @signature\n * swapProps(key1, key2)(data)\n * @example\n * swapProps('a', 'b')({a: 1, b: 2, c: 3}) // => {a: 2, b: 1, c: 3}\n * @dataLast\n * @category Object\n */\nexport function swapProps<\n T extends object,\n K1 extends keyof T,\n K2 extends keyof T,\n>(key1: K1, key2: K2): (data: T) => SwappedProps<T, K1, K2>;\n\nexport function swapProps(...args: ReadonlyArray<unknown>): unknown {\n return curry(swapPropsImplementation, args);\n}\n\nfunction swapPropsImplementation<T extends object>(\n obj: T,\n key1: keyof T,\n key2: keyof T,\n): Record<PropertyKey, unknown> {\n const { [key1]: value1, [key2]: value2 } = obj;\n return {\n ...obj,\n [key1]: value2,\n [key2]: value1,\n };\n}\n"],"mappings":"mCA6CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACA,EAC8B,CAC9B,GAAM,EAAG,GAAO,GAAS,GAAO,GAAW,EAC3C,MAAO,CACL,GAAG,GACF,GAAO,GACP,GAAO,CACV,CACF"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry-order-rules-DsJSy3gX.cjs`),t=require(`./heap-C0zPQGC0.cjs`);function n(...t){return e.n(r,t)}function r(e,n,r){if(r<=0)return[];if(r>=e.length)return[...e];let i=e.slice(0,r);t.n(i,n);let a=e.slice(r);for(let e of a)t.t(i,n,e);return i}exports.takeFirstBy=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry-order-rules-CacOTzfW.cjs"),t=require("./heap-BK0Y5t1Y.cjs");function n(...t){return e.n(r,t)}function r(e,n,r){if(r<=0)return[];if(r>=e.length)return[...e];let i=e.slice(0,r);t.n(i,n);let a=e.slice(r);for(let e of a)t.t(i,n,e);return i}exports.takeFirstBy=n;
2
2
  //# sourceMappingURL=take-first-by.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"take-first-by.cjs","names":["curryOrderRulesWithArgument"],"sources":["../src/take-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(data, n, ...rules);\n * @example\n * takeFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aa', 'a']\n * @dataFirst\n * @category Array\n */\nexport function takeFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], takeFirstBy(2, x => x.length)); // => ['aa', 'a']\n * @dataLast\n * @category Array\n */\nexport function takeFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function takeFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(takeFirstByImplementation, args);\n}\n\nfunction takeFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n <= 0) {\n return [];\n }\n\n if (n >= data.length) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const rest = data.slice(n);\n for (const item of rest) {\n heapMaybeInsert(heap, compareFn, item);\n }\n\n return heap;\n}\n"],"mappings":"wJAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,EAA4B,EAA2B,EAAK,CAGrE,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EACP,MAAO,EAAE,CAGX,GAAI,GAAK,EAAK,OACZ,MAAO,CAAC,GAAG,EAAK,CAGlB,IAAM,EAAO,EAAK,MAAM,EAAG,EAAE,CAC7B,EAAA,EAAQ,EAAM,EAAU,CAExB,IAAM,EAAO,EAAK,MAAM,EAAE,CAC1B,IAAK,IAAM,KAAQ,EACjB,EAAA,EAAgB,EAAM,EAAW,EAAK,CAGxC,OAAO"}
1
+ {"version":3,"file":"take-first-by.cjs","names":["curryOrderRulesWithArgument"],"sources":["../src/take-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(data, n, ...rules);\n * @example\n * takeFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aa', 'a']\n * @dataFirst\n * @category Array\n */\nexport function takeFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], takeFirstBy(2, x => x.length)); // => ['aa', 'a']\n * @dataLast\n * @category Array\n */\nexport function takeFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function takeFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(takeFirstByImplementation, args);\n}\n\nfunction takeFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n <= 0) {\n return [];\n }\n\n if (n >= data.length) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const rest = data.slice(n);\n for (const item of rest) {\n heapMaybeInsert(heap, compareFn, item);\n }\n\n return heap;\n}\n"],"mappings":"wJAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,EAA4B,EAA2B,CAAI,CACpE,CAEA,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EACP,MAAO,CAAC,EAGV,GAAI,GAAK,EAAK,OACZ,MAAO,CAAC,GAAG,CAAI,EAGjB,IAAM,EAAO,EAAK,MAAM,EAAG,CAAC,EAC5B,EAAA,EAAQ,EAAM,CAAS,EAEvB,IAAM,EAAO,EAAK,MAAM,CAAC,EACzB,IAAK,IAAM,KAAQ,EACjB,EAAA,EAAgB,EAAM,EAAW,CAAI,EAGvC,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- import{n as e}from"./curry-order-rules-BLyCSMdZ.js";import{n as t,t as n}from"./heap-M6D40vkc.js";function r(...t){return e(i,t)}function i(e,r,i){if(i<=0)return[];if(i>=e.length)return[...e];let a=e.slice(0,i);t(a,r);let o=e.slice(i);for(let e of o)n(a,r,e);return a}export{r as takeFirstBy};
1
+ import{n as e}from"./curry-order-rules-Dage-BeC.js";import{n as t,t as n}from"./heap-CL5ahv5n.js";function r(...t){return e(i,t)}function i(e,r,i){if(i<=0)return[];if(i>=e.length)return[...e];let a=e.slice(0,i);t(a,r);let o=e.slice(i);for(let e of o)n(a,r,e);return a}export{r as takeFirstBy};
2
2
  //# sourceMappingURL=take-first-by.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"take-first-by.js","names":[],"sources":["../src/take-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(data, n, ...rules);\n * @example\n * takeFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aa', 'a']\n * @dataFirst\n * @category Array\n */\nexport function takeFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], takeFirstBy(2, x => x.length)); // => ['aa', 'a']\n * @dataLast\n * @category Array\n */\nexport function takeFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function takeFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(takeFirstByImplementation, args);\n}\n\nfunction takeFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n <= 0) {\n return [];\n }\n\n if (n >= data.length) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const rest = data.slice(n);\n for (const item of rest) {\n heapMaybeInsert(heap, compareFn, item);\n }\n\n return heap;\n}\n"],"mappings":"kGAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAA4B,EAA2B,EAAK,CAGrE,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EACP,MAAO,EAAE,CAGX,GAAI,GAAK,EAAK,OACZ,MAAO,CAAC,GAAG,EAAK,CAGlB,IAAM,EAAO,EAAK,MAAM,EAAG,EAAE,CAC7B,EAAQ,EAAM,EAAU,CAExB,IAAM,EAAO,EAAK,MAAM,EAAE,CAC1B,IAAK,IAAM,KAAQ,EACjB,EAAgB,EAAM,EAAW,EAAK,CAGxC,OAAO"}
1
+ {"version":3,"file":"take-first-by.js","names":[],"sources":["../src/take-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(data, n, ...rules);\n * @example\n * takeFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aa', 'a']\n * @dataFirst\n * @category Array\n */\nexport function takeFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Take the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before taking the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to drop `n` elements) see `dropFirstBy`.\n *\n * @param n - The number of items to take. If `n` is non-positive no items would be returned, if `n` is bigger then data.length a *clone* of `data` would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * takeFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], takeFirstBy(2, x => x.length)); // => ['aa', 'a']\n * @dataLast\n * @category Array\n */\nexport function takeFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function takeFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(takeFirstByImplementation, args);\n}\n\nfunction takeFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n <= 0) {\n return [];\n }\n\n if (n >= data.length) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const rest = data.slice(n);\n for (const item of rest) {\n heapMaybeInsert(heap, compareFn, item);\n }\n\n return heap;\n}\n"],"mappings":"kGAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAA4B,EAA2B,CAAI,CACpE,CAEA,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EACP,MAAO,CAAC,EAGV,GAAI,GAAK,EAAK,OACZ,MAAO,CAAC,GAAG,CAAI,EAGjB,IAAM,EAAO,EAAK,MAAM,EAAG,CAAC,EAC5B,EAAQ,EAAM,CAAS,EAEvB,IAAM,EAAO,EAAK,MAAM,CAAC,EACzB,IAAK,IAAM,KAAQ,EACjB,EAAgB,EAAM,EAAW,CAAI,EAGvC,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(n+1);return[...e]}exports.takeLastWhile=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){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(n+1);return[...e]}exports.takeLastWhile=t;
2
2
  //# sourceMappingURL=take-last-while.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"take-last-while.cjs","names":["curry"],"sources":["../src/take-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(data, predicate)\n * @example\n * takeLastWhile([1, 2, 10, 3, 4, 5], x => x < 10) // => [3, 4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4, 5], takeLastWhile(x => x < 10)) // => [3, 4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function takeLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastWhileImplementation, args);\n}\n\nfunction takeLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(i + 1);\n }\n }\n return [...data];\n}\n"],"mappings":"kGA4CA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAOA,EAAAA,MAAM,EAA6B,EAAK,CAGjD,SAAS,EACP,EACA,EACkB,CAClB,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,EAAK,CAC9B,OAAO,EAAK,MAAM,EAAI,EAAE,CAG5B,MAAO,CAAC,GAAG,EAAK"}
1
+ {"version":3,"file":"take-last-while.cjs","names":["curry"],"sources":["../src/take-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(data, predicate)\n * @example\n * takeLastWhile([1, 2, 10, 3, 4, 5], x => x < 10) // => [3, 4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4, 5], takeLastWhile(x => x < 10)) // => [3, 4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function takeLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastWhileImplementation, args);\n}\n\nfunction takeLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(i + 1);\n }\n }\n return [...data];\n}\n"],"mappings":"kGA4CA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAOA,EAAAA,MAAM,EAA6B,CAAI,CAChD,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,CAAI,EAC7B,OAAO,EAAK,MAAM,EAAI,CAAC,EAG3B,MAAO,CAAC,GAAG,CAAI,CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"take-last-while.js","names":[],"sources":["../src/take-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(data, predicate)\n * @example\n * takeLastWhile([1, 2, 10, 3, 4, 5], x => x < 10) // => [3, 4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4, 5], takeLastWhile(x => x < 10)) // => [3, 4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function takeLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastWhileImplementation, args);\n}\n\nfunction takeLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(i + 1);\n }\n }\n return [...data];\n}\n"],"mappings":"mCA4CA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAO,EAAM,EAA6B,EAAK,CAGjD,SAAS,EACP,EACA,EACkB,CAClB,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,EAAK,CAC9B,OAAO,EAAK,MAAM,EAAI,EAAE,CAG5B,MAAO,CAAC,GAAG,EAAK"}
1
+ {"version":3,"file":"take-last-while.js","names":[],"sources":["../src/take-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(data, predicate)\n * @example\n * takeLastWhile([1, 2, 10, 3, 4, 5], x => x < 10) // => [3, 4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the end of the array until the predicate returns false.\n * The returned elements will be in the same order as in the original array.\n *\n * @param predicate - The predicate.\n * @signature\n * takeLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4, 5], takeLastWhile(x => x < 10)) // => [3, 4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLastWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function takeLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastWhileImplementation, args);\n}\n\nfunction takeLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(i + 1);\n }\n }\n return [...data];\n}\n"],"mappings":"mCA4CA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAO,EAAM,EAA6B,CAAI,CAChD,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,CAAI,EAC7B,OAAO,EAAK,MAAM,EAAI,CAAC,EAG3B,MAAO,CAAC,GAAG,CAAI,CACjB"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){return t>0?e.slice(Math.max(0,e.length-t)):[]}exports.takeLast=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){return t>0?e.slice(Math.max(0,e.length-t)):[]}exports.takeLast=t;
2
2
  //# sourceMappingURL=take-last.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"take-last.cjs","names":["curry"],"sources":["../src/take-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Takes the last `n` elements from the `array`.\n *\n * @param array - The target array.\n * @param n - The number of elements to take.\n * @signature\n * takeLast(array, n)\n * @example\n * takeLast([1, 2, 3, 4, 5], 2) // => [4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Take the last `n` elements from the `array`.\n *\n * @param n - The number of elements to take.\n * @signature\n * takeLast(n)(array)\n * @example\n * takeLast(2)([1, 2, 3, 4, 5]) // => [4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n n: number,\n): (array: T) => Array<T[number]>;\n\nexport function takeLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastImplementation, args);\n}\n\nfunction takeLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(Math.max(0, array.length - n)) : [];\n}\n"],"mappings":"kGAmCA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,EAAK,CAG5C,SAAS,EAAoD,EAAU,EAA6B,CAClG,OAAO,EAAI,EAAI,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,EAAE,CAAC,CAAG,EAAE"}
1
+ {"version":3,"file":"take-last.cjs","names":["curry"],"sources":["../src/take-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Takes the last `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - to skip past the last `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - same, but from the start of the array.\n *\n * @param array - The target array.\n * @param n - The number of elements to take.\n * @signature\n * takeLast(array, n)\n * @example\n * takeLast([1, 2, 3, 4, 5], 2) // => [4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Take the last `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - to skip past the last `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - same, but from the start of the array.\n *\n * @param n - The number of elements to take.\n * @signature\n * takeLast(n)(array)\n * @example\n * takeLast(2)([1, 2, 3, 4, 5]) // => [4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n n: number,\n): (array: T) => Array<T[number]>;\n\nexport function takeLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastImplementation, args);\n}\n\nfunction takeLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(Math.max(0, array.length - n)) : [];\n}\n"],"mappings":"kGA6CA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EAAoD,EAAU,EAA6B,CAClG,OAAO,EAAI,EAAI,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,CAAC,CAAC,EAAI,CAAC,CAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"take-last.js","names":[],"sources":["../src/take-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Takes the last `n` elements from the `array`.\n *\n * @param array - The target array.\n * @param n - The number of elements to take.\n * @signature\n * takeLast(array, n)\n * @example\n * takeLast([1, 2, 3, 4, 5], 2) // => [4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Take the last `n` elements from the `array`.\n *\n * @param n - The number of elements to take.\n * @signature\n * takeLast(n)(array)\n * @example\n * takeLast(2)([1, 2, 3, 4, 5]) // => [4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n n: number,\n): (array: T) => Array<T[number]>;\n\nexport function takeLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastImplementation, args);\n}\n\nfunction takeLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(Math.max(0, array.length - n)) : [];\n}\n"],"mappings":"mCAmCA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,EAAK,CAG5C,SAAS,EAAoD,EAAU,EAA6B,CAClG,OAAO,EAAI,EAAI,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,EAAE,CAAC,CAAG,EAAE"}
1
+ {"version":3,"file":"take-last.js","names":[],"sources":["../src/take-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Takes the last `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - to skip past the last `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - same, but from the start of the array.\n *\n * @param array - The target array.\n * @param n - The number of elements to take.\n * @signature\n * takeLast(array, n)\n * @example\n * takeLast([1, 2, 3, 4, 5], 2) // => [4, 5]\n * @dataFirst\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Take the last `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - to skip past the last `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - same, but from the start of the array.\n *\n * @param n - The number of elements to take.\n * @signature\n * takeLast(n)(array)\n * @example\n * takeLast(2)([1, 2, 3, 4, 5]) // => [4, 5]\n * @dataLast\n * @category Array\n */\nexport function takeLast<T extends IterableContainer>(\n n: number,\n): (array: T) => Array<T[number]>;\n\nexport function takeLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeLastImplementation, args);\n}\n\nfunction takeLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(Math.max(0, array.length - n)) : [];\n}\n"],"mappings":"mCA6CA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EAAoD,EAAU,EAA6B,CAClG,OAAO,EAAI,EAAI,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,CAAC,CAAC,EAAI,CAAC,CAC/D"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){let n=[];for(let[r,i]of e.entries()){if(!t(i,r,e))break;n.push(i)}return n}exports.takeWhile=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=[];for(let[r,i]of e.entries()){if(!t(i,r,e))break;n.push(i)}return n}exports.takeWhile=t;
2
2
  //# sourceMappingURL=take-while.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"take-while.cjs","names":["curry"],"sources":["../src/take-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeWhile(data, predicate)\n * @example\n * takeWhile([1, 2, 3, 4, 3, 2, 1], x => x !== 4) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param predicate - The predicate.\n * @signature\n * takeWhile(predicate)(data)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], takeWhile(x => x !== 4)) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (array: T) => Array<T[number]>;\n\nexport function takeWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeWhileImplementation, args);\n}\n\nfunction takeWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n const ret: Array<T[number]> = [];\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n break;\n }\n ret.push(item);\n }\n return ret;\n}\n"],"mappings":"kGA0CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,EAAK,CAG7C,SAAS,EACP,EACA,EACkB,CAClB,IAAM,EAAwB,EAAE,CAChC,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,GAAI,CAAC,EAAU,EAAM,EAAO,EAAK,CAC/B,MAEF,EAAI,KAAK,EAAK,CAEhB,OAAO"}
1
+ {"version":3,"file":"take-while.cjs","names":["curry"],"sources":["../src/take-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeWhile(data, predicate)\n * @example\n * takeWhile([1, 2, 3, 4, 3, 2, 1], x => x !== 4) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param predicate - The predicate.\n * @signature\n * takeWhile(predicate)(data)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], takeWhile(x => x !== 4)) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (array: T) => Array<T[number]>;\n\nexport function takeWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeWhileImplementation, args);\n}\n\nfunction takeWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n const ret: Array<T[number]> = [];\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n break;\n }\n ret.push(item);\n }\n return ret;\n}\n"],"mappings":"kGA0CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAM,EAAwB,CAAC,EAC/B,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,QAAQ,EAAG,CAC1C,GAAI,CAAC,EAAU,EAAM,EAAO,CAAI,EAC9B,MAEF,EAAI,KAAK,CAAI,CACf,CACA,OAAO,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"take-while.js","names":[],"sources":["../src/take-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeWhile(data, predicate)\n * @example\n * takeWhile([1, 2, 3, 4, 3, 2, 1], x => x !== 4) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param predicate - The predicate.\n * @signature\n * takeWhile(predicate)(data)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], takeWhile(x => x !== 4)) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (array: T) => Array<T[number]>;\n\nexport function takeWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeWhileImplementation, args);\n}\n\nfunction takeWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n const ret: Array<T[number]> = [];\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n break;\n }\n ret.push(item);\n }\n return ret;\n}\n"],"mappings":"mCA0CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,EAAK,CAG7C,SAAS,EACP,EACA,EACkB,CAClB,IAAM,EAAwB,EAAE,CAChC,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,SAAS,CAAE,CAC1C,GAAI,CAAC,EAAU,EAAM,EAAO,EAAK,CAC/B,MAEF,EAAI,KAAK,EAAK,CAEhB,OAAO"}
1
+ {"version":3,"file":"take-while.js","names":[],"sources":["../src/take-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * takeWhile(data, predicate)\n * @example\n * takeWhile([1, 2, 3, 4, 3, 2, 1], x => x !== 4) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => item is S,\n): Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Returns elements from the array until predicate returns false.\n *\n * @param predicate - The predicate.\n * @signature\n * takeWhile(predicate)(data)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], takeWhile(x => x !== 4)) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function takeWhile<T extends IterableContainer, S extends T[number]>(\n predicate: (item: T[number], index: number, data: T) => item is S,\n): (array: T) => Array<S>;\nexport function takeWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (array: T) => Array<T[number]>;\n\nexport function takeWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeWhileImplementation, args);\n}\n\nfunction takeWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n const ret: Array<T[number]> = [];\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n break;\n }\n ret.push(item);\n }\n return ret;\n}\n"],"mappings":"mCA0CA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAM,EAAwB,CAAC,EAC/B,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,QAAQ,EAAG,CAC1C,GAAI,CAAC,EAAU,EAAM,EAAO,CAAI,EAC9B,MAEF,EAAI,KAAK,CAAI,CACf,CACA,OAAO,CACT"}
package/dist/take.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`),t=require(`./utility-evaluators-C8koSp9T.cjs`);function n(...t){return e.curry(r,t,i)}function r(e,t){return t<0?[]:e.slice(0,t)}function i(e){if(e<=0)return t.n;let n=e;return e=>(--n,{done:n<=0,hasNext:!0,next:e})}exports.take=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs"),t=require("./utility-evaluators-BGM19SpK.cjs");function n(...t){return e.curry(r,t,i)}function r(e,t){return t<0?[]:e.slice(0,t)}function i(e){if(e<=0)return t.n;let n=e;return e=>(--n,{done:n<=0,hasNext:!0,next:e})}exports.take=n;
2
2
  //# sourceMappingURL=take.cjs.map
package/dist/take.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"take.cjs","names":["curry","lazyEmptyEvaluator"],"sources":["../src/take.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curry } from './curry';\nimport { lazyEmptyEvaluator } from './internal/utility-evaluators';\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * @param array - The array.\n * @param n - The number of elements to take.\n * @signature\n * take(array, n)\n * @example\n * take([1, 2, 3, 4, 3, 2, 1], 3) // => [1, 2, 3]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function take<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * @param n - The number of elements to take.\n * @signature\n * take(n)(array)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], take(3)) // => [1, 2, 3]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function take(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function take(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeImplementation, args, lazyImplementation);\n}\n\nfunction takeImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [] : array.slice(0, n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyEmptyEvaluator;\n }\n\n let remaining = n;\n return (value) => {\n remaining -= 1;\n return { done: remaining <= 0, hasNext: true, next: value };\n };\n}\n"],"mappings":"iJAuCA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,EAAM,EAAmB,CAG5D,SAAS,EAAgD,EAAU,EAA6B,CAC9F,OAAO,EAAI,EAAI,EAAE,CAAG,EAAM,MAAM,EAAG,EAAE,CAGvC,SAAS,EAAsB,EAA6B,CAC1D,GAAI,GAAK,EACP,OAAOC,EAAAA,EAGT,IAAI,EAAY,EAChB,MAAQ,KACN,IACO,CAAE,KAAM,GAAa,EAAG,QAAS,GAAM,KAAM,EAAO"}
1
+ {"version":3,"file":"take.cjs","names":["curry","lazyEmptyEvaluator"],"sources":["../src/take.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curry } from './curry';\nimport { lazyEmptyEvaluator } from './internal/utility-evaluators';\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * Related operations:\n * - `drop` - to skip past the first `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - same, but from the end of the array.\n *\n * @param array - The array.\n * @param n - The number of elements to take.\n * @signature\n * take(array, n)\n * @example\n * take([1, 2, 3, 4, 3, 2, 1], 3) // => [1, 2, 3]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function take<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * Related operations:\n * - `drop` - to skip past the first `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - same, but from the end of the array.\n *\n * @param n - The number of elements to take.\n * @signature\n * take(n)(array)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], take(3)) // => [1, 2, 3]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function take(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function take(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeImplementation, args, lazyImplementation);\n}\n\nfunction takeImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [] : array.slice(0, n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyEmptyEvaluator;\n }\n\n let remaining = n;\n return (value) => {\n remaining -= 1;\n return { done: remaining <= 0, hasNext: true, next: value };\n };\n}\n"],"mappings":"iJAiDA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,EAAM,CAAkB,CAC3D,CAEA,SAAS,EAAgD,EAAU,EAA6B,CAC9F,OAAO,EAAI,EAAI,CAAC,EAAI,EAAM,MAAM,EAAG,CAAC,CACtC,CAEA,SAAS,EAAsB,EAA6B,CAC1D,GAAI,GAAK,EACP,OAAOC,EAAAA,EAGT,IAAI,EAAY,EAChB,MAAQ,KACN,IACO,CAAE,KAAM,GAAa,EAAG,QAAS,GAAM,KAAM,CAAM,EAE9D"}
package/dist/take.js CHANGED
@@ -1,2 +1,2 @@
1
- import{curry as e}from"./curry.js";import{n as t}from"./utility-evaluators-ZAaUtL2Z.js";function n(...t){return e(r,t,i)}function r(e,t){return t<0?[]:e.slice(0,t)}function i(e){if(e<=0)return t;let n=e;return e=>(--n,{done:n<=0,hasNext:!0,next:e})}export{n as take};
1
+ import{curry as e}from"./curry.js";import{n as t}from"./utility-evaluators-DDW55xeL.js";function n(...t){return e(r,t,i)}function r(e,t){return t<0?[]:e.slice(0,t)}function i(e){if(e<=0)return t;let n=e;return e=>(--n,{done:n<=0,hasNext:!0,next:e})}export{n as take};
2
2
  //# sourceMappingURL=take.js.map
package/dist/take.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"take.js","names":[],"sources":["../src/take.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curry } from './curry';\nimport { lazyEmptyEvaluator } from './internal/utility-evaluators';\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * @param array - The array.\n * @param n - The number of elements to take.\n * @signature\n * take(array, n)\n * @example\n * take([1, 2, 3, 4, 3, 2, 1], 3) // => [1, 2, 3]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function take<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * @param n - The number of elements to take.\n * @signature\n * take(n)(array)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], take(3)) // => [1, 2, 3]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function take(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function take(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeImplementation, args, lazyImplementation);\n}\n\nfunction takeImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [] : array.slice(0, n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyEmptyEvaluator;\n }\n\n let remaining = n;\n return (value) => {\n remaining -= 1;\n return { done: remaining <= 0, hasNext: true, next: value };\n };\n}\n"],"mappings":"wFAuCA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,EAAM,EAAmB,CAG5D,SAAS,EAAgD,EAAU,EAA6B,CAC9F,OAAO,EAAI,EAAI,EAAE,CAAG,EAAM,MAAM,EAAG,EAAE,CAGvC,SAAS,EAAsB,EAA6B,CAC1D,GAAI,GAAK,EACP,OAAO,EAGT,IAAI,EAAY,EAChB,MAAQ,KACN,IACO,CAAE,KAAM,GAAa,EAAG,QAAS,GAAM,KAAM,EAAO"}
1
+ {"version":3,"file":"take.js","names":[],"sources":["../src/take.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curry } from './curry';\nimport { lazyEmptyEvaluator } from './internal/utility-evaluators';\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * Related operations:\n * - `drop` - to skip past the first `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - same, but from the end of the array.\n *\n * @param array - The array.\n * @param n - The number of elements to take.\n * @signature\n * take(array, n)\n * @example\n * take([1, 2, 3, 4, 3, 2, 1], 3) // => [1, 2, 3]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function take<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Returns the first `n` elements of `array`.\n *\n * Related operations:\n * - `drop` - to skip past the first `n` instead.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - same, but from the end of the array.\n *\n * @param n - The number of elements to take.\n * @signature\n * take(n)(array)\n * @example\n * pipe([1, 2, 3, 4, 3, 2, 1], take(3)) // => [1, 2, 3]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function take(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function take(...args: ReadonlyArray<unknown>): unknown {\n return curry(takeImplementation, args, lazyImplementation);\n}\n\nfunction takeImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [] : array.slice(0, n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyEmptyEvaluator;\n }\n\n let remaining = n;\n return (value) => {\n remaining -= 1;\n return { done: remaining <= 0, hasNext: true, next: value };\n };\n}\n"],"mappings":"wFAiDA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,EAAM,CAAkB,CAC3D,CAEA,SAAS,EAAgD,EAAU,EAA6B,CAC9F,OAAO,EAAI,EAAI,CAAC,EAAI,EAAM,MAAM,EAAG,CAAC,CACtC,CAEA,SAAS,EAAsB,EAA6B,CAC1D,GAAI,GAAK,EACP,OAAO,EAGT,IAAI,EAAY,EAChB,MAAQ,KACN,IACO,CAAE,KAAM,GAAa,EAAG,QAAS,GAAM,KAAM,CAAM,EAE9D"}
package/dist/tap.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){return t(e),e}exports.tap=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){return t(e),e}exports.tap=t;
2
2
  //# sourceMappingURL=tap.cjs.map
package/dist/tap.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tap.cjs","names":["curry"],"sources":["../src/tap.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param value - The value to pass into the function.\n * @param fn - The function to call.\n * @signature\n * tap(value, fn)\n * @example\n * tap(\"foo\", console.log) // => \"foo\"\n * @dataFirst\n * @category Other\n */\nexport function tap<T>(value: T, fn: (value: T) => void): T;\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param fn - The function to call.\n * @signature\n * tap(fn)(value)\n * @example\n * pipe(\n * [-5, -1, 2, 3],\n * filter(n => n > 0),\n * tap(console.log), // prints [2, 3]\n * map(n => n * 2)\n * ) // => [4, 6]\n * @dataLast\n * @category Other\n */\nexport function tap<\n T,\n F extends (value: T) => unknown,\n>(fn: F): (value: T) => T;\n\nexport function tap(...args: ReadonlyArray<unknown>): unknown {\n return curry(tapImplementation, args);\n}\n\nfunction tapImplementation<T>(value: T, fn: (value: T) => void): T {\n fn(value);\n return value;\n}\n"],"mappings":"kGA6CA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAOA,EAAAA,MAAM,EAAmB,EAAK,CAGvC,SAAS,EAAqB,EAAU,EAA2B,CAEjE,OADA,EAAG,EAAM,CACF"}
1
+ {"version":3,"file":"tap.cjs","names":["curry"],"sources":["../src/tap.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param value - The value to pass into the function.\n * @param fn - The function to call.\n * @signature\n * tap(value, fn)\n * @example\n * tap(\"foo\", console.log) // => \"foo\"\n * @dataFirst\n * @category Other\n */\nexport function tap<T>(value: T, fn: (value: T) => void): T;\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param fn - The function to call.\n * @signature\n * tap(fn)(value)\n * @example\n * pipe(\n * [-5, -1, 2, 3],\n * filter(n => n > 0),\n * tap(console.log), // prints [2, 3]\n * map(n => n * 2)\n * ) // => [4, 6]\n * @dataLast\n * @category Other\n */\nexport function tap<\n T,\n F extends (value: T) => unknown,\n>(fn: F): (value: T) => T;\n\nexport function tap(...args: ReadonlyArray<unknown>): unknown {\n return curry(tapImplementation, args);\n}\n\nfunction tapImplementation<T>(value: T, fn: (value: T) => void): T {\n fn(value);\n return value;\n}\n"],"mappings":"kGA6CA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAOA,EAAAA,MAAM,EAAmB,CAAI,CACtC,CAEA,SAAS,EAAqB,EAAU,EAA2B,CAEjE,OADA,EAAG,CAAK,EACD,CACT"}
package/dist/tap.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tap.js","names":[],"sources":["../src/tap.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param value - The value to pass into the function.\n * @param fn - The function to call.\n * @signature\n * tap(value, fn)\n * @example\n * tap(\"foo\", console.log) // => \"foo\"\n * @dataFirst\n * @category Other\n */\nexport function tap<T>(value: T, fn: (value: T) => void): T;\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param fn - The function to call.\n * @signature\n * tap(fn)(value)\n * @example\n * pipe(\n * [-5, -1, 2, 3],\n * filter(n => n > 0),\n * tap(console.log), // prints [2, 3]\n * map(n => n * 2)\n * ) // => [4, 6]\n * @dataLast\n * @category Other\n */\nexport function tap<\n T,\n F extends (value: T) => unknown,\n>(fn: F): (value: T) => T;\n\nexport function tap(...args: ReadonlyArray<unknown>): unknown {\n return curry(tapImplementation, args);\n}\n\nfunction tapImplementation<T>(value: T, fn: (value: T) => void): T {\n fn(value);\n return value;\n}\n"],"mappings":"mCA6CA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAO,EAAM,EAAmB,EAAK,CAGvC,SAAS,EAAqB,EAAU,EAA2B,CAEjE,OADA,EAAG,EAAM,CACF"}
1
+ {"version":3,"file":"tap.js","names":[],"sources":["../src/tap.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param value - The value to pass into the function.\n * @param fn - The function to call.\n * @signature\n * tap(value, fn)\n * @example\n * tap(\"foo\", console.log) // => \"foo\"\n * @dataFirst\n * @category Other\n */\nexport function tap<T>(value: T, fn: (value: T) => void): T;\n\n/**\n * Calls the given function with the given value, then returns the given value.\n * The return value of the provided function is ignored.\n *\n * This allows \"tapping into\" a function sequence in a pipe, to perform side\n * effects on intermediate results.\n *\n * @param fn - The function to call.\n * @signature\n * tap(fn)(value)\n * @example\n * pipe(\n * [-5, -1, 2, 3],\n * filter(n => n > 0),\n * tap(console.log), // prints [2, 3]\n * map(n => n * 2)\n * ) // => [4, 6]\n * @dataLast\n * @category Other\n */\nexport function tap<\n T,\n F extends (value: T) => unknown,\n>(fn: F): (value: T) => T;\n\nexport function tap(...args: ReadonlyArray<unknown>): unknown {\n return curry(tapImplementation, args);\n}\n\nfunction tapImplementation<T>(value: T, fn: (value: T) => void): T {\n fn(value);\n return value;\n}\n"],"mappings":"mCA6CA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAO,EAAM,EAAmB,CAAI,CACtC,CAEA,SAAS,EAAqB,EAAU,EAA2B,CAEjE,OADA,EAAG,CAAK,EACD,CACT"}
package/dist/times.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`);function t(...t){return e.curry(n,t)}function n(e,t){if(e<1)return[];let n=Number.isInteger(e)?e:Math.floor(e),r=Array(n);for(let e=0;e<n;e++)r[e]=t(e);return r}exports.times=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(e<1)return[];let n=Number.isInteger(e)?e:Math.floor(e),r=Array(n);for(let e=0;e<n;e++)r[e]=t(e);return r}exports.times=t;
2
2
  //# sourceMappingURL=times.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"times.cjs","names":["curry"],"sources":["../src/times.ts"],"sourcesContent":["import type { GreaterThan } from 'type-fest';\nimport { curry } from './curry';\n\n// This number was picked by trial-and-error until typescript stops failing with\n// \"Type instantiation is excessively deep and possibly infinite. (ts2589)\".\n// See the type tests for more information.\ntype MAX_LITERAL_SIZE = 46;\n\ntype TimesArray<\n T,\n N extends number,\n Iteration extends ReadonlyArray<unknown> = [],\n> = number extends N\n ? // N is not a literal number, we can't deduce the type\n Array<T>\n : `${N}` extends `-${number}`\n ? // N is non-positive, the mapper will never run\n []\n : `${N}` extends `${infer K extends number}.${number}`\n ? // N is not an integer, we \"floor\" the number.\n TimesArray<T, K, Iteration>\n : GreaterThan<N, MAX_LITERAL_SIZE> extends true\n ? // We can't build a literal tuple beyond this size, after that we\n // can't add more items to the tuple so we add a rest element instead.\n [...TimesArray<T, MAX_LITERAL_SIZE, Iteration>, ...Array<T>]\n : N extends Iteration['length']\n ? // We finished building the output tuple\n []\n : // Add another item to the tuple and recurse.\n [T, ...TimesArray<T, N, [unknown, ...Iteration]>];\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param count - A value between `0` and `n - 1`. Increments after each\n * function call.\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(count, fn)\n * @example\n * times(5, identity()); //=> [0, 1, 2, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function times<T, N extends number>(\n count: N,\n fn: (index: number) => T,\n): TimesArray<T, N>;\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(fn)(count)\n * @example\n * times(identity())(5); //=> [0, 1, 2, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function times<T>(\n fn: (index: number) => T,\n): <N extends number>(count: N) => TimesArray<T, N>;\n\nexport function times(...args: ReadonlyArray<unknown>): unknown {\n return curry(timesImplementation, args);\n}\n\nfunction timesImplementation<T>(count: number, fn: (index: number) => T): Array<T> {\n if (count < 1) {\n // We prefer to return trivial results on trivial inputs vs throwing errors.\n return [];\n }\n\n // Non-integer numbers would cause `new Array` to throw, but it makes more\n // sense to simply round them down to the nearest integer instead; but\n // rounding has some performance implications so we only do it when we have to\n const length = Number.isInteger(count) ? count : Math.floor(count);\n\n // eslint-disable-next-line unicorn/no-new-array -- This is the most efficient way to create the array, check out the benchmarks in the PR that added this comment.\n const res = new Array<T>(length);\n\n for (let i = 0; i < length; i++) {\n res[i] = fn(i);\n }\n\n return res;\n}\n"],"mappings":"kGA4EA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAOA,EAAAA,MAAM,EAAqB,EAAK,CAGzC,SAAS,EAAuB,EAAe,EAAoC,CACjF,GAAI,EAAQ,EAEV,MAAO,EAAE,CAMX,IAAM,EAAS,OAAO,UAAU,EAAM,CAAG,EAAQ,KAAK,MAAM,EAAM,CAG5D,EAAU,MAAS,EAAO,CAEhC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,IAC1B,EAAI,GAAK,EAAG,EAAE,CAGhB,OAAO"}
1
+ {"version":3,"file":"times.cjs","names":["curry"],"sources":["../src/times.ts"],"sourcesContent":["import type { GreaterThan } from 'type-fest';\nimport { curry } from './curry';\n\n// This number was picked by trial-and-error until typescript stops failing with\n// \"Type instantiation is excessively deep and possibly infinite. (ts2589)\".\n// See the type tests for more information.\ntype MAX_LITERAL_SIZE = 46;\n\ntype TimesArray<\n T,\n N extends number,\n Iteration extends ReadonlyArray<unknown> = [],\n> = number extends N\n ? // N is not a literal number, we can't deduce the type\n Array<T>\n : `${N}` extends `-${number}`\n ? // N is non-positive, the mapper will never run\n []\n : `${N}` extends `${infer K extends number}.${number}`\n ? // N is not an integer, we \"floor\" the number.\n TimesArray<T, K, Iteration>\n : GreaterThan<N, MAX_LITERAL_SIZE> extends true\n ? // We can't build a literal tuple beyond this size, after that we\n // can't add more items to the tuple so we add a rest element instead.\n [...TimesArray<T, MAX_LITERAL_SIZE, Iteration>, ...Array<T>]\n : N extends Iteration['length']\n ? // We finished building the output tuple\n []\n : // Add another item to the tuple and recurse.\n [T, ...TimesArray<T, N, [unknown, ...Iteration]>];\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param count - A value between `0` and `n - 1`. Increments after each\n * function call.\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(count, fn)\n * @example\n * times(5, identity()); //=> [0, 1, 2, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function times<T, N extends number>(\n count: N,\n fn: (index: number) => T,\n): TimesArray<T, N>;\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(fn)(count)\n * @example\n * times(identity())(5); //=> [0, 1, 2, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function times<T>(\n fn: (index: number) => T,\n): <N extends number>(count: N) => TimesArray<T, N>;\n\nexport function times(...args: ReadonlyArray<unknown>): unknown {\n return curry(timesImplementation, args);\n}\n\nfunction timesImplementation<T>(count: number, fn: (index: number) => T): Array<T> {\n if (count < 1) {\n // We prefer to return trivial results on trivial inputs vs throwing errors.\n return [];\n }\n\n // Non-integer numbers would cause `new Array` to throw, but it makes more\n // sense to simply round them down to the nearest integer instead; but\n // rounding has some performance implications so we only do it when we have to\n const length = Number.isInteger(count) ? count : Math.floor(count);\n\n // eslint-disable-next-line unicorn/no-new-array -- This is the most efficient way to create the array, check out the benchmarks in the PR that added this comment.\n const res = new Array<T>(length);\n\n for (let i = 0; i < length; i++) {\n res[i] = fn(i);\n }\n\n return res;\n}\n"],"mappings":"kGA4EA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAOA,EAAAA,MAAM,EAAqB,CAAI,CACxC,CAEA,SAAS,EAAuB,EAAe,EAAoC,CACjF,GAAI,EAAQ,EAEV,MAAO,CAAC,EAMV,IAAM,EAAS,OAAO,UAAU,CAAK,EAAI,EAAQ,KAAK,MAAM,CAAK,EAG3D,EAAU,MAAS,CAAM,EAE/B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,IAC1B,EAAI,GAAK,EAAG,CAAC,EAGf,OAAO,CACT"}
package/dist/times.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"times.js","names":[],"sources":["../src/times.ts"],"sourcesContent":["import type { GreaterThan } from 'type-fest';\nimport { curry } from './curry';\n\n// This number was picked by trial-and-error until typescript stops failing with\n// \"Type instantiation is excessively deep and possibly infinite. (ts2589)\".\n// See the type tests for more information.\ntype MAX_LITERAL_SIZE = 46;\n\ntype TimesArray<\n T,\n N extends number,\n Iteration extends ReadonlyArray<unknown> = [],\n> = number extends N\n ? // N is not a literal number, we can't deduce the type\n Array<T>\n : `${N}` extends `-${number}`\n ? // N is non-positive, the mapper will never run\n []\n : `${N}` extends `${infer K extends number}.${number}`\n ? // N is not an integer, we \"floor\" the number.\n TimesArray<T, K, Iteration>\n : GreaterThan<N, MAX_LITERAL_SIZE> extends true\n ? // We can't build a literal tuple beyond this size, after that we\n // can't add more items to the tuple so we add a rest element instead.\n [...TimesArray<T, MAX_LITERAL_SIZE, Iteration>, ...Array<T>]\n : N extends Iteration['length']\n ? // We finished building the output tuple\n []\n : // Add another item to the tuple and recurse.\n [T, ...TimesArray<T, N, [unknown, ...Iteration]>];\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param count - A value between `0` and `n - 1`. Increments after each\n * function call.\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(count, fn)\n * @example\n * times(5, identity()); //=> [0, 1, 2, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function times<T, N extends number>(\n count: N,\n fn: (index: number) => T,\n): TimesArray<T, N>;\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(fn)(count)\n * @example\n * times(identity())(5); //=> [0, 1, 2, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function times<T>(\n fn: (index: number) => T,\n): <N extends number>(count: N) => TimesArray<T, N>;\n\nexport function times(...args: ReadonlyArray<unknown>): unknown {\n return curry(timesImplementation, args);\n}\n\nfunction timesImplementation<T>(count: number, fn: (index: number) => T): Array<T> {\n if (count < 1) {\n // We prefer to return trivial results on trivial inputs vs throwing errors.\n return [];\n }\n\n // Non-integer numbers would cause `new Array` to throw, but it makes more\n // sense to simply round them down to the nearest integer instead; but\n // rounding has some performance implications so we only do it when we have to\n const length = Number.isInteger(count) ? count : Math.floor(count);\n\n // eslint-disable-next-line unicorn/no-new-array -- This is the most efficient way to create the array, check out the benchmarks in the PR that added this comment.\n const res = new Array<T>(length);\n\n for (let i = 0; i < length; i++) {\n res[i] = fn(i);\n }\n\n return res;\n}\n"],"mappings":"mCA4EA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAO,EAAM,EAAqB,EAAK,CAGzC,SAAS,EAAuB,EAAe,EAAoC,CACjF,GAAI,EAAQ,EAEV,MAAO,EAAE,CAMX,IAAM,EAAS,OAAO,UAAU,EAAM,CAAG,EAAQ,KAAK,MAAM,EAAM,CAG5D,EAAU,MAAS,EAAO,CAEhC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,IAC1B,EAAI,GAAK,EAAG,EAAE,CAGhB,OAAO"}
1
+ {"version":3,"file":"times.js","names":[],"sources":["../src/times.ts"],"sourcesContent":["import type { GreaterThan } from 'type-fest';\nimport { curry } from './curry';\n\n// This number was picked by trial-and-error until typescript stops failing with\n// \"Type instantiation is excessively deep and possibly infinite. (ts2589)\".\n// See the type tests for more information.\ntype MAX_LITERAL_SIZE = 46;\n\ntype TimesArray<\n T,\n N extends number,\n Iteration extends ReadonlyArray<unknown> = [],\n> = number extends N\n ? // N is not a literal number, we can't deduce the type\n Array<T>\n : `${N}` extends `-${number}`\n ? // N is non-positive, the mapper will never run\n []\n : `${N}` extends `${infer K extends number}.${number}`\n ? // N is not an integer, we \"floor\" the number.\n TimesArray<T, K, Iteration>\n : GreaterThan<N, MAX_LITERAL_SIZE> extends true\n ? // We can't build a literal tuple beyond this size, after that we\n // can't add more items to the tuple so we add a rest element instead.\n [...TimesArray<T, MAX_LITERAL_SIZE, Iteration>, ...Array<T>]\n : N extends Iteration['length']\n ? // We finished building the output tuple\n []\n : // Add another item to the tuple and recurse.\n [T, ...TimesArray<T, N, [unknown, ...Iteration]>];\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param count - A value between `0` and `n - 1`. Increments after each\n * function call.\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(count, fn)\n * @example\n * times(5, identity()); //=> [0, 1, 2, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function times<T, N extends number>(\n count: N,\n fn: (index: number) => T,\n): TimesArray<T, N>;\n\n/**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @param fn - The function to invoke. Passed one argument, the current value of\n * `n`.\n * @returns An array containing the return values of all calls to `fn`.\n * @signature\n * times(fn)(count)\n * @example\n * times(identity())(5); //=> [0, 1, 2, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function times<T>(\n fn: (index: number) => T,\n): <N extends number>(count: N) => TimesArray<T, N>;\n\nexport function times(...args: ReadonlyArray<unknown>): unknown {\n return curry(timesImplementation, args);\n}\n\nfunction timesImplementation<T>(count: number, fn: (index: number) => T): Array<T> {\n if (count < 1) {\n // We prefer to return trivial results on trivial inputs vs throwing errors.\n return [];\n }\n\n // Non-integer numbers would cause `new Array` to throw, but it makes more\n // sense to simply round them down to the nearest integer instead; but\n // rounding has some performance implications so we only do it when we have to\n const length = Number.isInteger(count) ? count : Math.floor(count);\n\n // eslint-disable-next-line unicorn/no-new-array -- This is the most efficient way to create the array, check out the benchmarks in the PR that added this comment.\n const res = new Array<T>(length);\n\n for (let i = 0; i < length; i++) {\n res[i] = fn(i);\n }\n\n return res;\n}\n"],"mappings":"mCA4EA,SAAgB,EAAM,GAAG,EAAuC,CAC9D,OAAO,EAAM,EAAqB,CAAI,CACxC,CAEA,SAAS,EAAuB,EAAe,EAAoC,CACjF,GAAI,EAAQ,EAEV,MAAO,CAAC,EAMV,IAAM,EAAS,OAAO,UAAU,CAAK,EAAI,EAAQ,KAAK,MAAM,CAAK,EAG3D,EAAU,MAAS,CAAM,EAE/B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,IAC1B,EAAI,GAAK,EAAG,CAAC,EAGf,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./words-C8Rd_80F.cjs`),t=/[a-z]/u;function n(e,t){return typeof e==`string`?r(e,t):t=>r(t,e)}function r(n,{preserveConsecutiveUppercase:r=!0}={}){return e.t(t.test(n)?n:n.toLowerCase()).map((e,t)=>`${t===0?e[0].toLowerCase():e[0].toUpperCase()}${r?e.slice(1):e.slice(1).toLowerCase()}`).join(``)}exports.toCamelCase=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./words-B-9EXtsW.cjs"),t=/[a-z]/u;function n(e,t){return typeof e==`string`?r(e,t):t=>r(t,e)}function r(n,{preserveConsecutiveUppercase:r=!0}={}){return e.t(t.test(n)?n:n.toLowerCase()).map((e,t)=>`${t===0?e[0].toLowerCase():e[0].toUpperCase()}${r?e.slice(1):e.slice(1).toLowerCase()}`).join(``)}exports.toCamelCase=n;
2
2
  //# sourceMappingURL=to-camel-case.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-camel-case.cjs","names":["words"],"sources":["../src/to-camel-case.ts"],"sourcesContent":["import type {\n CamelCaseOptions as BaseCamelCaseOptions,\n CamelCase,\n} from 'type-fest';\nimport type { OptionalOptionsWithDefaults } from './internal/types/optional-options-with-defaults';\nimport { words } from './internal/words';\n\nconst LOWER_CASE_CHARACTER_RE = /[a-z]/u;\n\nconst DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE = true;\n\ninterface CamelCaseOptions {\n readonly preserveConsecutiveUppercase?: boolean;\n}\n\ntype CamelCaseOptionsWithDefaults<Options extends CamelCaseOptions>\n = OptionalOptionsWithDefaults<\n CamelCaseOptions,\n Options,\n {\n // We use the runtime const for the default type so they stay coupled.\n preserveConsecutiveUppercase: typeof DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE;\n }\n >;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param data - A string.\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase(data);\n * toCamelCase(data, { preserveConsecutiveUppercase });\n * @example\n * toCamelCase(\"hello world\"); // \"helloWorld\"\n * toCamelCase(\"__HELLO_WORLD__\"); // \"helloWorld\"\n * toCamelCase(\"HasHTML\"); // \"hasHTML\"\n * toCamelCase(\"HasHTML\", { preserveConsecutiveUppercase: false }); // \"hasHtml\"\n * @dataFirst\n * @category String\n */\nexport function toCamelCase<T extends string, Options extends CamelCaseOptions>(\n data: T,\n options?: Options,\n): CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase()(data);\n * toCamelCase({ preserveConsecutiveUppercase })(data);\n * @example\n * pipe(\"hello world\", toCamelCase()); // \"helloWorld\"\n * pipe(\"__HELLO_WORLD__\", toCamelCase()); // \"helloWorld\"\n * pipe(\"HasHTML\", toCamelCase()); // \"hasHTML\"\n * pipe(\n * \"HasHTML\",\n * toCamelCase({ preserveConsecutiveUppercase: false }),\n * ); // \"hasHtml\"\n * @dataLast\n * @category String\n */\nexport function toCamelCase<Options extends CamelCaseOptions>(\n options?: Options,\n): <T extends string>(\n data: T,\n) => CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\nexport function toCamelCase(\n dataOrOptions: CamelCaseOptions | string,\n options?: CamelCaseOptions,\n): unknown {\n return typeof dataOrOptions === 'string'\n ? toCamelCaseImplementation(dataOrOptions, options)\n : (data: string) => toCamelCaseImplementation(data, dataOrOptions);\n}\n\n// Based on the type definition from type-fest.\n// @see https://github.com/sindresorhus/type-fest/blob/main/source/camel-case.d.ts#L76-L80\nfunction toCamelCaseImplementation(data: string, {\n preserveConsecutiveUppercase = DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE,\n}: CamelCaseOptions = {}): string {\n return words(\n LOWER_CASE_CHARACTER_RE.test(data)\n ? data\n : // If the text doesn't have **any** lower case characters we also lower\n // case everything, but if it does we need to maintain them as it\n // affects the word boundaries.\n data.toLowerCase(),\n )\n .map(\n (word, index) =>\n `${\n // The first word is uncapitalized, the rest are capitalized\n index === 0 ? word[0]!.toLowerCase() : word[0]!.toUpperCase()\n }${preserveConsecutiveUppercase ? word.slice(1) : word.slice(1).toLowerCase()}`,\n )\n .join('');\n}\n"],"mappings":"2GAOM,EAA0B,SAiGhC,SAAgB,EACd,EACA,EACS,CACT,OAAO,OAAO,GAAkB,SAC5B,EAA0B,EAAe,EAAQ,CAChD,GAAiB,EAA0B,EAAM,EAAc,CAKtE,SAAS,EAA0B,EAAc,CAC/C,+BAA+B,IACX,EAAE,CAAU,CAChC,OAAOA,EAAAA,EACL,EAAwB,KAAK,EAAK,CAC9B,EAIA,EAAK,aAAa,CACvB,CACE,KACE,EAAM,IACL,GAEE,IAAU,EAAI,EAAK,GAAI,aAAa,CAAG,EAAK,GAAI,aAAa,GAC5D,EAA+B,EAAK,MAAM,EAAE,CAAG,EAAK,MAAM,EAAE,CAAC,aAAa,GAChF,CACA,KAAK,GAAG"}
1
+ {"version":3,"file":"to-camel-case.cjs","names":["words"],"sources":["../src/to-camel-case.ts"],"sourcesContent":["import type {\n CamelCaseOptions as BaseCamelCaseOptions,\n CamelCase,\n} from 'type-fest';\nimport type { OptionalOptionsWithDefaults } from './internal/types/optional-options-with-defaults';\nimport { words } from './internal/words';\n\nconst LOWER_CASE_CHARACTER_RE = /[a-z]/u;\n\nconst DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE = true;\n\ninterface CamelCaseOptions {\n readonly preserveConsecutiveUppercase?: boolean;\n}\n\ntype CamelCaseOptionsWithDefaults<Options extends CamelCaseOptions>\n = OptionalOptionsWithDefaults<\n CamelCaseOptions,\n Options,\n {\n // We use the runtime const for the default type so they stay coupled.\n preserveConsecutiveUppercase: typeof DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE;\n }\n >;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param data - A string.\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase(data);\n * toCamelCase(data, { preserveConsecutiveUppercase });\n * @example\n * toCamelCase(\"hello world\"); // \"helloWorld\"\n * toCamelCase(\"__HELLO_WORLD__\"); // \"helloWorld\"\n * toCamelCase(\"HasHTML\"); // \"hasHTML\"\n * toCamelCase(\"HasHTML\", { preserveConsecutiveUppercase: false }); // \"hasHtml\"\n * @dataFirst\n * @category String\n */\nexport function toCamelCase<T extends string, Options extends CamelCaseOptions>(\n data: T,\n options?: Options,\n): CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase()(data);\n * toCamelCase({ preserveConsecutiveUppercase })(data);\n * @example\n * pipe(\"hello world\", toCamelCase()); // \"helloWorld\"\n * pipe(\"__HELLO_WORLD__\", toCamelCase()); // \"helloWorld\"\n * pipe(\"HasHTML\", toCamelCase()); // \"hasHTML\"\n * pipe(\n * \"HasHTML\",\n * toCamelCase({ preserveConsecutiveUppercase: false }),\n * ); // \"hasHtml\"\n * @dataLast\n * @category String\n */\nexport function toCamelCase<Options extends CamelCaseOptions>(\n options?: Options,\n): <T extends string>(\n data: T,\n) => CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\nexport function toCamelCase(\n dataOrOptions: CamelCaseOptions | string,\n options?: CamelCaseOptions,\n): unknown {\n return typeof dataOrOptions === 'string'\n ? toCamelCaseImplementation(dataOrOptions, options)\n : (data: string) => toCamelCaseImplementation(data, dataOrOptions);\n}\n\n// Based on the type definition from type-fest.\n// @see https://github.com/sindresorhus/type-fest/blob/main/source/camel-case.d.ts#L76-L80\nfunction toCamelCaseImplementation(data: string, {\n preserveConsecutiveUppercase = DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE,\n}: CamelCaseOptions = {}): string {\n return words(\n LOWER_CASE_CHARACTER_RE.test(data)\n ? data\n : // If the text doesn't have **any** lower case characters we also lower\n // case everything, but if it does we need to maintain them as it\n // affects the word boundaries.\n data.toLowerCase(),\n )\n .map(\n (word, index) =>\n `${\n // The first word is uncapitalized, the rest are capitalized\n index === 0 ? word[0]!.toLowerCase() : word[0]!.toUpperCase()\n }${preserveConsecutiveUppercase ? word.slice(1) : word.slice(1).toLowerCase()}`,\n )\n .join('');\n}\n"],"mappings":"2GAOM,EAA0B,SAiGhC,SAAgB,EACd,EACA,EACS,CACT,OAAO,OAAO,GAAkB,SAC5B,EAA0B,EAAe,CAAO,EAC/C,GAAiB,EAA0B,EAAM,CAAa,CACrE,CAIA,SAAS,EAA0B,EAAc,CAC/C,+BAA+B,IACX,CAAC,EAAW,CAChC,OAAOA,EAAAA,EACL,EAAwB,KAAK,CAAI,EAC7B,EAIA,EAAK,YAAY,CACvB,CAAC,CACE,KACE,EAAM,IACL,GAEE,IAAU,EAAI,EAAK,EAAE,CAAE,YAAY,EAAI,EAAK,EAAE,CAAE,YAAY,IAC3D,EAA+B,EAAK,MAAM,CAAC,EAAI,EAAK,MAAM,CAAC,CAAC,CAAC,YAAY,GAChF,CAAC,CACA,KAAK,EAAE,CACZ"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./words-CYZ0Lyko.js";const t=/[a-z]/u;function n(e,t){return typeof e==`string`?r(e,t):t=>r(t,e)}function r(n,{preserveConsecutiveUppercase:r=!0}={}){return e(t.test(n)?n:n.toLowerCase()).map((e,t)=>`${t===0?e[0].toLowerCase():e[0].toUpperCase()}${r?e.slice(1):e.slice(1).toLowerCase()}`).join(``)}export{n as toCamelCase};
1
+ import{t as e}from"./words-CN1Qil5U.js";const t=/[a-z]/u;function n(e,t){return typeof e==`string`?r(e,t):t=>r(t,e)}function r(n,{preserveConsecutiveUppercase:r=!0}={}){return e(t.test(n)?n:n.toLowerCase()).map((e,t)=>`${t===0?e[0].toLowerCase():e[0].toUpperCase()}${r?e.slice(1):e.slice(1).toLowerCase()}`).join(``)}export{n as toCamelCase};
2
2
  //# sourceMappingURL=to-camel-case.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-camel-case.js","names":[],"sources":["../src/to-camel-case.ts"],"sourcesContent":["import type {\n CamelCaseOptions as BaseCamelCaseOptions,\n CamelCase,\n} from 'type-fest';\nimport type { OptionalOptionsWithDefaults } from './internal/types/optional-options-with-defaults';\nimport { words } from './internal/words';\n\nconst LOWER_CASE_CHARACTER_RE = /[a-z]/u;\n\nconst DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE = true;\n\ninterface CamelCaseOptions {\n readonly preserveConsecutiveUppercase?: boolean;\n}\n\ntype CamelCaseOptionsWithDefaults<Options extends CamelCaseOptions>\n = OptionalOptionsWithDefaults<\n CamelCaseOptions,\n Options,\n {\n // We use the runtime const for the default type so they stay coupled.\n preserveConsecutiveUppercase: typeof DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE;\n }\n >;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param data - A string.\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase(data);\n * toCamelCase(data, { preserveConsecutiveUppercase });\n * @example\n * toCamelCase(\"hello world\"); // \"helloWorld\"\n * toCamelCase(\"__HELLO_WORLD__\"); // \"helloWorld\"\n * toCamelCase(\"HasHTML\"); // \"hasHTML\"\n * toCamelCase(\"HasHTML\", { preserveConsecutiveUppercase: false }); // \"hasHtml\"\n * @dataFirst\n * @category String\n */\nexport function toCamelCase<T extends string, Options extends CamelCaseOptions>(\n data: T,\n options?: Options,\n): CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase()(data);\n * toCamelCase({ preserveConsecutiveUppercase })(data);\n * @example\n * pipe(\"hello world\", toCamelCase()); // \"helloWorld\"\n * pipe(\"__HELLO_WORLD__\", toCamelCase()); // \"helloWorld\"\n * pipe(\"HasHTML\", toCamelCase()); // \"hasHTML\"\n * pipe(\n * \"HasHTML\",\n * toCamelCase({ preserveConsecutiveUppercase: false }),\n * ); // \"hasHtml\"\n * @dataLast\n * @category String\n */\nexport function toCamelCase<Options extends CamelCaseOptions>(\n options?: Options,\n): <T extends string>(\n data: T,\n) => CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\nexport function toCamelCase(\n dataOrOptions: CamelCaseOptions | string,\n options?: CamelCaseOptions,\n): unknown {\n return typeof dataOrOptions === 'string'\n ? toCamelCaseImplementation(dataOrOptions, options)\n : (data: string) => toCamelCaseImplementation(data, dataOrOptions);\n}\n\n// Based on the type definition from type-fest.\n// @see https://github.com/sindresorhus/type-fest/blob/main/source/camel-case.d.ts#L76-L80\nfunction toCamelCaseImplementation(data: string, {\n preserveConsecutiveUppercase = DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE,\n}: CamelCaseOptions = {}): string {\n return words(\n LOWER_CASE_CHARACTER_RE.test(data)\n ? data\n : // If the text doesn't have **any** lower case characters we also lower\n // case everything, but if it does we need to maintain them as it\n // affects the word boundaries.\n data.toLowerCase(),\n )\n .map(\n (word, index) =>\n `${\n // The first word is uncapitalized, the rest are capitalized\n index === 0 ? word[0]!.toLowerCase() : word[0]!.toUpperCase()\n }${preserveConsecutiveUppercase ? word.slice(1) : word.slice(1).toLowerCase()}`,\n )\n .join('');\n}\n"],"mappings":"wCAOA,MAAM,EAA0B,SAiGhC,SAAgB,EACd,EACA,EACS,CACT,OAAO,OAAO,GAAkB,SAC5B,EAA0B,EAAe,EAAQ,CAChD,GAAiB,EAA0B,EAAM,EAAc,CAKtE,SAAS,EAA0B,EAAc,CAC/C,+BAA+B,IACX,EAAE,CAAU,CAChC,OAAO,EACL,EAAwB,KAAK,EAAK,CAC9B,EAIA,EAAK,aAAa,CACvB,CACE,KACE,EAAM,IACL,GAEE,IAAU,EAAI,EAAK,GAAI,aAAa,CAAG,EAAK,GAAI,aAAa,GAC5D,EAA+B,EAAK,MAAM,EAAE,CAAG,EAAK,MAAM,EAAE,CAAC,aAAa,GAChF,CACA,KAAK,GAAG"}
1
+ {"version":3,"file":"to-camel-case.js","names":[],"sources":["../src/to-camel-case.ts"],"sourcesContent":["import type {\n CamelCaseOptions as BaseCamelCaseOptions,\n CamelCase,\n} from 'type-fest';\nimport type { OptionalOptionsWithDefaults } from './internal/types/optional-options-with-defaults';\nimport { words } from './internal/words';\n\nconst LOWER_CASE_CHARACTER_RE = /[a-z]/u;\n\nconst DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE = true;\n\ninterface CamelCaseOptions {\n readonly preserveConsecutiveUppercase?: boolean;\n}\n\ntype CamelCaseOptionsWithDefaults<Options extends CamelCaseOptions>\n = OptionalOptionsWithDefaults<\n CamelCaseOptions,\n Options,\n {\n // We use the runtime const for the default type so they stay coupled.\n preserveConsecutiveUppercase: typeof DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE;\n }\n >;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param data - A string.\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase(data);\n * toCamelCase(data, { preserveConsecutiveUppercase });\n * @example\n * toCamelCase(\"hello world\"); // \"helloWorld\"\n * toCamelCase(\"__HELLO_WORLD__\"); // \"helloWorld\"\n * toCamelCase(\"HasHTML\"); // \"hasHTML\"\n * toCamelCase(\"HasHTML\", { preserveConsecutiveUppercase: false }); // \"hasHtml\"\n * @dataFirst\n * @category String\n */\nexport function toCamelCase<T extends string, Options extends CamelCaseOptions>(\n data: T,\n options?: Options,\n): CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\n/**\n * Converts text to **camelCase** by splitting it into words, lowercasing the\n * first word, capitalizing the rest, then joining them back together.\n *\n * Because it uses the built-in case conversion methods, the function shares\n * their _[locale inaccuracies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase#description)_\n * too, making it best suited for simple strings like identifiers and internal\n * keys. For linguistic text processing, use [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter)\n * with [`granularity: \"word\"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#parameters),\n * [`toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase),\n * and [`toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase)\n * which are purpose-built to handle nuances in languages and locales.\n *\n * For other case manipulations see: `toLowerCase`, `toUpperCase`, `capitalize`,\n * `uncapitalize`, `toKebabCase`, `toSnakeCase`, and `toTitleCase`.\n *\n * For *PascalCase* use `capitalize(toCamelCase(data))`.\n *\n * @param options - An _optional_ object with the _optional_ property\n * `preserveConsecutiveUppercase` that can be used to change the way consecutive\n * uppercase characters are handled. Defaults to `true`.\n * @signature\n * toCamelCase()(data);\n * toCamelCase({ preserveConsecutiveUppercase })(data);\n * @example\n * pipe(\"hello world\", toCamelCase()); // \"helloWorld\"\n * pipe(\"__HELLO_WORLD__\", toCamelCase()); // \"helloWorld\"\n * pipe(\"HasHTML\", toCamelCase()); // \"hasHTML\"\n * pipe(\n * \"HasHTML\",\n * toCamelCase({ preserveConsecutiveUppercase: false }),\n * ); // \"hasHtml\"\n * @dataLast\n * @category String\n */\nexport function toCamelCase<Options extends CamelCaseOptions>(\n options?: Options,\n): <T extends string>(\n data: T,\n) => CamelCase<T, CamelCaseOptionsWithDefaults<Options> & BaseCamelCaseOptions>;\n\nexport function toCamelCase(\n dataOrOptions: CamelCaseOptions | string,\n options?: CamelCaseOptions,\n): unknown {\n return typeof dataOrOptions === 'string'\n ? toCamelCaseImplementation(dataOrOptions, options)\n : (data: string) => toCamelCaseImplementation(data, dataOrOptions);\n}\n\n// Based on the type definition from type-fest.\n// @see https://github.com/sindresorhus/type-fest/blob/main/source/camel-case.d.ts#L76-L80\nfunction toCamelCaseImplementation(data: string, {\n preserveConsecutiveUppercase = DEFAULT_PRESERVE_CONSECUTIVE_UPPERCASE,\n}: CamelCaseOptions = {}): string {\n return words(\n LOWER_CASE_CHARACTER_RE.test(data)\n ? data\n : // If the text doesn't have **any** lower case characters we also lower\n // case everything, but if it does we need to maintain them as it\n // affects the word boundaries.\n data.toLowerCase(),\n )\n .map(\n (word, index) =>\n `${\n // The first word is uncapitalized, the rest are capitalized\n index === 0 ? word[0]!.toLowerCase() : word[0]!.toUpperCase()\n }${preserveConsecutiveUppercase ? word.slice(1) : word.slice(1).toLowerCase()}`,\n )\n .join('');\n}\n"],"mappings":"wCAOA,MAAM,EAA0B,SAiGhC,SAAgB,EACd,EACA,EACS,CACT,OAAO,OAAO,GAAkB,SAC5B,EAA0B,EAAe,CAAO,EAC/C,GAAiB,EAA0B,EAAM,CAAa,CACrE,CAIA,SAAS,EAA0B,EAAc,CAC/C,+BAA+B,IACX,CAAC,EAAW,CAChC,OAAO,EACL,EAAwB,KAAK,CAAI,EAC7B,EAIA,EAAK,YAAY,CACvB,CAAC,CACE,KACE,EAAM,IACL,GAEE,IAAU,EAAI,EAAK,EAAE,CAAE,YAAY,EAAI,EAAK,EAAE,CAAE,YAAY,IAC3D,EAA+B,EAAK,MAAM,CAAC,EAAI,EAAK,MAAM,CAAC,CAAC,CAAC,YAAY,GAChF,CAAC,CACA,KAAK,EAAE,CACZ"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./curry.cjs`),t=require(`./words-C8Rd_80F.cjs`);function n(...t){return e.curry(r,t)}function r(e){return t.t(e).join(`-`).toLowerCase()}exports.toKebabCase=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs"),t=require("./words-B-9EXtsW.cjs");function n(...t){return e.curry(r,t)}function r(e){return t.t(e).join(`-`).toLowerCase()}exports.toKebabCase=n;
2
2
  //# sourceMappingURL=to-kebab-case.cjs.map