@daiso-tech/core 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (536) hide show
  1. package/README.md +29 -0
  2. package/dist/cjs/{types.js.map → _shared/types.js.map} +1 -1
  3. package/dist/cjs/collection/_shared.js.map +1 -1
  4. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/_module.js +35 -35
  5. package/dist/cjs/collection/async-iterable-collection/_shared/_module.js.map +1 -0
  6. package/dist/cjs/collection/async-iterable-collection/_shared/async-abort-iterable.js.map +1 -0
  7. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -0
  8. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-chunk-whilte-iterable.js +4 -4
  9. package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js.map +1 -0
  10. package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -0
  11. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-count-by-iterable.js +4 -4
  12. package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -0
  13. package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -0
  14. package/dist/cjs/collection/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -0
  15. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-entries-iterable.js +5 -4
  16. package/dist/cjs/collection/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -0
  17. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-filter-iterable.js +4 -4
  18. package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -0
  19. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-flat-map-iterable.js +7 -7
  20. package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -0
  21. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-group-by-iterable.js +4 -4
  22. package/dist/cjs/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -0
  23. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-insert-after-iterable.js +4 -4
  24. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -0
  25. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-insert-before-iterable.js +4 -4
  26. package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -0
  27. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-map-iterable.js +7 -7
  28. package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -0
  29. package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -0
  30. package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -0
  31. package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -0
  32. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-partion-iterable.js +4 -4
  33. package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -0
  34. package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -0
  35. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-reverse-iterable.js +5 -5
  36. package/dist/cjs/collection/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -0
  37. package/dist/cjs/collection/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -0
  38. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-skip-iterable.js +5 -5
  39. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -0
  40. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-skip-until-iterable.js +4 -4
  41. package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -0
  42. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-slice-iterable.js +4 -4
  43. package/dist/cjs/collection/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -0
  44. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-sliding-iterable.js +5 -5
  45. package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -0
  46. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-sort-iterable.js +4 -4
  47. package/dist/cjs/collection/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -0
  48. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-split-iterable.js +5 -5
  49. package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -0
  50. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-take-iterable.js +5 -5
  51. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -0
  52. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-take-until-iterable.js +4 -4
  53. package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -0
  54. package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -0
  55. package/dist/cjs/collection/async-iterable-collection/_shared/async-timeout-iterable.js.map +1 -0
  56. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-unique-iterable.js +3 -3
  57. package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -0
  58. package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-update-iterable.js +7 -7
  59. package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -0
  60. package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -0
  61. package/dist/cjs/collection/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -0
  62. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +121 -100
  63. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  64. package/dist/cjs/collection/iterable-collection/_shared/_module.js +49 -0
  65. package/dist/cjs/collection/iterable-collection/_shared/_module.js.map +1 -0
  66. package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -0
  67. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/chunk-whilte-iterable.js +7 -7
  68. package/dist/cjs/collection/iterable-collection/_shared/chunk-whilte-iterable.js.map +1 -0
  69. package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -0
  70. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/count-by-iterable.js +7 -7
  71. package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -0
  72. package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -0
  73. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/entries-iterable.js +4 -4
  74. package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js.map +1 -0
  75. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/filter-iterable.js +7 -7
  76. package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js.map +1 -0
  77. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/flat-map-iterable.js +7 -7
  78. package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -0
  79. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/group-by-iterable.js +7 -7
  80. package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -0
  81. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/insert-after-iterable.js +8 -7
  82. package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -0
  83. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/insert-before-iterable.js +8 -7
  84. package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -0
  85. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/map-iterable.js +7 -7
  86. package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js.map +1 -0
  87. package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js.map +1 -0
  88. package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -0
  89. package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -0
  90. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/partion-iterable.js +7 -7
  91. package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js.map +1 -0
  92. package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -0
  93. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/reverse-iterable.js +5 -5
  94. package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -0
  95. package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -0
  96. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/skip-iterable.js +6 -5
  97. package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js.map +1 -0
  98. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/skip-until-iterable.js +7 -7
  99. package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -0
  100. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/slice-iterable.js +4 -4
  101. package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js.map +1 -0
  102. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/sliding-iterable.js +5 -5
  103. package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -0
  104. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/sort-iterable.js +4 -4
  105. package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js.map +1 -0
  106. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/split-iterable.js +5 -5
  107. package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js.map +1 -0
  108. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/take-iterable.js +6 -5
  109. package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js.map +1 -0
  110. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/take-until-iterable.js +7 -7
  111. package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -0
  112. package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js.map +1 -0
  113. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/unique-iterable.js +4 -4
  114. package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js.map +1 -0
  115. package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/update-iterable.js +10 -10
  116. package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js.map +1 -0
  117. package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js.map +1 -0
  118. package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js.map +1 -0
  119. package/dist/cjs/collection/iterable-collection/iterable-collection.js +137 -111
  120. package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -1
  121. package/dist/cjs/collection/list-collection/list-collection.js +105 -73
  122. package/dist/cjs/collection/list-collection/list-collection.js.map +1 -1
  123. package/dist/cjs/contracts/_module.js +1 -1
  124. package/dist/cjs/contracts/_module.js.map +1 -1
  125. package/dist/cjs/contracts/collection/_module.js.map +1 -1
  126. package/dist/cjs/contracts/collection/_shared.js +1 -1
  127. package/dist/cjs/contracts/collection/_shared.js.map +1 -1
  128. package/dist/esm/{types.js.map → _shared/types.js.map} +1 -1
  129. package/dist/esm/collection/_shared.js.map +1 -1
  130. package/dist/esm/collection/async-iterable-collection/_shared/_module.js +36 -0
  131. package/dist/esm/collection/async-iterable-collection/_shared/_module.js.map +1 -0
  132. package/dist/esm/collection/async-iterable-collection/_shared/async-abort-iterable.js.map +1 -0
  133. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -0
  134. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-chunk-whilte-iterable.js +4 -4
  135. package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js.map +1 -0
  136. package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -0
  137. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-count-by-iterable.js +4 -4
  138. package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -0
  139. package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -0
  140. package/dist/esm/collection/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -0
  141. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-entries-iterable.js +5 -4
  142. package/dist/esm/collection/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -0
  143. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-filter-iterable.js +4 -4
  144. package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -0
  145. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-flat-map-iterable.js +7 -7
  146. package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -0
  147. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-group-by-iterable.js +4 -4
  148. package/dist/esm/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -0
  149. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-insert-after-iterable.js +4 -4
  150. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -0
  151. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-insert-before-iterable.js +4 -4
  152. package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -0
  153. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-map-iterable.js +7 -7
  154. package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -0
  155. package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -0
  156. package/dist/esm/collection/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -0
  157. package/dist/esm/collection/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -0
  158. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-partion-iterable.js +4 -4
  159. package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -0
  160. package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -0
  161. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-reverse-iterable.js +5 -5
  162. package/dist/esm/collection/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -0
  163. package/dist/esm/collection/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -0
  164. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-skip-iterable.js +5 -5
  165. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -0
  166. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-skip-until-iterable.js +4 -4
  167. package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -0
  168. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-slice-iterable.js +4 -4
  169. package/dist/esm/collection/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -0
  170. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-sliding-iterable.js +5 -5
  171. package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -0
  172. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-sort-iterable.js +4 -4
  173. package/dist/esm/collection/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -0
  174. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-split-iterable.js +5 -5
  175. package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -0
  176. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-take-iterable.js +5 -5
  177. package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -0
  178. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-take-until-iterable.js +4 -4
  179. package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -0
  180. package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -0
  181. package/dist/esm/collection/async-iterable-collection/_shared/async-timeout-iterable.js.map +1 -0
  182. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-unique-iterable.js +3 -3
  183. package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -0
  184. package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-update-iterable.js +7 -7
  185. package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -0
  186. package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -0
  187. package/dist/esm/collection/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -0
  188. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +121 -100
  189. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  190. package/dist/esm/collection/iterable-collection/_shared/_module.js +33 -0
  191. package/dist/esm/collection/iterable-collection/_shared/_module.js.map +1 -0
  192. package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -0
  193. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/chunk-whilte-iterable.js +7 -7
  194. package/dist/esm/collection/iterable-collection/_shared/chunk-whilte-iterable.js.map +1 -0
  195. package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -0
  196. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/count-by-iterable.js +7 -7
  197. package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -0
  198. package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -0
  199. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/entries-iterable.js +4 -4
  200. package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js.map +1 -0
  201. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/filter-iterable.js +7 -7
  202. package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js.map +1 -0
  203. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/flat-map-iterable.js +7 -7
  204. package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -0
  205. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/group-by-iterable.js +7 -7
  206. package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -0
  207. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/insert-after-iterable.js +8 -7
  208. package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -0
  209. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/insert-before-iterable.js +8 -7
  210. package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -0
  211. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/map-iterable.js +7 -7
  212. package/dist/esm/collection/iterable-collection/_shared/map-iterable.js.map +1 -0
  213. package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js.map +1 -0
  214. package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -0
  215. package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -0
  216. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/partion-iterable.js +7 -7
  217. package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js.map +1 -0
  218. package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -0
  219. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/reverse-iterable.js +5 -5
  220. package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -0
  221. package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -0
  222. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/skip-iterable.js +6 -5
  223. package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js.map +1 -0
  224. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/skip-until-iterable.js +7 -7
  225. package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -0
  226. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/slice-iterable.js +4 -4
  227. package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js.map +1 -0
  228. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/sliding-iterable.js +5 -5
  229. package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -0
  230. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/sort-iterable.js +4 -4
  231. package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js.map +1 -0
  232. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/split-iterable.js +5 -5
  233. package/dist/esm/collection/iterable-collection/_shared/split-iterable.js.map +1 -0
  234. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/take-iterable.js +6 -5
  235. package/dist/esm/collection/iterable-collection/_shared/take-iterable.js.map +1 -0
  236. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/take-until-iterable.js +7 -7
  237. package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -0
  238. package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js.map +1 -0
  239. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/unique-iterable.js +4 -4
  240. package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js.map +1 -0
  241. package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/update-iterable.js +10 -10
  242. package/dist/esm/collection/iterable-collection/_shared/update-iterable.js.map +1 -0
  243. package/dist/esm/collection/iterable-collection/_shared/when-iterable.js.map +1 -0
  244. package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js.map +1 -0
  245. package/dist/esm/collection/iterable-collection/iterable-collection.js +137 -111
  246. package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -1
  247. package/dist/esm/collection/list-collection/list-collection.js +105 -73
  248. package/dist/esm/collection/list-collection/list-collection.js.map +1 -1
  249. package/dist/esm/contracts/_module.js +1 -1
  250. package/dist/esm/contracts/_module.js.map +1 -1
  251. package/dist/esm/contracts/collection/_module.js.map +1 -1
  252. package/dist/esm/contracts/collection/_shared.js +1 -1
  253. package/dist/esm/contracts/collection/_shared.js.map +1 -1
  254. package/dist/types/collection/_shared.d.ts +9 -3
  255. package/dist/types/collection/async-iterable-collection/_shared/_module.d.ts +35 -0
  256. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-chunk-whilte-iterable.d.ts +3 -3
  257. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-count-by-iterable.d.ts +2 -2
  258. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-entries-iterable.d.ts +2 -2
  259. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-filter-iterable.d.ts +3 -3
  260. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-flat-map-iterable.d.ts +3 -3
  261. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-group-by-iterable.d.ts +2 -2
  262. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-insert-after-iterable.d.ts +3 -3
  263. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-insert-before-iterable.d.ts +3 -3
  264. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-map-iterable.d.ts +3 -3
  265. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-partion-iterable.d.ts +3 -3
  266. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-reverse-iterable.d.ts +2 -2
  267. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-skip-iterable.d.ts +2 -2
  268. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-skip-until-iterable.d.ts +3 -3
  269. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-slice-iterable.d.ts +2 -2
  270. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-sliding-iterable.d.ts +2 -2
  271. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-sort-iterable.d.ts +2 -2
  272. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-split-iterable.d.ts +2 -2
  273. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-take-iterable.d.ts +2 -2
  274. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-take-until-iterable.d.ts +3 -3
  275. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-unique-iterable.d.ts +2 -2
  276. package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-update-iterable.d.ts +4 -4
  277. package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +53 -44
  278. package/dist/types/collection/iterable-collection/_shared/_module.d.ts +32 -0
  279. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/chunk-iterable.d.ts +3 -0
  280. package/dist/types/collection/iterable-collection/_shared/chunk-whilte-iterable.d.ts +12 -0
  281. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/collapse-iterable.d.ts +3 -0
  282. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/count-by-iterable.d.ts +6 -3
  283. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/cross-join-iterable.d.ts +3 -0
  284. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/entries-iterable.d.ts +5 -2
  285. package/dist/types/collection/iterable-collection/_shared/filter-iterable.d.ts +11 -0
  286. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/flat-map-iterable.d.ts +6 -3
  287. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/group-by-iterable.d.ts +6 -3
  288. package/dist/types/collection/iterable-collection/_shared/insert-after-iterable.d.ts +12 -0
  289. package/dist/types/collection/iterable-collection/_shared/insert-before-iterable.d.ts +12 -0
  290. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/map-iterable.d.ts +6 -3
  291. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/merge-iterable.d.ts +3 -0
  292. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/pad-end-iterable.d.ts +3 -0
  293. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/pad-start-iterable.d.ts +3 -0
  294. package/dist/types/collection/iterable-collection/_shared/partion-iterable.d.ts +12 -0
  295. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/repeat-iterable.d.ts +3 -0
  296. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/reverse-iterable.d.ts +5 -2
  297. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/shuffle-iterable.d.ts +3 -0
  298. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/skip-iterable.d.ts +5 -2
  299. package/dist/types/collection/iterable-collection/_shared/skip-until-iterable.d.ts +11 -0
  300. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/slice-iterable.d.ts +5 -2
  301. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/sliding-iterable.d.ts +5 -2
  302. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/sort-iterable.d.ts +5 -2
  303. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/split-iterable.d.ts +5 -2
  304. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/take-iterable.d.ts +5 -2
  305. package/dist/types/collection/iterable-collection/_shared/take-until-iterable.d.ts +11 -0
  306. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/tap-iterable.d.ts +3 -0
  307. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/unique-iterable.d.ts +5 -2
  308. package/dist/types/collection/iterable-collection/_shared/update-iterable.d.ts +12 -0
  309. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/when-iterable.d.ts +3 -0
  310. package/dist/types/collection/iterable-collection/{iterable-helpers → _shared}/zip-iterable.d.ts +3 -0
  311. package/dist/types/collection/iterable-collection/iterable-collection.d.ts +53 -44
  312. package/dist/types/collection/list-collection/list-collection.d.ts +52 -44
  313. package/dist/types/contracts/_module.d.ts +1 -1
  314. package/dist/types/contracts/collection/_module.d.ts +3 -0
  315. package/dist/types/contracts/collection/_shared.d.ts +123 -170
  316. package/dist/types/contracts/collection/async-collection.contract.d.ts +606 -211
  317. package/dist/types/contracts/collection/collection.contract.d.ts +546 -155
  318. package/package.json +5 -5
  319. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/_module.js.map +0 -1
  320. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js.map +0 -1
  321. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js.map +0 -1
  322. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js.map +0 -1
  323. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js.map +0 -1
  324. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js.map +0 -1
  325. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js.map +0 -1
  326. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +0 -1
  327. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js.map +0 -1
  328. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js.map +0 -1
  329. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js.map +0 -1
  330. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js.map +0 -1
  331. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js.map +0 -1
  332. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js.map +0 -1
  333. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js.map +0 -1
  334. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js.map +0 -1
  335. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js.map +0 -1
  336. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js.map +0 -1
  337. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js.map +0 -1
  338. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js.map +0 -1
  339. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js.map +0 -1
  340. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js.map +0 -1
  341. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js.map +0 -1
  342. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js.map +0 -1
  343. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js.map +0 -1
  344. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js.map +0 -1
  345. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js.map +0 -1
  346. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js.map +0 -1
  347. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js.map +0 -1
  348. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js.map +0 -1
  349. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js.map +0 -1
  350. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js.map +0 -1
  351. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js.map +0 -1
  352. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js.map +0 -1
  353. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js.map +0 -1
  354. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js.map +0 -1
  355. package/dist/cjs/collection/iterable-collection/iterable-helpers/_module.js +0 -49
  356. package/dist/cjs/collection/iterable-collection/iterable-helpers/_module.js.map +0 -1
  357. package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-iterable.js.map +0 -1
  358. package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js.map +0 -1
  359. package/dist/cjs/collection/iterable-collection/iterable-helpers/collapse-iterable.js.map +0 -1
  360. package/dist/cjs/collection/iterable-collection/iterable-helpers/count-by-iterable.js.map +0 -1
  361. package/dist/cjs/collection/iterable-collection/iterable-helpers/cross-join-iterable.js.map +0 -1
  362. package/dist/cjs/collection/iterable-collection/iterable-helpers/entries-iterable.js.map +0 -1
  363. package/dist/cjs/collection/iterable-collection/iterable-helpers/filter-iterable.js.map +0 -1
  364. package/dist/cjs/collection/iterable-collection/iterable-helpers/flat-map-iterable.js.map +0 -1
  365. package/dist/cjs/collection/iterable-collection/iterable-helpers/group-by-iterable.js.map +0 -1
  366. package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-after-iterable.js.map +0 -1
  367. package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-before-iterable.js.map +0 -1
  368. package/dist/cjs/collection/iterable-collection/iterable-helpers/map-iterable.js.map +0 -1
  369. package/dist/cjs/collection/iterable-collection/iterable-helpers/merge-iterable.js.map +0 -1
  370. package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-end-iterable.js.map +0 -1
  371. package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-start-iterable.js.map +0 -1
  372. package/dist/cjs/collection/iterable-collection/iterable-helpers/partion-iterable.js.map +0 -1
  373. package/dist/cjs/collection/iterable-collection/iterable-helpers/repeat-iterable.js.map +0 -1
  374. package/dist/cjs/collection/iterable-collection/iterable-helpers/reverse-iterable.js.map +0 -1
  375. package/dist/cjs/collection/iterable-collection/iterable-helpers/shuffle-iterable.js.map +0 -1
  376. package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-iterable.js.map +0 -1
  377. package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-until-iterable.js.map +0 -1
  378. package/dist/cjs/collection/iterable-collection/iterable-helpers/slice-iterable.js.map +0 -1
  379. package/dist/cjs/collection/iterable-collection/iterable-helpers/sliding-iterable.js.map +0 -1
  380. package/dist/cjs/collection/iterable-collection/iterable-helpers/sort-iterable.js.map +0 -1
  381. package/dist/cjs/collection/iterable-collection/iterable-helpers/split-iterable.js.map +0 -1
  382. package/dist/cjs/collection/iterable-collection/iterable-helpers/take-iterable.js.map +0 -1
  383. package/dist/cjs/collection/iterable-collection/iterable-helpers/take-until-iterable.js.map +0 -1
  384. package/dist/cjs/collection/iterable-collection/iterable-helpers/tap-iterable.js.map +0 -1
  385. package/dist/cjs/collection/iterable-collection/iterable-helpers/unique-iterable.js.map +0 -1
  386. package/dist/cjs/collection/iterable-collection/iterable-helpers/update-iterable.js.map +0 -1
  387. package/dist/cjs/collection/iterable-collection/iterable-helpers/when-iterable.js.map +0 -1
  388. package/dist/cjs/collection/iterable-collection/iterable-helpers/zip-iterable.js.map +0 -1
  389. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/_module.js +0 -36
  390. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/_module.js.map +0 -1
  391. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js.map +0 -1
  392. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js.map +0 -1
  393. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js.map +0 -1
  394. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js.map +0 -1
  395. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js.map +0 -1
  396. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js.map +0 -1
  397. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +0 -1
  398. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js.map +0 -1
  399. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js.map +0 -1
  400. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js.map +0 -1
  401. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js.map +0 -1
  402. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js.map +0 -1
  403. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js.map +0 -1
  404. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js.map +0 -1
  405. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js.map +0 -1
  406. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js.map +0 -1
  407. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js.map +0 -1
  408. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js.map +0 -1
  409. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js.map +0 -1
  410. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js.map +0 -1
  411. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js.map +0 -1
  412. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js.map +0 -1
  413. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js.map +0 -1
  414. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js.map +0 -1
  415. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js.map +0 -1
  416. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js.map +0 -1
  417. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js.map +0 -1
  418. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js.map +0 -1
  419. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js.map +0 -1
  420. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js.map +0 -1
  421. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js.map +0 -1
  422. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js.map +0 -1
  423. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js.map +0 -1
  424. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js.map +0 -1
  425. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js.map +0 -1
  426. package/dist/esm/collection/iterable-collection/iterable-helpers/_module.js +0 -33
  427. package/dist/esm/collection/iterable-collection/iterable-helpers/_module.js.map +0 -1
  428. package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-iterable.js.map +0 -1
  429. package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js.map +0 -1
  430. package/dist/esm/collection/iterable-collection/iterable-helpers/collapse-iterable.js.map +0 -1
  431. package/dist/esm/collection/iterable-collection/iterable-helpers/count-by-iterable.js.map +0 -1
  432. package/dist/esm/collection/iterable-collection/iterable-helpers/cross-join-iterable.js.map +0 -1
  433. package/dist/esm/collection/iterable-collection/iterable-helpers/entries-iterable.js.map +0 -1
  434. package/dist/esm/collection/iterable-collection/iterable-helpers/filter-iterable.js.map +0 -1
  435. package/dist/esm/collection/iterable-collection/iterable-helpers/flat-map-iterable.js.map +0 -1
  436. package/dist/esm/collection/iterable-collection/iterable-helpers/group-by-iterable.js.map +0 -1
  437. package/dist/esm/collection/iterable-collection/iterable-helpers/insert-after-iterable.js.map +0 -1
  438. package/dist/esm/collection/iterable-collection/iterable-helpers/insert-before-iterable.js.map +0 -1
  439. package/dist/esm/collection/iterable-collection/iterable-helpers/map-iterable.js.map +0 -1
  440. package/dist/esm/collection/iterable-collection/iterable-helpers/merge-iterable.js.map +0 -1
  441. package/dist/esm/collection/iterable-collection/iterable-helpers/pad-end-iterable.js.map +0 -1
  442. package/dist/esm/collection/iterable-collection/iterable-helpers/pad-start-iterable.js.map +0 -1
  443. package/dist/esm/collection/iterable-collection/iterable-helpers/partion-iterable.js.map +0 -1
  444. package/dist/esm/collection/iterable-collection/iterable-helpers/repeat-iterable.js.map +0 -1
  445. package/dist/esm/collection/iterable-collection/iterable-helpers/reverse-iterable.js.map +0 -1
  446. package/dist/esm/collection/iterable-collection/iterable-helpers/shuffle-iterable.js.map +0 -1
  447. package/dist/esm/collection/iterable-collection/iterable-helpers/skip-iterable.js.map +0 -1
  448. package/dist/esm/collection/iterable-collection/iterable-helpers/skip-until-iterable.js.map +0 -1
  449. package/dist/esm/collection/iterable-collection/iterable-helpers/slice-iterable.js.map +0 -1
  450. package/dist/esm/collection/iterable-collection/iterable-helpers/sliding-iterable.js.map +0 -1
  451. package/dist/esm/collection/iterable-collection/iterable-helpers/sort-iterable.js.map +0 -1
  452. package/dist/esm/collection/iterable-collection/iterable-helpers/split-iterable.js.map +0 -1
  453. package/dist/esm/collection/iterable-collection/iterable-helpers/take-iterable.js.map +0 -1
  454. package/dist/esm/collection/iterable-collection/iterable-helpers/take-until-iterable.js.map +0 -1
  455. package/dist/esm/collection/iterable-collection/iterable-helpers/tap-iterable.js.map +0 -1
  456. package/dist/esm/collection/iterable-collection/iterable-helpers/unique-iterable.js.map +0 -1
  457. package/dist/esm/collection/iterable-collection/iterable-helpers/update-iterable.js.map +0 -1
  458. package/dist/esm/collection/iterable-collection/iterable-helpers/when-iterable.js.map +0 -1
  459. package/dist/esm/collection/iterable-collection/iterable-helpers/zip-iterable.js.map +0 -1
  460. package/dist/types/collection/async-iterable-collection/async-iterable-helpers/_module.d.ts +0 -35
  461. package/dist/types/collection/iterable-collection/iterable-helpers/_module.d.ts +0 -32
  462. package/dist/types/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.d.ts +0 -9
  463. package/dist/types/collection/iterable-collection/iterable-helpers/filter-iterable.d.ts +0 -8
  464. package/dist/types/collection/iterable-collection/iterable-helpers/insert-after-iterable.d.ts +0 -9
  465. package/dist/types/collection/iterable-collection/iterable-helpers/insert-before-iterable.d.ts +0 -9
  466. package/dist/types/collection/iterable-collection/iterable-helpers/partion-iterable.d.ts +0 -9
  467. package/dist/types/collection/iterable-collection/iterable-helpers/skip-until-iterable.d.ts +0 -8
  468. package/dist/types/collection/iterable-collection/iterable-helpers/take-until-iterable.d.ts +0 -8
  469. package/dist/types/collection/iterable-collection/iterable-helpers/update-iterable.d.ts +0 -9
  470. /package/dist/cjs/{types.js → _shared/types.js} +0 -0
  471. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-abort-iterable.js +0 -0
  472. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-chunk-iterable.js +0 -0
  473. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-collapse-iterable.js +0 -0
  474. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-cross-join-iterable.js +0 -0
  475. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-delay-iterable.js +0 -0
  476. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-merge-iterable.js +0 -0
  477. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-pad-end-iterable.js +0 -0
  478. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-pad-start-iterable.js +0 -0
  479. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-repeat-iterable.js +0 -0
  480. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-shuffle-iterable.js +0 -0
  481. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-tap-iterable.js +0 -0
  482. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-timeout-iterable.js +0 -0
  483. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-when-iterable.js +0 -0
  484. /package/dist/cjs/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-zip-iterable.js +0 -0
  485. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/chunk-iterable.js +0 -0
  486. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/collapse-iterable.js +0 -0
  487. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/cross-join-iterable.js +0 -0
  488. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/merge-iterable.js +0 -0
  489. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/pad-end-iterable.js +0 -0
  490. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/pad-start-iterable.js +0 -0
  491. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/repeat-iterable.js +0 -0
  492. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/shuffle-iterable.js +0 -0
  493. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/tap-iterable.js +0 -0
  494. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/when-iterable.js +0 -0
  495. /package/dist/cjs/collection/iterable-collection/{iterable-helpers → _shared}/zip-iterable.js +0 -0
  496. /package/dist/esm/{types.js → _shared/types.js} +0 -0
  497. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-abort-iterable.js +0 -0
  498. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-chunk-iterable.js +0 -0
  499. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-collapse-iterable.js +0 -0
  500. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-cross-join-iterable.js +0 -0
  501. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-delay-iterable.js +0 -0
  502. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-merge-iterable.js +0 -0
  503. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-pad-end-iterable.js +0 -0
  504. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-pad-start-iterable.js +0 -0
  505. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-repeat-iterable.js +0 -0
  506. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-shuffle-iterable.js +0 -0
  507. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-tap-iterable.js +0 -0
  508. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-timeout-iterable.js +0 -0
  509. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-when-iterable.js +0 -0
  510. /package/dist/esm/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-zip-iterable.js +0 -0
  511. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/chunk-iterable.js +0 -0
  512. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/collapse-iterable.js +0 -0
  513. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/cross-join-iterable.js +0 -0
  514. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/merge-iterable.js +0 -0
  515. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/pad-end-iterable.js +0 -0
  516. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/pad-start-iterable.js +0 -0
  517. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/repeat-iterable.js +0 -0
  518. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/shuffle-iterable.js +0 -0
  519. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/tap-iterable.js +0 -0
  520. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/when-iterable.js +0 -0
  521. /package/dist/esm/collection/iterable-collection/{iterable-helpers → _shared}/zip-iterable.js +0 -0
  522. /package/dist/types/{types.d.ts → _shared/types.d.ts} +0 -0
  523. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-abort-iterable.d.ts +0 -0
  524. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-chunk-iterable.d.ts +0 -0
  525. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-collapse-iterable.d.ts +0 -0
  526. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-cross-join-iterable.d.ts +0 -0
  527. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-delay-iterable.d.ts +0 -0
  528. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-merge-iterable.d.ts +0 -0
  529. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-pad-end-iterable.d.ts +0 -0
  530. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-pad-start-iterable.d.ts +0 -0
  531. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-repeat-iterable.d.ts +0 -0
  532. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-shuffle-iterable.d.ts +0 -0
  533. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-tap-iterable.d.ts +0 -0
  534. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-timeout-iterable.d.ts +0 -0
  535. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-when-iterable.d.ts +0 -0
  536. /package/dist/types/collection/async-iterable-collection/{async-iterable-helpers → _shared}/async-zip-iterable.d.ts +0 -0
