@daiso-tech/core 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/_shared/utilities.js +19 -0
  3. package/dist/cjs/_shared/utilities.js.map +1 -0
  4. package/dist/cjs/collection/_shared.js +4 -2
  5. package/dist/cjs/collection/_shared.js.map +1 -1
  6. package/dist/cjs/collection/async-iterable-collection/_shared/_module.js +1 -1
  7. package/dist/cjs/collection/async-iterable-collection/_shared/_module.js.map +1 -1
  8. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js +8 -7
  9. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
  10. package/dist/cjs/collection/async-iterable-collection/_shared/{async-chunk-whilte-iterable.js → async-chunk-while-iterable.js} +14 -16
  11. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -0
  12. package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js +1 -2
  13. package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
  14. package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js +3 -6
  15. package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  16. package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +19 -18
  17. package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  18. package/dist/cjs/collection/async-iterable-collection/_shared/async-entries-iterable.js +1 -8
  19. package/dist/cjs/collection/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
  20. package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js +6 -9
  21. package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  22. package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +3 -6
  23. package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  24. package/dist/cjs/collection/async-iterable-collection/_shared/async-group-by-iterable.js +12 -13
  25. package/dist/cjs/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
  26. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +5 -12
  27. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  28. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +5 -12
  29. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  30. package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js +3 -6
  31. package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  32. package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js +1 -2
  33. package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  34. package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-end-iterable.js +1 -4
  35. package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
  36. package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-start-iterable.js +1 -4
  37. package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
  38. package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js +12 -19
  39. package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  40. package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js +2 -3
  41. package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
  42. package/dist/cjs/collection/async-iterable-collection/_shared/async-reverse-iterable.js +3 -10
  43. package/dist/cjs/collection/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
  44. package/dist/cjs/collection/async-iterable-collection/_shared/async-shuffle-iterable.js +4 -2
  45. package/dist/cjs/collection/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
  46. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js +4 -9
  47. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
  48. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +5 -12
  49. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  50. package/dist/cjs/collection/async-iterable-collection/_shared/async-slice-iterable.js +2 -4
  51. package/dist/cjs/collection/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
  52. package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js +4 -11
  53. package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
  54. package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js +7 -9
  55. package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
  56. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js +4 -9
  57. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
  58. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js +6 -9
  59. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  60. package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js +1 -2
  61. package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  62. package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js +2 -5
  63. package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  64. package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js +6 -9
  65. package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  66. package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js +1 -2
  67. package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  68. package/dist/cjs/collection/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
  69. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +173 -228
  70. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  71. package/dist/cjs/collection/iterable-collection/_shared/_module.js +1 -1
  72. package/dist/cjs/collection/iterable-collection/_shared/_module.js.map +1 -1
  73. package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js +8 -7
  74. package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
  75. package/dist/cjs/collection/iterable-collection/_shared/{chunk-whilte-iterable.js → chunk-while-iterable.js} +12 -14
  76. package/dist/cjs/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -0
  77. package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js +1 -2
  78. package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
  79. package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js +3 -6
  80. package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  81. package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js +26 -20
  82. package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  83. package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js +2 -9
  84. package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
  85. package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js +3 -6
  86. package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
  87. package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js +3 -6
  88. package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  89. package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js +10 -12
  90. package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  91. package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js +3 -6
  92. package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  93. package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js +3 -6
  94. package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  95. package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js +3 -6
  96. package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
  97. package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js +1 -2
  98. package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
  99. package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js +2 -6
  100. package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
  101. package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js +2 -6
  102. package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
  103. package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js +9 -11
  104. package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
  105. package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js +2 -3
  106. package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
  107. package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js +4 -12
  108. package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
  109. package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js +5 -4
  110. package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
  111. package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js +4 -9
  112. package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
  113. package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js +3 -6
  114. package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  115. package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js +3 -6
  116. package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
  117. package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js +4 -11
  118. package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
  119. package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js +1 -2
  120. package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
  121. package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js +7 -9
  122. package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
  123. package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js +4 -9
  124. package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
  125. package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js +3 -6
  126. package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  127. package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js +1 -2
  128. package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
  129. package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js +3 -6
  130. package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
  131. package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js +3 -6
  132. package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
  133. package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js +1 -2
  134. package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
  135. package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js +1 -2
  136. package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
  137. package/dist/cjs/collection/iterable-collection/iterable-collection.js +161 -251
  138. package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -1
  139. package/dist/cjs/collection/list-collection/list-collection.js +213 -299
  140. package/dist/cjs/collection/list-collection/list-collection.js.map +1 -1
  141. package/dist/cjs/contracts/collection/_shared.js +17 -10
  142. package/dist/cjs/contracts/collection/_shared.js.map +1 -1
  143. package/dist/esm/_shared/utilities.js +15 -0
  144. package/dist/esm/_shared/utilities.js.map +1 -0
  145. package/dist/esm/collection/_shared.js +4 -2
  146. package/dist/esm/collection/_shared.js.map +1 -1
  147. package/dist/esm/collection/async-iterable-collection/_shared/_module.js +1 -1
  148. package/dist/esm/collection/async-iterable-collection/_shared/_module.js.map +1 -1
  149. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js +8 -7
  150. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
  151. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js +37 -0
  152. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -0
  153. package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js +1 -2
  154. package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
  155. package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js +3 -6
  156. package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  157. package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +19 -18
  158. package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  159. package/dist/esm/collection/async-iterable-collection/_shared/async-entries-iterable.js +1 -8
  160. package/dist/esm/collection/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
  161. package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js +6 -9
  162. package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  163. package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +3 -6
  164. package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  165. package/dist/esm/collection/async-iterable-collection/_shared/async-group-by-iterable.js +12 -13
  166. package/dist/esm/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
  167. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +6 -13
  168. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  169. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +6 -13
  170. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  171. package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js +3 -6
  172. package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  173. package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js +1 -2
  174. package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  175. package/dist/esm/collection/async-iterable-collection/_shared/async-pad-end-iterable.js +1 -4
  176. package/dist/esm/collection/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
  177. package/dist/esm/collection/async-iterable-collection/_shared/async-pad-start-iterable.js +1 -4
  178. package/dist/esm/collection/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
  179. package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js +13 -20
  180. package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  181. package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js +2 -3
  182. package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
  183. package/dist/esm/collection/async-iterable-collection/_shared/async-reverse-iterable.js +3 -10
  184. package/dist/esm/collection/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
  185. package/dist/esm/collection/async-iterable-collection/_shared/async-shuffle-iterable.js +4 -2
  186. package/dist/esm/collection/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
  187. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js +4 -9
  188. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
  189. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +6 -13
  190. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  191. package/dist/esm/collection/async-iterable-collection/_shared/async-slice-iterable.js +2 -4
  192. package/dist/esm/collection/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
  193. package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js +4 -11
  194. package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
  195. package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js +7 -9
  196. package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
  197. package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js +4 -9
  198. package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
  199. package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js +6 -9
  200. package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  201. package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js +1 -2
  202. package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  203. package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js +2 -5
  204. package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  205. package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js +6 -9
  206. package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  207. package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js +1 -2
  208. package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  209. package/dist/esm/collection/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
  210. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +174 -229
  211. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  212. package/dist/esm/collection/iterable-collection/_shared/_module.js +1 -1
  213. package/dist/esm/collection/iterable-collection/_shared/_module.js.map +1 -1
  214. package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js +8 -7
  215. package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
  216. package/dist/esm/collection/iterable-collection/_shared/{chunk-whilte-iterable.js → chunk-while-iterable.js} +12 -14
  217. package/dist/esm/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -0
  218. package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js +1 -2
  219. package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
  220. package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js +3 -6
  221. package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  222. package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js +24 -18
  223. package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  224. package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js +3 -10
  225. package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
  226. package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js +3 -6
  227. package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
  228. package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js +3 -6
  229. package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  230. package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js +10 -12
  231. package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  232. package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js +3 -6
  233. package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  234. package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js +3 -6
  235. package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  236. package/dist/esm/collection/iterable-collection/_shared/map-iterable.js +3 -6
  237. package/dist/esm/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
  238. package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js +1 -2
  239. package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
  240. package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js +2 -6
  241. package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
  242. package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js +2 -6
  243. package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
  244. package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js +9 -11
  245. package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
  246. package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js +2 -3
  247. package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
  248. package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js +4 -12
  249. package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
  250. package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js +5 -4
  251. package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
  252. package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js +4 -9
  253. package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
  254. package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js +3 -6
  255. package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  256. package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js +3 -6
  257. package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
  258. package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js +4 -11
  259. package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
  260. package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js +1 -2
  261. package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
  262. package/dist/esm/collection/iterable-collection/_shared/split-iterable.js +7 -9
  263. package/dist/esm/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
  264. package/dist/esm/collection/iterable-collection/_shared/take-iterable.js +4 -9
  265. package/dist/esm/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
  266. package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js +3 -6
  267. package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  268. package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js +1 -2
  269. package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
  270. package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js +3 -6
  271. package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
  272. package/dist/esm/collection/iterable-collection/_shared/update-iterable.js +3 -6
  273. package/dist/esm/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
  274. package/dist/esm/collection/iterable-collection/_shared/when-iterable.js +1 -2
  275. package/dist/esm/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
  276. package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js +1 -2
  277. package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
  278. package/dist/esm/collection/iterable-collection/iterable-collection.js +162 -252
  279. package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -1
  280. package/dist/esm/collection/list-collection/list-collection.js +214 -300
  281. package/dist/esm/collection/list-collection/list-collection.js.map +1 -1
  282. package/dist/esm/contracts/collection/_shared.js +12 -6
  283. package/dist/esm/contracts/collection/_shared.js.map +1 -1
  284. package/dist/types/_shared/types.d.ts +5 -0
  285. package/dist/types/_shared/utilities.d.ts +3 -0
  286. package/dist/types/collection/async-iterable-collection/_shared/_module.d.ts +1 -1
  287. package/dist/types/collection/async-iterable-collection/_shared/async-chunk-iterable.d.ts +2 -1
  288. package/dist/types/collection/async-iterable-collection/_shared/async-chunk-while-iterable.d.ts +12 -0
  289. package/dist/types/collection/async-iterable-collection/_shared/async-count-by-iterable.d.ts +3 -3
  290. package/dist/types/collection/async-iterable-collection/_shared/async-cross-join-iterable.d.ts +6 -5
  291. package/dist/types/collection/async-iterable-collection/_shared/async-entries-iterable.d.ts +3 -4
  292. package/dist/types/collection/async-iterable-collection/_shared/async-filter-iterable.d.ts +2 -3
  293. package/dist/types/collection/async-iterable-collection/_shared/async-flat-map-iterable.d.ts +1 -2
  294. package/dist/types/collection/async-iterable-collection/_shared/async-group-by-iterable.d.ts +4 -4
  295. package/dist/types/collection/async-iterable-collection/_shared/async-insert-after-iterable.d.ts +4 -4
  296. package/dist/types/collection/async-iterable-collection/_shared/async-insert-before-iterable.d.ts +4 -4
  297. package/dist/types/collection/async-iterable-collection/_shared/async-map-iterable.d.ts +1 -2
  298. package/dist/types/collection/async-iterable-collection/_shared/async-merge-iterable.d.ts +1 -1
  299. package/dist/types/collection/async-iterable-collection/_shared/async-pad-end-iterable.d.ts +2 -1
  300. package/dist/types/collection/async-iterable-collection/_shared/async-pad-start-iterable.d.ts +2 -1
  301. package/dist/types/collection/async-iterable-collection/_shared/async-partion-iterable.d.ts +4 -4
  302. package/dist/types/collection/async-iterable-collection/_shared/async-repeat-iterable.d.ts +2 -1
  303. package/dist/types/collection/async-iterable-collection/_shared/async-reverse-iterable.d.ts +3 -3
  304. package/dist/types/collection/async-iterable-collection/_shared/async-shuffle-iterable.d.ts +2 -1
  305. package/dist/types/collection/async-iterable-collection/_shared/async-skip-iterable.d.ts +1 -2
  306. package/dist/types/collection/async-iterable-collection/_shared/async-skip-until-iterable.d.ts +2 -3
  307. package/dist/types/collection/async-iterable-collection/_shared/async-slice-iterable.d.ts +1 -2
  308. package/dist/types/collection/async-iterable-collection/_shared/async-sliding-iterable.d.ts +1 -2
  309. package/dist/types/collection/async-iterable-collection/_shared/async-split-iterable.d.ts +3 -3
  310. package/dist/types/collection/async-iterable-collection/_shared/async-take-iterable.d.ts +1 -2
  311. package/dist/types/collection/async-iterable-collection/_shared/async-take-until-iterable.d.ts +2 -3
  312. package/dist/types/collection/async-iterable-collection/_shared/async-unique-iterable.d.ts +1 -2
  313. package/dist/types/collection/async-iterable-collection/_shared/async-update-iterable.d.ts +5 -6
  314. package/dist/types/collection/async-iterable-collection/_shared/async-zip-iterable.d.ts +2 -1
  315. package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +56 -54
  316. package/dist/types/collection/iterable-collection/_shared/_module.d.ts +1 -1
  317. package/dist/types/collection/iterable-collection/_shared/{chunk-whilte-iterable.d.ts → chunk-while-iterable.d.ts} +1 -2
  318. package/dist/types/collection/iterable-collection/_shared/count-by-iterable.d.ts +3 -3
  319. package/dist/types/collection/iterable-collection/_shared/cross-join-iterable.d.ts +5 -8
  320. package/dist/types/collection/iterable-collection/_shared/entries-iterable.d.ts +2 -3
  321. package/dist/types/collection/iterable-collection/_shared/filter-iterable.d.ts +1 -2
  322. package/dist/types/collection/iterable-collection/_shared/flat-map-iterable.d.ts +1 -2
  323. package/dist/types/collection/iterable-collection/_shared/group-by-iterable.d.ts +3 -3
  324. package/dist/types/collection/iterable-collection/_shared/insert-after-iterable.d.ts +1 -2
  325. package/dist/types/collection/iterable-collection/_shared/insert-before-iterable.d.ts +1 -2
  326. package/dist/types/collection/iterable-collection/_shared/map-iterable.d.ts +1 -2
  327. package/dist/types/collection/iterable-collection/_shared/partion-iterable.d.ts +1 -2
  328. package/dist/types/collection/iterable-collection/_shared/reverse-iterable.d.ts +1 -2
  329. package/dist/types/collection/iterable-collection/_shared/shuffle-iterable.d.ts +2 -1
  330. package/dist/types/collection/iterable-collection/_shared/skip-iterable.d.ts +1 -2
  331. package/dist/types/collection/iterable-collection/_shared/skip-until-iterable.d.ts +1 -2
  332. package/dist/types/collection/iterable-collection/_shared/slice-iterable.d.ts +1 -2
  333. package/dist/types/collection/iterable-collection/_shared/sliding-iterable.d.ts +1 -2
  334. package/dist/types/collection/iterable-collection/_shared/split-iterable.d.ts +1 -2
  335. package/dist/types/collection/iterable-collection/_shared/take-iterable.d.ts +1 -2
  336. package/dist/types/collection/iterable-collection/_shared/take-until-iterable.d.ts +1 -2
  337. package/dist/types/collection/iterable-collection/_shared/unique-iterable.d.ts +1 -2
  338. package/dist/types/collection/iterable-collection/_shared/update-iterable.d.ts +4 -5
  339. package/dist/types/collection/iterable-collection/_shared/zip-iterable.d.ts +1 -1
  340. package/dist/types/collection/iterable-collection/iterable-collection.d.ts +56 -54
  341. package/dist/types/collection/list-collection/list-collection.d.ts +57 -54
  342. package/dist/types/contracts/collection/_shared.d.ts +14 -158
  343. package/dist/types/contracts/collection/async-collection.contract.d.ts +430 -284
  344. package/dist/types/contracts/collection/collection.contract.d.ts +417 -260
  345. package/package.json +2 -1
  346. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js.map +0 -1
  347. package/dist/cjs/collection/iterable-collection/_shared/chunk-whilte-iterable.js.map +0 -1
  348. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js +0 -39
  349. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js.map +0 -1
  350. package/dist/esm/collection/iterable-collection/_shared/chunk-whilte-iterable.js.map +0 -1
  351. package/dist/types/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.d.ts +0 -12
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @module Collections
3
3
  */
