es-toolkit 1.48.1-dev.1890 → 1.48.1-dev.1894

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 (380) hide show
  1. package/dist/array/chunkBy.d.mts +32 -0
  2. package/dist/array/chunkBy.d.ts +32 -0
  3. package/dist/array/chunkBy.js +42 -0
  4. package/dist/array/chunkBy.mjs +42 -0
  5. package/dist/array/index.d.mts +2 -1
  6. package/dist/array/index.d.ts +2 -1
  7. package/dist/array/index.js +2 -0
  8. package/dist/array/index.mjs +2 -1
  9. package/dist/array/take.d.mts +1 -7
  10. package/dist/array/take.d.ts +1 -7
  11. package/dist/array/take.js +1 -9
  12. package/dist/array/take.mjs +1 -9
  13. package/dist/array/takeRight.d.mts +2 -2
  14. package/dist/array/takeRight.d.ts +2 -2
  15. package/dist/array/takeRight.js +2 -4
  16. package/dist/array/takeRight.mjs +2 -4
  17. package/dist/array/windowed.d.mts +1 -1
  18. package/dist/array/windowed.d.ts +1 -1
  19. package/dist/browser.global.js +3 -3
  20. package/dist/compat/array/drop.js +1 -1
  21. package/dist/compat/array/drop.mjs +1 -1
  22. package/dist/compat/array/dropRight.js +1 -1
  23. package/dist/compat/array/dropRight.mjs +1 -1
  24. package/dist/compat/array/findLast.js +1 -1
  25. package/dist/compat/array/findLast.mjs +1 -1
  26. package/dist/compat/array/includes.js +1 -1
  27. package/dist/compat/array/includes.mjs +1 -1
  28. package/dist/compat/array/nth.js +1 -1
  29. package/dist/compat/array/nth.mjs +1 -1
  30. package/dist/compat/array/slice.js +1 -1
  31. package/dist/compat/array/slice.mjs +1 -1
  32. package/dist/compat/array/sortedIndexBy.js +1 -1
  33. package/dist/compat/array/sortedIndexBy.mjs +1 -1
  34. package/dist/compat/array/take.js +2 -2
  35. package/dist/compat/array/take.mjs +2 -2
  36. package/dist/compat/array/takeRight.js +1 -1
  37. package/dist/compat/array/takeRight.mjs +1 -1
  38. package/dist/compat/compat.js +4 -4
  39. package/dist/compat/compat.mjs +4 -4
  40. package/dist/compat/index.js +4 -4
  41. package/dist/compat/index.mjs +4 -4
  42. package/dist/compat/math/add.js +1 -1
  43. package/dist/compat/math/add.mjs +1 -1
  44. package/dist/compat/math/divide.js +1 -1
  45. package/dist/compat/math/divide.mjs +1 -1
  46. package/dist/compat/math/multiply.js +1 -1
  47. package/dist/compat/math/multiply.mjs +1 -1
  48. package/dist/compat/math/subtract.js +1 -1
  49. package/dist/compat/math/subtract.mjs +1 -1
  50. package/dist/compat/object/omitBy.js +1 -1
  51. package/dist/compat/object/omitBy.mjs +1 -1
  52. package/dist/compat/object/pickBy.js +1 -1
  53. package/dist/compat/object/pickBy.mjs +1 -1
  54. package/dist/compat/string/repeat.js +1 -1
  55. package/dist/compat/string/repeat.mjs +1 -1
  56. package/dist/fp/_internal/lazy.js +58 -0
  57. package/dist/fp/_internal/lazy.mjs +57 -0
  58. package/dist/fp/array/at.d.mts +20 -0
  59. package/dist/fp/array/at.d.ts +20 -0
  60. package/dist/fp/array/at.js +25 -0
  61. package/dist/fp/array/at.mjs +25 -0
  62. package/dist/fp/array/cartesianProduct.d.mts +61 -0
  63. package/dist/fp/array/cartesianProduct.d.ts +61 -0
  64. package/dist/fp/array/cartesianProduct.js +9 -0
  65. package/dist/fp/array/cartesianProduct.mjs +9 -0
  66. package/dist/fp/array/chunk.d.mts +19 -0
  67. package/dist/fp/array/chunk.d.ts +19 -0
  68. package/dist/fp/array/chunk.js +24 -0
  69. package/dist/fp/array/chunk.mjs +24 -0
  70. package/dist/fp/array/chunkBy.d.mts +20 -0
  71. package/dist/fp/array/chunkBy.d.ts +20 -0
  72. package/dist/fp/array/chunkBy.js +25 -0
  73. package/dist/fp/array/chunkBy.mjs +25 -0
  74. package/dist/fp/array/combinations.d.mts +21 -0
  75. package/dist/fp/array/combinations.d.ts +21 -0
  76. package/dist/fp/array/combinations.js +26 -0
  77. package/dist/fp/array/combinations.mjs +26 -0
  78. package/dist/fp/array/compact.d.mts +22 -0
  79. package/dist/fp/array/compact.d.ts +22 -0
  80. package/dist/fp/array/compact.js +31 -0
  81. package/dist/fp/array/compact.mjs +30 -0
  82. package/dist/fp/array/countBy.d.mts +21 -0
  83. package/dist/fp/array/countBy.d.ts +21 -0
  84. package/dist/fp/array/countBy.js +26 -0
  85. package/dist/fp/array/countBy.mjs +26 -0
  86. package/dist/fp/array/difference.d.mts +21 -0
  87. package/dist/fp/array/difference.d.ts +21 -0
  88. package/dist/fp/array/difference.js +32 -0
  89. package/dist/fp/array/difference.mjs +31 -0
  90. package/dist/fp/array/differenceBy.d.mts +22 -0
  91. package/dist/fp/array/differenceBy.d.ts +22 -0
  92. package/dist/fp/array/differenceBy.js +33 -0
  93. package/dist/fp/array/differenceBy.mjs +32 -0
  94. package/dist/fp/array/differenceWith.d.mts +22 -0
  95. package/dist/fp/array/differenceWith.d.ts +22 -0
  96. package/dist/fp/array/differenceWith.js +32 -0
  97. package/dist/fp/array/differenceWith.mjs +31 -0
  98. package/dist/fp/array/drop.d.mts +20 -0
  99. package/dist/fp/array/drop.d.ts +20 -0
  100. package/dist/fp/array/drop.js +31 -0
  101. package/dist/fp/array/drop.mjs +30 -0
  102. package/dist/fp/array/dropRight.d.mts +20 -0
  103. package/dist/fp/array/dropRight.d.ts +20 -0
  104. package/dist/fp/array/dropRight.js +25 -0
  105. package/dist/fp/array/dropRight.mjs +25 -0
  106. package/dist/fp/array/dropRightWhile.d.mts +20 -0
  107. package/dist/fp/array/dropRightWhile.d.ts +20 -0
  108. package/dist/fp/array/dropRightWhile.js +25 -0
  109. package/dist/fp/array/dropRightWhile.mjs +25 -0
  110. package/dist/fp/array/dropWhile.d.mts +20 -0
  111. package/dist/fp/array/dropWhile.d.ts +20 -0
  112. package/dist/fp/array/dropWhile.js +36 -0
  113. package/dist/fp/array/dropWhile.mjs +36 -0
  114. package/dist/fp/array/filter.d.mts +45 -0
  115. package/dist/fp/array/filter.d.ts +45 -0
  116. package/dist/fp/array/filter.js +13 -0
  117. package/dist/fp/array/filter.mjs +12 -0
  118. package/dist/fp/array/find.d.mts +39 -0
  119. package/dist/fp/array/find.d.ts +39 -0
  120. package/dist/fp/array/find.js +8 -0
  121. package/dist/fp/array/find.mjs +8 -0
  122. package/dist/fp/array/findIndex.d.mts +20 -0
  123. package/dist/fp/array/findIndex.d.ts +20 -0
  124. package/dist/fp/array/findIndex.js +24 -0
  125. package/dist/fp/array/findIndex.mjs +24 -0
  126. package/dist/fp/array/findLast.d.mts +39 -0
  127. package/dist/fp/array/findLast.d.ts +39 -0
  128. package/dist/fp/array/findLast.js +11 -0
  129. package/dist/fp/array/findLast.mjs +11 -0
  130. package/dist/fp/array/findLastIndex.d.mts +20 -0
  131. package/dist/fp/array/findLastIndex.d.ts +20 -0
  132. package/dist/fp/array/findLastIndex.js +25 -0
  133. package/dist/fp/array/findLastIndex.mjs +25 -0
  134. package/dist/fp/array/flatMap.d.mts +28 -0
  135. package/dist/fp/array/flatMap.d.ts +28 -0
  136. package/dist/fp/array/flatMap.js +39 -0
  137. package/dist/fp/array/flatMap.mjs +38 -0
  138. package/dist/fp/array/flatMapDeep.d.mts +23 -0
  139. package/dist/fp/array/flatMapDeep.d.ts +23 -0
  140. package/dist/fp/array/flatMapDeep.js +38 -0
  141. package/dist/fp/array/flatMapDeep.mjs +37 -0
  142. package/dist/fp/array/flatten.d.mts +21 -0
  143. package/dist/fp/array/flatten.d.ts +21 -0
  144. package/dist/fp/array/flatten.js +39 -0
  145. package/dist/fp/array/flatten.mjs +38 -0
  146. package/dist/fp/array/flattenDeep.d.mts +21 -0
  147. package/dist/fp/array/flattenDeep.d.ts +21 -0
  148. package/dist/fp/array/flattenDeep.js +36 -0
  149. package/dist/fp/array/flattenDeep.mjs +35 -0
  150. package/dist/fp/array/forEach.d.mts +22 -0
  151. package/dist/fp/array/forEach.d.ts +22 -0
  152. package/dist/fp/array/forEach.js +33 -0
  153. package/dist/fp/array/forEach.mjs +32 -0
  154. package/dist/fp/array/groupBy.d.mts +21 -0
  155. package/dist/fp/array/groupBy.d.ts +21 -0
  156. package/dist/fp/array/groupBy.js +26 -0
  157. package/dist/fp/array/groupBy.mjs +26 -0
  158. package/dist/fp/array/head.d.mts +35 -0
  159. package/dist/fp/array/head.d.ts +35 -0
  160. package/dist/fp/array/head.js +9 -0
  161. package/dist/fp/array/head.mjs +9 -0
  162. package/dist/fp/array/index.d.mts +69 -0
  163. package/dist/fp/array/index.d.ts +69 -0
  164. package/dist/fp/array/index.js +68 -0
  165. package/dist/fp/array/index.mjs +68 -0
  166. package/dist/fp/array/initial.d.mts +19 -0
  167. package/dist/fp/array/initial.d.ts +19 -0
  168. package/dist/fp/array/initial.js +24 -0
  169. package/dist/fp/array/initial.mjs +24 -0
  170. package/dist/fp/array/intersection.d.mts +21 -0
  171. package/dist/fp/array/intersection.d.ts +21 -0
  172. package/dist/fp/array/intersection.js +32 -0
  173. package/dist/fp/array/intersection.mjs +31 -0
  174. package/dist/fp/array/intersectionBy.d.mts +22 -0
  175. package/dist/fp/array/intersectionBy.d.ts +22 -0
  176. package/dist/fp/array/intersectionBy.js +33 -0
  177. package/dist/fp/array/intersectionBy.mjs +32 -0
  178. package/dist/fp/array/intersectionWith.d.mts +22 -0
  179. package/dist/fp/array/intersectionWith.d.ts +22 -0
  180. package/dist/fp/array/intersectionWith.js +32 -0
  181. package/dist/fp/array/intersectionWith.mjs +31 -0
  182. package/dist/fp/array/isSubset.d.mts +20 -0
  183. package/dist/fp/array/isSubset.d.ts +20 -0
  184. package/dist/fp/array/isSubset.js +25 -0
  185. package/dist/fp/array/isSubset.mjs +25 -0
  186. package/dist/fp/array/isSubsetWith.d.mts +21 -0
  187. package/dist/fp/array/isSubsetWith.d.ts +21 -0
  188. package/dist/fp/array/isSubsetWith.js +26 -0
  189. package/dist/fp/array/isSubsetWith.mjs +26 -0
  190. package/dist/fp/array/join.d.mts +20 -0
  191. package/dist/fp/array/join.d.ts +20 -0
  192. package/dist/fp/array/join.js +24 -0
  193. package/dist/fp/array/join.mjs +24 -0
  194. package/dist/fp/array/keyBy.d.mts +21 -0
  195. package/dist/fp/array/keyBy.d.ts +21 -0
  196. package/dist/fp/array/keyBy.js +26 -0
  197. package/dist/fp/array/keyBy.mjs +26 -0
  198. package/dist/fp/array/last.d.mts +35 -0
  199. package/dist/fp/array/last.d.ts +35 -0
  200. package/dist/fp/array/last.js +9 -0
  201. package/dist/fp/array/last.mjs +9 -0
  202. package/dist/fp/array/length.d.mts +18 -0
  203. package/dist/fp/array/length.d.ts +18 -0
  204. package/dist/fp/array/length.js +22 -0
  205. package/dist/fp/array/length.mjs +22 -0
  206. package/dist/fp/array/map.d.mts +27 -0
  207. package/dist/fp/array/map.d.ts +27 -0
  208. package/dist/fp/array/map.js +36 -0
  209. package/dist/fp/array/map.mjs +35 -0
  210. package/dist/fp/array/maxBy.d.mts +37 -0
  211. package/dist/fp/array/maxBy.d.ts +37 -0
  212. package/dist/fp/array/maxBy.js +9 -0
  213. package/dist/fp/array/maxBy.mjs +9 -0
  214. package/dist/fp/array/minBy.d.mts +37 -0
  215. package/dist/fp/array/minBy.d.ts +37 -0
  216. package/dist/fp/array/minBy.js +9 -0
  217. package/dist/fp/array/minBy.mjs +9 -0
  218. package/dist/fp/array/orderBy.d.mts +21 -0
  219. package/dist/fp/array/orderBy.d.ts +21 -0
  220. package/dist/fp/array/orderBy.js +26 -0
  221. package/dist/fp/array/orderBy.mjs +26 -0
  222. package/dist/fp/array/partition.d.mts +39 -0
  223. package/dist/fp/array/partition.d.ts +39 -0
  224. package/dist/fp/array/partition.js +9 -0
  225. package/dist/fp/array/partition.mjs +9 -0
  226. package/dist/fp/array/reverse.d.mts +19 -0
  227. package/dist/fp/array/reverse.d.ts +19 -0
  228. package/dist/fp/array/reverse.js +23 -0
  229. package/dist/fp/array/reverse.mjs +23 -0
  230. package/dist/fp/array/sample.d.mts +18 -0
  231. package/dist/fp/array/sample.d.ts +18 -0
  232. package/dist/fp/array/sample.js +23 -0
  233. package/dist/fp/array/sample.mjs +23 -0
  234. package/dist/fp/array/sampleSize.d.mts +20 -0
  235. package/dist/fp/array/sampleSize.d.ts +20 -0
  236. package/dist/fp/array/sampleSize.js +25 -0
  237. package/dist/fp/array/sampleSize.mjs +25 -0
  238. package/dist/fp/array/shuffle.d.mts +19 -0
  239. package/dist/fp/array/shuffle.d.ts +19 -0
  240. package/dist/fp/array/shuffle.js +24 -0
  241. package/dist/fp/array/shuffle.mjs +24 -0
  242. package/dist/fp/array/sortBy.d.mts +26 -0
  243. package/dist/fp/array/sortBy.d.ts +26 -0
  244. package/dist/fp/array/sortBy.js +31 -0
  245. package/dist/fp/array/sortBy.mjs +31 -0
  246. package/dist/fp/array/tail.d.mts +19 -0
  247. package/dist/fp/array/tail.d.ts +19 -0
  248. package/dist/fp/array/tail.js +24 -0
  249. package/dist/fp/array/tail.mjs +24 -0
  250. package/dist/fp/array/take.d.mts +26 -0
  251. package/dist/fp/array/take.d.ts +26 -0
  252. package/dist/fp/array/take.js +39 -0
  253. package/dist/fp/array/take.mjs +38 -0
  254. package/dist/fp/array/takeRight.d.mts +20 -0
  255. package/dist/fp/array/takeRight.d.ts +20 -0
  256. package/dist/fp/array/takeRight.js +25 -0
  257. package/dist/fp/array/takeRight.mjs +25 -0
  258. package/dist/fp/array/takeRightWhile.d.mts +20 -0
  259. package/dist/fp/array/takeRightWhile.d.ts +20 -0
  260. package/dist/fp/array/takeRightWhile.js +25 -0
  261. package/dist/fp/array/takeRightWhile.mjs +25 -0
  262. package/dist/fp/array/takeWhile.d.mts +21 -0
  263. package/dist/fp/array/takeWhile.d.ts +21 -0
  264. package/dist/fp/array/takeWhile.js +32 -0
  265. package/dist/fp/array/takeWhile.mjs +31 -0
  266. package/dist/fp/array/toFilled.d.mts +23 -0
  267. package/dist/fp/array/toFilled.d.ts +23 -0
  268. package/dist/fp/array/toFilled.js +30 -0
  269. package/dist/fp/array/toFilled.mjs +30 -0
  270. package/dist/fp/array/union.d.mts +20 -0
  271. package/dist/fp/array/union.d.ts +20 -0
  272. package/dist/fp/array/union.js +25 -0
  273. package/dist/fp/array/union.mjs +25 -0
  274. package/dist/fp/array/unionBy.d.mts +22 -0
  275. package/dist/fp/array/unionBy.d.ts +22 -0
  276. package/dist/fp/array/unionBy.js +27 -0
  277. package/dist/fp/array/unionBy.mjs +27 -0
  278. package/dist/fp/array/unionWith.d.mts +21 -0
  279. package/dist/fp/array/unionWith.d.ts +21 -0
  280. package/dist/fp/array/unionWith.js +26 -0
  281. package/dist/fp/array/unionWith.mjs +26 -0
  282. package/dist/fp/array/uniq.d.mts +21 -0
  283. package/dist/fp/array/uniq.d.ts +21 -0
  284. package/dist/fp/array/uniq.js +36 -0
  285. package/dist/fp/array/uniq.mjs +36 -0
  286. package/dist/fp/array/uniqBy.d.mts +21 -0
  287. package/dist/fp/array/uniqBy.d.ts +21 -0
  288. package/dist/fp/array/uniqBy.js +38 -0
  289. package/dist/fp/array/uniqBy.mjs +38 -0
  290. package/dist/fp/array/uniqWith.d.mts +20 -0
  291. package/dist/fp/array/uniqWith.d.ts +20 -0
  292. package/dist/fp/array/uniqWith.js +35 -0
  293. package/dist/fp/array/uniqWith.mjs +35 -0
  294. package/dist/fp/array/unzip.d.mts +20 -0
  295. package/dist/fp/array/unzip.d.ts +20 -0
  296. package/dist/fp/array/unzip.js +24 -0
  297. package/dist/fp/array/unzip.mjs +24 -0
  298. package/dist/fp/array/unzipWith.d.mts +21 -0
  299. package/dist/fp/array/unzipWith.d.ts +21 -0
  300. package/dist/fp/array/unzipWith.js +26 -0
  301. package/dist/fp/array/unzipWith.mjs +26 -0
  302. package/dist/fp/array/windowed.d.mts +25 -0
  303. package/dist/fp/array/windowed.d.ts +25 -0
  304. package/dist/fp/array/windowed.js +50 -0
  305. package/dist/fp/array/windowed.mjs +50 -0
  306. package/dist/fp/array/without.d.mts +19 -0
  307. package/dist/fp/array/without.d.ts +19 -0
  308. package/dist/fp/array/without.js +30 -0
  309. package/dist/fp/array/without.mjs +29 -0
  310. package/dist/fp/array/xor.d.mts +20 -0
  311. package/dist/fp/array/xor.d.ts +20 -0
  312. package/dist/fp/array/xor.js +25 -0
  313. package/dist/fp/array/xor.mjs +25 -0
  314. package/dist/fp/array/xorBy.d.mts +22 -0
  315. package/dist/fp/array/xorBy.d.ts +22 -0
  316. package/dist/fp/array/xorBy.js +27 -0
  317. package/dist/fp/array/xorBy.mjs +27 -0
  318. package/dist/fp/array/xorWith.d.mts +21 -0
  319. package/dist/fp/array/xorWith.d.ts +21 -0
  320. package/dist/fp/array/xorWith.js +26 -0
  321. package/dist/fp/array/xorWith.mjs +26 -0
  322. package/dist/fp/array/zip.d.mts +61 -0
  323. package/dist/fp/array/zip.d.ts +61 -0
  324. package/dist/fp/array/zip.js +9 -0
  325. package/dist/fp/array/zip.mjs +9 -0
  326. package/dist/fp/array/zipObject.d.mts +21 -0
  327. package/dist/fp/array/zipObject.d.ts +21 -0
  328. package/dist/fp/array/zipObject.js +26 -0
  329. package/dist/fp/array/zipObject.mjs +26 -0
  330. package/dist/fp/array/zipWith.d.mts +57 -0
  331. package/dist/fp/array/zipWith.d.ts +57 -0
  332. package/dist/fp/array/zipWith.js +9 -0
  333. package/dist/fp/array/zipWith.mjs +9 -0
  334. package/dist/fp/index.d.mts +75 -0
  335. package/dist/fp/index.d.ts +75 -0
  336. package/dist/fp/index.js +150 -0
  337. package/dist/fp/index.mjs +77 -0
  338. package/dist/fp/math/add.d.mts +17 -0
  339. package/dist/fp/math/add.d.ts +17 -0
  340. package/dist/fp/math/add.js +21 -0
  341. package/dist/fp/math/add.mjs +21 -0
  342. package/dist/fp/math/index.d.mts +2 -0
  343. package/dist/fp/math/index.d.ts +2 -0
  344. package/dist/fp/math/index.js +2 -0
  345. package/dist/fp/math/index.mjs +2 -0
  346. package/dist/fp/math/multiply.d.mts +17 -0
  347. package/dist/fp/math/multiply.d.ts +17 -0
  348. package/dist/fp/math/multiply.js +21 -0
  349. package/dist/fp/math/multiply.mjs +21 -0
  350. package/dist/fp/object/index.d.mts +2 -0
  351. package/dist/fp/object/index.d.ts +2 -0
  352. package/dist/fp/object/index.js +2 -0
  353. package/dist/fp/object/index.mjs +2 -0
  354. package/dist/fp/object/omit.d.mts +18 -0
  355. package/dist/fp/object/omit.d.ts +18 -0
  356. package/dist/fp/object/omit.js +23 -0
  357. package/dist/fp/object/omit.mjs +23 -0
  358. package/dist/fp/object/pick.d.mts +19 -0
  359. package/dist/fp/object/pick.d.ts +19 -0
  360. package/dist/fp/object/pick.js +24 -0
  361. package/dist/fp/object/pick.mjs +24 -0
  362. package/dist/fp/pipe.d.mts +235 -0
  363. package/dist/fp/pipe.d.ts +235 -0
  364. package/dist/fp/pipe.js +116 -0
  365. package/dist/fp/pipe.mjs +116 -0
  366. package/dist/index.d.mts +3 -1
  367. package/dist/index.d.ts +3 -1
  368. package/dist/index.js +4 -0
  369. package/dist/index.mjs +3 -1
  370. package/dist/predicate/index.d.mts +2 -1
  371. package/dist/predicate/index.d.ts +2 -1
  372. package/dist/predicate/index.js +2 -0
  373. package/dist/predicate/index.mjs +2 -1
  374. package/dist/predicate/isIterable.d.mts +26 -0
  375. package/dist/predicate/isIterable.d.ts +26 -0
  376. package/dist/predicate/isIterable.js +28 -0
  377. package/dist/predicate/isIterable.mjs +28 -0
  378. package/fp.d.ts +1 -0
  379. package/fp.js +1 -0
  380. package/package.json +22 -1