@@ -1,50 +1,102 @@
1
- import { type SliceSettings, type SlidingSettings, type Comparator, type Filter, type FindOrSettings, type FindSettings, type ForEach, type GroupBySettings, type JoinSettings, type Lazyable, type Map, type Modifier, type PageSettings, type RecordItem, type ReduceSettings, type ReverseSettings, type Tap, type Transform, type UpdatedItem } from "../../contracts/collection/_shared";
2
- import { type EnsureType } from "../../types";
3
1
  /**
4
- * @group Collections
2
+ * @module Collections
5
3
  */
4
+ import { type SliceSettings, type SlidingSettings, type Comparator, type Predicate, type FindOrSettings, type FindSettings, type ForEach, type GroupBySettings, type CountBySettings, type UniqueSettings, type JoinSettings, type Lazyable, type Map, type Modifier, type PageSettings, type RecordItem, type ReduceSettings, type ReverseSettings, type Tap, type Transform, type UpdatedItem } from "../../contracts/collection/_shared";
5
+ import { type EnsureType } from "../../_shared/types";
6
6
  export type Collapse<TValue> = TValue extends Array<infer TItem> | Iterable<infer TItem> | ICollection<infer TItem> ? TItem : TValue;
7
7
  /**
8
- * ICollection is immutable and all the methods return new copies
8
+ * <i>ICollection</i> is immutable. The <i>throwOnIndexOverflow</i> parameter in the <i>ICollection</i> methods is used for preventing the index to overflow by throwing an error.
9
9
  * @throws {CollectionError}
10
10
  * @throws {UnexpectedCollectionError}
11
11
  * @throws {IndexOverflowError}
12
12
  * @throws {ItemNotFoundError}
13
13
  * @throws {MultipleItemsFoundError}
14
14
  * @throws {TypeError}
15
- * @group Collections
15
+ * @group Contracts
16
16
  */
