@daiso-tech/core 0.4.0 → 0.5.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 (268) hide show
  1. package/dist/cjs/async/_module.js +1 -0
  2. package/dist/cjs/async/_module.js.map +1 -1
  3. package/dist/cjs/collection/async-iterable-collection/_shared/_module.js +1 -3
  4. package/dist/cjs/collection/async-iterable-collection/_shared/_module.js.map +1 -1
  5. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js +14 -23
  6. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
  7. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js +12 -21
  8. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
  9. package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js +5 -14
  10. package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
  11. package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js +9 -18
  12. package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  13. package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +18 -27
  14. package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  15. package/dist/cjs/collection/async-iterable-collection/_shared/async-error-handler-iterable.js +31 -0
  16. package/dist/cjs/collection/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -0
  17. package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js +3 -12
  18. package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  19. package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +2 -11
  20. package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  21. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +8 -17
  22. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  23. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +8 -17
  24. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  25. package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js +2 -11
  26. package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  27. package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js +2 -11
  28. package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  29. package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js +9 -18
  30. package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  31. package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js +4 -13
  32. package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
  33. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js +3 -12
  34. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
  35. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +7 -16
  36. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  37. package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js +9 -18
  38. package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
  39. package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js +17 -26
  40. package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
  41. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js +3 -12
  42. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
  43. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js +4 -13
  44. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  45. package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js +2 -11
  46. package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  47. package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js +6 -15
  48. package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  49. package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js +5 -14
  50. package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  51. package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js +4 -13
  52. package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  53. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +177 -265
  54. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  55. package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js +14 -23
  56. package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
  57. package/dist/cjs/collection/iterable-collection/_shared/chunk-while-iterable.js +12 -21
  58. package/dist/cjs/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
  59. package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js +5 -14
  60. package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
  61. package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js +9 -18
  62. package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  63. package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js +19 -31
  64. package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  65. package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js +4 -13
  66. package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
  67. package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js +3 -12
  68. package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
  69. package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js +2 -11
  70. package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  71. package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js +9 -18
  72. package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  73. package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js +6 -16
  74. package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  75. package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js +6 -16
  76. package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  77. package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js +2 -11
  78. package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
  79. package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js +2 -11
  80. package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
  81. package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js +11 -20
  82. package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
  83. package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js +11 -20
  84. package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
  85. package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js +9 -18
  86. package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
  87. package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js +4 -13
  88. package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
  89. package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js +4 -13
  90. package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
  91. package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js +9 -18
  92. package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
  93. package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js +3 -12
  94. package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
  95. package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js +6 -15
  96. package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  97. package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js +15 -24
  98. package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
  99. package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js +9 -18
  100. package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
  101. package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js +1 -10
  102. package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
  103. package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js +17 -26
  104. package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
  105. package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js +3 -12
  106. package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
  107. package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js +4 -13
  108. package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  109. package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js +2 -11
  110. package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
  111. package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js +6 -15
  112. package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
  113. package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js +5 -14
  114. package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
  115. package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js +4 -13
  116. package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
  117. package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js +6 -15
  118. package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
  119. package/dist/cjs/collection/iterable-collection/iterable-collection.js +154 -346
  120. package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -1
  121. package/dist/cjs/collection/list-collection/list-collection.js +348 -931
  122. package/dist/cjs/collection/list-collection/list-collection.js.map +1 -1
  123. package/dist/esm/async/_module.js +1 -0
  124. package/dist/esm/async/_module.js.map +1 -1
  125. package/dist/esm/collection/async-iterable-collection/_shared/_module.js +1 -3
  126. package/dist/esm/collection/async-iterable-collection/_shared/_module.js.map +1 -1
  127. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js +14 -23
  128. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
  129. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js +12 -21
  130. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
  131. package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js +5 -14
  132. package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
  133. package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js +9 -18
  134. package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  135. package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +17 -26
  136. package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  137. package/dist/esm/collection/async-iterable-collection/_shared/async-error-handler-iterable.js +27 -0
  138. package/dist/esm/collection/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -0
  139. package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js +3 -12
  140. package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  141. package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +2 -11
  142. package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  143. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +8 -17
  144. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  145. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +8 -17
  146. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  147. package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js +2 -11
  148. package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  149. package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js +2 -11
  150. package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  151. package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js +9 -18
  152. package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  153. package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js +4 -13
  154. package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
  155. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js +3 -12
  156. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
  157. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +7 -16
  158. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  159. package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js +9 -18
  160. package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
  161. package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js +17 -26
  162. package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
  163. package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js +3 -12
  164. package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
  165. package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js +4 -13
  166. package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  167. package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js +2 -11
  168. package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  169. package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js +6 -15
  170. package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  171. package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js +5 -14
  172. package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  173. package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js +4 -13
  174. package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  175. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +179 -267
  176. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  177. package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js +14 -23
  178. package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
  179. package/dist/esm/collection/iterable-collection/_shared/chunk-while-iterable.js +12 -21
  180. package/dist/esm/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
  181. package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js +5 -14
  182. package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
  183. package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js +9 -18
  184. package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  185. package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js +19 -31
  186. package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  187. package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js +4 -13
  188. package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
  189. package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js +3 -12
  190. package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
  191. package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js +2 -11
  192. package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  193. package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js +9 -18
  194. package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  195. package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js +6 -16
  196. package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  197. package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js +6 -16
  198. package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  199. package/dist/esm/collection/iterable-collection/_shared/map-iterable.js +2 -11
  200. package/dist/esm/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
  201. package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js +2 -11
  202. package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
  203. package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js +11 -20
  204. package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
  205. package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js +11 -20
  206. package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
  207. package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js +9 -18
  208. package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
  209. package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js +4 -13
  210. package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
  211. package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js +4 -13
  212. package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
  213. package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js +9 -18
  214. package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
  215. package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js +3 -12
  216. package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
  217. package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js +6 -15
  218. package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  219. package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js +15 -24
  220. package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
  221. package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js +9 -18
  222. package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
  223. package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js +1 -10
  224. package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
  225. package/dist/esm/collection/iterable-collection/_shared/split-iterable.js +17 -26
  226. package/dist/esm/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
  227. package/dist/esm/collection/iterable-collection/_shared/take-iterable.js +3 -12
  228. package/dist/esm/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
  229. package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js +4 -13
  230. package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  231. package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js +2 -11
  232. package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
  233. package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js +6 -15
  234. package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
  235. package/dist/esm/collection/iterable-collection/_shared/update-iterable.js +5 -14
  236. package/dist/esm/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
  237. package/dist/esm/collection/iterable-collection/_shared/when-iterable.js +4 -13
  238. package/dist/esm/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
  239. package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js +6 -15
  240. package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
  241. package/dist/esm/collection/iterable-collection/iterable-collection.js +155 -347
  242. package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -1
  243. package/dist/esm/collection/list-collection/list-collection.js +349 -932
  244. package/dist/esm/collection/list-collection/list-collection.js.map +1 -1
  245. package/dist/types/_shared/types.d.ts +2 -2
  246. package/dist/types/async/_module.d.ts +1 -0
  247. package/dist/types/collection/async-iterable-collection/_shared/_module.d.ts +1 -3
  248. package/dist/types/collection/async-iterable-collection/_shared/async-error-handler-iterable.d.ts +6 -0
  249. package/dist/types/collection/async-iterable-collection/_shared/async-when-iterable.d.ts +1 -1
  250. package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +39 -37
  251. package/dist/types/contracts/collection/_shared.d.ts +7 -7
  252. package/dist/types/contracts/collection/async-collection.contract.d.ts +51 -39
  253. package/package.json +1 -1
  254. package/dist/cjs/collection/async-iterable-collection/_shared/async-abort-iterable.js +0 -25
  255. package/dist/cjs/collection/async-iterable-collection/_shared/async-abort-iterable.js.map +0 -1
  256. package/dist/cjs/collection/async-iterable-collection/_shared/async-delay-iterable.js +0 -25
  257. package/dist/cjs/collection/async-iterable-collection/_shared/async-delay-iterable.js.map +0 -1
  258. package/dist/cjs/collection/async-iterable-collection/_shared/async-timeout-iterable.js +0 -21
  259. package/dist/cjs/collection/async-iterable-collection/_shared/async-timeout-iterable.js.map +0 -1
  260. package/dist/esm/collection/async-iterable-collection/_shared/async-abort-iterable.js +0 -21
  261. package/dist/esm/collection/async-iterable-collection/_shared/async-abort-iterable.js.map +0 -1
  262. package/dist/esm/collection/async-iterable-collection/_shared/async-delay-iterable.js +0 -21
  263. package/dist/esm/collection/async-iterable-collection/_shared/async-delay-iterable.js.map +0 -1
  264. package/dist/esm/collection/async-iterable-collection/_shared/async-timeout-iterable.js +0 -17
  265. package/dist/esm/collection/async-iterable-collection/_shared/async-timeout-iterable.js.map +0 -1
  266. package/dist/types/collection/async-iterable-collection/_shared/async-abort-iterable.d.ts +0 -10
  267. package/dist/types/collection/async-iterable-collection/_shared/async-delay-iterable.d.ts +0 -10
  268. package/dist/types/collection/async-iterable-collection/_shared/async-timeout-iterable.d.ts +0 -10