@@ -1,8 +1,4 @@
1
1
  const require_runtime = require("../_virtual/_rolldown/runtime.js");
2
- const require_isSymbol = require("./predicate/isSymbol.js");
3
- const require_toNumber = require("./util/toNumber.js");
4
- const require_toFinite = require("./util/toFinite.js");
5
- const require_toInteger = require("./util/toInteger.js");
6
2
  const require_isArray = require("./predicate/isArray.js");
7
3
  const require_isPlainObject = require("./predicate/isPlainObject.js");
8
4
  const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
@@ -34,6 +30,10 @@ const require_difference = require("./array/difference.js");
34
30
  const require_last = require("./array/last.js");
35
31
  const require_differenceBy = require("./array/differenceBy.js");
36
32
  const require_differenceWith = require("./array/differenceWith.js");
33
+ const require_isSymbol = require("./predicate/isSymbol.js");
34
+ const require_toNumber = require("./util/toNumber.js");
35
+ const require_toFinite = require("./util/toFinite.js");
36
+ const require_toInteger = require("./util/toInteger.js");
37
37
  const require_drop = require("./array/drop.js");
38
38
  const require_dropRight = require("./array/dropRight.js");
39
39
  const require_dropRightWhile = require("./array/dropRightWhile.js");
@@ -1,8 +1,4 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
- import { isSymbol } from "./predicate/isSymbol.mjs";
3
- import { toNumber } from "./util/toNumber.mjs";
4
- import { toFinite } from "./util/toFinite.mjs";
5
- import { toInteger } from "./util/toInteger.mjs";
6
2
  import { isArray } from "./predicate/isArray.mjs";