17
17
  export type ICollection<TInput> = Iterable<TInput> & {
18
- iterator(): Iterator<TInput, void>;
19
- entries(throwOnNumberLimit?: boolean): ICollection<RecordItem<number, TInput>>;
20
- keys(throwOnNumberLimit?: boolean): ICollection<number>;
18
+ /**
19
+ * The <i>toIterator</i> method converts the collection to a new iterator.
20
+ */
21
+ toIterator(): Iterator<TInput, void>;
22
+ /**
23
+ * The <i>entries</i> returns an ICollection of key, value pairs for every entry in the collection.
24
+ */
25
+ entries(throwOnIndexOverflow?: boolean): ICollection<RecordItem<number, TInput>>;
26
+ /**
27
+ * The <i>keys</i> method returns an ICollection of keys in the collection.
28
+ */
29
+ keys(throwOnIndexOverflow?: boolean): ICollection<number>;
30
+ /**
31
+ * The <i>values</i> method returns a copy of the collection.
32
+ */
21
33
  values(): ICollection<TInput>;
22
34
  /**
23
- * The filter method filters the collection using the given callback, keeping only those items that pass a given truth test:
35
+ * The <i>filter</i> method filters the collection using <i>predicateFn</i>, keeping only those items that pass <i>predicateFn</i>.
24
36
  * @example
25
37
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
26
38
  * const filtered = collection.filter(item => 2 < item && item < 5);
27
39
  * filtered.toArray();
28
40
  * // [3, 4]
29
41
  */
30
- filter<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): ICollection<TOutput>;
42
+ filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<TOutput>;
43
+ /**
44
+ * The <i>reject</i> method filters the collection using <i>predicateFn</i>, keeping only those items that not pass <i>predicateFn</i>.
45
+ * @example
46
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
47
+ * const filtered = collection.reject(item => 2 < item && item < 5);
48
+ * filtered.toArray();
49
+ * // [1, 2, 5, 6]
50
+ */
51
+ reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<Exclude<TInput, TOutput>>;
31
52
  /**
32
- * The map method iterates through the collection and passes each value to the given callback.
33
- * The mapFunction is free to modify the item and return it, thus forming a new collection of modified items:
53
+ * The <i>map</i> method iterates through the collection and passes each item to <i>mapFn</i>.
54
+ * The <i>mapFn</i> is free to modify the item and return it, thus forming a new collection of modified items.
34
55
  * @example
35
56
  * const collection = new ListCollection([1, 2, 3, 4, 5]);
36
57
  * const mapped = collection.map(item => item * 2);
37
58
  * mapped.toArray();
38
59
  * // [2, 4, 6, 8, 10]
39
60
  */