4
- import { type Collapse, type Comparator, type Predicate, type FindOrSettings, type FindSettings, type ForEach, type GroupBySettings, type CountBySettings, type UniqueSettings, type ICollection, type JoinSettings, type Lazyable, type Map, type Modifier, type PageSettings, type RecordItem, type ReduceSettings, type ReverseSettings, type SliceSettings, type SlidingSettings, type Tap, type Transform, type UpdatedItem } from "../../contracts/collection/_module";
5
- import { type EnsureType } from "../../_shared/types";
4
+ import { type Collapse, type Comparator, type Predicate, type ForEach, type ICollection, type Map, type Modifier, type Tap, type Transform, type ChangendItem, type Reduce, type CrossJoinResult } from "../../contracts/collection/_module";
5
+ import { type Lazyable, type EnsureType } from "../../_shared/types";
6
+ import { type RecordItem } from "../../_shared/types";
6
7
  /**
7
8
  * All methods that return <i>{@link ICollection}</i> are executed lazly which means they will be executed when the <i>IterableCollection</i> is iterated with <i>forEach</i> method or "for of" loop.
8
9
  * The rest of the methods are executed eagerly.
@@ -10,7 +11,6 @@ import { type EnsureType } from "../../_shared/types";
10
11
  */
11
12
  export declare class IterableCollection<TInput> implements ICollection<TInput> {
12
13
  private iterable;
13
- private static THROW_ON_NUMBER_LIMIT;
14
14
  private static DEFAULT_CHUNK_SIZE;
15
15
  private static makeCollection;
16
16
  /**
@@ -19,32 +19,34 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
19
19
  constructor(iterable: Iterable<TInput>);
20
20
  [Symbol.iterator](): Iterator<TInput>;
21
21
  toIterator(): Iterator<TInput, void>;
22
- entries(throwOnIndexOverflow?: boolean): ICollection<RecordItem<number, TInput>>;
23
- keys(throwOnIndexOverflow?: boolean): ICollection<number>;
22
+ entries(): ICollection<RecordItem<number, TInput>>;
23
+ keys(): ICollection<number>;
24
24
  values(): ICollection<TInput>;
25
- filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<TOutput>;
26
- reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<Exclude<TInput, TOutput>>;
27
- map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<TOutput>;
28
- reduce<TOutput = TInput>(settings: ReduceSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
29
- join(settings?: JoinSettings): EnsureType<TInput, string>;
25
+ filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
26
+ reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
27
+ map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
28
+ reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>): TInput;
29
+ reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>, initialValue: TInput): TInput;
30
+ reduce<TOutput>(reduceFn: Reduce<TInput, ICollection<TInput>, TOutput>, initialValue: TOutput): TOutput;
31
+ join(separator?: string): EnsureType<TInput, string>;
30
32
  collapse(): ICollection<Collapse<TInput>>;
31
- flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>, throwOnIndexOverflow?: boolean): ICollection<TOutput>;
32
- update<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>, throwOnIndexOverflow?: boolean): ICollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
33
- page(settings: PageSettings): ICollection<TInput>;
33
+ flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>): ICollection<TOutput>;
34
+ change<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<ChangendItem<TInput, TFilterOutput, TMapOutput>>;
35
+ page(page: number, pageSize: number): ICollection<TInput>;
34
36
  sum(): EnsureType<TInput, number>;
35
37
  average(): EnsureType<TInput, number>;
36
- median(throwOnIndexOverflow?: boolean): EnsureType<TInput, number>;
38
+ median(): EnsureType<TInput, number>;
37
39
  min(): EnsureType<TInput, number>;
38
40
  max(): EnsureType<TInput, number>;
39
- percentage(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
40
- some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): boolean;
41
- every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): boolean;
42
- take(limit: number, throwOnIndexOverflow?: boolean): ICollection<TInput>;
43
- takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
44
- takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
45
- skip(offset: number, throwOnIndexOverflow?: boolean): ICollection<TInput>;
46
- skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
47
- skipWhile<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
41
+ percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
42
+ some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
43
+ every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
44
+ take(limit: number): ICollection<TInput>;
45
+ takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
46
+ takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
47
+ skip(offset: number): ICollection<TInput>;
48
+ skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
49
+ skipWhile<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
48
50
  when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
49
51
  whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
50
52
  whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
@@ -52,47 +54,47 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
52
54
  pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
53
55
  tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
54
56
  chunk(chunkSize: number): ICollection<ICollection<TInput>>;
55
- chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
56
- split(chunkAmount: number, throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
57
- partition(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
58
- sliding(settings: SlidingSettings): ICollection<ICollection<TInput>>;
59
- groupBy<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
60
- countBy<TOutput = TInput>(settings?: CountBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
61
- unique<TOutput>(settings?: UniqueSettings<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
57
+ chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
58
+ split(chunkAmount: number): ICollection<ICollection<TInput>>;
59
+ partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
60
+ sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
61
+ groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
62
+ countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
63
+ unique<TOutput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
62
64
  difference<TOutput = TInput>(iterable: Iterable<TInput>, mapFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
63
65
  repeat(amount: number): ICollection<TInput>;
64
66
  padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
65
67
  padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
66
- slice(settings?: SliceSettings): ICollection<TInput>;
68
+ slice(start?: number, end?: number): ICollection<TInput>;
67
69
  prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
68
70
  append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
69
- insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnIndexOverflow?: boolean): ICollection<TInput | TExtended>;
70
- insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnIndexOverflow?: boolean): ICollection<TInput | TExtended>;
71
- crossJoin<TExtended = TInput>(...iterables: Array<Iterable<TExtended>>): ICollection<ICollection<TInput | TExtended>>;
71
+ insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
72
+ insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
73
+ crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
72
74
  zip<TExtended>(iterable: Iterable<TExtended>): ICollection<RecordItem<TInput, TExtended>>;
73
75
  sort(comparator?: Comparator<TInput>): ICollection<TInput>;
74
- reverse(settings?: ReverseSettings): ICollection<TInput>;
75
- shuffle(): ICollection<TInput>;
76
- first<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
77
- firstOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
78
- firstOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
79
- last<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
80
- lastOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
81
- lastOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
82
- before(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | null;
83
- beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | TExtended;
84
- beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput;
85
- after(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | null;
86
- afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | TExtended;
87
- afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput;
88
- sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): TOutput;
76
+ reverse(chunkSize?: number): ICollection<TInput>;
77
+ shuffle(mathRandom?: () => number): ICollection<TInput>;
78
+ first<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
79
+ firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
80
+ firstOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
81
+ last<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
82
+ lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
83
+ lastOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
84
+ before(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
85
+ beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
86
+ beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
87
+ after(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
88
+ afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
89
+ afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
90
+ sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
89
91
  nth(step: number): ICollection<TInput>;
90
- count(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
91
- size(throwOnIndexOverflow?: boolean): number;
92
+ count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
93
+ size(): number;
92
94
  isEmpty(): boolean;
93
95
  isNotEmpty(): boolean;
94
- searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
95
- searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
96
- forEach(callback: ForEach<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): void;
96
+ searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
97
+ searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
98
+ forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
97
99
  toArray(): TInput[];
98
100
  }
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * @module Collections
3
3
  */
4
- import { type Collapse, type Comparator, type Predicate, type FindOrSettings, type FindSettings, type ForEach, type GroupBySettings, type CountBySettings, type UniqueSettings, type ICollection, type JoinSettings, type Lazyable, type Map, type Modifier, type PageSettings, type RecordItem, type ReduceSettings, type ReverseSettings, type SliceSettings, type SlidingSettings, type Tap, type Transform, type UpdatedItem } from "../../contracts/collection/_module";
5
- import { EnsureType } from "../../_shared/types";
4
+ import { type Collapse, type Comparator, type Predicate, type ICollection, type Map, type Modifier, type Tap, type Transform, type ChangendItem, type Reduce, type ForEach, type CrossJoinResult } from "../../contracts/collection/_module";
5
+ import { type EnsureType, type Lazyable } from "../../_shared/types";
6
+ import { type RecordItem } from "../../_shared/types";
6
7
  /**
7
- * All methods in <i>ListCollection</i> are executed eagerly. The <i>throwOnIndexOverflow</i> parameter in the <i>ListCollection</i> methods doesnt have any affect.
8
+ * All methods in <i>ListCollection</i> are executed eagerly.
8
9
  * @group Adapters
9
10
  */
10
11
  export declare class ListCollection<TInput> implements ICollection<TInput> {
@@ -15,32 +16,34 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
15
16
  constructor(iterable?: Iterable<TInput>);
16
17
  [Symbol.iterator](): Iterator<TInput>;
17
18
  toIterator(): Iterator<TInput, void>;
18
- entries(_throwOnIndexOverflow?: boolean): ICollection<RecordItem<number, TInput>>;
19
- keys(_throwOnIndexOverflow?: boolean): ICollection<number>;
19
+ entries(): ICollection<RecordItem<number, TInput>>;
20
+ keys(): ICollection<number>;
20
21
  values(): ICollection<TInput>;
21
- filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, _throwOnIndexOverflow?: boolean): ICollection<TOutput>;
22
- reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, _throwOnIndexOverflow?: boolean): ICollection<Exclude<TInput, TOutput>>;
23
- map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>, _throwOnIndexOverflow?: boolean): ICollection<TOutput>;
24
- reduce<TOutput = TInput>(settings: ReduceSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
25
- join(settings?: JoinSettings): EnsureType<TInput, string>;
22
+ filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
23
+ reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
24
+ map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
25
+ reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>): TInput;
26
+ reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>, initialValue: TInput): TInput;
27
+ reduce<TOutput>(reduceFn: Reduce<TInput, ICollection<TInput>, TOutput>, initialValue: TOutput): TOutput;
28
+ join(separator?: string): EnsureType<TInput, string>;
26
29
  collapse(): ICollection<Collapse<TInput>>;