7
3
  import { isPlainObject } from "./predicate/isPlainObject.mjs";
8
4
  import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
@@ -34,6 +30,10 @@ import { difference } from "./array/difference.mjs";
34
30
  import { last } from "./array/last.mjs";
35
31
  import { differenceBy } from "./array/differenceBy.mjs";
36
32
  import { differenceWith } from "./array/differenceWith.mjs";
33
+ import { isSymbol } from "./predicate/isSymbol.mjs";
34
+ import { toNumber } from "./util/toNumber.mjs";
35
+ import { toFinite } from "./util/toFinite.mjs";
36
+ import { toInteger } from "./util/toInteger.mjs";
37
37
  import { drop } from "./array/drop.mjs";
38
38
  import { dropRight } from "./array/dropRight.mjs";
39
39
  import { dropRightWhile } from "./array/dropRightWhile.mjs";
@@ -2,10 +2,6 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_isSymbol = require("./predicate/isSymbol.js");
6
- const require_toNumber = require("./util/toNumber.js");
7
- const require_toFinite = require("./util/toFinite.js");
8
- const require_toInteger = require("./util/toInteger.js");
9
5
  const require_isArray = require("./predicate/isArray.js");
10
6
  const require_isPlainObject = require("./predicate/isPlainObject.js");