@@ -4,6 +4,8 @@ exports.AsyncIterableCollection = void 0;
4
4
  const _module_1 = require("../../contracts/collection/_module");
5
5
  const _module_2 = require("../../collection/async-iterable-collection/_shared/_module");
6
6
  const utilities_1 = require("../../_shared/utilities");
7
+ const _module_3 = require("../../_module");
8
+ const _module_4 = require("../../async/_module");
7
9
  class AsyncIterableCollection {
8
10
  iterable;
9
11
  static DEFAULT_CHUNK_SIZE = 1024;
@@ -37,41 +39,45 @@ class AsyncIterableCollection {
37
39
  map(mapFn) {
38
40
  return new AsyncIterableCollection(new _module_2.AsyncMapIterable(this, mapFn));
39
41
  }
40
- async reduce(reduceFn, initialValue) {
41
- if (initialValue === undefined && (await this.isEmpty())) {
42
- throw new _module_1.TypeCollectionError("Reduce of empty array must be inputed a initial value");
43
- }
44
- if (initialValue !== undefined) {
45
- let output = initialValue;
46
- for await (const [index, item] of this.entries()) {
47
- output = await reduceFn(output, item, index, this);
48
- }
49
- return output;
50
- }
51
- let output = (await this.firstOrFail()), index = 0, isFirstIteration = true;
52
- for await (const item of this) {
53
- if (!isFirstIteration) {
54
- output = await reduceFn(output, item, index, this);
42
+ reduce(reduceFn, initialValue) {
43
+ return new _module_3.LazyPromise(async () => {
44
+ if (initialValue === undefined && (await this.isEmpty())) {
45
+ throw new _module_1.TypeCollectionError("Reduce of empty array must be inputed a initial value");
55
46
  }
56
- isFirstIteration = false;
57
- index++;
58
- }
59
- return output;
60
- }
61
- async join(separator = ",") {
62
- let str = null;
63
- for await (const item of this) {
64
- if (typeof item !== "string") {
65
- throw new _module_1.TypeCollectionError("Item type is invalid must be string");
47
+ if (initialValue !== undefined) {
48
+ let output = initialValue;
49
+ for await (const [index, item] of this.entries()) {
50
+ output = await reduceFn(output, item, index, this);
51
+ }
52
+ return output;
66
53
  }
67
- if (str === null) {
68
- str = item;
54
+ let output = (await this.firstOrFail()), index = 0, isFirstIteration = true;
55
+ for await (const item of this) {
56
+ if (!isFirstIteration) {
57
+ output = await reduceFn(output, item, index, this);
58
+ }
59
+ isFirstIteration = false;
60
+ index++;
69
61
  }
70
- else {
71
- str = str + separator + item;
62
+ return output;
63
+ });
64
+ }
65
+ join(separator = ",") {
66
+ return new _module_3.LazyPromise(async () => {
67
+ let str = null;
68
+ for await (const item of this) {
69
+ if (typeof item !== "string") {
70
+ throw new _module_1.TypeCollectionError("Item type is invalid must be string");
71
+ }
72
+ if (str === null) {
73
+ str = item;
74
+ }
75
+ else {
76
+ str = str + separator + item;
77
+ }
72
78
  }
73
- }
74
- return str;
79
+ return str;
80
+ });
75
81
  }
76
82
  collapse() {
77
83
  return new AsyncIterableCollection(new _module_2.AsyncCollapseIterable(this));
@@ -88,8 +94,8 @@ class AsyncIterableCollection {
88
94
  }
89
95
  return this.skip((page - 1) * pageSize).take(pageSize);
90
96
  }
91
- async sum() {
92
- try {
97
+ sum() {
98
+ return new _module_3.LazyPromise(async () => {
93
99
  if (await this.isEmpty()) {
94
100
  throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
95
101
  }
@@ -101,16 +107,10 @@ class AsyncIterableCollection {
101
107
  sum += item;
102
108
  }
103
109
  return sum;
104
- }
105
- catch (error) {
106
- if (error instanceof _module_1.CollectionError) {
107
- throw error;
108
- }
109
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
110
- }
110
+ });
111
111
  }
112
- async average() {
113
- try {
112
+ average() {
113
+ return new _module_3.LazyPromise(async () => {
114
114
  if (await this.isEmpty()) {
115
115
  throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
116
116
  }
@@ -123,53 +123,49 @@ class AsyncIterableCollection {
123
123
  sum += item;
124
124
  }
125
125
  return (sum / size);
126
- }
127
- catch (error) {
128
- if (error instanceof _module_1.CollectionError) {
129
- throw error;
130
- }
131
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
132
- }
126
+ });
133
127
  }
134
- async median() {
135
- if (await this.isEmpty()) {
136
- throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
137
- }
138
- const size = await this.size();
139
- if (size === 0) {
140
- return 0;
141
- }
142
- const isEven = size % 2 === 0, items = await this.map((item) => {
143
- if (typeof item !== "number") {
144
- throw new _module_1.TypeCollectionError("Item type is invalid must be number");
128
+ median() {
129
+ return new _module_3.LazyPromise(async () => {
130
+ if (await this.isEmpty()) {
131
+ throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
145
132
  }
146
- return item;
147
- })
148
- .filter((_item, index) => {
133
+ const size = await this.size();
134
+ if (size === 0) {
135
+ return 0;
136
+ }
137
+ const isEven = size % 2 === 0, items = await this.map((item) => {
138
+ if (typeof item !== "number") {
139
+ throw new _module_1.TypeCollectionError("Item type is invalid must be number");
140
+ }
141
+ return item;
142
+ })
143
+ .filter((_item, index) => {
144
+ if (isEven) {
145
+ return index === size / 2 || index === size / 2 - 1;
146
+ }
147
+ return index === Math.floor(size / 2);
148
+ })
149
+ .toArray();
149
150
  if (isEven) {
150
- return index === size / 2 || index === size / 2 - 1;
151
- }
152
- return index === Math.floor(size / 2);
153
- })
154
- .toArray();
155
- if (isEven) {
156
- const [a, b] = items;
157
- if (a === undefined) {
158
- throw new _module_1.UnexpectedCollectionError("Is in invalid state");
151
+ const [a, b] = items;
152
+ if (a === undefined) {
153
+ throw new _module_1.UnexpectedCollectionError("Is in invalid state");
154
+ }
155
+ if (b === undefined) {
156
+ throw new _module_1.UnexpectedCollectionError("Is in invalid state");
157
+ }
158
+ return ((a + b) / 2);
159
159
  }
160
- if (b === undefined) {
160
+ const [median] = items;
161
+ if (median === undefined) {
161
162
  throw new _module_1.UnexpectedCollectionError("Is in invalid state");
162
163
  }
163
- return ((a + b) / 2);
164
- }
165
- const [median] = items;
166
- if (median === undefined) {
167
- throw new _module_1.UnexpectedCollectionError("Is in invalid state");
168
- }
169
- return median;
164
+ return median;
165
+ });
170
166
  }
171
- async min() {
172
- try {
167
+ min() {
168
+ return new _module_3.LazyPromise(async () => {
173
169
  if (await this.isEmpty()) {
174
170
  throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
175
171
  }
@@ -186,16 +182,10 @@ class AsyncIterableCollection {
186
182
  }
187
183
  }
188
184
  return min;
189
- }
190
- catch (error) {
191
- if (error instanceof _module_1.CollectionError) {
192
- throw error;
193
- }
194
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
195
- }
185
+ });
196
186
  }
197
- async max() {
198
- try {
187
+ max() {
188
+ return new _module_3.LazyPromise(async () => {
199
189
  if (await this.isEmpty()) {
200
190
  throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
201
191
  }
@@ -212,16 +202,10 @@ class AsyncIterableCollection {
212
202
  }
213
203
  }
214
204
  return max;
215
- }
216
- catch (error) {
217
- if (error instanceof _module_1.CollectionError) {
218
- throw error;
219
- }
220
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
221
- }
205
+ });
222
206
  }
223
- async percentage(predicateFn) {
224
- try {
207
+ percentage(predicateFn) {
208
+ return new _module_3.LazyPromise(async () => {
225
209
  if (await this.isEmpty()) {
226
210
  throw new _module_1.EmptyCollectionError("Collection is empty therby operation cannot be performed");
227
211
  }
@@ -233,32 +217,20 @@ class AsyncIterableCollection {
233
217
  total++;
234
218
  }
235
219
  return (part / total) * 100;
236
- }
237
- catch (error) {
238
- if (error instanceof _module_1.CollectionError) {
239
- throw error;
240
- }
241
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
242
- }
220
+ });
243
221
  }
244
- async some(predicateFn) {
245
- try {
222
+ some(predicateFn) {
223
+ return new _module_3.LazyPromise(async () => {
246
224
  for await (const [index, item] of this.entries()) {
247
225
  if (await predicateFn(item, index, this)) {
248
226
  return true;
249
227
  }
250
228
  }
251
229
  return false;
252
- }
253
- catch (error) {
254
- if (error instanceof _module_1.CollectionError) {
255
- throw error;
256
- }
257
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
258
- }
230
+ });
259
231
  }
260
- async every(predicateFn) {
261
- try {
232
+ every(predicateFn) {
233
+ return new _module_3.LazyPromise(async () => {
262
234
  let isTrue = true;
263
235
  for await (const [index, item] of this.entries()) {
264
236
  isTrue &&= await predicateFn(item, index, this);
@@ -267,13 +239,7 @@ class AsyncIterableCollection {
267
239
  }
268
240
  }
269
241
  return isTrue;
270
- }
271
- catch (error) {
272
- if (error instanceof _module_1.CollectionError) {
273
- throw error;
274
- }
275
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
276
- }
242
+ });
277
243
  }
278
244
  take(limit) {
279
245
  return new AsyncIterableCollection(new _module_2.AsyncTakeIterable(this, limit));
@@ -305,16 +271,10 @@ class AsyncIterableCollection {
305
271
  whenNotEmpty(callback) {
306
272
  return new AsyncIterableCollection(new _module_2.AsyncWhenIterable(this, () => this.isNotEmpty(), callback));
307
273
  }
308
- async pipe(callback) {
309
- try {
274
+ pipe(callback) {
275
+ return new _module_3.LazyPromise(async () => {
310
276
  return await callback(this);
311
- }
312
- catch (error) {
313
- if (error instanceof _module_1.CollectionError) {
314
- throw error;
315
- }
316
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
317
- }
277
+ });
318
278
  }
319
279
  tap(callback) {
320
280
  return new AsyncIterableCollection(new _module_2.AsyncTapIterable(this, callback));
@@ -391,37 +351,33 @@ class AsyncIterableCollection {
391
351
  shuffle(mathRandom = Math.random) {
392
352
  return new AsyncIterableCollection(new _module_2.AsyncShuffleIterable(this, mathRandom));
393
353
  }
394
- async first(predicateFn) {
354
+ first(predicateFn) {
395
355
  return this.firstOr(null, predicateFn);
396
356
  }
397
- async firstOr(defaultValue, predicateFn = () => true) {
398
- try {
357
+ firstOr(defaultValue, predicateFn = () => true) {
358
+ return new _module_3.LazyPromise(async () => {
399
359
  for await (const [index, item] of this.entries()) {
400
360
  if (await predicateFn(item, index, this)) {
401
361
  return item;
402
362
  }
403
363
  }
404
364
  return await (0, utilities_1.simplifyAsyncLazyable)(defaultValue);
405
- }
406
- catch (error) {
407
- if (error instanceof _module_1.CollectionError) {
408
- throw error;
409
- }
410
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
411
- }
365
+ });
412
366
  }
413
- async firstOrFail(predicateFn) {
414
- const item = await this.first(predicateFn);
415
- if (item === null) {
416
- throw new _module_1.ItemNotFoundCollectionError("Item was not found");
417
- }
418
- return item;
367
+ firstOrFail(predicateFn) {
368
+ return new _module_3.LazyPromise(async () => {
369
+ const item = await this.first(predicateFn);
370
+ if (item === null) {
371
+ throw new _module_1.ItemNotFoundCollectionError("Item was not found");
372
+ }
373
+ return item;
374
+ });
419
375
  }
420
- async last(predicateFn) {
376
+ last(predicateFn) {
421
377
  return this.lastOr(null, predicateFn);
422
378
  }
423
- async lastOr(defaultValue, predicateFn = () => true) {
424
- try {
379
+ lastOr(defaultValue, predicateFn = () => true) {
380
+ return new _module_3.LazyPromise(async () => {
425
381
  let matchedItem = null;
426
382
  for await (const [index, item] of this.entries()) {
427
383
  if (await predicateFn(item, index, this)) {
@@ -432,26 +388,22 @@ class AsyncIterableCollection {
432
388
  return matchedItem;
433
389
  }
434
390
  return await (0, utilities_1.simplifyAsyncLazyable)(defaultValue);
435
- }
436
- catch (error) {
437
- if (error instanceof _module_1.CollectionError) {
438
- throw error;
439
- }
440
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
441
- }
391
+ });
442
392
  }
443
- async lastOrFail(predicateFn) {
444
- const item = await this.last(predicateFn);
445
- if (item === null) {
446
- throw new _module_1.ItemNotFoundCollectionError("Item was not found");
447
- }
448
- return item;
393
+ lastOrFail(predicateFn) {
394
+ return new _module_3.LazyPromise(async () => {
395
+ const item = await this.last(predicateFn);
396
+ if (item === null) {
397
+ throw new _module_1.ItemNotFoundCollectionError("Item was not found");
398
+ }
399
+ return item;
400
+ });
449
401
  }
450
- async before(predicateFn) {
402
+ before(predicateFn) {
451
403
  return this.beforeOr(null, predicateFn);
452
404
  }
453
- async beforeOr(defaultValue, predicateFn) {
454
- try {
405
+ beforeOr(defaultValue, predicateFn) {
406
+ return new _module_3.LazyPromise(async () => {
455
407
  let beforeItem = null, index = 0;
456
408
  for await (const item of this) {
457
409
  if ((await predicateFn(item, index, this)) && beforeItem) {
@@ -461,26 +413,22 @@ class AsyncIterableCollection {
461
413
  beforeItem = item;
462
414
  }
463
415
  return await (0, utilities_1.simplifyAsyncLazyable)(defaultValue);
464
- }
465
- catch (error) {
466
- if (error instanceof _module_1.CollectionError) {
467
- throw error;
468
- }
469
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
470
- }
416
+ });
471
417
  }
472
- async beforeOrFail(predicateFn) {
473
- const item = await this.before(predicateFn);
474
- if (item === null) {
475
- throw new _module_1.ItemNotFoundCollectionError("Item was not found");
476
- }
477
- return item;
418
+ beforeOrFail(predicateFn) {
419
+ return new _module_3.LazyPromise(async () => {
420
+ const item = await this.before(predicateFn);
421
+ if (item === null) {
422
+ throw new _module_1.ItemNotFoundCollectionError("Item was not found");
423
+ }
424
+ return item;
425
+ });
478
426
  }
479
- async after(predicateFn) {
427
+ after(predicateFn) {
480
428
  return this.afterOr(null, predicateFn);
481
429
  }
482
- async afterOr(defaultValue, predicateFn) {
483
- try {
430
+ afterOr(defaultValue, predicateFn) {
431
+ return new _module_3.LazyPromise(async () => {
484
432
  let hasMatched = false, index = 0;
485
433
  for await (const item of this) {
486
434
  if (hasMatched) {
@@ -490,23 +438,19 @@ class AsyncIterableCollection {
490
438
  index++;
491
439
  }
492
440
  return await (0, utilities_1.simplifyAsyncLazyable)(defaultValue);
493
- }
494
- catch (error) {
495
- if (error instanceof _module_1.CollectionError) {
496
- throw error;
497
- }
498
- throw new _module_1.UnexpectedCollectionError("!!__messge__!!", error);
499
- }
441
+ });
500
442
  }
501
- async afterOrFail(predicateFn) {
502
- const item = await this.after(predicateFn);
503
- if (item === null) {
504
- throw new _module_1.ItemNotFoundCollectionError("Item was not found");
505
- }
506
- return item;
443
+ afterOrFail(predicateFn) {
444
+ return new _module_3.LazyPromise(async () => {
445
+ const item = await this.after(predicateFn);
446
+ if (item === null) {
447
+ throw new _module_1.ItemNotFoundCollectionError("Item was not found");
448
+ }
449
+ return item;
450
+ });
507
451
  }
508
- async sole(predicateFn) {
509
- try {
452
+ sole(predicateFn) {
453
+ return new _module_3.LazyPromise(async () => {
510
454
  let matchedItem = null;
511
455
  for await (const [index, item] of this.entries()) {
512
456
  if (await predicateFn(item, index, this)) {
@@ -520,28 +464,22 @@ class AsyncIterableCollection {
520
464
  throw new _module_1.ItemNotFoundCollectionError("Item was not found");
521
465
  }
522
466
  return matchedItem;
523
- }
524
- catch (error) {
525
- if (error instanceof _module_1.CollectionError) {
526
- throw error;
527
- }
528
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
529
- }
467
+ });
530
468
  }
531
469
  nth(step) {
532
470
  return this.filter((_item, index) => index % step === 0);
533
471
  }
534
- delay(timeInMs) {
535
- return new AsyncIterableCollection(new _module_2.AsyncDelayIterable(this, timeInMs));
472
+ delay(time) {
473
+ return new AsyncIterableCollection((0, _module_3.delayIterable)(this, time));
536
474
  }
537
- abort(signal) {
538
- return new AsyncIterableCollection(new _module_2.AsyncAbortIterable(this, signal));
475
+ takeUntilAbort(abortSignal) {
476
+ return new AsyncIterableCollection(new _module_2.AsyncErrorHandlerIterable((0, _module_3.abortableIterable)(this, abortSignal), (error) => error instanceof _module_4.AbortAsyncError));
539
477
  }
540
- timeout(timeInMs) {
541
- return new AsyncIterableCollection(new _module_2.AsyncTimeoutIterable(this, timeInMs));
478
+ takeUntilTimeout(timeInMs) {
479
+ return new AsyncIterableCollection(new _module_2.AsyncErrorHandlerIterable((0, _module_4.timeoutIterable)(this, timeInMs), (error) => error instanceof _module_4.TimeoutAsyncError));
542
480
  }
543
- async count(predicateFn) {
544
- try {
481
+ count(predicateFn) {
482
+ return new _module_3.LazyPromise(async () => {
545
483
  let size = 0;
546
484
  for await (const item of this) {
547
485
  if (await predicateFn(item, size, this)) {
@@ -549,52 +487,36 @@ class AsyncIterableCollection {
549
487
  }
550
488
  }
551
489
  return size;
552
- }
553
- catch (error) {
554
- if (error instanceof _module_1.CollectionError) {
555
- throw error;
556
- }
557
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
558
- }
490
+ });
559
491
  }
560
- async size() {
492
+ size() {
561
493
  return this.count(() => true);
562
494
  }
563
- async isEmpty() {
564
- try {
495
+ isEmpty() {
496
+ return new _module_3.LazyPromise(async () => {
565
497
  for await (const _ of this) {
566
498
  return false;
567
499
  }
568
500
  return true;
569
- }
570
- catch (error) {
571
- if (error instanceof _module_1.CollectionError) {
572
- throw error;
573
- }
574
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
575
- }
501
+ });
576
502
  }
577
- async isNotEmpty() {
578
- return !(await this.isEmpty());
503
+ isNotEmpty() {
504
+ return new _module_3.LazyPromise(async () => {
505
+ return !(await this.isEmpty());
506
+ });
579
507
  }
580
- async searchFirst(predicateFn) {
581
- try {
508
+ searchFirst(predicateFn) {
509
+ return new _module_3.LazyPromise(async () => {
582
510
  for await (const [index, item] of this.entries()) {
583
511
  if (await predicateFn(item, index, this)) {
584
512
  return index;
585
513
  }
586
514
  }
587
515
  return -1;
588
- }
589
- catch (error) {
590
- if (error instanceof _module_1.CollectionError) {
591
- throw error;
592
- }
593
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
594
- }
516
+ });
595
517
  }
596
- async searchLast(predicateFn) {
597
- try {
518
+ searchLast(predicateFn) {
519
+ return new _module_3.LazyPromise(async () => {
598
520
  let matchedIndex = -1;
599
521
  for await (const [index, item] of this.entries()) {
600
522
  if (await predicateFn(item, index, this)) {
@@ -602,33 +524,23 @@ class AsyncIterableCollection {
602
524
  }
603
525
  }
604
526
  return matchedIndex;
605
- }
606
- catch (error) {
607
- if (error instanceof _module_1.CollectionError) {
608
- throw error;
609
- }
610
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
611
- }
527
+ });
612
528
  }
613
- async forEach(callback) {
614
- for await (const [index, item] of this.entries()) {
615
- await callback(item, index, this);
616
- }
529
+ forEach(callback) {
530
+ return new _module_3.LazyPromise(async () => {
531
+ for await (const [index, item] of this.entries()) {
532
+ await callback(item, index, this);
533
+ }
534
+ });
617
535
  }
618
- async toArray() {
619
- try {
536
+ toArray() {
537
+ return new _module_3.LazyPromise(async () => {
620
538
  const items = [];
621
539
  for await (const item of this) {
622
540
  items.push(item);
623
541
  }
624
542
  return items;
625
- }
626
- catch (error) {
627
- if (error instanceof _module_1.CollectionError) {
628
- throw error;
629
- }
630
- throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
631
- }
543
+ });
632
544
  }
633
545
  }
634
546
  exports.AsyncIterableCollection = AsyncIterableCollection;