@vinicunca/perkakas 0.0.3

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 (728) hide show
  1. package/LICENSE +21 -0
  2. package/dist/commonjs/aria/index.d.ts +2 -0
  3. package/dist/commonjs/aria/index.d.ts.map +1 -0
  4. package/dist/commonjs/aria/index.js +17 -0
  5. package/dist/commonjs/aria/key-codes.d.ts +23 -0
  6. package/dist/commonjs/aria/key-codes.d.ts.map +1 -0
  7. package/dist/commonjs/aria/key-codes.js +25 -0
  8. package/dist/commonjs/array/all-pass.d.ts +3 -0
  9. package/dist/commonjs/array/all-pass.d.ts.map +1 -0
  10. package/dist/commonjs/array/all-pass.js +11 -0
  11. package/dist/commonjs/array/any-pass.d.ts +3 -0
  12. package/dist/commonjs/array/any-pass.d.ts.map +1 -0
  13. package/dist/commonjs/array/any-pass.js +11 -0
  14. package/dist/commonjs/array/chunk.d.ts +6 -0
  15. package/dist/commonjs/array/chunk.d.ts.map +1 -0
  16. package/dist/commonjs/array/chunk.js +17 -0
  17. package/dist/commonjs/array/compact.d.ts +2 -0
  18. package/dist/commonjs/array/compact.d.ts.map +1 -0
  19. package/dist/commonjs/array/compact.js +8 -0
  20. package/dist/commonjs/array/concat.d.ts +3 -0
  21. package/dist/commonjs/array/concat.d.ts.map +1 -0
  22. package/dist/commonjs/array/concat.js +11 -0
  23. package/dist/commonjs/array/count-by.d.ts +8 -0
  24. package/dist/commonjs/array/count-by.d.ts.map +1 -0
  25. package/dist/commonjs/array/count-by.js +22 -0
  26. package/dist/commonjs/array/difference-with.d.ts +9 -0
  27. package/dist/commonjs/array/difference-with.d.ts.map +1 -0
  28. package/dist/commonjs/array/difference-with.js +31 -0
  29. package/dist/commonjs/array/difference.d.ts +7 -0
  30. package/dist/commonjs/array/difference.d.ts.map +1 -0
  31. package/dist/commonjs/array/difference.js +32 -0
  32. package/dist/commonjs/array/drop-last.d.ts +3 -0
  33. package/dist/commonjs/array/drop-last.d.ts.map +1 -0
  34. package/dist/commonjs/array/drop-last.js +15 -0
  35. package/dist/commonjs/array/drop.d.ts +7 -0
  36. package/dist/commonjs/array/drop.d.ts.map +1 -0
  37. package/dist/commonjs/array/drop.js +32 -0
  38. package/dist/commonjs/array/filter.d.ts +17 -0
  39. package/dist/commonjs/array/filter.d.ts.map +1 -0
  40. package/dist/commonjs/array/filter.js +41 -0
  41. package/dist/commonjs/array/find-index.d.ts +32 -0
  42. package/dist/commonjs/array/find-index.d.ts.map +1 -0
  43. package/dist/commonjs/array/find-index.js +46 -0
  44. package/dist/commonjs/array/find-last-index.d.ts +8 -0
  45. package/dist/commonjs/array/find-last-index.d.ts.map +1 -0
  46. package/dist/commonjs/array/find-last-index.js +24 -0
  47. package/dist/commonjs/array/find-last.d.ts +8 -0
  48. package/dist/commonjs/array/find-last.d.ts.map +1 -0
  49. package/dist/commonjs/array/find-last.js +23 -0
  50. package/dist/commonjs/array/find.d.ts +24 -0
  51. package/dist/commonjs/array/find.d.ts.map +1 -0
  52. package/dist/commonjs/array/find.js +38 -0
  53. package/dist/commonjs/array/first.d.ts +16 -0
  54. package/dist/commonjs/array/first.d.ts.map +1 -0
  55. package/dist/commonjs/array/first.js +26 -0
  56. package/dist/commonjs/array/flat-map-to-obj.d.ts +7 -0
  57. package/dist/commonjs/array/flat-map-to-obj.d.ts.map +1 -0
  58. package/dist/commonjs/array/flat-map-to-obj.js +25 -0
  59. package/dist/commonjs/array/flat-map.d.ts +16 -0
  60. package/dist/commonjs/array/flat-map.d.ts.map +1 -0
  61. package/dist/commonjs/array/flat-map.js +33 -0
  62. package/dist/commonjs/array/flatten-deep.d.ts +12 -0
  63. package/dist/commonjs/array/flatten-deep.d.ts.map +1 -0
  64. package/dist/commonjs/array/flatten-deep.js +48 -0
  65. package/dist/commonjs/array/flatten.d.ts +9 -0
  66. package/dist/commonjs/array/flatten.d.ts.map +1 -0
  67. package/dist/commonjs/array/flatten.js +32 -0
  68. package/dist/commonjs/array/for-each.d.ts +13 -0
  69. package/dist/commonjs/array/for-each.d.ts.map +1 -0
  70. package/dist/commonjs/array/for-each.js +40 -0
  71. package/dist/commonjs/array/group-by.d.ts +19 -0
  72. package/dist/commonjs/array/group-by.d.ts.map +1 -0
  73. package/dist/commonjs/array/group-by.js +31 -0
  74. package/dist/commonjs/array/index-by.d.ts +8 -0
  75. package/dist/commonjs/array/index-by.d.ts.map +1 -0
  76. package/dist/commonjs/array/index-by.js +24 -0
  77. package/dist/commonjs/array/index.d.ts +56 -0
  78. package/dist/commonjs/array/index.d.ts.map +1 -0
  79. package/dist/commonjs/array/index.js +71 -0
  80. package/dist/commonjs/array/intersection-with.d.ts +9 -0
  81. package/dist/commonjs/array/intersection-with.d.ts.map +1 -0
  82. package/dist/commonjs/array/intersection-with.js +31 -0
  83. package/dist/commonjs/array/intersection.d.ts +7 -0
  84. package/dist/commonjs/array/intersection.d.ts.map +1 -0
  85. package/dist/commonjs/array/intersection.js +32 -0
  86. package/dist/commonjs/array/join.d.ts +8 -0
  87. package/dist/commonjs/array/join.d.ts.map +1 -0
  88. package/dist/commonjs/array/join.js +11 -0
  89. package/dist/commonjs/array/last.d.ts +5 -0
  90. package/dist/commonjs/array/last.d.ts.map +1 -0
  91. package/dist/commonjs/array/last.js +11 -0
  92. package/dist/commonjs/array/length.d.ts +5 -0
  93. package/dist/commonjs/array/length.d.ts.map +1 -0
  94. package/dist/commonjs/array/length.js +11 -0
  95. package/dist/commonjs/array/map-to-obj.d.ts +7 -0
  96. package/dist/commonjs/array/map-to-obj.d.ts.map +1 -0
  97. package/dist/commonjs/array/map-to-obj.js +23 -0
  98. package/dist/commonjs/array/map.d.ts +26 -0
  99. package/dist/commonjs/array/map.d.ts.map +1 -0
  100. package/dist/commonjs/array/map.js +35 -0
  101. package/dist/commonjs/array/max-by.d.ts +8 -0
  102. package/dist/commonjs/array/max-by.d.ts.map +1 -0
  103. package/dist/commonjs/array/max-by.js +28 -0
  104. package/dist/commonjs/array/mean-by.d.ts +8 -0
  105. package/dist/commonjs/array/mean-by.d.ts.map +1 -0
  106. package/dist/commonjs/array/mean-by.js +26 -0
  107. package/dist/commonjs/array/merge-all.d.ts +7 -0
  108. package/dist/commonjs/array/merge-all.d.ts.map +1 -0
  109. package/dist/commonjs/array/merge-all.js +7 -0
  110. package/dist/commonjs/array/min-by.d.ts +8 -0
  111. package/dist/commonjs/array/min-by.d.ts.map +1 -0
  112. package/dist/commonjs/array/min-by.js +28 -0
  113. package/dist/commonjs/array/partition.d.ts +10 -0
  114. package/dist/commonjs/array/partition.d.ts.map +1 -0
  115. package/dist/commonjs/array/partition.js +24 -0
  116. package/dist/commonjs/array/range.d.ts +3 -0
  117. package/dist/commonjs/array/range.d.ts.map +1 -0
  118. package/dist/commonjs/array/range.js +15 -0
  119. package/dist/commonjs/array/reduce.d.ts +7 -0
  120. package/dist/commonjs/array/reduce.d.ts.map +1 -0
  121. package/dist/commonjs/array/reduce.js +19 -0
  122. package/dist/commonjs/array/reject.d.ts +13 -0
  123. package/dist/commonjs/array/reject.d.ts.map +1 -0
  124. package/dist/commonjs/array/reject.js +41 -0
  125. package/dist/commonjs/array/reverse.d.ts +6 -0
  126. package/dist/commonjs/array/reverse.d.ts.map +1 -0
  127. package/dist/commonjs/array/reverse.js +11 -0
  128. package/dist/commonjs/array/sample.d.ts +11 -0
  129. package/dist/commonjs/array/sample.d.ts.map +1 -0
  130. package/dist/commonjs/array/sample.js +34 -0
  131. package/dist/commonjs/array/shuffle.d.ts +3 -0
  132. package/dist/commonjs/array/shuffle.d.ts.map +1 -0
  133. package/dist/commonjs/array/shuffle.js +18 -0
  134. package/dist/commonjs/array/sort-by.d.ts +27 -0
  135. package/dist/commonjs/array/sort-by.d.ts.map +1 -0
  136. package/dist/commonjs/array/sort-by.js +55 -0
  137. package/dist/commonjs/array/sort.d.ts +15 -0
  138. package/dist/commonjs/array/sort.d.ts.map +1 -0
  139. package/dist/commonjs/array/sort.js +16 -0
  140. package/dist/commonjs/array/split-at.d.ts +3 -0
  141. package/dist/commonjs/array/split-at.d.ts.map +1 -0
  142. package/dist/commonjs/array/split-at.js +13 -0
  143. package/dist/commonjs/array/split-when.d.ts +3 -0
  144. package/dist/commonjs/array/split-when.d.ts.map +1 -0
  145. package/dist/commonjs/array/split-when.js +17 -0
  146. package/dist/commonjs/array/sum-by.d.ts +8 -0
  147. package/dist/commonjs/array/sum-by.d.ts.map +1 -0
  148. package/dist/commonjs/array/sum-by.js +24 -0
  149. package/dist/commonjs/array/swap-indices.d.ts +25 -0
  150. package/dist/commonjs/array/swap-indices.d.ts.map +1 -0
  151. package/dist/commonjs/array/swap-indices.js +34 -0
  152. package/dist/commonjs/array/take-while.d.ts +3 -0
  153. package/dist/commonjs/array/take-while.d.ts.map +1 -0
  154. package/dist/commonjs/array/take-while.js +18 -0
  155. package/dist/commonjs/array/take.d.ts +7 -0
  156. package/dist/commonjs/array/take.d.ts.map +1 -0
  157. package/dist/commonjs/array/take.js +38 -0
  158. package/dist/commonjs/array/uniq-by.d.ts +3 -0
  159. package/dist/commonjs/array/uniq-by.d.ts.map +1 -0
  160. package/dist/commonjs/array/uniq-by.js +30 -0
  161. package/dist/commonjs/array/uniq-with.d.ts +12 -0
  162. package/dist/commonjs/array/uniq-with.d.ts.map +1 -0
  163. package/dist/commonjs/array/uniq-with.js +33 -0
  164. package/dist/commonjs/array/uniq.d.ts +7 -0
  165. package/dist/commonjs/array/uniq.d.ts.map +1 -0
  166. package/dist/commonjs/array/uniq.js +32 -0
  167. package/dist/commonjs/array/zip-obj.d.ts +3 -0
  168. package/dist/commonjs/array/zip-obj.d.ts.map +1 -0
  169. package/dist/commonjs/array/zip-obj.js +16 -0
  170. package/dist/commonjs/array/zip-with.d.ts +4 -0
  171. package/dist/commonjs/array/zip-with.d.ts.map +1 -0
  172. package/dist/commonjs/array/zip-with.js +28 -0
  173. package/dist/commonjs/array/zip.d.ts +3 -0
  174. package/dist/commonjs/array/zip.d.ts.map +1 -0
  175. package/dist/commonjs/array/zip.js +16 -0
  176. package/dist/commonjs/base.d.ts +2 -0
  177. package/dist/commonjs/base.d.ts.map +1 -0
  178. package/dist/commonjs/base.js +7 -0
  179. package/dist/commonjs/function/create-pipe.d.ts +8 -0
  180. package/dist/commonjs/function/create-pipe.d.ts.map +1 -0
  181. package/dist/commonjs/function/create-pipe.js +8 -0
  182. package/dist/commonjs/function/identity.d.ts +2 -0
  183. package/dist/commonjs/function/identity.d.ts.map +1 -0
  184. package/dist/commonjs/function/identity.js +7 -0
  185. package/dist/commonjs/function/index.d.ts +7 -0
  186. package/dist/commonjs/function/index.d.ts.map +1 -0
  187. package/dist/commonjs/function/index.js +22 -0
  188. package/dist/commonjs/function/noop.d.ts +2 -0
  189. package/dist/commonjs/function/noop.d.ts.map +1 -0
  190. package/dist/commonjs/function/noop.js +7 -0
  191. package/dist/commonjs/function/once.d.ts +2 -0
  192. package/dist/commonjs/function/once.d.ts.map +1 -0
  193. package/dist/commonjs/function/once.js +15 -0
  194. package/dist/commonjs/function/pipe.d.ts +16 -0
  195. package/dist/commonjs/function/pipe.d.ts.map +1 -0
  196. package/dist/commonjs/function/pipe.js +105 -0
  197. package/dist/commonjs/function/purry.d.ts +2 -0
  198. package/dist/commonjs/function/purry.d.ts.map +1 -0
  199. package/dist/commonjs/function/purry.js +20 -0
  200. package/dist/commonjs/guard/index.d.ts +16 -0
  201. package/dist/commonjs/guard/index.d.ts.map +1 -0
  202. package/dist/commonjs/guard/index.js +31 -0
  203. package/dist/commonjs/guard/is-array.d.ts +4 -0
  204. package/dist/commonjs/guard/is-array.d.ts.map +1 -0
  205. package/dist/commonjs/guard/is-array.js +7 -0
  206. package/dist/commonjs/guard/is-boolean.d.ts +4 -0
  207. package/dist/commonjs/guard/is-boolean.d.ts.map +1 -0
  208. package/dist/commonjs/guard/is-boolean.js +7 -0
  209. package/dist/commonjs/guard/is-date.d.ts +2 -0
  210. package/dist/commonjs/guard/is-date.d.ts.map +1 -0
  211. package/dist/commonjs/guard/is-date.js +7 -0
  212. package/dist/commonjs/guard/is-defined.d.ts +5 -0
  213. package/dist/commonjs/guard/is-defined.d.ts.map +1 -0
  214. package/dist/commonjs/guard/is-defined.js +13 -0
  215. package/dist/commonjs/guard/is-empty.d.ts +4 -0
  216. package/dist/commonjs/guard/is-empty.d.ts.map +1 -0
  217. package/dist/commonjs/guard/is-empty.js +19 -0
  218. package/dist/commonjs/guard/is-error.d.ts +4 -0
  219. package/dist/commonjs/guard/is-error.d.ts.map +1 -0
  220. package/dist/commonjs/guard/is-error.js +7 -0
  221. package/dist/commonjs/guard/is-function.d.ts +4 -0
  222. package/dist/commonjs/guard/is-function.d.ts.map +1 -0
  223. package/dist/commonjs/guard/is-function.js +7 -0
  224. package/dist/commonjs/guard/is-nil.d.ts +2 -0
  225. package/dist/commonjs/guard/is-nil.d.ts.map +1 -0
  226. package/dist/commonjs/guard/is-nil.js +7 -0
  227. package/dist/commonjs/guard/is-non-null.d.ts +2 -0
  228. package/dist/commonjs/guard/is-non-null.d.ts.map +1 -0
  229. package/dist/commonjs/guard/is-non-null.js +7 -0
  230. package/dist/commonjs/guard/is-not.d.ts +3 -0
  231. package/dist/commonjs/guard/is-not.d.ts.map +1 -0
  232. package/dist/commonjs/guard/is-not.js +9 -0
  233. package/dist/commonjs/guard/is-number.d.ts +4 -0
  234. package/dist/commonjs/guard/is-number.d.ts.map +1 -0
  235. package/dist/commonjs/guard/is-number.js +7 -0
  236. package/dist/commonjs/guard/is-object.d.ts +4 -0
  237. package/dist/commonjs/guard/is-object.d.ts.map +1 -0
  238. package/dist/commonjs/guard/is-object.js +8 -0
  239. package/dist/commonjs/guard/is-promise.d.ts +2 -0
  240. package/dist/commonjs/guard/is-promise.d.ts.map +1 -0
  241. package/dist/commonjs/guard/is-promise.js +7 -0
  242. package/dist/commonjs/guard/is-string.d.ts +4 -0
  243. package/dist/commonjs/guard/is-string.d.ts.map +1 -0
  244. package/dist/commonjs/guard/is-string.js +7 -0
  245. package/dist/commonjs/guard/is-truthy.d.ts +2 -0
  246. package/dist/commonjs/guard/is-truthy.d.ts.map +1 -0
  247. package/dist/commonjs/guard/is-truthy.js +7 -0
  248. package/dist/commonjs/helpers/index.d.ts +8 -0
  249. package/dist/commonjs/helpers/index.d.ts.map +1 -0
  250. package/dist/commonjs/helpers/index.js +52 -0
  251. package/dist/commonjs/index.d.ts +10 -0
  252. package/dist/commonjs/index.d.ts.map +1 -0
  253. package/dist/commonjs/index.js +25 -0
  254. package/dist/commonjs/number/clamp.d.ts +9 -0
  255. package/dist/commonjs/number/clamp.d.ts.map +1 -0
  256. package/dist/commonjs/number/clamp.js +17 -0
  257. package/dist/commonjs/number/index.d.ts +2 -0
  258. package/dist/commonjs/number/index.d.ts.map +1 -0
  259. package/dist/commonjs/number/index.js +17 -0
  260. package/dist/commonjs/object/add-prop.d.ts +7 -0
  261. package/dist/commonjs/object/add-prop.d.ts.map +1 -0
  262. package/dist/commonjs/object/add-prop.js +11 -0
  263. package/dist/commonjs/object/clone.d.ts +2 -0
  264. package/dist/commonjs/object/clone.d.ts.map +1 -0
  265. package/dist/commonjs/object/clone.js +49 -0
  266. package/dist/commonjs/object/equals.d.ts +3 -0
  267. package/dist/commonjs/object/equals.d.ts.map +1 -0
  268. package/dist/commonjs/object/equals.js +71 -0
  269. package/dist/commonjs/object/for-each-obj.d.ts +10 -0
  270. package/dist/commonjs/object/for-each-obj.d.ts.map +1 -0
  271. package/dist/commonjs/object/for-each-obj.js +30 -0
  272. package/dist/commonjs/object/from-pairs.d.ts +21 -0
  273. package/dist/commonjs/object/from-pairs.d.ts.map +1 -0
  274. package/dist/commonjs/object/from-pairs.js +14 -0
  275. package/dist/commonjs/object/index.d.ts +23 -0
  276. package/dist/commonjs/object/index.d.ts.map +1 -0
  277. package/dist/commonjs/object/index.js +38 -0
  278. package/dist/commonjs/object/invert.d.ts +5 -0
  279. package/dist/commonjs/object/invert.d.ts.map +1 -0
  280. package/dist/commonjs/object/invert.js +15 -0
  281. package/dist/commonjs/object/keys.d.ts +15 -0
  282. package/dist/commonjs/object/keys.d.ts.map +1 -0
  283. package/dist/commonjs/object/keys.js +10 -0
  284. package/dist/commonjs/object/map-keys.d.ts +3 -0
  285. package/dist/commonjs/object/map-keys.d.ts.map +1 -0
  286. package/dist/commonjs/object/map-keys.js +16 -0
  287. package/dist/commonjs/object/map-values.d.ts +3 -0
  288. package/dist/commonjs/object/map-values.d.ts.map +1 -0
  289. package/dist/commonjs/object/map-values.js +16 -0
  290. package/dist/commonjs/object/merge.d.ts +3 -0
  291. package/dist/commonjs/object/merge.d.ts.map +1 -0
  292. package/dist/commonjs/object/merge.js +11 -0
  293. package/dist/commonjs/object/omit-by.d.ts +3 -0
  294. package/dist/commonjs/object/omit-by.d.ts.map +1 -0
  295. package/dist/commonjs/object/omit-by.js +16 -0
  296. package/dist/commonjs/object/omit.d.ts +3 -0
  297. package/dist/commonjs/object/omit.d.ts.map +1 -0
  298. package/dist/commonjs/object/omit.js +35 -0
  299. package/dist/commonjs/object/path-or.d.ts +21 -0
  300. package/dist/commonjs/object/path-or.d.ts.map +1 -0
  301. package/dist/commonjs/object/path-or.js +18 -0
  302. package/dist/commonjs/object/pick-by.d.ts +3 -0
  303. package/dist/commonjs/object/pick-by.d.ts.map +1 -0
  304. package/dist/commonjs/object/pick-by.js +19 -0
  305. package/dist/commonjs/object/pick.d.ts +3 -0
  306. package/dist/commonjs/object/pick.d.ts.map +1 -0
  307. package/dist/commonjs/object/pick.js +19 -0
  308. package/dist/commonjs/object/prop.d.ts +2 -0
  309. package/dist/commonjs/object/prop.d.ts.map +1 -0
  310. package/dist/commonjs/object/prop.js +5 -0
  311. package/dist/commonjs/object/set-path.d.ts +6 -0
  312. package/dist/commonjs/object/set-path.d.ts.map +1 -0
  313. package/dist/commonjs/object/set-path.js +23 -0
  314. package/dist/commonjs/object/set.d.ts +3 -0
  315. package/dist/commonjs/object/set.d.ts.map +1 -0
  316. package/dist/commonjs/object/set.js +11 -0
  317. package/dist/commonjs/object/swap-props.d.ts +7 -0
  318. package/dist/commonjs/object/swap-props.d.ts.map +1 -0
  319. package/dist/commonjs/object/swap-props.js +12 -0
  320. package/dist/commonjs/object/to-pairs.d.ts +13 -0
  321. package/dist/commonjs/object/to-pairs.d.ts.map +1 -0
  322. package/dist/commonjs/object/to-pairs.js +13 -0
  323. package/dist/commonjs/object/values.d.ts +2 -0
  324. package/dist/commonjs/object/values.d.ts.map +1 -0
  325. package/dist/commonjs/object/values.js +7 -0
  326. package/dist/commonjs/string/cases-types.d.ts +29 -0
  327. package/dist/commonjs/string/cases-types.d.ts.map +1 -0
  328. package/dist/commonjs/string/cases-types.js +2 -0
  329. package/dist/commonjs/string/cases.d.ts +16 -0
  330. package/dist/commonjs/string/cases.d.ts.map +1 -0
  331. package/dist/commonjs/string/cases.js +86 -0
  332. package/dist/commonjs/string/index.d.ts +4 -0
  333. package/dist/commonjs/string/index.d.ts.map +1 -0
  334. package/dist/commonjs/string/index.js +19 -0
  335. package/dist/commonjs/string/random-string.d.ts +2 -0
  336. package/dist/commonjs/string/random-string.d.ts.map +1 -0
  337. package/dist/commonjs/string/random-string.js +10 -0
  338. package/dist/commonjs/string/string-to-path.d.ts +3 -0
  339. package/dist/commonjs/string/string-to-path.d.ts.map +1 -0
  340. package/dist/commonjs/string/string-to-path.js +19 -0
  341. package/dist/commonjs/type/index.d.ts +2 -0
  342. package/dist/commonjs/type/index.d.ts.map +1 -0
  343. package/dist/commonjs/type/index.js +17 -0
  344. package/dist/commonjs/type/type.d.ts +2 -0
  345. package/dist/commonjs/type/type.d.ts.map +1 -0
  346. package/dist/commonjs/type/type.js +11 -0
  347. package/dist/commonjs/utils/narrow.d.ts +8 -0
  348. package/dist/commonjs/utils/narrow.d.ts.map +1 -0
  349. package/dist/commonjs/utils/narrow.js +2 -0
  350. package/dist/commonjs/utils/paths.d.ts +9 -0
  351. package/dist/commonjs/utils/paths.d.ts.map +1 -0
  352. package/dist/commonjs/utils/paths.js +2 -0
  353. package/dist/commonjs/utils/reduce-lazy.d.ts +22 -0
  354. package/dist/commonjs/utils/reduce-lazy.d.ts.map +1 -0
  355. package/dist/commonjs/utils/reduce-lazy.js +18 -0
  356. package/dist/commonjs/utils/to-lazy-indexed.d.ts +4 -0
  357. package/dist/commonjs/utils/to-lazy-indexed.d.ts.map +1 -0
  358. package/dist/commonjs/utils/to-lazy-indexed.js +8 -0
  359. package/dist/commonjs/utils/to-single.d.ts +4 -0
  360. package/dist/commonjs/utils/to-single.d.ts.map +1 -0
  361. package/dist/commonjs/utils/to-single.js +8 -0
  362. package/dist/commonjs/utils/types.d.ts +6 -0
  363. package/dist/commonjs/utils/types.d.ts.map +1 -0
  364. package/dist/commonjs/utils/types.js +2 -0
  365. package/dist/es/aria/index.d.ts +2 -0
  366. package/dist/es/aria/index.d.ts.map +1 -0
  367. package/dist/es/aria/index.js +1 -0
  368. package/dist/es/aria/key-codes.d.ts +23 -0
  369. package/dist/es/aria/key-codes.d.ts.map +1 -0
  370. package/dist/es/aria/key-codes.js +22 -0
  371. package/dist/es/array/all-pass.d.ts +3 -0
  372. package/dist/es/array/all-pass.d.ts.map +1 -0
  373. package/dist/es/array/all-pass.js +7 -0
  374. package/dist/es/array/any-pass.d.ts +3 -0
  375. package/dist/es/array/any-pass.d.ts.map +1 -0
  376. package/dist/es/array/any-pass.js +7 -0
  377. package/dist/es/array/chunk.d.ts +6 -0
  378. package/dist/es/array/chunk.d.ts.map +1 -0
  379. package/dist/es/array/chunk.js +13 -0
  380. package/dist/es/array/compact.d.ts +2 -0
  381. package/dist/es/array/compact.d.ts.map +1 -0
  382. package/dist/es/array/compact.js +4 -0
  383. package/dist/es/array/concat.d.ts +3 -0
  384. package/dist/es/array/concat.d.ts.map +1 -0
  385. package/dist/es/array/concat.js +7 -0
  386. package/dist/es/array/count-by.d.ts +8 -0
  387. package/dist/es/array/count-by.d.ts.map +1 -0
  388. package/dist/es/array/count-by.js +18 -0
  389. package/dist/es/array/difference-with.d.ts +9 -0
  390. package/dist/es/array/difference-with.d.ts.map +1 -0
  391. package/dist/es/array/difference-with.js +27 -0
  392. package/dist/es/array/difference.d.ts +7 -0
  393. package/dist/es/array/difference.d.ts.map +1 -0
  394. package/dist/es/array/difference.js +28 -0
  395. package/dist/es/array/drop-last.d.ts +3 -0
  396. package/dist/es/array/drop-last.d.ts.map +1 -0
  397. package/dist/es/array/drop-last.js +11 -0
  398. package/dist/es/array/drop.d.ts +7 -0
  399. package/dist/es/array/drop.d.ts.map +1 -0
  400. package/dist/es/array/drop.js +28 -0
  401. package/dist/es/array/filter.d.ts +17 -0
  402. package/dist/es/array/filter.d.ts.map +1 -0
  403. package/dist/es/array/filter.js +37 -0
  404. package/dist/es/array/find-index.d.ts +32 -0
  405. package/dist/es/array/find-index.d.ts.map +1 -0
  406. package/dist/es/array/find-index.js +42 -0
  407. package/dist/es/array/find-last-index.d.ts +8 -0
  408. package/dist/es/array/find-last-index.d.ts.map +1 -0
  409. package/dist/es/array/find-last-index.js +20 -0
  410. package/dist/es/array/find-last.d.ts +8 -0
  411. package/dist/es/array/find-last.d.ts.map +1 -0
  412. package/dist/es/array/find-last.js +19 -0
  413. package/dist/es/array/find.d.ts +24 -0
  414. package/dist/es/array/find.d.ts.map +1 -0
  415. package/dist/es/array/find.js +34 -0
  416. package/dist/es/array/first.d.ts +16 -0
  417. package/dist/es/array/first.d.ts.map +1 -0
  418. package/dist/es/array/first.js +22 -0
  419. package/dist/es/array/flat-map-to-obj.d.ts +7 -0
  420. package/dist/es/array/flat-map-to-obj.d.ts.map +1 -0
  421. package/dist/es/array/flat-map-to-obj.js +21 -0
  422. package/dist/es/array/flat-map.d.ts +16 -0
  423. package/dist/es/array/flat-map.d.ts.map +1 -0
  424. package/dist/es/array/flat-map.js +29 -0
  425. package/dist/es/array/flatten-deep.d.ts +12 -0
  426. package/dist/es/array/flatten-deep.d.ts.map +1 -0
  427. package/dist/es/array/flatten-deep.js +44 -0
  428. package/dist/es/array/flatten.d.ts +9 -0
  429. package/dist/es/array/flatten.d.ts.map +1 -0
  430. package/dist/es/array/flatten.js +28 -0
  431. package/dist/es/array/for-each.d.ts +13 -0
  432. package/dist/es/array/for-each.d.ts.map +1 -0
  433. package/dist/es/array/for-each.js +36 -0
  434. package/dist/es/array/group-by.d.ts +19 -0
  435. package/dist/es/array/group-by.d.ts.map +1 -0
  436. package/dist/es/array/group-by.js +27 -0
  437. package/dist/es/array/index-by.d.ts +8 -0
  438. package/dist/es/array/index-by.d.ts.map +1 -0
  439. package/dist/es/array/index-by.js +20 -0
  440. package/dist/es/array/index.d.ts +56 -0
  441. package/dist/es/array/index.d.ts.map +1 -0
  442. package/dist/es/array/index.js +55 -0
  443. package/dist/es/array/intersection-with.d.ts +9 -0
  444. package/dist/es/array/intersection-with.d.ts.map +1 -0
  445. package/dist/es/array/intersection-with.js +27 -0
  446. package/dist/es/array/intersection.d.ts +7 -0
  447. package/dist/es/array/intersection.d.ts.map +1 -0
  448. package/dist/es/array/intersection.js +28 -0
  449. package/dist/es/array/join.d.ts +8 -0
  450. package/dist/es/array/join.d.ts.map +1 -0
  451. package/dist/es/array/join.js +7 -0
  452. package/dist/es/array/last.d.ts +5 -0
  453. package/dist/es/array/last.d.ts.map +1 -0
  454. package/dist/es/array/last.js +7 -0
  455. package/dist/es/array/length.d.ts +5 -0
  456. package/dist/es/array/length.d.ts.map +1 -0
  457. package/dist/es/array/length.js +7 -0
  458. package/dist/es/array/map-to-obj.d.ts +7 -0
  459. package/dist/es/array/map-to-obj.d.ts.map +1 -0
  460. package/dist/es/array/map-to-obj.js +19 -0
  461. package/dist/es/array/map.d.ts +26 -0
  462. package/dist/es/array/map.d.ts.map +1 -0
  463. package/dist/es/array/map.js +31 -0
  464. package/dist/es/array/max-by.d.ts +8 -0
  465. package/dist/es/array/max-by.d.ts.map +1 -0
  466. package/dist/es/array/max-by.js +24 -0
  467. package/dist/es/array/mean-by.d.ts +8 -0
  468. package/dist/es/array/mean-by.d.ts.map +1 -0
  469. package/dist/es/array/mean-by.js +22 -0
  470. package/dist/es/array/merge-all.d.ts +7 -0
  471. package/dist/es/array/merge-all.d.ts.map +1 -0
  472. package/dist/es/array/merge-all.js +3 -0
  473. package/dist/es/array/min-by.d.ts +8 -0
  474. package/dist/es/array/min-by.d.ts.map +1 -0
  475. package/dist/es/array/min-by.js +24 -0
  476. package/dist/es/array/partition.d.ts +10 -0
  477. package/dist/es/array/partition.d.ts.map +1 -0
  478. package/dist/es/array/partition.js +20 -0
  479. package/dist/es/array/range.d.ts +3 -0
  480. package/dist/es/array/range.d.ts.map +1 -0
  481. package/dist/es/array/range.js +11 -0
  482. package/dist/es/array/reduce.d.ts +7 -0
  483. package/dist/es/array/reduce.d.ts.map +1 -0
  484. package/dist/es/array/reduce.js +15 -0
  485. package/dist/es/array/reject.d.ts +13 -0
  486. package/dist/es/array/reject.d.ts.map +1 -0
  487. package/dist/es/array/reject.js +37 -0
  488. package/dist/es/array/reverse.d.ts +6 -0
  489. package/dist/es/array/reverse.d.ts.map +1 -0
  490. package/dist/es/array/reverse.js +7 -0
  491. package/dist/es/array/sample.d.ts +11 -0
  492. package/dist/es/array/sample.d.ts.map +1 -0
  493. package/dist/es/array/sample.js +30 -0
  494. package/dist/es/array/shuffle.d.ts +3 -0
  495. package/dist/es/array/shuffle.d.ts.map +1 -0
  496. package/dist/es/array/shuffle.js +14 -0
  497. package/dist/es/array/sort-by.d.ts +27 -0
  498. package/dist/es/array/sort-by.d.ts.map +1 -0
  499. package/dist/es/array/sort-by.js +51 -0
  500. package/dist/es/array/sort.d.ts +15 -0
  501. package/dist/es/array/sort.d.ts.map +1 -0
  502. package/dist/es/array/sort.js +12 -0
  503. package/dist/es/array/split-at.d.ts +3 -0
  504. package/dist/es/array/split-at.d.ts.map +1 -0
  505. package/dist/es/array/split-at.js +9 -0
  506. package/dist/es/array/split-when.d.ts +3 -0
  507. package/dist/es/array/split-when.d.ts.map +1 -0
  508. package/dist/es/array/split-when.js +13 -0
  509. package/dist/es/array/sum-by.d.ts +8 -0
  510. package/dist/es/array/sum-by.d.ts.map +1 -0
  511. package/dist/es/array/sum-by.js +20 -0
  512. package/dist/es/array/swap-indices.d.ts +25 -0
  513. package/dist/es/array/swap-indices.d.ts.map +1 -0
  514. package/dist/es/array/swap-indices.js +30 -0
  515. package/dist/es/array/take-while.d.ts +3 -0
  516. package/dist/es/array/take-while.d.ts.map +1 -0
  517. package/dist/es/array/take-while.js +14 -0
  518. package/dist/es/array/take.d.ts +7 -0
  519. package/dist/es/array/take.d.ts.map +1 -0
  520. package/dist/es/array/take.js +34 -0
  521. package/dist/es/array/uniq-by.d.ts +3 -0
  522. package/dist/es/array/uniq-by.d.ts.map +1 -0
  523. package/dist/es/array/uniq-by.js +26 -0
  524. package/dist/es/array/uniq-with.d.ts +12 -0
  525. package/dist/es/array/uniq-with.d.ts.map +1 -0
  526. package/dist/es/array/uniq-with.js +29 -0
  527. package/dist/es/array/uniq.d.ts +7 -0
  528. package/dist/es/array/uniq.d.ts.map +1 -0
  529. package/dist/es/array/uniq.js +28 -0
  530. package/dist/es/array/zip-obj.d.ts +3 -0
  531. package/dist/es/array/zip-obj.d.ts.map +1 -0
  532. package/dist/es/array/zip-obj.js +12 -0
  533. package/dist/es/array/zip-with.d.ts +4 -0
  534. package/dist/es/array/zip-with.d.ts.map +1 -0
  535. package/dist/es/array/zip-with.js +24 -0
  536. package/dist/es/array/zip.d.ts +3 -0
  537. package/dist/es/array/zip.d.ts.map +1 -0
  538. package/dist/es/array/zip.js +12 -0
  539. package/dist/es/base.d.ts +2 -0
  540. package/dist/es/base.d.ts.map +1 -0
  541. package/dist/es/base.js +3 -0
  542. package/dist/es/function/create-pipe.d.ts +8 -0
  543. package/dist/es/function/create-pipe.d.ts.map +1 -0
  544. package/dist/es/function/create-pipe.js +4 -0
  545. package/dist/es/function/identity.d.ts +2 -0
  546. package/dist/es/function/identity.d.ts.map +1 -0
  547. package/dist/es/function/identity.js +3 -0
  548. package/dist/es/function/index.d.ts +7 -0
  549. package/dist/es/function/index.d.ts.map +1 -0
  550. package/dist/es/function/index.js +6 -0
  551. package/dist/es/function/noop.d.ts +2 -0
  552. package/dist/es/function/noop.d.ts.map +1 -0
  553. package/dist/es/function/noop.js +3 -0
  554. package/dist/es/function/once.d.ts +2 -0
  555. package/dist/es/function/once.d.ts.map +1 -0
  556. package/dist/es/function/once.js +11 -0
  557. package/dist/es/function/pipe.d.ts +16 -0
  558. package/dist/es/function/pipe.d.ts.map +1 -0
  559. package/dist/es/function/pipe.js +101 -0
  560. package/dist/es/function/purry.d.ts +2 -0
  561. package/dist/es/function/purry.d.ts.map +1 -0
  562. package/dist/es/function/purry.js +16 -0
  563. package/dist/es/guard/index.d.ts +16 -0
  564. package/dist/es/guard/index.d.ts.map +1 -0
  565. package/dist/es/guard/index.js +15 -0
  566. package/dist/es/guard/is-array.d.ts +4 -0
  567. package/dist/es/guard/is-array.d.ts.map +1 -0
  568. package/dist/es/guard/is-array.js +3 -0
  569. package/dist/es/guard/is-boolean.d.ts +4 -0
  570. package/dist/es/guard/is-boolean.d.ts.map +1 -0
  571. package/dist/es/guard/is-boolean.js +3 -0
  572. package/dist/es/guard/is-date.d.ts +2 -0
  573. package/dist/es/guard/is-date.d.ts.map +1 -0
  574. package/dist/es/guard/is-date.js +3 -0
  575. package/dist/es/guard/is-defined.d.ts +5 -0
  576. package/dist/es/guard/is-defined.d.ts.map +1 -0
  577. package/dist/es/guard/is-defined.js +9 -0
  578. package/dist/es/guard/is-empty.d.ts +4 -0
  579. package/dist/es/guard/is-empty.d.ts.map +1 -0
  580. package/dist/es/guard/is-empty.js +15 -0
  581. package/dist/es/guard/is-error.d.ts +4 -0
  582. package/dist/es/guard/is-error.d.ts.map +1 -0
  583. package/dist/es/guard/is-error.js +3 -0
  584. package/dist/es/guard/is-function.d.ts +4 -0
  585. package/dist/es/guard/is-function.d.ts.map +1 -0
  586. package/dist/es/guard/is-function.js +3 -0
  587. package/dist/es/guard/is-nil.d.ts +2 -0
  588. package/dist/es/guard/is-nil.d.ts.map +1 -0
  589. package/dist/es/guard/is-nil.js +3 -0
  590. package/dist/es/guard/is-non-null.d.ts +2 -0
  591. package/dist/es/guard/is-non-null.d.ts.map +1 -0
  592. package/dist/es/guard/is-non-null.js +3 -0
  593. package/dist/es/guard/is-not.d.ts +3 -0
  594. package/dist/es/guard/is-not.d.ts.map +1 -0
  595. package/dist/es/guard/is-not.js +5 -0
  596. package/dist/es/guard/is-number.d.ts +4 -0
  597. package/dist/es/guard/is-number.d.ts.map +1 -0
  598. package/dist/es/guard/is-number.js +3 -0
  599. package/dist/es/guard/is-object.d.ts +4 -0
  600. package/dist/es/guard/is-object.d.ts.map +1 -0
  601. package/dist/es/guard/is-object.js +4 -0
  602. package/dist/es/guard/is-promise.d.ts +2 -0
  603. package/dist/es/guard/is-promise.d.ts.map +1 -0
  604. package/dist/es/guard/is-promise.js +3 -0
  605. package/dist/es/guard/is-string.d.ts +4 -0
  606. package/dist/es/guard/is-string.d.ts.map +1 -0
  607. package/dist/es/guard/is-string.js +3 -0
  608. package/dist/es/guard/is-truthy.d.ts +2 -0
  609. package/dist/es/guard/is-truthy.d.ts.map +1 -0
  610. package/dist/es/guard/is-truthy.js +3 -0
  611. package/dist/es/helpers/index.d.ts +8 -0
  612. package/dist/es/helpers/index.d.ts.map +1 -0
  613. package/dist/es/helpers/index.js +45 -0
  614. package/dist/es/index.d.ts +10 -0
  615. package/dist/es/index.d.ts.map +1 -0
  616. package/dist/es/index.js +9 -0
  617. package/dist/es/number/clamp.d.ts +9 -0
  618. package/dist/es/number/clamp.d.ts.map +1 -0
  619. package/dist/es/number/clamp.js +13 -0
  620. package/dist/es/number/index.d.ts +2 -0
  621. package/dist/es/number/index.d.ts.map +1 -0
  622. package/dist/es/number/index.js +1 -0
  623. package/dist/es/object/add-prop.d.ts +7 -0
  624. package/dist/es/object/add-prop.d.ts.map +1 -0
  625. package/dist/es/object/add-prop.js +7 -0
  626. package/dist/es/object/clone.d.ts +2 -0
  627. package/dist/es/object/clone.d.ts.map +1 -0
  628. package/dist/es/object/clone.js +45 -0
  629. package/dist/es/object/equals.d.ts +3 -0
  630. package/dist/es/object/equals.d.ts.map +1 -0
  631. package/dist/es/object/equals.js +67 -0
  632. package/dist/es/object/for-each-obj.d.ts +10 -0
  633. package/dist/es/object/for-each-obj.d.ts.map +1 -0
  634. package/dist/es/object/for-each-obj.js +26 -0
  635. package/dist/es/object/from-pairs.d.ts +21 -0
  636. package/dist/es/object/from-pairs.d.ts.map +1 -0
  637. package/dist/es/object/from-pairs.js +10 -0
  638. package/dist/es/object/index.d.ts +23 -0
  639. package/dist/es/object/index.d.ts.map +1 -0
  640. package/dist/es/object/index.js +22 -0
  641. package/dist/es/object/invert.d.ts +5 -0
  642. package/dist/es/object/invert.d.ts.map +1 -0
  643. package/dist/es/object/invert.js +11 -0
  644. package/dist/es/object/keys.d.ts +15 -0
  645. package/dist/es/object/keys.d.ts.map +1 -0
  646. package/dist/es/object/keys.js +6 -0
  647. package/dist/es/object/map-keys.d.ts +3 -0
  648. package/dist/es/object/map-keys.d.ts.map +1 -0
  649. package/dist/es/object/map-keys.js +12 -0
  650. package/dist/es/object/map-values.d.ts +3 -0
  651. package/dist/es/object/map-values.d.ts.map +1 -0
  652. package/dist/es/object/map-values.js +12 -0
  653. package/dist/es/object/merge.d.ts +3 -0
  654. package/dist/es/object/merge.d.ts.map +1 -0
  655. package/dist/es/object/merge.js +7 -0
  656. package/dist/es/object/omit-by.d.ts +3 -0
  657. package/dist/es/object/omit-by.d.ts.map +1 -0
  658. package/dist/es/object/omit-by.js +12 -0
  659. package/dist/es/object/omit.d.ts +3 -0
  660. package/dist/es/object/omit.d.ts.map +1 -0
  661. package/dist/es/object/omit.js +31 -0
  662. package/dist/es/object/path-or.d.ts +21 -0
  663. package/dist/es/object/path-or.d.ts.map +1 -0
  664. package/dist/es/object/path-or.js +14 -0
  665. package/dist/es/object/pick-by.d.ts +3 -0
  666. package/dist/es/object/pick-by.d.ts.map +1 -0
  667. package/dist/es/object/pick-by.js +15 -0
  668. package/dist/es/object/pick.d.ts +3 -0
  669. package/dist/es/object/pick.d.ts.map +1 -0
  670. package/dist/es/object/pick.js +15 -0
  671. package/dist/es/object/prop.d.ts +2 -0
  672. package/dist/es/object/prop.d.ts.map +1 -0
  673. package/dist/es/object/prop.js +1 -0
  674. package/dist/es/object/set-path.d.ts +6 -0
  675. package/dist/es/object/set-path.d.ts.map +1 -0
  676. package/dist/es/object/set-path.js +18 -0
  677. package/dist/es/object/set.d.ts +3 -0
  678. package/dist/es/object/set.d.ts.map +1 -0
  679. package/dist/es/object/set.js +7 -0
  680. package/dist/es/object/swap-props.d.ts +7 -0
  681. package/dist/es/object/swap-props.d.ts.map +1 -0
  682. package/dist/es/object/swap-props.js +8 -0
  683. package/dist/es/object/to-pairs.d.ts +13 -0
  684. package/dist/es/object/to-pairs.d.ts.map +1 -0
  685. package/dist/es/object/to-pairs.js +9 -0
  686. package/dist/es/object/values.d.ts +2 -0
  687. package/dist/es/object/values.d.ts.map +1 -0
  688. package/dist/es/object/values.js +3 -0
  689. package/dist/es/string/cases-types.d.ts +29 -0
  690. package/dist/es/string/cases-types.d.ts.map +1 -0
  691. package/dist/es/string/cases-types.js +1 -0
  692. package/dist/es/string/cases.d.ts +16 -0
  693. package/dist/es/string/cases.d.ts.map +1 -0
  694. package/dist/es/string/cases.js +75 -0
  695. package/dist/es/string/index.d.ts +4 -0
  696. package/dist/es/string/index.d.ts.map +1 -0
  697. package/dist/es/string/index.js +3 -0
  698. package/dist/es/string/random-string.d.ts +2 -0
  699. package/dist/es/string/random-string.d.ts.map +1 -0
  700. package/dist/es/string/random-string.js +6 -0
  701. package/dist/es/string/string-to-path.d.ts +3 -0
  702. package/dist/es/string/string-to-path.d.ts.map +1 -0
  703. package/dist/es/string/string-to-path.js +15 -0
  704. package/dist/es/type/index.d.ts +2 -0
  705. package/dist/es/type/index.d.ts.map +1 -0
  706. package/dist/es/type/index.js +1 -0
  707. package/dist/es/type/type.d.ts +2 -0
  708. package/dist/es/type/type.d.ts.map +1 -0
  709. package/dist/es/type/type.js +7 -0
  710. package/dist/es/utils/narrow.d.ts +8 -0
  711. package/dist/es/utils/narrow.d.ts.map +1 -0
  712. package/dist/es/utils/narrow.js +1 -0
  713. package/dist/es/utils/paths.d.ts +9 -0
  714. package/dist/es/utils/paths.d.ts.map +1 -0
  715. package/dist/es/utils/paths.js +1 -0
  716. package/dist/es/utils/reduce-lazy.d.ts +22 -0
  717. package/dist/es/utils/reduce-lazy.d.ts.map +1 -0
  718. package/dist/es/utils/reduce-lazy.js +14 -0
  719. package/dist/es/utils/to-lazy-indexed.d.ts +4 -0
  720. package/dist/es/utils/to-lazy-indexed.d.ts.map +1 -0
  721. package/dist/es/utils/to-lazy-indexed.js +4 -0
  722. package/dist/es/utils/to-single.d.ts +4 -0
  723. package/dist/es/utils/to-single.d.ts.map +1 -0
  724. package/dist/es/utils/to-single.js +4 -0
  725. package/dist/es/utils/types.d.ts +6 -0
  726. package/dist/es/utils/types.d.ts.map +1 -0
  727. package/dist/es/utils/types.js +1 -0
  728. package/package.json +50 -0
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findLast = void 0;
4
+ const function_1 = require("../function");
5
+ function findLast() {
6
+ return (0, function_1.purry)(_findLast(false), arguments);
7
+ }
8
+ exports.findLast = findLast;
9
+ function _findLast(indexed) {
10
+ return (array, fn) => {
11
+ for (let i = array.length - 1; i >= 0; i--) {
12
+ if (indexed ? fn(array[i], i, array) : fn(array[i])) {
13
+ return array[i];
14
+ }
15
+ }
16
+ };
17
+ }
18
+ (function (findLast) {
19
+ function indexed() {
20
+ return (0, function_1.purry)(_findLast(true), arguments);
21
+ }
22
+ findLast.indexed = indexed;
23
+ })(findLast || (exports.findLast = findLast = {}));
@@ -0,0 +1,24 @@
1
+ import { type Pred, type PredIndexed, type PredIndexedOptional } from '../utils/types';
2
+ export declare function find<T>(array: ReadonlyArray<T>, fn: Pred<T, boolean>): T | undefined;
3
+ export declare function find<T = never>(fn: Pred<T, boolean>): (array: ReadonlyArray<T>) => T | undefined;
4
+ export declare namespace find {
5
+ function indexed<T>(array: ReadonlyArray<T>, fn: PredIndexed<T, boolean>): T | undefined;
6
+ function indexed<T>(fn: PredIndexed<T, boolean>): (array: ReadonlyArray<T>) => T | undefined;
7
+ const lazy: (<T>(fn: PredIndexedOptional<T, boolean>) => (value: T, index?: number | undefined, array?: T[] | undefined) => {
8
+ done: boolean;
9
+ hasNext: boolean;
10
+ next: T;
11
+ }) & {
12
+ single: true;
13
+ };
14
+ const lazyIndexed: (<T>(fn: PredIndexedOptional<T, boolean>) => (value: T, index?: number | undefined, array?: T[] | undefined) => {
15
+ done: boolean;
16
+ hasNext: boolean;
17
+ next: T;
18
+ }) & {
19
+ indexed: true;
20
+ } & {
21
+ single: true;
22
+ };
23
+ }
24
+ //# sourceMappingURL=find.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/array/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAoBvF,wBAAgB,IAAI,CAAC,CAAC,EACpB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GACnB,CAAC,GAAG,SAAS,CAAC;AAsBjB,wBAAgB,IAAI,CAAC,CAAC,GAAG,KAAK,EAC5B,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GACnB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AA6B9C,yBAAiB,IAAI,CAAC;IACpB,SAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,GAC1B,CAAC,GAAG,SAAS,CAAC;IACjB,SAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,GAC1B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAKvC,MAAM,IAAI;;;;;;KAAyB,CAAC;IAEpC,MAAM,WAAW;;;;;;;;KAAuC,CAAC;CACjE"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.find = void 0;
4
+ const to_lazy_indexed_1 = require("../utils/to-lazy-indexed");
5
+ const to_single_1 = require("../utils/to-single");
6
+ const function_1 = require("../function");
7
+ function find() {
8
+ return (0, function_1.purry)(_find(false), arguments, find.lazy);
9
+ }
10
+ exports.find = find;
11
+ function _find(indexed) {
12
+ return (array, fn) => {
13
+ if (indexed) {
14
+ return array.find(fn);
15
+ }
16
+ return array.find((x) => fn(x));
17
+ };
18
+ }
19
+ function _lazy(indexed) {
20
+ return (fn) => {
21
+ return (value, index, array) => {
22
+ const valid = indexed ? fn(value, index, array) : fn(value);
23
+ return {
24
+ done: valid,
25
+ hasNext: valid,
26
+ next: value,
27
+ };
28
+ };
29
+ };
30
+ }
31
+ (function (find) {
32
+ function indexed() {
33
+ return (0, function_1.purry)(_find(true), arguments, find.lazyIndexed);
34
+ }
35
+ find.indexed = indexed;
36
+ find.lazy = (0, to_single_1.toSingle)(_lazy(false));
37
+ find.lazyIndexed = (0, to_single_1.toSingle)((0, to_lazy_indexed_1.toLazyIndexed)(_lazy(true)));
38
+ })(find || (exports.find = find = {}));
@@ -0,0 +1,16 @@
1
+ import { type IterableContainer } from '../utils/types';
2
+ type FirstOut<T extends IterableContainer> = T extends [] ? undefined : T extends readonly [unknown, ...Array<unknown>] ? T[0] : T extends readonly [...infer Pre, infer Last] ? Pre[0] | Last : T[0] | undefined;
3
+ export declare function first<T extends IterableContainer>(array: Readonly<T>): FirstOut<T>;
4
+ export declare function first<T extends IterableContainer>(): (array: Readonly<T>) => FirstOut<T>;
5
+ export declare namespace first {
6
+ function lazy<T>(): (value: T) => {
7
+ done: boolean;
8
+ hasNext: boolean;
9
+ next: T;
10
+ };
11
+ namespace lazy {
12
+ const single = true;
13
+ }
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=first.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first.d.ts","sourceRoot":"","sources":["../../../src/array/first.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,KAAK,QAAQ,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,SAAS,EAAE,GACrD,SAAS,GACT,CAAC,SAAS,SAAS,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,GAC7C,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,SAAS,SAAS,CAAC,GAAG,MAAM,GAAG,EAAE,MAAM,IAAI,CAAC,GAC3C,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GACb,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAqBzB,wBAAgB,KAAK,CAAC,CAAC,SAAS,iBAAiB,EAC/C,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GACjB,QAAQ,CAAC,CAAC,CAAC,CAAC;AACf,wBAAgB,KAAK,CAAC,CAAC,SAAS,iBAAiB,KAAK,CACpD,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KACf,QAAQ,CAAC,CAAC,CAAC,CAAC;AAUjB,yBAAiB,KAAK,CAAC;IACrB,SAAgB,IAAI,CAAC,CAAC,aACL,CAAC;;;;MAOjB;IACD,UAAiB,IAAI,CAAC;QACb,MAAM,MAAM,OAAO,CAAC;KAC5B;CACF"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.first = void 0;
4
+ const function_1 = require("../function");
5
+ function first() {
6
+ return (0, function_1.purry)(_first, arguments, first.lazy);
7
+ }
8
+ exports.first = first;
9
+ function _first([first]) {
10
+ return first;
11
+ }
12
+ (function (first) {
13
+ function lazy() {
14
+ return (value) => {
15
+ return {
16
+ done: true,
17
+ hasNext: true,
18
+ next: value,
19
+ };
20
+ };
21
+ }
22
+ first.lazy = lazy;
23
+ (function (lazy) {
24
+ lazy.single = true;
25
+ })(lazy = first.lazy || (first.lazy = {}));
26
+ })(first || (exports.first = first = {}));
@@ -0,0 +1,7 @@
1
+ export declare function flatMapToObj<T, K extends keyof any, V>(array: ReadonlyArray<T>, fn: (element: T) => Array<[K, V]>): Record<K, V>;
2
+ export declare function flatMapToObj<T, K extends keyof any, V>(fn: (element: T) => Array<[K, V]>): (array: ReadonlyArray<T>) => Record<K, V>;
3
+ export declare namespace flatMapToObj {
4
+ function indexed<T, K extends keyof any, V>(array: ReadonlyArray<T>, fn: (element: T, index: number, array: ReadonlyArray<T>) => Array<[K, V]>): Record<K, V>;
5
+ function indexed<T, K extends keyof any, V>(fn: (element: T, index: number, array: ReadonlyArray<T>) => Array<[K, V]>): (array: ReadonlyArray<T>) => Record<K, V>;
6
+ }
7
+ //# sourceMappingURL=flat-map-to-obj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-map-to-obj.d.ts","sourceRoot":"","sources":["../../../src/array/flat-map-to-obj.ts"],"names":[],"mappings":"AAuBA,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,CAAC,EACpD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAChC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAyBhB,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,CAAC,EACpD,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAChC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAkB7C,yBAAiB,YAAY,CAAC;IAC5B,SAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,CAAC,EAC/C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GACxE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChB,SAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,CAAC,EAC/C,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GACxE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAI9C"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flatMapToObj = void 0;
4
+ const function_1 = require("../function");
5
+ function flatMapToObj() {
6
+ return (0, function_1.purry)(_flatMapToObj(false), arguments);
7
+ }
8
+ exports.flatMapToObj = flatMapToObj;
9
+ function _flatMapToObj(indexed) {
10
+ return (array, fn) => {
11
+ return array.reduce((result, element, index) => {
12
+ const items = indexed ? fn(element, index, array) : fn(element);
13
+ items.forEach(([key, value]) => {
14
+ result[key] = value;
15
+ });
16
+ return result;
17
+ }, {});
18
+ };
19
+ }
20
+ (function (flatMapToObj) {
21
+ function indexed() {
22
+ return (0, function_1.purry)(_flatMapToObj(true), arguments);
23
+ }
24
+ flatMapToObj.indexed = indexed;
25
+ })(flatMapToObj || (exports.flatMapToObj = flatMapToObj = {}));
@@ -0,0 +1,16 @@
1
+ export declare function flatMap<T, K>(array: ReadonlyArray<T>, fn: (input: T) => K | Array<K>): Array<K>;
2
+ export declare function flatMap<T, K>(fn: (input: T) => K | Array<K>): (array: ReadonlyArray<T>) => Array<K>;
3
+ export declare namespace flatMap {
4
+ function lazy<T, K>(fn: (input: T) => K | Array<K>): (value: T) => {
5
+ done: boolean;
6
+ hasNext: boolean;
7
+ hasMany: boolean;
8
+ next: K[];
9
+ } | {
10
+ done: boolean;
11
+ hasNext: boolean;
12
+ next: K;
13
+ hasMany?: undefined;
14
+ };
15
+ }
16
+ //# sourceMappingURL=flat-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-map.d.ts","sourceRoot":"","sources":["../../../src/array/flat-map.ts"],"names":[],"mappings":"AAeA,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAC1B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAC7B,KAAK,CAAC,CAAC,CAAC,CAAC;AAcZ,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAC1B,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAC7B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAUzC,yBAAiB,OAAO,CAAC;IACvB,SAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,WACxC,CAAC;;;;;;;;;;MAgBjB;CACF"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flatMap = void 0;
4
+ const flatten_1 = require("./flatten");
5
+ const function_1 = require("../function");
6
+ function flatMap() {
7
+ return (0, function_1.purry)(_flatMap, arguments, flatMap.lazy);
8
+ }
9
+ exports.flatMap = flatMap;
10
+ function _flatMap(array, fn) {
11
+ return (0, flatten_1.flatten)(array.map((item) => fn(item)));
12
+ }
13
+ (function (flatMap) {
14
+ function lazy(fn) {
15
+ return (value) => {
16
+ const next = fn(value);
17
+ if (Array.isArray(next)) {
18
+ return {
19
+ done: false,
20
+ hasNext: true,
21
+ hasMany: true,
22
+ next,
23
+ };
24
+ }
25
+ return {
26
+ done: false,
27
+ hasNext: true,
28
+ next,
29
+ };
30
+ };
31
+ }
32
+ flatMap.lazy = lazy;
33
+ })(flatMap || (exports.flatMap = flatMap = {}));
@@ -0,0 +1,12 @@
1
+ import { type LazyResult } from '../utils/reduce-lazy';
2
+ type FlattenDeep<T> = T extends ReadonlyArray<infer K> ? FlattenDeep2<K> : T;
3
+ type FlattenDeep2<T> = T extends ReadonlyArray<infer K> ? FlattenDeep3<K> : T;
4
+ type FlattenDeep3<T> = T extends ReadonlyArray<infer K> ? FlattenDeep4<K> : T;
5
+ type FlattenDeep4<T> = T extends ReadonlyArray<infer K> ? K : T;
6
+ export declare function flattenDeep<T>(items: ReadonlyArray<T>): Array<FlattenDeep<T>>;
7
+ export declare function flattenDeep<T>(): (items: ReadonlyArray<T>) => Array<FlattenDeep<T>>;
8
+ export declare namespace flattenDeep {
9
+ function lazy(): (value: any) => LazyResult<any>;
10
+ }
11
+ export {};
12
+ //# sourceMappingURL=flatten-deep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten-deep.d.ts","sourceRoot":"","sources":["../../../src/array/flatten-deep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7E,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9E,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9E,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAgBhE,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E,wBAAgB,WAAW,CAAC,CAAC,KAAK,CAChC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KACpB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAyB3B,yBAAiB,WAAW,CAAC;IAC3B,SAAgB,IAAI,YACH,GAAG,KAAG,WAAW,GAAG,CAAC,CAgBrC;CACF"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flattenDeep = void 0;
4
+ const reduce_lazy_1 = require("../utils/reduce-lazy");
5
+ const function_1 = require("../function");
6
+ function flattenDeep() {
7
+ return (0, function_1.purry)(_flattenDeep, arguments, flattenDeep.lazy);
8
+ }
9
+ exports.flattenDeep = flattenDeep;
10
+ function _flattenDeep(items) {
11
+ return (0, reduce_lazy_1._reduceLazy)(items, flattenDeep.lazy());
12
+ }
13
+ function _flattenDeepValue(value) {
14
+ if (!Array.isArray(value)) {
15
+ return value;
16
+ }
17
+ const ret = [];
18
+ value.forEach((item) => {
19
+ if (Array.isArray(item)) {
20
+ ret.push(...flattenDeep(item));
21
+ }
22
+ else {
23
+ ret.push(item);
24
+ }
25
+ });
26
+ return ret;
27
+ }
28
+ (function (flattenDeep) {
29
+ function lazy() {
30
+ return (value) => {
31
+ const next = _flattenDeepValue(value);
32
+ if (Array.isArray(next)) {
33
+ return {
34
+ done: false,
35
+ hasNext: true,
36
+ hasMany: true,
37
+ next,
38
+ };
39
+ }
40
+ return {
41
+ done: false,
42
+ hasNext: true,
43
+ next,
44
+ };
45
+ };
46
+ }
47
+ flattenDeep.lazy = lazy;
48
+ })(flattenDeep || (exports.flattenDeep = flattenDeep = {}));
@@ -0,0 +1,9 @@
1
+ import { type LazyResult } from '../utils/reduce-lazy';
2
+ type Flatten<T> = T extends ReadonlyArray<infer K> ? K : T;
3
+ export declare function flatten<T>(items: ReadonlyArray<T>): Array<Flatten<T>>;
4
+ export declare function flatten<T>(): (items: ReadonlyArray<T>) => Array<Flatten<T>>;
5
+ export declare namespace flatten {
6
+ function lazy<T>(): (next: T) => LazyResult<any>;
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/array/flatten.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAiB3D,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvE,wBAAgB,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAU7E,yBAAiB,OAAO,CAAC;IACvB,SAAgB,IAAI,CAAC,CAAC,YACN,CAAC,KAAG,WAAW,GAAG,CAAC,CAelC;CACF"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flatten = void 0;
4
+ const reduce_lazy_1 = require("../utils/reduce-lazy");
5
+ const function_1 = require("../function");
6
+ function flatten() {
7
+ return (0, function_1.purry)(_flatten, arguments, flatten.lazy);
8
+ }
9
+ exports.flatten = flatten;
10
+ function _flatten(items) {
11
+ return (0, reduce_lazy_1._reduceLazy)(items, flatten.lazy());
12
+ }
13
+ (function (flatten) {
14
+ function lazy() {
15
+ return (next) => {
16
+ if (Array.isArray(next)) {
17
+ return {
18
+ done: false,
19
+ hasNext: true,
20
+ hasMany: true,
21
+ next,
22
+ };
23
+ }
24
+ return {
25
+ done: false,
26
+ hasNext: true,
27
+ next,
28
+ };
29
+ };
30
+ }
31
+ flatten.lazy = lazy;
32
+ })(flatten || (exports.flatten = flatten = {}));
@@ -0,0 +1,13 @@
1
+ import { type LazyResult } from '../utils/reduce-lazy';
2
+ import { type Pred, type PredIndexed, type PredIndexedOptional } from '../utils/types';
3
+ export declare function forEach<T>(array: ReadonlyArray<T>, fn: Pred<T, void>): Array<T>;
4
+ export declare function forEach<T>(fn: Pred<T, void>): (array: ReadonlyArray<T>) => Array<T>;
5
+ export declare namespace forEach {
6
+ function indexed<T>(array: ReadonlyArray<T>, fn: PredIndexed<T, void>): Array<T>;
7
+ function indexed<T>(fn: PredIndexed<T, void>): (array: ReadonlyArray<T>) => Array<T>;
8
+ const lazy: <T>(fn: PredIndexedOptional<T, void>) => (value: T, index?: number | undefined, array?: T[] | undefined) => LazyResult<T>;
9
+ const lazyIndexed: (<T>(fn: PredIndexedOptional<T, void>) => (value: T, index?: number | undefined, array?: T[] | undefined) => LazyResult<T>) & {
10
+ indexed: true;
11
+ };
12
+ }
13
+ //# sourceMappingURL=for-each.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for-each.d.ts","sourceRoot":"","sources":["../../../src/array/for-each.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAsBvF,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,GAChB,KAAK,CAAC,CAAC,CAAC,CAAC;AA0BZ,wBAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,GAChB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AAiCzC,yBAAiB,OAAO,CAAC;IACvB,SAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,GACvB,KAAK,CAAC,CAAC,CAAC,CAAC;IACZ,SAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,GACvB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;IAIlC,MAAM,IAAI,2HAAe,CAAC;IAC1B,MAAM,WAAW;;KAA6B,CAAC;CACvD"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.forEach = void 0;
4
+ const function_1 = require("../function");
5
+ const reduce_lazy_1 = require("../utils/reduce-lazy");
6
+ const to_lazy_indexed_1 = require("../utils/to-lazy-indexed");
7
+ function forEach() {
8
+ return (0, function_1.purry)(_forEach(false), arguments, forEach.lazy);
9
+ }
10
+ exports.forEach = forEach;
11
+ function _forEach(indexed) {
12
+ return (array, fn) => {
13
+ return (0, reduce_lazy_1._reduceLazy)(array, indexed ? forEach.lazyIndexed(fn) : forEach.lazy(fn), indexed);
14
+ };
15
+ }
16
+ function _lazy(indexed) {
17
+ return (fn) => {
18
+ return (value, index, array) => {
19
+ if (indexed) {
20
+ fn(value, index, array);
21
+ }
22
+ else {
23
+ fn(value);
24
+ }
25
+ return {
26
+ done: false,
27
+ hasNext: true,
28
+ next: value,
29
+ };
30
+ };
31
+ };
32
+ }
33
+ (function (forEach) {
34
+ function indexed() {
35
+ return (0, function_1.purry)(_forEach(true), arguments, forEach.lazyIndexed);
36
+ }
37
+ forEach.indexed = indexed;
38
+ forEach.lazy = _lazy(false);
39
+ forEach.lazyIndexed = (0, to_lazy_indexed_1.toLazyIndexed)(_lazy(true));
40
+ })(forEach || (exports.forEach = forEach = {}));
@@ -0,0 +1,19 @@
1
+ import { type NonEmptyArray, type PredIndexed } from '../utils/types';
2
+ export declare function groupBy<T>(items: ReadonlyArray<T>, fn: (item: T) => PropertyKey | undefined): Record<PropertyKey, NonEmptyArray<T>>;
3
+ export declare function groupBy<T>(fn: (item: T) => PropertyKey | undefined): (array: ReadonlyArray<T>) => Record<PropertyKey, NonEmptyArray<T>>;
4
+ interface Strict {
5
+ <Value, Key extends PropertyKey = PropertyKey>(items: ReadonlyArray<Value>, fn: (item: Value) => Key | undefined): StrictOut<Value, Key>;
6
+ <Value, Key extends PropertyKey = PropertyKey>(fn: (item: Value) => Key | undefined): (items: ReadonlyArray<Value>) => StrictOut<Value, Key>;
7
+ readonly indexed: {
8
+ <Value, Key extends PropertyKey = PropertyKey>(items: ReadonlyArray<Value>, fn: PredIndexed<Value, Key | undefined>): StrictOut<Value, Key>;
9
+ <Value, Key extends PropertyKey = PropertyKey>(fn: PredIndexed<Value, Key | undefined>): (items: ReadonlyArray<Value>) => StrictOut<Value, Key>;
10
+ };
11
+ }
12
+ type StrictOut<Value, Key extends PropertyKey = PropertyKey> = string extends Key ? Record<Key, NonEmptyArray<Value>> : number extends Key ? Record<Key, NonEmptyArray<Value>> : symbol extends Key ? Record<Key, NonEmptyArray<Value>> : Partial<Record<Key, NonEmptyArray<Value>>>;
13
+ export declare namespace groupBy {
14
+ function indexed<T>(array: ReadonlyArray<T>, fn: PredIndexed<T, PropertyKey | undefined>): Record<string, NonEmptyArray<T>>;
15
+ function indexed<T>(fn: PredIndexed<T, PropertyKey | undefined>): (array: ReadonlyArray<T>) => Record<string, NonEmptyArray<T>>;
16
+ const strict: Strict;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=group-by.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-by.d.ts","sourceRoot":"","sources":["../../../src/array/group-by.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAA4B,MAAM,gBAAgB,CAAC;AAoBhG,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,WAAW,GAAG,SAAS,GACvC,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzC,wBAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,WAAW,GAAG,SAAS,GACvC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAuCtE,UAAU,MAAM;IAEd,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW,EAC3C,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAC3B,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,GAAG,GAAG,SAAS,GACnC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAGzB,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW,EAC3C,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,GAAG,GAAG,SAAS,GACnC,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE1D,QAAQ,CAAC,OAAO,EAAE;QAEhB,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW,EAC3C,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAC3B,EAAE,EAAE,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC,GACtC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAGzB,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW,EAC3C,EAAE,EAAE,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC,GACtC,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC3D,CAAC;CACH;AAQD,KAAK,SAAS,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW,IAGzD,MAAM,SAAS,GAAG,GACd,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,GACjC,MAAM,SAAS,GAAG,GAChB,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,GACjC,MAAM,SAAS,GAAG,GAChB,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,GAInC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnD,yBAAiB,OAAO,CAAC;IACvB,SAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAC1C,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,SAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAC1C,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAK1D,MAAM,MAAM,EAAE,MAAgB,CAAC;CACvC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.groupBy = void 0;
4
+ const function_1 = require("../function");
5
+ function groupBy() {
6
+ return (0, function_1.purry)(_groupBy(false), arguments);
7
+ }
8
+ exports.groupBy = groupBy;
9
+ function _groupBy(indexed) {
10
+ return (array, fn) => {
11
+ const ret = {};
12
+ array.forEach((item, index) => {
13
+ const key = indexed ? fn(item, index, array) : fn(item);
14
+ if (key !== undefined) {
15
+ const actualKey = String(key);
16
+ if (!ret[actualKey]) {
17
+ ret[actualKey] = [];
18
+ }
19
+ ret[actualKey].push(item);
20
+ }
21
+ });
22
+ return ret;
23
+ };
24
+ }
25
+ (function (groupBy) {
26
+ function indexed() {
27
+ return (0, function_1.purry)(_groupBy(true), arguments);
28
+ }
29
+ groupBy.indexed = indexed;
30
+ groupBy.strict = groupBy;
31
+ })(groupBy || (exports.groupBy = groupBy = {}));
@@ -0,0 +1,8 @@
1
+ import { type PredIndexed } from '../utils/types';
2
+ export declare function indexBy<T>(array: ReadonlyArray<T>, fn: (item: T) => any): Record<string, T>;
3
+ export declare function indexBy<T>(fn: (item: T) => any): (array: ReadonlyArray<T>) => Record<string, T>;
4
+ export declare namespace indexBy {
5
+ function indexed<T>(array: ReadonlyArray<T>, fn: PredIndexed<T, any>): Record<string, T>;
6
+ function indexed<T>(fn: PredIndexed<T, any>): (array: ReadonlyArray<T>) => Record<string, T>;
7
+ }
8
+ //# sourceMappingURL=index-by.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-by.d.ts","sourceRoot":"","sources":["../../../src/array/index-by.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA4B,MAAM,gBAAgB,CAAC;AAe5E,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,GACnB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAiBrB,wBAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,GACnB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAiBlD,yBAAiB,OAAO,CAAC;IACvB,SAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,GACtB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACrB,SAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,GACtB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAInD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.indexBy = void 0;
4
+ const function_1 = require("../function");
5
+ function indexBy() {
6
+ return (0, function_1.purry)(_indexBy(false), arguments);
7
+ }
8
+ exports.indexBy = indexBy;
9
+ function _indexBy(indexed) {
10
+ return (array, fn) => {
11
+ return array.reduce((ret, item, index) => {
12
+ const value = indexed ? fn(item, index, array) : fn(item);
13
+ const key = String(value);
14
+ ret[key] = item;
15
+ return ret;
16
+ }, {});
17
+ };
18
+ }
19
+ (function (indexBy) {
20
+ function indexed() {
21
+ return (0, function_1.purry)(_indexBy(true), arguments);
22
+ }
23
+ indexBy.indexed = indexed;
24
+ })(indexBy || (exports.indexBy = indexBy = {}));
@@ -0,0 +1,56 @@
1
+ export * from './all-pass';
2
+ export * from './any-pass';
3
+ export * from './chunk';
4
+ export * from './compact';
5
+ export * from './concat';
6
+ export * from './count-by';
7
+ export * from './difference-with';
8
+ export * from './difference';
9
+ export * from './drop-last';
10
+ export * from './drop';
11
+ export * from './filter';
12
+ export * from './find-index';
13
+ export * from './find-last-index';
14
+ export * from './find-last';
15
+ export * from './find';
16
+ export * from './first';
17
+ export * from './flat-map-to-obj';
18
+ export * from './flat-map';
19
+ export * from './flatten-deep';
20
+ export * from './flatten';
21
+ export * from './for-each';
22
+ export * from './group-by';
23
+ export * from './index-by';
24
+ export * from './intersection';
25
+ export * from './intersection-with';
26
+ export * from './join';
27
+ export * from './last';
28
+ export * from './length';
29
+ export * from './map';
30
+ export * from './map-to-obj';
31
+ export * from './max-by';
32
+ export * from './mean-by';
33
+ export * from './merge-all';
34
+ export * from './min-by';
35
+ export * from './partition';
36
+ export * from './range';
37
+ export * from './reduce';
38
+ export * from './reject';
39
+ export * from './reverse';
40
+ export * from './sample';
41
+ export * from './shuffle';
42
+ export * from './sort';
43
+ export * from './sort-by';
44
+ export * from './split-at';
45
+ export * from './split-when';
46
+ export * from './sum-by';
47
+ export * from './swap-indices';
48
+ export * from './take';
49
+ export * from './take-while';
50
+ export * from './uniq';
51
+ export * from './uniq-by';
52
+ export * from './uniq-with';
53
+ export * from './zip';
54
+ export * from './zip-obj';
55
+ export * from './zip-with';
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/array/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./all-pass"), exports);
18
+ __exportStar(require("./any-pass"), exports);
19
+ __exportStar(require("./chunk"), exports);
20
+ __exportStar(require("./compact"), exports);
21
+ __exportStar(require("./concat"), exports);
22
+ __exportStar(require("./count-by"), exports);
23
+ __exportStar(require("./difference-with"), exports);
24
+ __exportStar(require("./difference"), exports);
25
+ __exportStar(require("./drop-last"), exports);
26
+ __exportStar(require("./drop"), exports);
27
+ __exportStar(require("./filter"), exports);
28
+ __exportStar(require("./find-index"), exports);
29
+ __exportStar(require("./find-last-index"), exports);
30
+ __exportStar(require("./find-last"), exports);
31
+ __exportStar(require("./find"), exports);
32
+ __exportStar(require("./first"), exports);
33
+ __exportStar(require("./flat-map-to-obj"), exports);
34
+ __exportStar(require("./flat-map"), exports);
35
+ __exportStar(require("./flatten-deep"), exports);
36
+ __exportStar(require("./flatten"), exports);
37
+ __exportStar(require("./for-each"), exports);
38
+ __exportStar(require("./group-by"), exports);
39
+ __exportStar(require("./index-by"), exports);
40
+ __exportStar(require("./intersection"), exports);
41
+ __exportStar(require("./intersection-with"), exports);
42
+ __exportStar(require("./join"), exports);
43
+ __exportStar(require("./last"), exports);
44
+ __exportStar(require("./length"), exports);
45
+ __exportStar(require("./map"), exports);
46
+ __exportStar(require("./map-to-obj"), exports);
47
+ __exportStar(require("./max-by"), exports);
48
+ __exportStar(require("./mean-by"), exports);
49
+ __exportStar(require("./merge-all"), exports);
50
+ __exportStar(require("./min-by"), exports);
51
+ __exportStar(require("./partition"), exports);
52
+ __exportStar(require("./range"), exports);
53
+ __exportStar(require("./reduce"), exports);
54
+ __exportStar(require("./reject"), exports);
55
+ __exportStar(require("./reverse"), exports);
56
+ __exportStar(require("./sample"), exports);
57
+ __exportStar(require("./shuffle"), exports);
58
+ __exportStar(require("./sort"), exports);
59
+ __exportStar(require("./sort-by"), exports);
60
+ __exportStar(require("./split-at"), exports);
61
+ __exportStar(require("./split-when"), exports);
62
+ __exportStar(require("./sum-by"), exports);
63
+ __exportStar(require("./swap-indices"), exports);
64
+ __exportStar(require("./take"), exports);
65
+ __exportStar(require("./take-while"), exports);
66
+ __exportStar(require("./uniq"), exports);
67
+ __exportStar(require("./uniq-by"), exports);
68
+ __exportStar(require("./uniq-with"), exports);
69
+ __exportStar(require("./zip"), exports);
70
+ __exportStar(require("./zip-obj"), exports);
71
+ __exportStar(require("./zip-with"), exports);