11
7
  const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
@@ -36,6 +32,10 @@ const require_difference = require("./array/difference.js");
36
32
  const require_last = require("./array/last.js");
37
33
  const require_differenceBy = require("./array/differenceBy.js");
38
34
  const require_differenceWith = require("./array/differenceWith.js");
35
+ const require_isSymbol = require("./predicate/isSymbol.js");
36
+ const require_toNumber = require("./util/toNumber.js");
37
+ const require_toFinite = require("./util/toFinite.js");
38
+ const require_toInteger = require("./util/toInteger.js");
39
39
  const require_drop = require("./array/drop.js");
40
40
  const require_dropRight = require("./array/dropRight.js");
41
41
  const require_dropRightWhile = require("./array/dropRightWhile.js");
@@ -1,7 +1,3 @@
1
- import { isSymbol } from "./predicate/isSymbol.mjs";
2
- import { toNumber } from "./util/toNumber.mjs";
3
- import { toFinite } from "./util/toFinite.mjs";
4
- import { toInteger } from "./util/toInteger.mjs";
5
1
  import { isArray } from "./predicate/isArray.mjs";
6
2
  import { isPlainObject } from "./predicate/isPlainObject.mjs";
7
3
  import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
@@ -32,6 +28,10 @@ import { difference } from "./array/difference.mjs";
32
28
  import { last } from "./array/last.mjs";