27
- flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>, _throwOnIndexOverflow?: boolean): ICollection<TOutput>;
28
- update<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>, _throwOnIndexOverflow?: boolean): ICollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
29
- page(settings: PageSettings): ICollection<TInput>;
30
+ flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>): ICollection<TOutput>;
31
+ change<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<ChangendItem<TInput, TFilterOutput, TMapOutput>>;
32
+ page(page: number, pageSize: number): ICollection<TInput>;
30
33
  sum(): EnsureType<TInput, number>;
31
34
  average(): EnsureType<TInput, number>;
32
- median(_throwOnIndexOverflow?: boolean): EnsureType<TInput, number>;
35
+ median(): EnsureType<TInput, number>;
33
36
  min(): EnsureType<TInput, number>;
34
37
  max(): EnsureType<TInput, number>;
35
- percentage(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): number;
36
- some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, _throwOnIndexOverflow?: boolean): boolean;
37
- every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, _throwOnIndexOverflow?: boolean): boolean;
38
- take(limit: number, _throwOnIndexOverflow?: boolean): ICollection<TInput>;
39
- takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): ICollection<TInput>;
40
- takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): ICollection<TInput>;
41
- skip(offset: number, _throwOnIndexOverflow?: boolean): ICollection<TInput>;
42
- skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): ICollection<TInput>;
43
- skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): ICollection<TInput>;
38
+ percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
39
+ some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
40
+ every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
41
+ take(limit: number): ICollection<TInput>;
42
+ takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
43
+ takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
44
+ skip(offset: number): ICollection<TInput>;
45
+ skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
46
+ skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
44
47
  when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