40
- map<TOutput>(map: Map<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): ICollection<TOutput>;
61
+ map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): ICollection<TOutput>;
62
+ /**
63
+ * The <i>reduce</i> method executes <i> {@link ReduceSettings | ReduceSettings.reduceFn} </i> function on each item of the array, passing in the return value from the calculation on the preceding item.
64
+ * The final result of running the reducer across all items of the array is a single value.
65
+ * @example
66
+ * const collection = new ListCollection([1, 2, 3]);
67
+ * collection.reduce({
68
+ * reduceFn: (sum, item) => sum + item
69
+ * });
70
+ * // 6
71
+ * @example
72
+ * const collection = new ListCollection(["a", "b", "c"]);
73
+ * collection.entries().reduce({
74
+ * reduceFn: (record, [key, value]) => ({
75
+ * ...record,
76
+ * [key]: value
77
+ * }),
78
+ * initialValue: {} as Record<number, string>
79
+ * });
80
+ * // { 0: "a", 1: "b", 2: "c" }
81
+ */
41
82
  reduce<TOutput = TInput>(settings: ReduceSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
42
83
  /**
84
+ * The <i>join</i> method joins the collection's items with {@link JoinSettings | JoinSettings.seperator}. An error will be thrown when if a none string item is encounterd.
43
85
  * @throws {TypeError}
86
+ * @example
87
+ * const collection = new ListCollection([1, 2, 3, 4]);
88
+ * collection.map(item => item.toString()).join();
89
+ * // "1,2,3,4"
90
+ * @example
91
+ * const collection = new ListCollection([1, 2, 3, 4]);
92
+ * collection.map(item => item.toString()).join({
93
+ * seperator: "_"
94
+ * });
95
+ * // "1_2_3_4"
44
96
  */
45
- join(settings?: JoinSettings): string;
97
+ join(settings?: JoinSettings): EnsureType<TInput, string>;
46
98
  /**
47
- * The collapse method collapses a collection of arrays into a single, flat collection:
99
+ * The <i>collapse</i> method collapses a collection of iterables into a single, flat collection.
48
100
  * @example
49
101
  * const collection = new ListCollection([[1, 2], [3, 4]]);
50
102
  * const collapsed = collection.collapse();
@@ -53,40 +105,37 @@ export type ICollection<TInput> = Iterable<TInput> & {
53
105
  */
54
106
  collapse(): ICollection<Collapse<TInput>>;
55
107
  /**
56
- * The flatMap method returns a new array formed by applying a given callback function to each element of the array, and then collapses the result by one level.
57
- * It is identical to a map() followed by a collapse()
108
+ * The <i>flatMap</i> method returns a new array formed by applying <i>mapFn</i> to each item of the array, and then collapses the result by one level.
109
+ * It is identical to a <i>map</i> method followed by a <i>collapse</i> method.
58
110
  * @example
59
111
  * const collection = new ListCollection([["a", "b"], ["c", "d"]]).flatMap(item => [item.length, ...item]);
60
112
  * collection.toArray();
61
113
  * // [2, "a", "b", 2, "c", "d"]
62
114
  */
63
- flatMap<TOutput>(map: Map<TInput, ICollection<TInput>, Iterable<TOutput>>, throwOnNumberLimit?: boolean): ICollection<TOutput>;
115
+ flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>, throwOnIndexOverflow?: boolean): ICollection<TOutput>;
64
116
  /**
65
- * The update method filters the collection using the given callback, keeping only those items that pass a given truth test and thereafter updates the filtered items:
117
+ * The <i>update</i> method updates only the items that passes <i>predicateFn</i> using <i>mapFn</i>.
66
118
  * @example
67
119
  * const collection = new ListCollection([1, 2, 3, 4, 5]);
68
120
  * const updateCollection = collection.update(item => item % 2 === 0, item => item * 2);
69
121
  * updateCollection.toArray();
70
122
  * // [1, 4, 3, 8, 5]
71
123
  */
72
- update<TFilterOutput extends TInput, TMapOutput>(filter: Filter<TInput, ICollection<TInput>, TFilterOutput>, map: Map<TFilterOutput, ICollection<TInput>, TMapOutput>, throwOnNumberLimit?: boolean): ICollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
124
+ update<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>, throwOnIndexOverflow?: boolean): ICollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
73
125
  /**
74
- * The page method returns a new collection containing the items that would be present on a given page number.
75
- * The method accepts the page number as its first argument and the number of items to show per page as its second argument:
126
+ * The <i>page</i> method returns a new collection containing the items that would be present on <i>{@link PageSettings | PageSettings.page}</i> with custom <i>{@link PageSettings | PageSettings.pageSize}</i>.
76
127
  * @example
77
128
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7, 8, 9]);
78
129
  * const page = collection.page({
79
- * page: 2,
80
- * pageSize: 3
130
+ * page: 2,
131
+ * pageSize: 3
81
132
  * });
82
133
  * page.toArray();
83
134
  * // [4, 5, 6]
84
135
  */
85
136
  page(settings: PageSettings): ICollection<TInput>;
86
137
  /**
87
- * The sum method returns the sum of all items in the collection. If the collection contains nested arrays or objects,
88
- * you should pass a map function that returns a number to be used in sum calculation.
89
- * You can only pass filter to filter out the items you want:
138
+ * The <i>sum</i> method returns the sum of all items in the collection. If the collection includes other than number items an error will be thrown.
90
139
  * @example
91
140
  * const collection = new ListCollection([1, 2, 3]);
92
141
  * collection.sum();
@@ -97,9 +146,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
97
146
  */
98
147
  sum(): EnsureType<TInput, number>;
99
148
  /**
100
- * The average method returns the average of all items in the collection. If the collection contains nested arrays or objects,
101
- * you should pass a map function that returns a number to be used in average calculation.
102
- * You can only pass filter to filter out the items you want:
149
+ * The <i>average</i> method returns the average of all items in the collection. If the collection includes other than number items an error will be thrown.
103
150
  * @example
104
151
  * const collection = new ListCollection([1, 2, 3]);
105
152
  * collection.average();
@@ -110,9 +157,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
110
157
  */
111
158
  average(): EnsureType<TInput, number>;
112
159
  /**
113
- * The median method returns the median of all items in the collection. If the collection contains nested arrays or objects,
114
- * you should pass a map function that returns a number to be used in median calculation.
115
- * You can only pass filter to filter out the items you want:
160
+ * The <i>median</i> method returns the median of all items in the collection. If the collection includes other than number items an error will be thrown.
116
161
  * @example
117
162
  * const collection = new ListCollection([1, 2, 3]);
118
163
  * collection.median();
@@ -122,11 +167,9 @@ export type ICollection<TInput> = Iterable<TInput> & {
122
167
  * @throws {IndexOverflowError} {@link IndexOverflowError}
123
168
  * @throws {TypeError} {@link TypeError}
124
169
  */
125
- median(throwOnNumberLimit?: boolean): EnsureType<TInput, number>;
170
+ median(throwOnIndexOverflow?: boolean): EnsureType<TInput, number>;
126
171
  /**
127
- * The min method returns the min of all items in the collection. If the collection contains nested arrays or objects,
128
- * you should pass a map function that returns a number to be used in min calculation.
129
- * You can only pass filter to filter out the items you want:
172
+ * The <i>min</i> method returns the min of all items in the collection. If the collection includes other than number items an error will be thrown.
130
173
  * @example
131
174
  * const collection = new ListCollection([1, 2, 3]);
132
175
  * collection.min();
@@ -137,9 +180,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
137
180
  */
138
181
  min(): EnsureType<TInput, number>;
139
182
  /**
140
- * The max method returns the max of all items in the collection. If the collection contains nested arrays or objects,
141
- * you should pass a map function that returns a number to be used in max calculation.
142
- * You can only pass filter to filter out the items you want:
183
+ * The <i>max</i> method returns the max of all items in the collection. If the collection includes other than number items an error will be thrown.
143
184
  * @example
144
185
  * const collection = new ListCollection([1, 2, 3]);
145
186
  * collection.max();
@@ -150,7 +191,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
150
191
  */
151
192
  max(): EnsureType<TInput, number>;
152
193
  /**
153
- * The percentage method may be used to quickly determine the percentage of items in the collection that pass a given truth test
194
+ * The <i>percentage</i> method may be used to quickly determine the percentage of items in the collection that pass <i>predicateFn</i>.
154
195
  * @example
155
196
  * const collection = new ListCollection([1, 1, 2, 2, 2, 3]);
156
197
  * collection.percentage(value => value === 1);
@@ -159,10 +200,9 @@ export type ICollection<TInput> = Iterable<TInput> & {
159
200
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
160
201
  * @throws {IndexOverflowError} {@link IndexOverflowError}
161
202
  */
162
- percentage(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): number;
203
+ percentage(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
163
204
  /**
164
- * The some method determines whether the collection has a given item.
165
- * You must pass a closure to the some method to determine if an element exists in the collection matching a given truth test:
205
+ * The <i>some</i> method determines whether at least one item in the collection matches <i>predicateFn</i>.
166
206
  * @example
167
207
  * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
168
208
  * collection.some(item => item === 1);
@@ -171,9 +211,9 @@ export type ICollection<TInput> = Iterable<TInput> & {
171
211
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
172
212
  * @throws {IndexOverflowError} {@link IndexOverflowError}
173
213
  */
174
- some<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): boolean;
214
+ some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): boolean;
175
215
  /**
176
- * The every method may be used to verify that all elements of a collection pass a given truth test:
216
+ * The <i>every</i> method determines whether all items in the collection matches <i>predicateFn</i>.
177
217
  * @example
178
218
  * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
179
219
  * collection.every(item => item < 6);
@@ -182,9 +222,9 @@ export type ICollection<TInput> = Iterable<TInput> & {
182
222
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
183
223
  * @throws {IndexOverflowError} {@link IndexOverflowError}
184
224
  */
185
- every<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): boolean;
225
+ every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): boolean;
186
226
  /**
187
- * The take method returns items in the collection until the given callback returns true:
227
+ * The <i>take</i> method takes the first <i>limit</i> items.
188
228
  * @example
189
229
  * const collection = new ListCollection([0, 1, 2, 3, 4, 5]);
190
230
  * const chunk = collection.take(3);
@@ -196,52 +236,51 @@ export type ICollection<TInput> = Iterable<TInput> & {
196
236
  * chunk.toArray();
197
237
  * // [4, 5]
198
238
  */
199
- take(limit: number, throwOnNumberLimit?: boolean): ICollection<TInput>;
239
+ take(limit: number, throwOnIndexOverflow?: boolean): ICollection<TInput>;
200
240
  /**
201
- * The takeUntil method returns items in the collection until the given callback returns true:
241
+ * The <i>takeUntil</i> method takes items until <i>predicateFn</i> returns true.
202
242
  * @example
203
243
  * const collection = new ListCollection([1, 2, 3, 4]);
204
244
  * const chunk = collection.takeUntil(item => item >= 3);
205
245
  * chunk.toArray();
206
246
  * // [1, 2]
207
247
  */
