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