45
48
  whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
46
49
  whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
@@ -48,47 +51,47 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
48
51
  pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
49
52
  tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
50
53
  chunk(chunkSize: number): ICollection<ICollection<TInput>>;
51
- chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
52
- split(chunkAmount: number, _throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
53
- partition(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
54
- sliding(settings: SlidingSettings): ICollection<ICollection<TInput>>;
55
- groupBy<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
56
- countBy<TOutput = TInput>(settings?: CountBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
57
- unique<TOutput = TInput>(settings?: UniqueSettings<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
54
+ chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
55
+ split(chunkAmount: number): ICollection<ICollection<TInput>>;
56
+ partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
57
+ sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
58
+ groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
59
+ countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
60
+ unique<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
58
61
  difference<TOutput = TInput>(iterable: Iterable<TInput>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
59
62
  repeat(amount: number): ICollection<TInput>;
60
63
  padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
61
64
  padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
62
- slice(settings?: SliceSettings): ICollection<TInput>;
65
+ slice(start?: number, end?: number): ICollection<TInput>;
63
66
  prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
64
67
  append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
65
- insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, _throwOnIndexOverflow?: boolean): ICollection<TInput | TExtended>;
66
- insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, _throwOnIndexOverflow?: boolean): ICollection<TInput | TExtended>;
67
- crossJoin<TExtended = TInput>(...iterables: Array<Iterable<TExtended>>): ICollection<ICollection<TInput | TExtended>>;
68
+ insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
69
+ insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
70
+ crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
68
71
  zip<TExtended>(iterable: Iterable<TExtended>): ICollection<RecordItem<TInput, TExtended>>;
69
72
  sort(comparator?: Comparator<TInput>): ICollection<TInput>;
70
- reverse(_settings?: ReverseSettings): ICollection<TInput>;
71
- shuffle(): ICollection<TInput>;
72
- first<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
73
- firstOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
74
- firstOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
75
- last<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
76
- lastOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
77
- lastOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
78
- before(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): TInput | null;
79
- beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): TInput | TExtended;
80
- beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): TInput;
81
- after(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): TInput | null;
82
- afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): TInput | TExtended;
83
- afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): TInput;
84
- sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, _throwOnIndexOverflow?: boolean): TOutput;
73
+ reverse(_chunkSize?: number): ICollection<TInput>;
74
+ shuffle(mathRandom?: () => number): ICollection<TInput>;
75
+ first<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
76
+ firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
77
+ firstOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
78
+ last<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
79
+ lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
80
+ lastOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
81
+ before(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
82
+ beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
83
+ beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
84
+ after(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
85
+ afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
86
+ afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
87
+ sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
85
88
  nth(step: number): ICollection<TInput>;
86
- count(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): number;
87
- size(_throwOnIndexOverflow?: boolean): number;
89
+ count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
90
+ size(): number;
88
91
  isEmpty(): boolean;
89
92
  isNotEmpty(): boolean;
90
- searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): number;
91
- searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): number;
92
- forEach(callback: ForEach<TInput, ICollection<TInput>>, _throwOnIndexOverflow?: boolean): void;
93
+ searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
94
+ searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
95
+ forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
93
96
  toArray(): TInput[];