208
- takeUntil(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
248
+ takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
209
249
  /**
210
- * The takeWhile method returns items in the collection until the given callback returns false:
250
+ * The <i>takeWhile</i> method takes items until <i>predicateFn</i> returns false.
211
251
  * @example
212
252
  * const collection = new ListCollection([1, 2, 3, 4]);
213
- * const chunk = collection.takeWhile(item => item < 3);
253
+ * const chunk = collection.takeWhile(item => item < 4);
214
254
  * chunk.toArray();
215
- * // [1, 2]
255
+ * // [1, 2, 3]
216
256
  */
217
- takeWhile(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
257
+ takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
218
258
  /**
219
- * The skip method returns a new collection, with the given number of elements removed from the beginning of the collection:
259
+ * The <i>skip</i> method skips the first <i>offset</i> items.
220
260
  * @example
221
261
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).skip(4);
222
262
  * collection.toArray();
223
263
  * // [5, 6, 7, 8, 9, 10]
224
264
  */
225
- skip(offset: number, throwOnNumberLimit?: boolean): ICollection<TInput>;
265
+ skip(offset: number, throwOnIndexOverflow?: boolean): ICollection<TInput>;
226
266
  /**
227
- * The skipUntil method skips over items from the collection until the given callback returns true
228
- * and then returns the remaining items in the collection as a new collection instance:
267
+ * The <i>skipUntil</i> method skips items until <i>predicateFn</i> returns true.
229
268
  * @example
230
269
  * const collection = new ListCollection([1, 2, 3, 4]).skipUntil(item => item >= 3);
231
270
  * collection.toArray();
232
271
  * // [3, 4]
233
272
  */
234
- skipUntil(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
273
+ skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
235
274
  /**
236
- * The skipWhile method skips over items from the collection while the given callback returns false and then returns the remaining items in the collection as a new collection:
275
+ * The <i>skipWhile</i> method skips items until <i>predicateFn</i> returns false.
237
276
  * @example
238
277
  * const collection = new ListCollection([1, 2, 3, 4]).skipWhile(item => item <= 3);
239
278
  * collection.toArray();
240
279
  * // [4]
241
280
  */
242
- skipWhile(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<TInput>;
281
+ skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<TInput>;
243
282
  /**
244
- * The when method will execute the given callback when the first argument given to the method evaluates to true:
283
+ * The <i>when</i> method will execute <i>callback</i> when <i>condition</i> evaluates to true.
245
284
  * @example
246
285
  * const collection = new ListCollection([1, 2, 3, 4])
247
286
  * .when(true, collection => collection.append([-3]))
@@ -251,7 +290,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
251
290
  */
252
291
  when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
253
292
  /**
254
- * The whenEmpty method will execute the given callback when the collection is empty:
293
+ * The <i>whenEmpty</i> method will execute <i>callback</i> when the collection is empty.
255
294
  * @example
256
295
  * const collection = new ListCollection([])
257
296
  * .whenEmpty(collection => collection.append([-3]))
@@ -265,7 +304,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
265
304
  */
266
305
  whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
267
306
  /**
268
- * The whenNot method will execute the given callback when the first argument given to the method evaluates to false:
307
+ * The <i>whenNot</i> method will execute <i>callback</i> when <i>condition</i> evaluates to false.
269
308
  * @example
270
309
  * const collection = new ListCollection([1, 2, 3, 4])
271
310
  * .whenNot(true, collection => collection.append([-3]))
@@ -275,7 +314,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
275
314
  */
276
315
  whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
277
316
  /**
278
- * The whenNotEmpty method will execute the given callback when the collection is empty:
317
+ * The <i>whenNotEmpty</i> method will execute <i>callback</i> when the collection is not empty.
279
318
  * @example
280
319
  * const collection = new ListCollection([])
281
320
  * .whenNotEmpty(collection => collection.append([-3]))
@@ -289,16 +328,26 @@ export type ICollection<TInput> = Iterable<TInput> & {
289
328
  */
290
329
  whenNotEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
291
330
  /**
292
- * The pipe method passes the collection to the given closure and returns the result of the executed closure:
331
+ * The <i>pipe</i> method passes the orignal collection to <i>callback</i> and returns the result from <i>callback</i>.
332
+ * This method is useful when you want compose multiple smaller functions.
293
333
  * @example
294
- * const collection = new ListCollection([1, 2, 3]);
295
- * const piped = collection.pipe(collection => collection.sum());
296
- * // 6
334
+ * const collection = new ListCollection([1, "2", "a", 1, 3, {}]);
335
+ *
336
+ * function toNbrs<TInput>(collection: ICollection<TInput>): ICollection<number> {
337
+ * return collection.map(item => Number(item)).reject(nbr => Number.isNaN(nbr)))
338
+ * }
339
+ * function nbrToStr(collection: ICollection<number>): ICollection<string> {
340
+ * return collection.map(nbr => String.fromCharCode(nbr)).repeat(2).join("_")
341
+ * }
342
+ *
343
+ * const piped = collection
344
+ * .pipe(toNbrs)
345
+ * .pipe(nbrToStr);
346
+ * // "\x01_\x02_\x01_\x03_\x01_\x02_\x01_\x03"
297
347
  */
298
348
  pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
299
349
  /**
300
- * The tap method passes the collection to the given callback, allowing you to "tap" into the collection at a specific point
301
- * and do something with the items while not affecting the collection itself.The collection is then returned by the tap method:
350
+ * The <i>tap</i> method passes a copy of the original collection to <i>callback</i>, allowing you to do something with the items while not affecting the original collection.
302
351
  * @example
303
352
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6])
304
353
  * .tap(collection => {
@@ -311,7 +360,8 @@ export type ICollection<TInput> = Iterable<TInput> & {
311
360
  */
312
361
  tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
313
362
  /**
314
- * The chunk method breaks the collection into multiple, smaller collections of a given size:
363
+ * The <i>chunk</i> method breaks the collection into multiple, smaller collections of size <i>chunkSize</i>.
364
+ * If <i>chunkSize</i> is not divisible with total number of items then the last chunk will contain the remaining items.
315
365
  * @example
316
366
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7]);
317
367
  * const chunks = collection.chunk(4);
@@ -320,8 +370,8 @@ export type ICollection<TInput> = Iterable<TInput> & {
320
370
  */
321
371
  chunk(chunkSize: number): ICollection<ICollection<TInput>>;
322
372
  /**
323
- * The chunkWhile method breaks the collection into multiple, smaller collections based on the evaluation of the given callback.
324
- * The chunk variable passed to the closure may be used to inspect the previous element:
373
+ * The <i>chunkWhile</i> method breaks the collection into multiple, smaller collections based on the evaluation of <i>predicateFn</i>.
374
+ * The chunk variable passed to the <i>predicateFn</i> may be used to inspect the previous item.
325
375
  * @example
326
376
  * const collection = new ListCollection("AABBCCCD");
327
377
  * const chunks = collection.chunkWhile((value, index, chunk) => {
@@ -330,27 +380,37 @@ export type ICollection<TInput> = Iterable<TInput> & {
330
380
  * chunks.toArray();
331
381
  * // [["A", "A"], ["B", "B"], ["C", "C", "C"], ["D"]]
332
382
  */
333
- chunkWhile(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<ICollection<TInput>>;
383
+ chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
334
384
  /**
335
- * The split method breaks a collection into the given number of groups:
385
+ * The <i>split</i> method breaks a collection evenly into <i>chunkAmount</i> of chunks.
336
386
  * @example
337
387
  * const collection = new ListCollection([1, 2, 3, 4, 5]);
338
388
  * const chunks = collection.split(3);
339
389
  * chunks.toArray();
340
390
  * // [[1, 2], [3, 4], [5]]
391
+ * @example
392
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
393
+ * const chunks = collection.split(3);
394
+ * chunks.toArray();
395
+ * // [[1, 2], [3, 4], [5, 6]]
396
+ * @example
397
+ * const collection = new ListCollection([1, 2, 3, 4, 5, 6, 7]);
398
+ * const chunks = collection.split(3);
399
+ * chunks.toArray();
400
+ * // [[1, 2, 7], [3, 4], [5, 6]]
341
401
  */
342
- split(chunkAmount: number, throwOnNumberLimit?: boolean): ICollection<ICollection<TInput>>;
402
+ split(chunkAmount: number, throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
343
403
  /**
344
- * The partition method is used to separate elements that pass a given truth test from those that do not:
404
+ * The <i>partition</i> method is used to separate items that pass <i>predicateFn</i> from those that do not.
345
405
  * @example
346
406
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
347
407
  * collection.partition(item => item < 3);
408
+ * collection.toArray();
348
409
  * // [[1, 2], [3, 4, 5, 6]]
349
410
  */
350
- partition(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): ICollection<ICollection<TInput>>;
411
+ partition(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): ICollection<ICollection<TInput>>;
351
412
  /**
352
- * The sliding method returns a new collection of chunks representing a "sliding window" view of the items in the collection:
353
- * @experimental
413
+ * The <i>sliding</i> method returns a new collection of chunks representing a "sliding window" view of the items in the collection.
354
414
  * @example
355
415
  * const collection = new ListCollection([1, 2, 3, 4, 5]).sliding(2);
356
416
  * collection.toArray();
@@ -358,36 +418,79 @@ export type ICollection<TInput> = Iterable<TInput> & {
358
418
  */
359
419
  sliding(settings: SlidingSettings): ICollection<ICollection<TInput>>;
360
420
  /**
361
- * The groupBy method groups the collection's items by a given map function:
421
+ * The <i>groupBy</i> method groups the collection's items by {@link GroupBySettings | GroupBySettings.selectFn}.
422
+ * By default the equality check occurs on the item.
362
423
  * @example
363
424
  * const collection = new ListCollection(["a", "a", "a", "b", "b", "c"]);
364
425
  * const group = collection
365
426
  * .groupBy()
366
- * .map(([key, value]) => [key, value.toArray()]);
367
- * // [["a", ["a", "a", "a"]], ["b", ["b", "b", "b"]], ["c", ["c"]]]
427
+ * .map(([key, collection]) => [key, collection.toArray()])
428
+ * .toArray();
429
+ * // [
430
+ * // [
431
+ * // "a",
432
+ * // ["a", "a", "a"]
433
+ * // ],
434
+ * // [
435
+ * // "b",
436
+ * // ["b", "b"]
437
+ * // ],
438
+ * // [
439
+ * // "c",
440
+ * // ["c"]
441
+ * // ]
442
+ * // ]
368
443
  * @example
369
444
  * const collection = new ListCollection(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
370
445
  * const group = collection
371
- * .groupBy(item => item.split("@")[1])
372
- * .map(([key, value]) => [key, value.toArray()]);
373
- * // [["gmail.com", ["alice@gmail.com", "carlos@gmail.com"]], ["yahoo.com", ["bob@yahoo.com"]]]
446
+ * .groupBy({
447
+ * selectFn: item => item.split("@")[1]
448
+ * })
449
+ * .map(([key, collection]) => [key, collection.toArray()])
450
+ * .toArray();
451
+ * // [
452
+ * // [
453
+ * // "gmail.com",
454
+ * // ["alice@gmail.com", "carlos@gmail.com"]
455
+ * // ],
456
+ * // [
457
+ * // "yahoo.com",
458
+ * // ["bob@yahoo.com"]
459
+ * // ]
460
+ * // ]
374
461
  */
375
462
  groupBy<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
376
463
  /**
377
- * The countBy method counts the occurrences of values in the collection.
378
- * By default, the method counts the occurrences of every element, allowing you to count certain "types" of elements in the collection:
464
+ * The <i>countBy</i> method counts the occurrences of values in the collection by {@link CountBySettings | CountBySettings.selectFn}.
465
+ * By default the equality check occurs on the item.
379
466
  * @example
380
467
  * const collection = new ListCollection(["a", "a", "a", "b", "b", "c"]);
381
- * const count = collection.countBy();
382
- * // [["a", 3], ["b", 2], ["c", 1]]
468
+ * const count = collection
469
+ * .countBy()
470
+ * .map(([key, collection]) => [key, collection.toArray()])
471
+ * .toArray();
472
+ * // [
473
+ * // ["a", 3],
474
+ * // ["b", 2],
475
+ * // ["c", 1]
476
+ * // ]
383
477
  * @example
384
478
  * const collection = new ListCollection(["alice@gmail.com", "bob@yahoo.com", "carlos@gmail.com"]);
385
- * const count = collection.countBy(item => item.split("@")[1])
386
- * // [["gmail.com", 2], ["yahoo.com", 1]]
479
+ * const count = collection
480
+ * .countBy({
481
+ * selectFn: item => item.split("@")[1]
482
+ * })
483
+ * .map(([key, collection]) => [key, collection.toArray()])
484
+ * .toArray();
485
+ * // [
486
+ * // ["gmail.com", 2],
487
+ * // ["yahoo.com", 1]
488
+ * // ]
387
489
  */
388
- countBy<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
490
+ countBy<TOutput = TInput>(settings?: CountBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
389
491
  /**
390
- * The unique method removes all duplicate values from the collection:
492
+ * The <i>unique</i> method removes all duplicate values from the collection by {@link UniqueSettings | UniqueSettings.selectFn}.
493
+ * By default the equality check occurs on the item.
391
494
  * @example
392
495
  * const collection = new ListCollection([1, 1, 2, 2, 3, 4, 2]);
393
496
  * collection.unique().toArray();
@@ -400,25 +503,47 @@ export type ICollection<TInput> = Iterable<TInput> & {
400
503
  * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
401
504
  * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
402
505
  * ]);
403
- * const unique = collection.unique(item => item.brand);
404
- * unique.toArray();
506
+ * const unique = collection.unique({
507
+ * selectFn: item => item.brand
508
+ * }).toArray();
405
509
  * // [
406
- * { name: "iPhone 6", brand: "Apple", type: "phone" },
407
- * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
408
- * ]
510
+ * // { name: "iPhone 6", brand: "Apple", type: "phone" },
511
+ * // { name: "Galaxy S6", brand: "Samsung", type: "phone" },
512
+ * // ]
409
513
  */
410
- unique<TOutput = TInput>(settings?: GroupBySettings<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
514
+ unique<TOutput = TInput>(settings?: UniqueSettings<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
411
515
  /**
412
- * The diff method will return the values in the original collection that are not present in the given iterable:
516
+ * The <i>difference</i> method will return the values in the original collection that are not present in <i>iterable</i>.
517
+ * By default the equality check occurs on the item.
413
518
  * @example
414
- * const collection = new ListCollection([1, 2, 3, 4, 5]);
519
+ * const collection = new ListCollection([1, 2, 2, 3, 4, 5]);
415
520
  * const difference = collection.difference([2, 4, 6, 8]);
416
521
  * difference.toArray();
417
522
  * // [1, 3, 5]
523
+ * @example
524
+ * const collection = new ListCollection([
525
+ * { name: "iPhone 6", brand: "Apple", type: "phone" },
526
+ * { name: "iPhone 5", brand: "Apple", type: "phone" },
527
+ * { name: "Apple Watch", brand: "Apple", type: "watch" },
528
+ * { name: "Galaxy S6", brand: "Samsung", type: "phone" },
529
+ * { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
530
+ * ]);
531
+ * const difference = collection.difference(
532
+ * [
533
+ * { name: "Apple Watch", brand: "Apple", type: "watch" },
534
+ * ],
535
+ * (product) => product.type
536
+ * );
537
+ * difference.toArray();
538
+ * // [
539
+ * // { name: "iPhone 6", brand: "Apple", type: "phone" },
540
+ * // { name: "iPhone 5", brand: "Apple", type: "phone" },
541
+ * // { name: "Galaxy S6", brand: "Samsung", type: "phone" },
542
+ * // ]
418
543
  */
419
- difference<TOutput = TInput>(iterable: Iterable<TInput>, map?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
544
+ difference<TOutput = TInput>(iterable: Iterable<TInput>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
420
545
  /**
421
- * The repeat method will repat the current collection given amount
546
+ * The <i>repeat</i> method will repeat the original collection <i>amount</i> times.
422
547
  * @example
423
548
  * const collection = new ListCollection([1, 2, 3]);
424
549
  * const newCollection = collection.repeat(3);
@@ -427,8 +552,8 @@ export type ICollection<TInput> = Iterable<TInput> & {
427
552
  */
428
553
  repeat(amount: number): ICollection<TInput>;
429
554
  /**
430
- * The padStart method pads this collection with another item (multiple times, if needed) until the resulting collection reaches the given length.
431
- * The padding is applied from the start of this collection:
555
+ * The <i>padStart</i> method pads this collection with <i>fillItems</i> until the resulting collection size reaches <i>maxLength</i>.
556
+ * The padding is applied from the start of this collection.
432
557
  * @example
433
558
  * new ListCollection("abc").padStart(10, "foo").join({ seperator: ""});
434
559
  * // "foofoofabc"
@@ -444,8 +569,8 @@ export type ICollection<TInput> = Iterable<TInput> & {
444
569
  */
445
570
  padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
446
571
  /**
447
- * The padEnd method pads this collection with another item (multiple times, if needed) until the resulting collection reaches the given length.
448
- * The padding is applied from the end of this collection:
572
+ * The <i>padEnd</i> method pads this collection with <i>fillItems</i> until the resulting collection size reaches <i>maxLength</i>.
573
+ * The padding is applied from the end of this collection.
449
574
  * @example
450
575
  * new ListCollection("abc").padEnd(10, "foo").join({ seperator: ""});
451
576
  * // "abcfoofoof"
@@ -461,12 +586,50 @@ export type ICollection<TInput> = Iterable<TInput> & {
461
586
  */
462
587
  padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
463
588
  /**
464
- * The slice is the same as Array.slice method. Se documentation on mdn:
465
- * @link {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice}
589
+ * The <i>slice</i> method creates porition of the original collection selected from {@link SliceSettings | SliceSettings.start} and {@link SliceSettings | SliceSettings.end}
590
+ * where {@link SliceSettings | SliceSettings.start} and {@link SliceSettings | SliceSettings.end} (end not included) represent the index of items in the collection.
591
+ * @example
592
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
593
+ * collection.slice({
594
+ * start: 3
595
+ * }).toArray();
596
+ * // ["d", "e", "f"]
597
+ * @example
598
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
599
+ * collection.slice({
600
+ * end: 2,
601
+ * }).toArray();
602
+ * // ["a", "b"]
603
+ * @example
604
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
605
+ * collection.slice({
606
+ * start: 2
607
+ * end: 5,
608
+ * }).toArray();
609
+ * // ["c", "d", "e"]
610
+ * @example
611
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
612
+ * collection.slice({
613
+ * start: -2
614
+ * }).toArray();
615
+ * // ["e", "f"]
616
+ * @example
617
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
618
+ * collection.slice({
619
+ * end: -2
620
+ * }).toArray();
621
+ * // ["a", "b", "c", "d"]
622
+ * @example
623
+ * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]);
624
+ * collection.slice({
625
+ * start: -4,
626
+ * end: -2
627
+ * }).toArray();
628
+ * // ["c", "d"]
466
629
  */
467
630
  slice(settings?: SliceSettings): ICollection<TInput>;
468
631
  /**
469
- * The prepend method adds items to the beginning of the collection:
632
+ * The <i>prepend</i> method adds <i>iterable</i> to the beginning of the collection.
470
633
  * @example
471
634
  * const collection = new ListCollection([1, 2, 3, 4, 5]).prepend([-1, 20]);
472
635
  * collection.toArray();
@@ -474,7 +637,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
474
637
  */
475
638
  prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
476
639
  /**
477
- * The append method adds items to the end of the collection:
640
+ * The <i>append</i> method adds <i>iterable</i> to the end of the collection.
478
641
  * @example
479
642
  * const collection = new ListCollection([1, 2, 3, 4, 5]).append([-1, -2]);
480
643
  * collection.toArray();
@@ -482,23 +645,23 @@ export type ICollection<TInput> = Iterable<TInput> & {
482
645
  */
483
646
  append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
484
647
  /**
485
- * The insertBefore method adds items before a specific filtered item:
648
+ * The <i>insertBefore</i> method adds <i>iterable</i> before the first item that matches <i>predicateFn</i>.
486
649
  * @example
487
650
  * const collection = new ListCollection([1, 2, 2, 3, 4, 5]).insertBefore(item => item === 2, [-1, 20]);
488
651
  * collection.toArray();
489
652
  * // [1, -1, 20, 2, 2, 3, 4, 5]
490
653
  */
491
- insertBefore<TExtended = TInput>(filter: Filter<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnNumberLimit?: boolean): ICollection<TInput | TExtended>;
654
+ insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnIndexOverflow?: boolean): ICollection<TInput | TExtended>;
492
655
  /**
493
- * The insertAfter method adds items after a specific filtered item:
656
+ * The <i>insertAfter</i> method adds <i>iterable</i> after the first item that matches <i>predicateFn</i>.
494
657
  * @example
495
658
  * const collection = new ListCollection([1, 2, 2, 3, 4, 5]).insertAfter(item => item === 2, [-1, 20]);
496
659
  * collection.toArray();
497
660
  * // [1, 2, -1, 20, 2, 3, 4, 5]
498
661
  */
499
- insertAfter<TExtended = TInput>(filter: Filter<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnNumberLimit?: boolean): ICollection<TInput | TExtended>;
662
+ insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>, throwOnIndexOverflow?: boolean): ICollection<TInput | TExtended>;
500
663
  /**
501
- * The crossJoin method cross joins the collection's values among the given arrays or collections, returning a Cartesian product with all possible permutations:
664
+ * The <i>crossJoin</i> method cross joins the collection's values among <i>iterables</i>, returning a Cartesian product with all possible permutations.
502
665
  * @example
503
666
  * const collection = new ListCollection([1, 2]);
504
667
  * const matrix = collection.crossJoin(["a", "b"]);
@@ -526,22 +689,79 @@ export type ICollection<TInput> = Iterable<TInput> & {
526
689
  */
527
690
  crossJoin<TExtended = TInput>(...iterables: Array<Iterable<TExtended>>): ICollection<ICollection<TInput | TExtended>>;
528
691
  /**
529
- * The zip method merges together the values of the given array with the values of the original collection at their corresponding index:
692
+ * The <i>zip</i> method merges together the values of <i>iterable</i> with the values of the collection at their corresponding index.
693
+ * The returned collection has size of the shortest collection.
530
694
  * @example
531
695
  * const collection = new ListCollection(["Chair", "Desk"]);
532
696
  * const zipped = collection.zip([100, 200]);
533
697
  * zipped.toArray();
534
698
  * // [["Chari", 100], ["Desk", 200]]
699
+ * @example
700
+ * const collection = new ListCollection(["Chair", "Desk", "Couch"]);
701
+ * const zipped = collection.zip([100, 200]);
702
+ * zipped.toArray();
703
+ * // [["Chari", 100], ["Desk", 200]]
704
+ * @example
705
+ * const collection = new ListCollection(["Chair", "Desk"]);
706
+ * const zipped = collection.zip([100, 200, 300]);
707
+ * zipped.toArray();
708
+ * // [["Chari", 100], ["Desk", 200]]
535
709
  */
536
710
  zip<TExtended>(iterable: Iterable<TExtended>): ICollection<RecordItem<TInput, TExtended>>;
537
- sort(compare?: Comparator<TInput>): ICollection<TInput>;
711
+ /**
712
+ * The <i>sort</i> method sorts the collection. You can provide a <i>comparator</i> function.
713
+ * @example
714
+ * const collection = new ListCollection([-1, 2, 4, 3]);
715
+ * collection.sort().toArray();
716
+ * // [-1, 2, 3, 4]
717
+ * @example
718
+ * const collection = new ListCollection([
719
+ * { name: "Anders", age: 30 },
720
+ * { name: "Joe", age: 20 },
721
+ * { name: "Hasan", age: 25 },
722
+ * { name: "Linda", age: 19 }
723
+ * ]);
724
+ * collection.sort(({ age: ageA }, { age: ageB }) => ageA - ageB).toArray();
725
+ * // [
726
+ * // { name: "Linda", age: 19 }
727
+ * // { name: "Joe", age: 20 },
728
+ * // { name: "Hasan", age: 25 },
729
+ * // { name: "Anders", age: 30 },
730
+ * // ]
731
+ */
732
+ sort(comparator?: Comparator<TInput>): ICollection<TInput>;
733
+ /**
734
+ * The <i>reverse</i> method will reverse the order of the collection.
735
+ * The reversing of the collection will be applied in chunks that are the size of <i>{@link ReverseSettings | ReverseSettings.chunkSize}</i>.
736
+ * @example
737
+ * const collection = new ListCollection([-1, 2, 4, 3]);
738
+ * collection.reverse().toArray();
739
+ * // [3, 4, 2, -1]
740
+ */
538
741
  reverse(settings?: ReverseSettings): ICollection<TInput>;
742
+ /**
743
+ * The <i>shuffle</i> method randomly shuffles the items in the collection.
744
+ */
539
745
  shuffle(): ICollection<TInput>;
540
746
  /**
541
- * The first method returns the first element in the collection that passes a given truth test. By default it will get the first element:
747
+ * The <i>first</i> method returns the first item in the collection that passes <i>{@link FindSettings | FindSettings.predicateFn}</i>.
748
+ * By default it will get the first item. If the collection is empty or no items passes <i>{@link FindSettings | FindSettings.predicateFn}</i> than null i returned.
749
+ * @example
750
+ * const collection = new ListCollection([1, 2, 3, 4]);
751
+ * collection.first();
752
+ * // 1
542
753
  * @example
543
754
  * const collection = new ListCollection([1, 2, 3, 4]);
544
- * collection.first({ filter: item => item > 2 });
755
+ * collection.first({
756
+ * predicateFn: item => item > 2
757
+ * });
758
+ * // 3
759
+ * @example
760
+ * const collection = new ListCollection([1, 2, 3, 4]);
761
+ * collection.first({
762
+ * predicateFn: item => item > 10
763
+ * });
764
+ * // null
545
765
  * @throws {CollectionError} {@link CollectionError}
546
766
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
547
767
  * @throws {IndexOverflowError} {@link IndexOverflowError}
@@ -549,14 +769,59 @@ export type ICollection<TInput> = Iterable<TInput> & {
549
769
  */
550
770
  first<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
551
771
  /**
552
- * The firstOr method is the same as first method but will return a provided default value if not found
772
+ * The <i>firstOr</i> method returns the first item in the collection that passes <i>{@link FindOrSettings | FindOrSettings.predicateFn}</i>
773
+ * By default it will get the first item. If the collection is empty or no items passes <i>{@link FindOrSettings | FindOrSettings.predicateFn}</i> than {@link FindOrSettings | FindOrSettings.defaultValue}.
774
+ * @example
775
+ * const collection = new ListCollection([1, 2, 3, 4]);
776
+ * collection.firstOr({
777
+ * defaultValue: -1
778
+ * });
779
+ * // 1
780
+ * @example
781
+ * const collection = new ListCollection([1, 2, 3, 4]);
782
+ * collection.firstOr({
783
+ * predicateFn: item => item > 2,
784
+ * defaultValue: -1
785
+ * });
786
+ * // 3
787
+ * @example
788
+ * const collection = new ListCollection([1, 2, 3, 4]);
789
+ * collection.firstOr({
790
+ * predicateFn: item => item > 10,
791
+ * defaultValue: -1
792
+ * });
793
+ * // -1
794
+ * @example
795
+ * const collection = new ListCollection([1, 2, 3, 4]);
796
+ * collection.firstOr({
797
+ * predicateFn: item => item > 10,
798
+ * defaultValue: () => -1
799
+ * });
800
+ * // -1
553
801
  * @throws {CollectionError} {@link CollectionError}
554
802
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
555
803
  * @throws {IndexOverflowError} {@link IndexOverflowError}
556
804
  */
557
805
  firstOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
558
806
  /**
559
- * The firstOrFail method is the same as first method but will throw an Error if not found
807
+ * The <i>firstOrFail</i> method returns the first item in the collection that passes <i>{@link FindSettings | FindSettings.predicateFn}</i>.
808
+ * By default it will get the first item. If the collection is empty or no items passes <i>{@link FindSettings | FindSettings.predicateFn}</i> than error is thrown.
809
+ * @example
810
+ * const collection = new ListCollection([1, 2, 3, 4]);
811
+ * collection.firstOrFail();
812
+ * // 1
813
+ * @example
814
+ * const collection = new ListCollection([1, 2, 3, 4]);
815
+ * collection.firstOrFail({
816
+ * predicateFn: item => item > 2
817
+ * });
818
+ * // 3
819
+ * @example
820
+ * const collection = new ListCollection([1, 2, 3, 4]);
821
+ * collection.firstOrFail({
822
+ * predicateFn: item => item > 10
823
+ * });
824
+ * // throws an error
560
825
  * @throws {CollectionError} {@link CollectionError}
561
826
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
562
827
  * @throws {ItemNotFoundError} {@link ItemNotFoundError}
@@ -564,25 +829,84 @@ export type ICollection<TInput> = Iterable<TInput> & {
564
829
  */
565
830
  firstOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
566
831
  /**
567
- * The last method returns the last element in the collection that passes a given truth test. By default it will get the last element:
832
+ * The <i>last</i> method returns the last item in the collection that passes <i>{@link FindSettings | FindSettings.predicateFn}</i>.
833
+ * By default it will get the last item. If the collection is empty or no items passes <i>{@link FindSettings | FindSettings.predicateFn}</i> than null i returned.
568
834
  * @example
569
835
  * const collection = new ListCollection([1, 2, 3, 4]);
570
- * collection.last({ filter: item => item > 2 });
571
- * // 4
836
+ * collection.last();
837
+ * // 1
838
+ * @example
839
+ * const collection = new ListCollection([1, 2, 3, 4]);
840
+ * collection.last({
841
+ * predicateFn: item => item > 2
842
+ * });
843
+ * // 3
844
+ * @example
845
+ * const collection = new ListCollection([1, 2, 3, 4]);
846
+ * collection.last({
847
+ * predicateFn: item => item > 10
848
+ * });
849
+ * // null
572
850
  * @throws {CollectionError} {@link CollectionError}
573
851
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
574
852
  * @throws {IndexOverflowError} {@link IndexOverflowError}
853
+ * // 3
575
854
  */
576
855
  last<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput | null;
577
856
  /**
578
- * The lastOr method is the same as last method but will return a provided default value if not found
857
+ * The <i>lastOr</i> method returns the last item in the collection that passes <i>{@link FindOrSettings | FindOrSettings.predicateFn}</i>.
858
+ * By default it will get the last item. If the collection is empty or no items passes <i>{@link FindOrSettings | FindOrSettings.predicateFn}</i> than {@link FindOrSettings | FindOrSettings.defaultValue}.
859
+ * @example
860
+ * const collection = new ListCollection([1, 2, 3, 4]);
861
+ * collection.lastOr({
862
+ * defaultValue: -1
863
+ * });
864
+ * // 1
865
+ * @example
866
+ * const collection = new ListCollection([1, 2, 3, 4]);
867
+ * collection.lastOr({
868
+ * predicateFn: item => item > 2,
869
+ * defaultValue: -1
870
+ * });
871
+ * // 3
872
+ * @example
873
+ * const collection = new ListCollection([1, 2, 3, 4]);
874
+ * collection.lastOr({
875
+ * predicateFn: item => item > 10,
876
+ * defaultValue: -1
877
+ * });
878
+ * // -1
879
+ * @example
880
+ * const collection = new ListCollection([1, 2, 3, 4]);
881
+ * collection.lastOr({
882
+ * predicateFn: item => item > 10,
883
+ * defaultValue: () => -1
884
+ * });
885
+ * // -1
579
886
  * @throws {CollectionError} {@link CollectionError}
580
887
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
581
888
  * @throws {IndexOverflowError} {@link IndexOverflowError}
582
889
  */
583
890
  lastOr<TOutput extends TInput, TExtended = TInput>(settings: FindOrSettings<TInput, ICollection<TInput>, TOutput, TExtended>): TOutput | TExtended;
584
891
  /**
585
- * The lastOrFail method is the same as last method but will throw an Error if not found
892
+ * The <i>lastOrFail</i> method returns the last item in the collection that passes <i>{@link FindSettings | FindSettings.predicateFn}</i>.
893
+ * By default it will get the last item. If the collection is empty or no items passes <i>{@link FindSettings | FindSettings.predicateFn}</i> than error is thrown.
894
+ * @example
895
+ * const collection = new ListCollection([1, 2, 3, 4]);
896
+ * collection.lastOrFail();
897
+ * // 1
898
+ * @example
899
+ * const collection = new ListCollection([1, 2, 3, 4]);
900
+ * collection.lastOrFail({
901
+ * predicateFn: item => item > 2
902
+ * });
903
+ * // 3
904
+ * @example
905
+ * const collection = new ListCollection([1, 2, 3, 4]);
906
+ * collection.lastOrFail({
907
+ * predicateFn: item => item > 10
908
+ * });
909
+ * // throws an error
586
910
  * @throws {CollectionError} {@link CollectionError}
587
911
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
588
912
  * @throws {ItemNotFoundError} {@link ItemNotFoundError}
@@ -590,7 +914,8 @@ export type ICollection<TInput> = Iterable<TInput> & {
590
914
  */
591
915
  lastOrFail<TOutput extends TInput>(settings?: FindSettings<TInput, ICollection<TInput>, TOutput>): TOutput;
592
916
  /**
593
- * The before method is the opposite of the after method. It returns the item before the given item. null is returned if the given item is not found or is the first item:
917
+ * The <i>before</i> method returns the item that comes before the first item that matches <i>predicateFn</i>.
918
+ * If the <i>predicateFn</i> does not match or matches the first item then null is returned.
594
919
  * @example
595
920
  * const collection = new ListCollection([1, 2, 3, 4]);
596
921
  * collection.before(item => item === 2);
@@ -603,54 +928,100 @@ export type ICollection<TInput> = Iterable<TInput> & {
603
928
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
604
929
  * @throws {IndexOverflowError} {@link IndexOverflowError}
605
930
  */
606
- before(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | null;
931
+ before(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | null;
607
932
  /**
608
- * The beforeOr method is the same as before method but will return a provided default value if not found
933
+ * The <i>beforeOr</i> method returns the item that comes before the first item that matches <i>predicateFn</i>.
934
+ * If the collection is empty or the <i>predicateFn</i> does not match or matches the first item then <i>defaultValue</i> is returned.
935
+ * @example
936
+ * const collection = new ListCollection([1, 2, 3, 4]);
937
+ * collection.beforeOr(-1, item => item === 2);
938
+ * // 1
939
+ * @example
940
+ * const collection = new ListCollection([1, 2, 3, 4]);
941
+ * collection.beforeOr(-1, item => item === 1);
942
+ * // -1
943
+ * @example
944
+ * const collection = new ListCollection([1, 2, 3, 4]);
945
+ * collection.beforeOr(() => -1, item => item === 1);
946
+ * // -1
609
947
  * @throws {CollectionError} {@link CollectionError}
610
948
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
611
949
  * @throws {IndexOverflowError} {@link IndexOverflowError}
612
950
  */
613
- beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | TExtended;
951
+ beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | TExtended;
614
952
  /**
615
- * The beforeOrFail method is the same as before method but will throw an Error if not found
953
+ * The <i>beforeOrFail</i> method returns the item that comes before the first item that matches <i>predicateFn</i>.
954
+ * If the collection is empty or the <i>predicateFn</i> does not match or matches the first item then an error is thrown.
955
+ * @example
956
+ * const collection = new ListCollection([1, 2, 3, 4]);
957
+ * collection.beforeOrFail(item => item === 2);
958
+ * // 1
959
+ * @example
960
+ * const collection = new ListCollection([1, 2, 3, 4]);
961
+ * collection.beforeOrFail(item => item === 1);
962
+ * // error is thrown
616
963
  * @throws {CollectionError} {@link CollectionError}
617
964
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
618
965
  * @throws {ItemNotFoundError} {@link ItemNotFoundError}
619
966
  * @throws {IndexOverflowError} {@link IndexOverflowError}
620
967
  */
621
- beforeOrFail(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput;
968
+ beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput;
622
969
  /**
623
- * The after method returns the item after the given item. null is returned if the given item is not found or is the last item:
970
+ * The <i>after</i> method returns the item that comes after the first item that matches <i>predicateFn</i>.
971
+ * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then null is returned.
624
972
  * @example
625
973
  * const collection = new ListCollection([1, 2, 3, 4]);
626
974
  * collection.after(item => item === 2);
627
- * // 3
975
+ * // 1
628
976
  * @example
629
977
  * const collection = new ListCollection([1, 2, 3, 4]);
630
- * collection.after(item => item === 4);
978
+ * collection.after(item => item === 1);
631
979
  * // null
632
980
  * @throws {CollectionError} {@link CollectionError}
633
981
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
634
982
  * @throws {IndexOverflowError} {@link IndexOverflowError}
635
983
  */
636
- after(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | null;
984
+ after(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | null;
637
985
  /**
638
- * The afterOr method is the same as after method but will return a provided default value if not found
986
+ * The <i>afterOr</i> method returns the item that comes after the first item that matches <i>predicateFn</i>.
987
+ * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then <i>defaultValue</i> is returned.
988
+ * @example
989
+ * const collection = new ListCollection([1, 2, 3, 4]);
990
+ * collection.afterOr(-1, item => item === 2);
991
+ * // 1
992
+ * @example
993
+ * const collection = new ListCollection([1, 2, 3, 4]);
994
+ * collection.afterOr(-1, item => item === 1);
995
+ * // -1
996
+ * @example
997
+ * const collection = new ListCollection([1, 2, 3, 4]);
998
+ * collection.afterOr(() => -1, item => item === 1);
999
+ * // -1
639
1000
  * @throws {CollectionError} {@link CollectionError}
640
1001
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
641
1002
  * @throws {IndexOverflowError} {@link IndexOverflowError}
642
1003
  */
643
- afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput | TExtended;
1004
+ afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput | TExtended;
644
1005
  /**
645
- * The afterOrFail method is the same as after method but will throw an Error if not found
1006
+ * The <i>afterOrFail</i> method returns the item that comes after the first item that matches <i>predicateFn</i>.
1007
+ * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then an error is thrown.
1008
+ * @example
1009
+ * const collection = new ListCollection([1, 2, 3, 4]);
1010
+ * collection.afterOrFail(item => item === 2);
1011
+ * // 1
1012
+ * @example
1013
+ * const collection = new ListCollection([1, 2, 3, 4]);
1014
+ * collection.afterOrFail(item => item === 1);
1015
+ * // error is thrown
646
1016
  * @throws {CollectionError} {@link CollectionError}
647
1017
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
648
1018
  * @throws {ItemNotFoundError} {@link ItemNotFoundError}
649
1019
  * @throws {IndexOverflowError} {@link IndexOverflowError}
650
1020
  */
651
- afterOrFail(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): TInput;
1021
+ afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): TInput;
652
1022
  /**
653
- * The sole method returns the first element in the collection that passes a given truth test, but only if the truth test matches exactly one element:
1023
+ * The <i>sole</i> method returns the first item in the collection that passes <i>predicateFn</i>, but only if <i>predicateFn</i> matches exactly one item.
1024
+ * If no items matches or multiple items are found an error will be thrown.
654
1025
  * @example
655
1026
  * const collection = new ListCollection([1, 2, 3, 4, 5]);
656
1027
  * collection.sole(item => item === 4);
@@ -661,9 +1032,9 @@ export type ICollection<TInput> = Iterable<TInput> & {
661
1032
  * @throws {MultipleItemsFoundError} {@link MultipleItemsFoundError}
662
1033
  * @throws {IndexOverflowError} {@link IndexOverflowError}
663
1034
  */
664
- sole<TOutput extends TInput>(filter: Filter<TInput, ICollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): TOutput;
1035
+ sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>, throwOnIndexOverflow?: boolean): TOutput;
665
1036
  /**
666
- * The nth method creates a new collection consisting of every n-th element:
1037
+ * The <i>nth</i> method creates a new collection consisting of every n-th item.
667
1038
  * @example
668
1039
  * const collection = new ListCollection(["a", "b", "c", "d", "e", "f"]).nth(4);
669
1040
  * collection.toArray();
@@ -671,7 +1042,7 @@ export type ICollection<TInput> = Iterable<TInput> & {
671
1042
  */
672
1043
  nth(step: number): ICollection<TInput>;
673
1044
  /**
674
- * The count method returns the total number of items in the collection:
1045
+ * The <i>count</i> method returns the total number of items in the collection that passes <i>predicateFn</i>.
675
1046
  * @example
676
1047
  * const collection = new ListCollection([1, 2, 3, 4, 5, 6]);
677
1048
  * collection.count(value => value % 2 === 0);
@@ -680,39 +1051,59 @@ export type ICollection<TInput> = Iterable<TInput> & {
680
1051
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
681
1052
  * @throws {IndexOverflowError} {@link IndexOverflowError}
682
1053
  */
683
- count(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): number;
1054
+ count(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
1055
+ /**
1056
+ * The <i>size</i> returns the size of the collection.
1057
+ * @throws {CollectionError} {@link CollectionError}
1058
+ * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
1059
+ * @throws {IndexOverflowError} {@link IndexOverflowError}
1060
+ */
1061
+ size(throwOnIndexOverflow?: boolean): number;
684
1062
  /**
1063
+ * The <i>isEmpty</i> returns true if the collection is empty.
685
1064
  * @throws {CollectionError} {@link CollectionError}
686
1065
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
687
1066
  * @throws {IndexOverflowError} {@link IndexOverflowError}
688
1067
  */
689
- size(throwOnNumberLimit?: boolean): number;
1068
+ isEmpty(): boolean;
690
1069
  /**
1070
+ * The <i>isNotEmpty</i> returns true if the collection is not empty.
691
1071
  * @throws {CollectionError} {@link CollectionError}
692
1072
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
693
1073
  * @throws {IndexOverflowError} {@link IndexOverflowError}
694
1074
  */
695
- empty(): boolean;
1075
+ isNotEmpty(): boolean;
696
1076
  /**
1077
+ * The <i>searchFirst</i> return the index of the first item that matches <i>predicateFn</i>.
1078
+ * @example
1079
+ * const collection = new ListCollection(["a", "b", "b", "c"]);
1080
+ * collection.searchFirst(item => item === "b");
1081
+ * // 1
697
1082
  * @throws {CollectionError} {@link CollectionError}
698
1083
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
699
1084
  * @throws {IndexOverflowError} {@link IndexOverflowError}
700
1085
  */
701
- notEmpty(): boolean;
1086
+ searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
702
1087
  /**
703
- * The search method searches the collection for the given value and returns its index if found. If the item is not found, -1 is returned:
1088
+ * The <i>searchLast</i> return the index of the last item that matches <i>predicateFn</i>.
1089
+ * @example
1090
+ * const collection = new ListCollection(["a", "b", "b", "c"]);
1091
+ * collection.searchLast(item => item === "b");
1092
+ * // 2
704
1093
  * @throws {CollectionError} {@link CollectionError}
705
1094
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
706
1095
  * @throws {IndexOverflowError} {@link IndexOverflowError}
707
1096
  */
708
- search(filter: Filter<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): number;
1097
+ searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): number;
709
1098
  /**
1099
+ * The <i>forEach</i> method iterates through all items in the collection.
710
1100
  * @throws {CollectionError} {@link CollectionError}
711
1101
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
712
1102
  * @throws {IndexOverflowError} {@link IndexOverflowError}
713
1103
  */
714
- forEach(callback: ForEach<TInput, ICollection<TInput>>, throwOnNumberLimit?: boolean): void;
1104
+ forEach(callback: ForEach<TInput, ICollection<TInput>>, throwOnIndexOverflow?: boolean): void;
715
1105
  /**
1106
+ * The <i>toArray</i> method converts the collection to a new array.
716
1107
  * @throws {CollectionError} {@link CollectionError}
717
1108
  * @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
718
1109
  * @throws {IndexOverflowError} {@link IndexOverflowError}