33
29
  import { differenceBy } from "./array/differenceBy.mjs";
34
30
  import { differenceWith } from "./array/differenceWith.mjs";
31
+ import { isSymbol } from "./predicate/isSymbol.mjs";
32
+ import { toNumber } from "./util/toNumber.mjs";
33
+ import { toFinite } from "./util/toFinite.mjs";
34
+ import { toInteger } from "./util/toInteger.mjs";
35
35
  import { drop } from "./array/drop.mjs";
36
36
  import { dropRight } from "./array/dropRight.mjs";
37
37
  import { dropRightWhile } from "./array/dropRightWhile.mjs";
@@ -1,5 +1,5 @@
1
- const require_toNumber = require("../util/toNumber.js");
2
1
  const require_toString = require("../util/toString.js");
2
+ const require_toNumber = require("../util/toNumber.js");
3
3
  //#region src/compat/math/add.ts
4
4
  /**
5
5
  * Adds two numbers while safely handling `NaN` values.
@@ -1,5 +1,5 @@
1
- import { toNumber } from "../util/toNumber.mjs";
2
1
  import { toString } from "../util/toString.mjs";
2
+ import { toNumber } from "../util/toNumber.mjs";
3
3
  //#region src/compat/math/add.ts
4
4
  /**
5
5
  * Adds two numbers while safely handling `NaN` values.
@@ -1,5 +1,5 @@
1
- const require_toNumber = require("../util/toNumber.js");
2
1
  const require_toString = require("../util/toString.js");
2
+ const require_toNumber = require("../util/toNumber.js");
3
3
  //#region src/compat/math/divide.ts
4
4
  /**
5
5
  * Divide two numbers.
@@ -1,5 +1,5 @@
1
- import { toNumber } from "../util/toNumber.mjs";
2
1
  import { toString } from "../util/toString.mjs";
2
+ import { toNumber } from "../util/toNumber.mjs";
3
3
  //#region src/compat/math/divide.ts
4
4
  /**
5
5
  * Divide two numbers.
@@ -1,5 +1,5 @@
1
- const require_toNumber = require("../util/toNumber.js");
2
1
  const require_toString = require("../util/toString.js");
2
+ const require_toNumber = require("../util/toNumber.js");
3
3
  //#region src/compat/math/multiply.ts
4
4
  /**
5
5
  * Multiply two numbers.
@@ -1,5 +1,5 @@
1
- import { toNumber } from "../util/toNumber.mjs";
2
1
  import { toString } from "../util/toString.mjs";
2
+ import { toNumber } from "../util/toNumber.mjs";
3
3
  //#region src/compat/math/multiply.ts
4
4
  /**
5
5
  * Multiply two numbers.
@@ -1,5 +1,5 @@
1
- const require_toNumber = require("../util/toNumber.js");
2
1
  const require_toString = require("../util/toString.js");
2
+ const require_toNumber = require("../util/toNumber.js");
3
3
  //#region src/compat/math/subtract.ts
4
4
  /**
5
5
  * Subtracts one number from another.
@@ -1,5 +1,5 @@
1
- import { toNumber } from "../util/toNumber.mjs";
2
1
  import { toString } from "../util/toString.mjs";
2
+ import { toNumber } from "../util/toNumber.mjs";
3
3
  //#region src/compat/math/subtract.ts
4
4
  /**
5
5
  * Subtracts one number from another.
@@ -1,5 +1,5 @@
1
- const require_isSymbol = require("../predicate/isSymbol.js");
2
1
  const require_iteratee = require("../util/iteratee.js");
2
+ const require_isSymbol = require("../predicate/isSymbol.js");
3
3
  const require_identity = require("../function/identity.js");
4
4
  const require_keysIn = require("./keysIn.js");
5
5
  const require_getSymbolsIn = require("../_internal/getSymbolsIn.js");
@@ -1,5 +1,5 @@
1
- import { isSymbol } from "../predicate/isSymbol.mjs";
2
1
  import { iteratee } from "../util/iteratee.mjs";
2
+ import { isSymbol } from "../predicate/isSymbol.mjs";
3
3
  import { identity } from "../function/identity.mjs";
4
4
  import { keysIn } from "./keysIn.mjs";
5
5
  import { getSymbolsIn } from "../_internal/getSymbolsIn.mjs";
@@ -1,7 +1,7 @@
1
- const require_isSymbol = require("../predicate/isSymbol.js");
2
1
  const require_range = require("../../math/range.js");
3
2
  const require_isArrayLike = require("../predicate/isArrayLike.js");
4
3
  const require_iteratee = require("../util/iteratee.js");
4
+ const require_isSymbol = require("../predicate/isSymbol.js");
5
5
  const require_identity = require("../function/identity.js");
6
6
  const require_keysIn = require("./keysIn.js");
7
7
  const require_getSymbolsIn = require("../_internal/getSymbolsIn.js");
@@ -1,7 +1,7 @@
1
- import { isSymbol } from "../predicate/isSymbol.mjs";
2
1
  import { range } from "../../math/range.mjs";
3
2
  import { isArrayLike } from "../predicate/isArrayLike.mjs";
4
3
  import { iteratee } from "../util/iteratee.mjs";
4
+ import { isSymbol } from "../predicate/isSymbol.mjs";
5
5
  import { identity } from "../function/identity.mjs";
6
6
  import { keysIn } from "./keysIn.mjs";
7
7
  import { getSymbolsIn } from "../_internal/getSymbolsIn.mjs";
@@ -1,5 +1,5 @@
1
- const require_toInteger = require("../util/toInteger.js");
2
1
  const require_toString = require("../util/toString.js");
2
+ const require_toInteger = require("../util/toInteger.js");
3
3
  const require_isIterateeCall = require("../_internal/isIterateeCall.js");
4
4
  const require_MAX_SAFE_INTEGER = require("../_internal/MAX_SAFE_INTEGER.js");
5
5
  //#region src/compat/string/repeat.ts
@@ -1,5 +1,5 @@
1
- import { toInteger } from "../util/toInteger.mjs";
2
1
  import { toString } from "../util/toString.mjs";
2
+ import { toInteger } from "../util/toInteger.mjs";
3
3
  import { isIterateeCall } from "../_internal/isIterateeCall.mjs";
4
4
  import { MAX_SAFE_INTEGER } from "../_internal/MAX_SAFE_INTEGER.mjs";
5
5
  //#region src/compat/string/repeat.ts
@@ -0,0 +1,58 @@
1
+ //#region src/fp/_internal/lazy.ts
2
+ /**
3
+ * Pairs an eager data-last function with a lazy transform (see
4
+ * {@link createLazyFunction}).
5
+ *
6
+ * The returned function behaves exactly like `eager` when called directly. When
7
+ * placed inside a {@link pipe}, the attached transform lets `pipe` fuse it with
8
+ * adjacent lazy functions into a single, short-circuiting pass.
9
+ *
10
+ * @template Eager - The eager data-last function type.
11
+ * @param eager - The eager `(array) => result` implementation.
12
+ * @param lazy - The lazy transform built by {@link createLazyFunction}.
13
+ * @param options - Set `shortCircuit: true` for functions that can end a run early.
14
+ * @returns `eager`, augmented in place with the lazy metadata.
15
+ */
16
+ function combineEagerAndLazyFunctions(eager, lazy, { shortCircuit } = {}) {
17
+ return Object.assign(eager, {
18
+ lazy,
19
+ shortCircuit
20
+ });
21
+ }
22
+ /**
23
+ * Builds a {@link LazyTransform} from a per-element `step`.
24
+ *
25
+ * `step` receives each input `value`, its zero-based `index` within this stage,
26
+ * and an `emit` callback that forwards a result to the next stage. Call `emit`
27
+ * zero times (drop), once (`map`), or many times (`flatMap`). Return
28
+ * `false` to end the run after this element (used by short-circuiting functions
29
+ * like `take`); returning nothing continues.
30
+ *
31
+ * @template T - The type of values entering this stage.
32
+ * @template U - The type of values it emits.
33
+ * @param step - The per-element push function.
34
+ * @returns A lazy transform that `pipe` can fuse and drive.
35
+ *
36
+ * @example
37
+ * // map
38
+ * createLazyFunction<T, U>((value, index, emit) => {
39
+ * emit(callback(value, index));
40
+ * });
41
+ */
42
+ function createLazyFunction(step) {
43
+ return (emit) => {
44
+ let index = 0;
45
+ let active = true;
46
+ const _emit = (value) => {
47
+ if (!active) return;
48
+ if (emit(value) === false) active = false;
49
+ };
50
+ return (value) => {
51
+ if (step(value, index++, _emit) === false) active = false;
52
+ return active;
53
+ };
54
+ };
55
+ }
56
+ //#endregion
57
+ exports.combineEagerAndLazyFunctions = combineEagerAndLazyFunctions;
58
+ exports.createLazyFunction = createLazyFunction;
@@ -0,0 +1,57 @@
1
+ //#region src/fp/_internal/lazy.ts
2
+ /**
3
+ * Pairs an eager data-last function with a lazy transform (see
4
+ * {@link createLazyFunction}).
5
+ *
6
+ * The returned function behaves exactly like `eager` when called directly. When
7
+ * placed inside a {@link pipe}, the attached transform lets `pipe` fuse it with
8
+ * adjacent lazy functions into a single, short-circuiting pass.
9
+ *
10
+ * @template Eager - The eager data-last function type.
11
+ * @param eager - The eager `(array) => result` implementation.
12
+ * @param lazy - The lazy transform built by {@link createLazyFunction}.
13
+ * @param options - Set `shortCircuit: true` for functions that can end a run early.
14
+ * @returns `eager`, augmented in place with the lazy metadata.
15
+ */
16
+ function combineEagerAndLazyFunctions(eager, lazy, { shortCircuit } = {}) {
17
+ return Object.assign(eager, {
18
+ lazy,
19
+ shortCircuit
20
+ });
21
+ }
22
+ /**
23
+ * Builds a {@link LazyTransform} from a per-element `step`.
24
+ *
25
+ * `step` receives each input `value`, its zero-based `index` within this stage,
26
+ * and an `emit` callback that forwards a result to the next stage. Call `emit`
27
+ * zero times (drop), once (`map`), or many times (`flatMap`). Return
28
+ * `false` to end the run after this element (used by short-circuiting functions
29
+ * like `take`); returning nothing continues.
30
+ *
31
+ * @template T - The type of values entering this stage.
32
+ * @template U - The type of values it emits.
33
+ * @param step - The per-element push function.
34
+ * @returns A lazy transform that `pipe` can fuse and drive.
35
+ *
36
+ * @example
37
+ * // map
38
+ * createLazyFunction<T, U>((value, index, emit) => {
39
+ * emit(callback(value, index));
40
+ * });
41
+ */
42
+ function createLazyFunction(step) {
43
+ return (emit) => {
44
+ let index = 0;
45
+ let active = true;
46
+ const _emit = (value) => {
47
+ if (!active) return;
48
+ if (emit(value) === false) active = false;
49
+ };
50
+ return (value) => {
51
+ if (step(value, index++, _emit) === false) active = false;
52
+ return active;
53
+ };
54
+ };
55
+ }
56
+ //#endregion
57
+ export { combineEagerAndLazyFunctions, createLazyFunction };
@@ -0,0 +1,20 @@
1
+ //#region src/fp/array/at.d.ts
2
+ /**
3
+ * Creates a function that retrieves elements from the piped array at the specified indices.
4
+ *
5
+ * Negative indices count back from the end of the array, matching the main {@link at}
6
+ * implementation. Use the returned function with {@link pipe}.
7
+ *
8
+ * @template T - The type of elements in the array.
9
+ * @param indices - The indices of the elements to retrieve from the piped array.
10
+ * @returns A function that maps a readonly array to a new array of selected values.
11
+ *
12
+ * @example
13
+ * import { at, pipe } from 'es-toolkit/fp';
14
+ *
15
+ * pipe([10, 20, 30, 40], at([1, -1]));
16
+ * // => [20, 40]
17
+ */
18
+ declare function at<T>(indices: number[]): (array: readonly T[]) => T[];
19
+ //#endregion
20
+ export { at };
@@ -0,0 +1,20 @@
1
+ //#region src/fp/array/at.d.ts
2
+ /**
3
+ * Creates a function that retrieves elements from the piped array at the specified indices.
4
+ *
5
+ * Negative indices count back from the end of the array, matching the main {@link at}
6
+ * implementation. Use the returned function with {@link pipe}.
7
+ *
8
+ * @template T - The type of elements in the array.
9
+ * @param indices - The indices of the elements to retrieve from the piped array.
10
+ * @returns A function that maps a readonly array to a new array of selected values.
11
+ *
12
+ * @example
13
+ * import { at, pipe } from 'es-toolkit/fp';
14
+ *
15
+ * pipe([10, 20, 30, 40], at([1, -1]));
16
+ * // => [20, 40]
17
+ */
18
+ declare function at<T>(indices: number[]): (array: readonly T[]) => T[];
19
+ //#endregion
20
+ export { at };
@@ -0,0 +1,25 @@
1
+ const require_at = require("../../array/at.js");
2
+ //#region src/fp/array/at.ts
3
+ /**
4
+ * Creates a function that retrieves elements from the piped array at the specified indices.
5
+ *
6
+ * Negative indices count back from the end of the array, matching the main {@link at}
7
+ * implementation. Use the returned function with {@link pipe}.
8
+ *
9
+ * @template T - The type of elements in the array.
10
+ * @param indices - The indices of the elements to retrieve from the piped array.
11
+ * @returns A function that maps a readonly array to a new array of selected values.
12
+ *
13
+ * @example
14
+ * import { at, pipe } from 'es-toolkit/fp';
15
+ *
16
+ * pipe([10, 20, 30, 40], at([1, -1]));
17
+ * // => [20, 40]
18
+ */
19
+ function at(indices) {
20
+ return function(array) {
21
+ return require_at.at(array, indices);
22
+ };
23
+ }
24
+ //#endregion
25
+ exports.at = at;
@@ -0,0 +1,25 @@
1
+ import { at as at$1 } from "../../array/at.mjs";
2
+ //#region src/fp/array/at.ts
3
+ /**
4
+ * Creates a function that retrieves elements from the piped array at the specified indices.
5
+ *
6
+ * Negative indices count back from the end of the array, matching the main {@link at}
7
+ * implementation. Use the returned function with {@link pipe}.
8
+ *
9
+ * @template T - The type of elements in the array.
10
+ * @param indices - The indices of the elements to retrieve from the piped array.
11
+ * @returns A function that maps a readonly array to a new array of selected values.
12
+ *
13
+ * @example
14
+ * import { at, pipe } from 'es-toolkit/fp';
15
+ *
16
+ * pipe([10, 20, 30, 40], at([1, -1]));
17
+ * // => [20, 40]
18
+ */
19
+ function at(indices) {
20
+ return function(array) {
21
+ return at$1(array, indices);
22
+ };
23
+ }
24
+ //#endregion
25
+ export { at };
@@ -0,0 +1,61 @@
1
+ //#region src/fp/array/cartesianProduct.d.ts
2
+ /**
3
+ * Creates a function that wraps each element of the piped array in a one-item tuple.
4
+ *
5
+ * @template T - The type of elements in the piped array.
6
+ * @returns A function that maps the piped array to one-item cartesian product tuples.
7
+ *
8
+ * @example
9
+ * import { cartesianProduct, pipe } from 'es-toolkit/fp';
10
+ *
11
+ * pipe([1, 2], cartesianProduct());
12
+ * // => [[1], [2]]
13
+ */
14
+ declare function cartesianProduct<T>(): (array: readonly T[]) => Array<[T]>;
15
+ /**
16
+ * Creates a function that computes the cartesian product of the piped array and one configured array.
17
+ *
18
+ * @template T - The type of elements in the piped array.
19
+ * @template U - The type of elements in the configured array.
20
+ * @param arr2 - The second array in the cartesian product.
21
+ * @returns A function that maps the piped array to two-item cartesian product tuples.
22
+ *
23
+ * @example
24
+ * pipe([1, 2], cartesianProduct(['a', 'b']));
25
+ * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
26
+ */
27
+ declare function cartesianProduct<T, U>(arr2: readonly U[]): (array: readonly T[]) => Array<[T, U]>;
28
+ /**
29
+ * Creates a function that computes the cartesian product of the piped array and two configured arrays.
30
+ *
31
+ * @template T - The type of elements in the piped array.
32
+ * @template U - The type of elements in the second array.
33
+ * @template V - The type of elements in the third array.
34
+ * @param arr2 - The second array in the cartesian product.
35
+ * @param arr3 - The third array in the cartesian product.
36
+ * @returns A function that maps the piped array to three-item cartesian product tuples.
37
+ */
38
+ declare function cartesianProduct<T, U, V>(arr2: readonly U[], arr3: readonly V[]): (array: readonly T[]) => Array<[T, U, V]>;
39
+ /**
40
+ * Creates a function that computes the cartesian product of the piped array and three configured arrays.
41
+ *
42
+ * @template T - The type of elements in the piped array.
43
+ * @template U - The type of elements in the second array.
44
+ * @template V - The type of elements in the third array.
45
+ * @template W - The type of elements in the fourth array.
46
+ * @param arr2 - The second array in the cartesian product.
47
+ * @param arr3 - The third array in the cartesian product.
48
+ * @param arr4 - The fourth array in the cartesian product.
49
+ * @returns A function that maps the piped array to four-item cartesian product tuples.
50
+ */
51
+ declare function cartesianProduct<T, U, V, W>(arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): (array: readonly T[]) => Array<[T, U, V, W]>;
52
+ /**
53
+ * Creates a function that computes the cartesian product of the piped array and any number of configured arrays.
54
+ *
55
+ * @template T - The shared element type of the arrays.
56
+ * @param arrs - Additional arrays included in the cartesian product.
57
+ * @returns A function that maps the piped array to cartesian product rows.
58
+ */
59
+ declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): (array: readonly T[]) => T[][];
60
+ //#endregion
61
+ export { cartesianProduct };
@@ -0,0 +1,61 @@
1
+ //#region src/fp/array/cartesianProduct.d.ts
2
+ /**
3
+ * Creates a function that wraps each element of the piped array in a one-item tuple.
4
+ *
5
+ * @template T - The type of elements in the piped array.
6
+ * @returns A function that maps the piped array to one-item cartesian product tuples.
7
+ *
8
+ * @example
9
+ * import { cartesianProduct, pipe } from 'es-toolkit/fp';
10
+ *
11
+ * pipe([1, 2], cartesianProduct());
12
+ * // => [[1], [2]]
13
+ */
14
+ declare function cartesianProduct<T>(): (array: readonly T[]) => Array<[T]>;
15
+ /**
16
+ * Creates a function that computes the cartesian product of the piped array and one configured array.
17
+ *
18
+ * @template T - The type of elements in the piped array.
19
+ * @template U - The type of elements in the configured array.
20
+ * @param arr2 - The second array in the cartesian product.
21
+ * @returns A function that maps the piped array to two-item cartesian product tuples.
22
+ *
23
+ * @example
24
+ * pipe([1, 2], cartesianProduct(['a', 'b']));
25
+ * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
26
+ */
27
+ declare function cartesianProduct<T, U>(arr2: readonly U[]): (array: readonly T[]) => Array<[T, U]>;
28
+ /**
29
+ * Creates a function that computes the cartesian product of the piped array and two configured arrays.
30
+ *
31
+ * @template T - The type of elements in the piped array.
32
+ * @template U - The type of elements in the second array.
33
+ * @template V - The type of elements in the third array.
34
+ * @param arr2 - The second array in the cartesian product.
35
+ * @param arr3 - The third array in the cartesian product.
36
+ * @returns A function that maps the piped array to three-item cartesian product tuples.
37
+ */
38
+ declare function cartesianProduct<T, U, V>(arr2: readonly U[], arr3: readonly V[]): (array: readonly T[]) => Array<[T, U, V]>;
39
+ /**
40
+ * Creates a function that computes the cartesian product of the piped array and three configured arrays.
41
+ *
42
+ * @template T - The type of elements in the piped array.
43
+ * @template U - The type of elements in the second array.
44
+ * @template V - The type of elements in the third array.
45
+ * @template W - The type of elements in the fourth array.
46
+ * @param arr2 - The second array in the cartesian product.
47
+ * @param arr3 - The third array in the cartesian product.
48
+ * @param arr4 - The fourth array in the cartesian product.
49
+ * @returns A function that maps the piped array to four-item cartesian product tuples.
50
+ */
51
+ declare function cartesianProduct<T, U, V, W>(arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): (array: readonly T[]) => Array<[T, U, V, W]>;
52
+ /**
53
+ * Creates a function that computes the cartesian product of the piped array and any number of configured arrays.
54
+ *
55
+ * @template T - The shared element type of the arrays.
56
+ * @param arrs - Additional arrays included in the cartesian product.
57
+ * @returns A function that maps the piped array to cartesian product rows.
58
+ */
59
+ declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): (array: readonly T[]) => T[][];
60
+ //#endregion
61
+ export { cartesianProduct };
@@ -0,0 +1,9 @@
1
+ const require_cartesianProduct = require("../../array/cartesianProduct.js");
2
+ //#region src/fp/array/cartesianProduct.ts
3
+ function cartesianProduct(...arrs) {
4
+ return function(array) {
5
+ return require_cartesianProduct.cartesianProduct(array, ...arrs);
6
+ };
7
+ }
8
+ //#endregion
9
+ exports.cartesianProduct = cartesianProduct;
@@ -0,0 +1,9 @@
1
+ import { cartesianProduct as cartesianProduct$1 } from "../../array/cartesianProduct.mjs";
2
+ //#region src/fp/array/cartesianProduct.ts
3
+ function cartesianProduct(...arrs) {
4
+ return function(array) {
5
+ return cartesianProduct$1(array, ...arrs);
6
+ };
7
+ }
8
+ //#endregion
9
+ export { cartesianProduct };
@@ -0,0 +1,19 @@
1
+ //#region src/fp/array/chunk.d.ts
2
+ /**
3
+ * Creates a function that splits an array into sub-arrays of length `size`. The
4
+ * final chunk holds the remaining elements when the array cannot be divided
5
+ * evenly. Use it with {@link pipe}.
6
+ *
7
+ * @template T - The type of elements in the array.
8
+ * @param size - The length of each chunk. Must be a positive integer.
9
+ * @returns A function that maps a `readonly T[]` to a `T[][]`.
10
+ * @throws {Error} When `size` is not a positive integer (propagated from the underlying implementation).
11
+ *
12
+ * @example
13
+ * import { pipe, chunk } from 'es-toolkit/fp';
14
+ *
15
+ * pipe([1, 2, 3, 4, 5], chunk(2)); // => [[1, 2], [3, 4], [5]]
16
+ */
17
+ declare function chunk<T>(size: number): (array: readonly T[]) => T[][];
18
+ //#endregion
19
+ export { chunk };
@@ -0,0 +1,19 @@
1
+ //#region src/fp/array/chunk.d.ts
2
+ /**
3
+ * Creates a function that splits an array into sub-arrays of length `size`. The
4
+ * final chunk holds the remaining elements when the array cannot be divided
5
+ * evenly. Use it with {@link pipe}.
6
+ *
7
+ * @template T - The type of elements in the array.
8
+ * @param size - The length of each chunk. Must be a positive integer.
9
+ * @returns A function that maps a `readonly T[]` to a `T[][]`.
10
+ * @throws {Error} When `size` is not a positive integer (propagated from the underlying implementation).
11
+ *
12
+ * @example
13
+ * import { pipe, chunk } from 'es-toolkit/fp';
14
+ *
15
+ * pipe([1, 2, 3, 4, 5], chunk(2)); // => [[1, 2], [3, 4], [5]]
16
+ */
17
+ declare function chunk<T>(size: number): (array: readonly T[]) => T[][];
18
+ //#endregion
19
+ export { chunk };
@@ -0,0 +1,24 @@
1
+ const require_chunk = require("../../array/chunk.js");
2
+ //#region src/fp/array/chunk.ts
3
+ /**
4
+ * Creates a function that splits an array into sub-arrays of length `size`. The
5
+ * final chunk holds the remaining elements when the array cannot be divided
6
+ * evenly. Use it with {@link pipe}.
7
+ *
8
+ * @template T - The type of elements in the array.
9
+ * @param size - The length of each chunk. Must be a positive integer.
10
+ * @returns A function that maps a `readonly T[]` to a `T[][]`.
11
+ * @throws {Error} When `size` is not a positive integer (propagated from the underlying implementation).
12
+ *
13
+ * @example
14
+ * import { pipe, chunk } from 'es-toolkit/fp';
15
+ *
16
+ * pipe([1, 2, 3, 4, 5], chunk(2)); // => [[1, 2], [3, 4], [5]]
17
+ */
18
+ function chunk(size) {
19
+ return function(array) {
20
+ return require_chunk.chunk(array, size);
21
+ };
22
+ }
23
+ //#endregion
24
+ exports.chunk = chunk;
@@ -0,0 +1,24 @@
1
+ import { chunk as chunk$1 } from "../../array/chunk.mjs";
2
+ //#region src/fp/array/chunk.ts
3
+ /**
4
+ * Creates a function that splits an array into sub-arrays of length `size`. The
5
+ * final chunk holds the remaining elements when the array cannot be divided
6
+ * evenly. Use it with {@link pipe}.
7
+ *
8
+ * @template T - The type of elements in the array.
9
+ * @param size - The length of each chunk. Must be a positive integer.
10
+ * @returns A function that maps a `readonly T[]` to a `T[][]`.
11
+ * @throws {Error} When `size` is not a positive integer (propagated from the underlying implementation).
12
+ *
13
+ * @example
14
+ * import { pipe, chunk } from 'es-toolkit/fp';
15
+ *
16
+ * pipe([1, 2, 3, 4, 5], chunk(2)); // => [[1, 2], [3, 4], [5]]
17
+ */
18
+ function chunk(size) {
19
+ return function(array) {
20
+ return chunk$1(array, size);
21
+ };
22
+ }
23
+ //#endregion
24
+ export { chunk };