94
97
  }
@@ -16,147 +16,42 @@ export declare class UnexpectedCollectionError extends CollectionError {
16
16
  /**
17
17
  * @group Errors
18
18
  */
19
- export declare class IndexOverflowError extends CollectionError {
19
+ export declare class ItemNotFoundCollectionError extends CollectionError {
20
20
  constructor(message: string, cause?: unknown);
21
21
  }
22
22
  /**
23
23
  * @group Errors
24
24
  */
25
- export declare class ItemNotFoundError extends CollectionError {
25
+ export declare class MultipleItemsFoundCollectionError extends CollectionError {
26
26
  constructor(message: string, cause?: unknown);
27
27
  }
28
28
  /**
29
29
  * @group Errors
30
30
  */
31
- export declare class MultipleItemsFoundError extends CollectionError {
31
+ export declare class TypeCollectionError extends CollectionError {
32
32
  constructor(message: string, cause?: unknown);
33
33
  }
34
- export type UpdatedItem<TInput, TFilterOutput, TMapOutput> = TInput | TFilterOutput | TMapOutput;
35
- export type RecordItem<TKey, TValue> = [key: TKey, value: TValue];
36
- export type ReverseSettings = {
37
- /**
38
- * @defaultValue 1024
39
- */
40
- chunkSize?: number;
41
- /**
42
- * @defaultValue false
43
- */
44
- throwOnIndexOverflow?: boolean;
45
- };
46
- export type PageSettings = {
47
- page: number;
48
- pageSize: number;
49
- /**
50
- * @defaultValue false
51
- */
52
- throwOnIndexOverflow?: boolean;
53
- };
54
- export type JoinSettings = {
55
- /**
56
- * @defaultValue ","
57
- */
58
- seperator?: string;
59
- /**
60
- * @defaultValue false
61
- */
62
- throwOnIndexOverflow?: boolean;
63
- };
64
- export type SliceSettings = {
65
- /**
66
- * @defaultValue 0
67
- */
68
- start?: number;
69
- /**
70
- * @defaultValue the size of the collection
71
- */
72
- end?: number;
73
- /**
74
- * @defaultValue false
75
- */
76
- throwOnIndexOverflow?: boolean;
77
- };
78
- export type SlidingSettings = {
79
- chunkSize: number;
80
- /**
81
- * @defaultValue SlidingSettings.chunkSize - 1
82
- */
83
- step?: number;
84
- /**
85
- * @defaultValue false
86
- */
87
- throwOnIndexOverflow?: boolean;
88
- };
34
+ /**
35
+ * @group Errors
36
+ */
37
+ export declare class EmptyCollectionError extends CollectionError {
38
+ constructor(message: string, cause?: unknown);
39
+ }
40
+ export type ChangendItem<TInput, TFilterOutput, TMapOutput> = TInput | TFilterOutput | TMapOutput;
89
41
  export type Comparator<TItem> = (itemA: TItem, itemB: TItem) => number;
90
42
  export type Predicate_<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => boolean;
91
43
  export type PredicateGuard<TInput, TCollection, TOutput extends TInput = TInput> = (item: TInput, index: number, collection: TCollection) => item is TOutput;
92
44
  export type Predicate<TInput, TCollection, TOutput extends TInput = TInput> = Predicate_<TInput, TCollection> | PredicateGuard<TInput, TCollection, TOutput>;
93
45
  export type Reduce<TInput, TCollection, TOutput> = (output: TOutput, item: TInput, index: number, collection: TCollection) => TOutput;
94
- export type ReduceSettings<TInput, TCollection, TOutput> = {
95
- reduceFn: Reduce<TInput, TCollection, TOutput>;
96
- initialValue?: TOutput;
97
- /**
98
- * @defaultValue false
99
- */
100
- throwOnIndexOverflow?: boolean;
101
- };
102
46
  export type Map<TInput, TCollection, TOutput> = (item: TInput, index: number, collection: TCollection) => TOutput;
103
47
  export type ForEach<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => void;
104
48
  export type Modifier<TInput, TOutput> = (collection: TInput) => TOutput;
105
49
  export type Tap<TCollection> = (collection: TCollection) => void;
106
50
  export type Transform<TInput, TOutput> = (value: TInput) => TOutput;
107
- export type Lazyable<TValue> = TValue | (() => TValue);
108
- export type FindSettings<TInput, TCollection, TOutput extends TInput> = {
109
- predicateFn?: Predicate<TInput, TCollection, TOutput>;
110
- /**
111
- * @defaultValue false
112
- */
113
- throwOnIndexOverflow?: boolean;
114
- };
115
- export type FindOrSettings<TInput, TCollection, TOutput extends TInput, TDefault> = FindSettings<TInput, TCollection, TOutput> & {
116
- defaultValue: Lazyable<TDefault>;
117
- };
118
- export type GroupBySettings<TInput, TCollection, TOutput> = {
119
- /**
120
- * @defaultValue (item: TInput) => item
121
- */
122
- selectFn?: Map<TInput, TCollection, TOutput>;
123
- /**
124
- * @defaultValue false
125
- */
126
- throwOnIndexOverflow?: boolean;
127
- };
128
- export type CountBySettings<TInput, TCollection, TOutput> = {
129
- /**
130
- * @defaultValue (item: TInput) => item
131
- */
132
- selectFn?: Map<TInput, TCollection, TOutput>;
133
- /**
134
- * @defaultValue false
135
- */
136
- throwOnIndexOverflow?: boolean;
137
- };
138
- export type UniqueSettings<TInput, TCollection, TOutput> = {
139
- /**
140
- * @defaultValue (item: TInput) => item
141
- */
142
- selectFn?: Map<TInput, TCollection, TOutput>;
143
- /**
144
- * @defaultValue false
145
- */
146
- throwOnIndexOverflow?: boolean;
147
- };
148
51
  export type AsyncPredicate_<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => Promise<boolean>;
149
52
  export type AsyncPredicate<TInput, TCollection, TOutput extends TInput = TInput> = AsyncPredicate_<TInput, TCollection> | Predicate<TInput, TCollection, TOutput>;
150
53
  export type AsyncReduce_<TInput, TCollection, TOutput> = (output: TOutput, item: TInput, index: number, collection: TCollection) => Promise<TOutput>;
151
54
  export type AsyncReduce<TInput, TCollection, TOutput> = AsyncReduce_<TInput, TCollection, TOutput> | Reduce<TInput, TCollection, TOutput>;
152
- export type AsyncReduceSettings<TInput, TCollection, TOutput> = {
153
- reduceFn: AsyncReduce<TInput, TCollection, TOutput>;
154
- initialValue?: TOutput;
155
- /**
156
- * @defaultValue false
157
- */
158
- throwOnIndexOverflow?: boolean;
159
- };
160
55
  export type AsyncMap_<TInput, TCollection, TOutput> = (item: TInput, index: number, collection: TCollection) => Promise<TOutput>;
161
56
  export type AsyncMap<TInput, TCollection, TOutput> = AsyncMap_<TInput, TCollection, TOutput> | Map<TInput, TCollection, TOutput>;
162
57
  export type AsyncForEach_<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => Promise<void>;
@@ -167,46 +62,7 @@ export type AsyncTap_<TCollection> = (collection: TCollection) => Promise<void>;
167
62
  export type AsyncTap<TCollection> = Tap<TCollection> | AsyncTap_<TCollection>;
168
63
  export type AsyncTransform_<TInput, TOutput> = (value: TInput) => Promise<TOutput>;
169
64
  export type AsyncTransform<TInput, TOutput> = Transform<TInput, TOutput> | AsyncTransform_<TInput, TOutput>;
170
- export type AsyncLazyable_<TValue> = TValue | (() => Promise<TValue>);
171
- export type AsyncLazyable<TValue> = AsyncLazyable_<TValue> | Lazyable<TValue>;
172
- export type AsyncFindSettings<TInput, TCollection, TOutput extends TInput> = {
173
- predicateFn?: AsyncPredicate<TInput, TCollection, TOutput>;
174
- /**
175
- * @defaultValue false
176
- */
177
- throwOnIndexOverflow?: boolean;
178
- };
179
- export type AsyncFindOrSettings<TInput, TCollection, TOutput extends TInput, TDefault> = AsyncFindSettings<TInput, TCollection, TOutput> & {
180
- defaultValue: AsyncLazyable<TDefault>;
181
- };
182
- export type AsyncGroupBySettings<TInput, TCollection, TOutput> = {
183
- /**
184
- * @defaultValue (item: TInput) => item
185
- */
186
- selectFn?: AsyncMap<TInput, TCollection, TOutput>;
187
- chunkSize?: number;
188
- /**
189
- * @defaultValue false
190
- */
191
- throwOnIndexOverflow?: boolean;
192
- };
193
- export type AsyncCountBySettings<TInput, TCollection, TOutput> = {
194
- /**
195
- * @defaultValue (item: TInput) => item
196
- */
197
- selectFn?: AsyncMap<TInput, TCollection, TOutput>;
198
- /**
199
- * @defaultValue false
200
- */
201
- throwOnIndexOverflow?: boolean;
202
- };
203
- export type AsyncUniqueSettings<TInput, TCollection, TOutput> = {
204
- /**
205
- * @defaultValue (item: TInput) => item
206
- */
207
- selectFn?: AsyncMap<TInput, TCollection, TOutput>;
208
- /**
209
- * @defaultValue false
210
- */
211
- throwOnIndexOverflow?: boolean;
212
- };
65
+ export type CrossJoinResult<TInput, TExtended> = TInput extends [
66
+ infer R,
67
+ ...infer L
68
+ ] ? [R, ...L, TExtended] : [TInput, TExtended];