@daiso-tech/core 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/_shared/utilities.js +19 -0
- package/dist/cjs/_shared/utilities.js.map +1 -0
- package/dist/cjs/collection/_shared.js +4 -2
- package/dist/cjs/collection/_shared.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/_module.js +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js +8 -7
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/{async-chunk-whilte-iterable.js → async-chunk-while-iterable.js} +14 -16
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js +1 -2
- package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js +3 -6
- package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +19 -18
- package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-entries-iterable.js +1 -8
- package/dist/cjs/collection/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js +6 -9
- package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +3 -6
- package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-group-by-iterable.js +12 -13
- package/dist/cjs/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +5 -12
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +5 -12
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js +3 -6
- package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js +1 -2
- package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-end-iterable.js +1 -4
- package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-start-iterable.js +1 -4
- package/dist/cjs/collection/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js +12 -19
- package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js +2 -3
- package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-reverse-iterable.js +3 -10
- package/dist/cjs/collection/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-shuffle-iterable.js +4 -2
- package/dist/cjs/collection/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js +4 -9
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +5 -12
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-slice-iterable.js +2 -4
- package/dist/cjs/collection/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js +4 -11
- package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js +7 -9
- package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js +4 -9
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js +6 -9
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js +1 -2
- package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js +2 -5
- package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js +6 -9
- package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js +1 -2
- package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +173 -228
- package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/_module.js +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/_module.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js +8 -7
- package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/{chunk-whilte-iterable.js → chunk-while-iterable.js} +12 -14
- package/dist/cjs/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js +1 -2
- package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js +26 -20
- package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js +2 -9
- package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js +10 -12
- package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js +1 -2
- package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js +2 -6
- package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js +2 -6
- package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js +9 -11
- package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js +2 -3
- package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js +4 -12
- package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js +5 -4
- package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js +4 -9
- package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js +4 -11
- package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js +1 -2
- package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js +7 -9
- package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js +4 -9
- package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js +1 -2
- package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js +3 -6
- package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js +1 -2
- package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js +1 -2
- package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/iterable-collection.js +161 -251
- package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/cjs/collection/list-collection/list-collection.js +213 -299
- package/dist/cjs/collection/list-collection/list-collection.js.map +1 -1
- package/dist/cjs/contracts/collection/_shared.js +17 -10
- package/dist/cjs/contracts/collection/_shared.js.map +1 -1
- package/dist/esm/_shared/utilities.js +15 -0
- package/dist/esm/_shared/utilities.js.map +1 -0
- package/dist/esm/collection/_shared.js +4 -2
- package/dist/esm/collection/_shared.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/_module.js +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js +8 -7
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js +37 -0
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js +1 -2
- package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js +3 -6
- package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +19 -18
- package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-entries-iterable.js +1 -8
- package/dist/esm/collection/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js +6 -9
- package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +3 -6
- package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-group-by-iterable.js +12 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +6 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +6 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js +3 -6
- package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js +1 -2
- package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-pad-end-iterable.js +1 -4
- package/dist/esm/collection/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-pad-start-iterable.js +1 -4
- package/dist/esm/collection/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js +13 -20
- package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js +2 -3
- package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-reverse-iterable.js +3 -10
- package/dist/esm/collection/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-shuffle-iterable.js +4 -2
- package/dist/esm/collection/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js +4 -9
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +6 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-slice-iterable.js +2 -4
- package/dist/esm/collection/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js +4 -11
- package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js +7 -9
- package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js +4 -9
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js +6 -9
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js +1 -2
- package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js +2 -5
- package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js +6 -9
- package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js +1 -2
- package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +174 -229
- package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/_module.js +1 -1
- package/dist/esm/collection/iterable-collection/_shared/_module.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js +8 -7
- package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/{chunk-whilte-iterable.js → chunk-while-iterable.js} +12 -14
- package/dist/esm/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js +1 -2
- package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js +24 -18
- package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js +3 -10
- package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js +10 -12
- package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/map-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js +1 -2
- package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js +2 -6
- package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js +2 -6
- package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js +9 -11
- package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js +2 -3
- package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js +4 -12
- package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js +5 -4
- package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js +4 -9
- package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js +4 -11
- package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js +1 -2
- package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/split-iterable.js +7 -9
- package/dist/esm/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/take-iterable.js +4 -9
- package/dist/esm/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js +1 -2
- package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/update-iterable.js +3 -6
- package/dist/esm/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/when-iterable.js +1 -2
- package/dist/esm/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js +1 -2
- package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/iterable-collection.js +162 -252
- package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/esm/collection/list-collection/list-collection.js +214 -300
- package/dist/esm/collection/list-collection/list-collection.js.map +1 -1
- package/dist/esm/contracts/collection/_shared.js +12 -6
- package/dist/esm/contracts/collection/_shared.js.map +1 -1
- package/dist/types/_shared/types.d.ts +5 -0
- package/dist/types/_shared/utilities.d.ts +3 -0
- package/dist/types/collection/async-iterable-collection/_shared/_module.d.ts +1 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-chunk-iterable.d.ts +2 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-chunk-while-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/_shared/async-count-by-iterable.d.ts +3 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-cross-join-iterable.d.ts +6 -5
- package/dist/types/collection/async-iterable-collection/_shared/async-entries-iterable.d.ts +3 -4
- package/dist/types/collection/async-iterable-collection/_shared/async-filter-iterable.d.ts +2 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-flat-map-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-group-by-iterable.d.ts +4 -4
- package/dist/types/collection/async-iterable-collection/_shared/async-insert-after-iterable.d.ts +4 -4
- package/dist/types/collection/async-iterable-collection/_shared/async-insert-before-iterable.d.ts +4 -4
- package/dist/types/collection/async-iterable-collection/_shared/async-map-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-merge-iterable.d.ts +1 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-pad-end-iterable.d.ts +2 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-pad-start-iterable.d.ts +2 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-partion-iterable.d.ts +4 -4
- package/dist/types/collection/async-iterable-collection/_shared/async-repeat-iterable.d.ts +2 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-reverse-iterable.d.ts +3 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-shuffle-iterable.d.ts +2 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-skip-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-skip-until-iterable.d.ts +2 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-slice-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-sliding-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-split-iterable.d.ts +3 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-take-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-take-until-iterable.d.ts +2 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-unique-iterable.d.ts +1 -2
- package/dist/types/collection/async-iterable-collection/_shared/async-update-iterable.d.ts +5 -6
- package/dist/types/collection/async-iterable-collection/_shared/async-zip-iterable.d.ts +2 -1
- package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +56 -54
- package/dist/types/collection/iterable-collection/_shared/_module.d.ts +1 -1
- package/dist/types/collection/iterable-collection/_shared/{chunk-whilte-iterable.d.ts → chunk-while-iterable.d.ts} +1 -2
- package/dist/types/collection/iterable-collection/_shared/count-by-iterable.d.ts +3 -3
- package/dist/types/collection/iterable-collection/_shared/cross-join-iterable.d.ts +5 -8
- package/dist/types/collection/iterable-collection/_shared/entries-iterable.d.ts +2 -3
- package/dist/types/collection/iterable-collection/_shared/filter-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/flat-map-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/group-by-iterable.d.ts +3 -3
- package/dist/types/collection/iterable-collection/_shared/insert-after-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/insert-before-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/map-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/partion-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/reverse-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/shuffle-iterable.d.ts +2 -1
- package/dist/types/collection/iterable-collection/_shared/skip-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/skip-until-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/slice-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/sliding-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/split-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/take-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/take-until-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/unique-iterable.d.ts +1 -2
- package/dist/types/collection/iterable-collection/_shared/update-iterable.d.ts +4 -5
- package/dist/types/collection/iterable-collection/_shared/zip-iterable.d.ts +1 -1
- package/dist/types/collection/iterable-collection/iterable-collection.d.ts +56 -54
- package/dist/types/collection/list-collection/list-collection.d.ts +57 -54
- package/dist/types/contracts/collection/_shared.d.ts +14 -158
- package/dist/types/contracts/collection/async-collection.contract.d.ts +430 -284
- package/dist/types/contracts/collection/collection.contract.d.ts +417 -260
- package/package.json +2 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js.map +0 -1
- package/dist/cjs/collection/iterable-collection/_shared/chunk-whilte-iterable.js.map +0 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js +0 -39
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.js.map +0 -1
- package/dist/esm/collection/iterable-collection/_shared/chunk-whilte-iterable.js.map +0 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-chunk-whilte-iterable.d.ts +0 -12
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Collections
|
|
3
3
|
*/
|
|
4
|
-
import { type Collapse, type Comparator, type Predicate, type
|
|
5
|
-
import { type EnsureType } from "../../_shared/types";
|
|
4
|
+
import { type Collapse, type Comparator, type Predicate, type ForEach, type ICollection, type Map, type Modifier, type Tap, type Transform, type ChangendItem, type Reduce, type CrossJoinResult } from "../../contracts/collection/_module";
|
|
5
|
+
import { type Lazyable, type EnsureType } from "../../_shared/types";
|
|
6
|
+
import { type RecordItem } from "../../_shared/types";
|
|
6
7
|
/**
|
|
7
8
|
* All methods that return <i>{@link ICollection}</i> are executed lazly which means they will be executed when the <i>IterableCollection</i> is iterated with <i>forEach</i> method or "for of" loop.
|
|
8
9
|
* The rest of the methods are executed eagerly.
|
|
@@ -10,7 +11,6 @@ import { type EnsureType } from "../../_shared/types";
|
|
|
10
11
|
*/
|
|
11
12
|
export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
12
13
|
private iterable;
|
|
13
|
-
private static THROW_ON_NUMBER_LIMIT;
|
|
14
14
|
private static DEFAULT_CHUNK_SIZE;
|
|
15
15
|
private static makeCollection;
|
|
16
16
|
/**
|
|
@@ -19,32 +19,34 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
|
19
19
|
constructor(iterable: Iterable<TInput>);
|
|
20
20
|
[Symbol.iterator](): Iterator<TInput>;
|
|
21
21
|
toIterator(): Iterator<TInput, void>;
|
|
22
|
-
entries(
|
|
23
|
-
keys(
|
|
22
|
+
entries(): ICollection<RecordItem<number, TInput>>;
|
|
23
|
+
keys(): ICollection<number>;
|
|
24
24
|
values(): ICollection<TInput>;
|
|
25
|
-
filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
26
|
-
reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
27
|
-
map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput
|
|
28
|
-
reduce
|
|
29
|
-
|
|
25
|
+
filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
|
|
26
|
+
reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
|
|
27
|
+
map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
|
|
28
|
+
reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>): TInput;
|
|
29
|
+
reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>, initialValue: TInput): TInput;
|
|
30
|
+
reduce<TOutput>(reduceFn: Reduce<TInput, ICollection<TInput>, TOutput>, initialValue: TOutput): TOutput;
|
|
31
|
+
join(separator?: string): EnsureType<TInput, string>;
|
|
30
32
|
collapse(): ICollection<Collapse<TInput>>;
|
|
31
|
-
flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput
|
|
32
|
-
|
|
33
|
-
page(
|
|
33
|
+
flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>): ICollection<TOutput>;
|
|
34
|
+
change<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<ChangendItem<TInput, TFilterOutput, TMapOutput>>;
|
|
35
|
+
page(page: number, pageSize: number): ICollection<TInput>;
|
|
34
36
|
sum(): EnsureType<TInput, number>;
|
|
35
37
|
average(): EnsureType<TInput, number>;
|
|
36
|
-
median(
|
|
38
|
+
median(): EnsureType<TInput, number>;
|
|
37
39
|
min(): EnsureType<TInput, number>;
|
|
38
40
|
max(): EnsureType<TInput, number>;
|
|
39
|
-
percentage(predicateFn: Predicate<TInput, ICollection<TInput
|
|
40
|
-
some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
41
|
-
every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
42
|
-
take(limit: number
|
|
43
|
-
takeUntil(predicateFn: Predicate<TInput, ICollection<TInput
|
|
44
|
-
takeWhile(predicateFn: Predicate<TInput, ICollection<TInput
|
|
45
|
-
skip(offset: number
|
|
46
|
-
skipUntil(predicateFn: Predicate<TInput, ICollection<TInput
|
|
47
|
-
skipWhile<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
41
|
+
percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
42
|
+
some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
|
|
43
|
+
every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
|
|
44
|
+
take(limit: number): ICollection<TInput>;
|
|
45
|
+
takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
46
|
+
takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
47
|
+
skip(offset: number): ICollection<TInput>;
|
|
48
|
+
skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
49
|
+
skipWhile<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
48
50
|
when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
|
|
49
51
|
whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
|
|
50
52
|
whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
|
|
@@ -52,47 +54,47 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
|
52
54
|
pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
|
|
53
55
|
tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
|
|
54
56
|
chunk(chunkSize: number): ICollection<ICollection<TInput>>;
|
|
55
|
-
chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput
|
|
56
|
-
split(chunkAmount: number
|
|
57
|
-
partition(predicateFn: Predicate<TInput, ICollection<TInput
|
|
58
|
-
sliding(
|
|
59
|
-
groupBy<TOutput = TInput>(
|
|
60
|
-
countBy<TOutput = TInput>(
|
|
61
|
-
unique<TOutput>(
|
|
57
|
+
chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
|
|
58
|
+
split(chunkAmount: number): ICollection<ICollection<TInput>>;
|
|
59
|
+
partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
|
|
60
|
+
sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
|
|
61
|
+
groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
|
|
62
|
+
countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
|
|
63
|
+
unique<TOutput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
62
64
|
difference<TOutput = TInput>(iterable: Iterable<TInput>, mapFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
63
65
|
repeat(amount: number): ICollection<TInput>;
|
|
64
66
|
padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
|
|
65
67
|
padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
|
|
66
|
-
slice(
|
|
68
|
+
slice(start?: number, end?: number): ICollection<TInput>;
|
|
67
69
|
prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
68
70
|
append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
69
|
-
insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended
|
|
70
|
-
insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended
|
|
71
|
-
crossJoin<TExtended
|
|
71
|
+
insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
72
|
+
insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
73
|
+
crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
|
|
72
74
|
zip<TExtended>(iterable: Iterable<TExtended>): ICollection<RecordItem<TInput, TExtended>>;
|
|
73
75
|
sort(comparator?: Comparator<TInput>): ICollection<TInput>;
|
|
74
|
-
reverse(
|
|
75
|
-
shuffle(): ICollection<TInput>;
|
|
76
|
-
first<TOutput extends TInput>(
|
|
77
|
-
firstOr<TOutput extends TInput, TExtended = TInput>(
|
|
78
|
-
firstOrFail<TOutput extends TInput>(
|
|
79
|
-
last<TOutput extends TInput>(
|
|
80
|
-
lastOr<TOutput extends TInput, TExtended = TInput>(
|
|
81
|
-
lastOrFail<TOutput extends TInput>(
|
|
82
|
-
before(predicateFn: Predicate<TInput, ICollection<TInput
|
|
83
|
-
beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput
|
|
84
|
-
beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput
|
|
85
|
-
after(predicateFn: Predicate<TInput, ICollection<TInput
|
|
86
|
-
afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput
|
|
87
|
-
afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput
|
|
88
|
-
sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
76
|
+
reverse(chunkSize?: number): ICollection<TInput>;
|
|
77
|
+
shuffle(mathRandom?: () => number): ICollection<TInput>;
|
|
78
|
+
first<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
|
|
79
|
+
firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
|
|
80
|
+
firstOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
|
|
81
|
+
last<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
|
|
82
|
+
lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
|
|
83
|
+
lastOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
|
|
84
|
+
before(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
|
|
85
|
+
beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
|
|
86
|
+
beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
|
|
87
|
+
after(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
|
|
88
|
+
afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
|
|
89
|
+
afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
|
|
90
|
+
sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
|
|
89
91
|
nth(step: number): ICollection<TInput>;
|
|
90
|
-
count(predicateFn: Predicate<TInput, ICollection<TInput
|
|
91
|
-
size(
|
|
92
|
+
count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
93
|
+
size(): number;
|
|
92
94
|
isEmpty(): boolean;
|
|
93
95
|
isNotEmpty(): boolean;
|
|
94
|
-
searchFirst(predicateFn: Predicate<TInput, ICollection<TInput
|
|
95
|
-
searchLast(predicateFn: Predicate<TInput, ICollection<TInput
|
|
96
|
-
forEach(callback: ForEach<TInput, ICollection<TInput
|
|
96
|
+
searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
97
|
+
searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
98
|
+
forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
|
|
97
99
|
toArray(): TInput[];
|
|
98
100
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Collections
|
|
3
3
|
*/
|
|
4
|
-
import { type Collapse, type Comparator, type Predicate, type
|
|
5
|
-
import { EnsureType } from "../../_shared/types";
|
|
4
|
+
import { type Collapse, type Comparator, type Predicate, type ICollection, type Map, type Modifier, type Tap, type Transform, type ChangendItem, type Reduce, type ForEach, type CrossJoinResult } from "../../contracts/collection/_module";
|
|
5
|
+
import { type EnsureType, type Lazyable } from "../../_shared/types";
|
|
6
|
+
import { type RecordItem } from "../../_shared/types";
|
|
6
7
|
/**
|
|
7
|
-
* All methods in <i>ListCollection</i> are executed eagerly.
|
|
8
|
+
* All methods in <i>ListCollection</i> are executed eagerly.
|
|
8
9
|
* @group Adapters
|
|
9
10
|
*/
|
|
10
11
|
export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
@@ -15,32 +16,34 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
|
15
16
|
constructor(iterable?: Iterable<TInput>);
|
|
16
17
|
[Symbol.iterator](): Iterator<TInput>;
|
|
17
18
|
toIterator(): Iterator<TInput, void>;
|
|
18
|
-
entries(
|
|
19
|
-
keys(
|
|
19
|
+
entries(): ICollection<RecordItem<number, TInput>>;
|
|
20
|
+
keys(): ICollection<number>;
|
|
20
21
|
values(): ICollection<TInput>;
|
|
21
|
-
filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
22
|
-
reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
23
|
-
map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput
|
|
24
|
-
reduce
|
|
25
|
-
|
|
22
|
+
filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
|
|
23
|
+
reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
|
|
24
|
+
map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
|
|
25
|
+
reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>): TInput;
|
|
26
|
+
reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>, initialValue: TInput): TInput;
|
|
27
|
+
reduce<TOutput>(reduceFn: Reduce<TInput, ICollection<TInput>, TOutput>, initialValue: TOutput): TOutput;
|
|
28
|
+
join(separator?: string): EnsureType<TInput, string>;
|
|
26
29
|
collapse(): ICollection<Collapse<TInput>>;
|
|
27
|
-
flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput
|
|
28
|
-
|
|
29
|
-
page(
|
|
30
|
+
flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput>>): ICollection<TOutput>;
|
|
31
|
+
change<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<ChangendItem<TInput, TFilterOutput, TMapOutput>>;
|
|
32
|
+
page(page: number, pageSize: number): ICollection<TInput>;
|
|
30
33
|
sum(): EnsureType<TInput, number>;
|
|
31
34
|
average(): EnsureType<TInput, number>;
|
|
32
|
-
median(
|
|
35
|
+
median(): EnsureType<TInput, number>;
|
|
33
36
|
min(): EnsureType<TInput, number>;
|
|
34
37
|
max(): EnsureType<TInput, number>;
|
|
35
|
-
percentage(predicateFn: Predicate<TInput, ICollection<TInput
|
|
36
|
-
some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
37
|
-
every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
38
|
-
take(limit: number
|
|
39
|
-
takeUntil(predicateFn: Predicate<TInput, ICollection<TInput
|
|
40
|
-
takeWhile(predicateFn: Predicate<TInput, ICollection<TInput
|
|
41
|
-
skip(offset: number
|
|
42
|
-
skipUntil(predicateFn: Predicate<TInput, ICollection<TInput
|
|
43
|
-
skipWhile(predicateFn: Predicate<TInput, ICollection<TInput
|
|
38
|
+
percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
39
|
+
some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
|
|
40
|
+
every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
|
|
41
|
+
take(limit: number): ICollection<TInput>;
|
|
42
|
+
takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
43
|
+
takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
44
|
+
skip(offset: number): ICollection<TInput>;
|
|
45
|
+
skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
46
|
+
skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
|
|
44
47
|
when<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
|
|
45
48
|
whenEmpty<TExtended = TInput>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
|
|
46
49
|
whenNot<TExtended = TInput>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
|
|
@@ -48,47 +51,47 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
|
48
51
|
pipe<TOutput = TInput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
|
|
49
52
|
tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
|
|
50
53
|
chunk(chunkSize: number): ICollection<ICollection<TInput>>;
|
|
51
|
-
chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput
|
|
52
|
-
split(chunkAmount: number
|
|
53
|
-
partition(predicateFn: Predicate<TInput, ICollection<TInput
|
|
54
|
-
sliding(
|
|
55
|
-
groupBy<TOutput = TInput>(
|
|
56
|
-
countBy<TOutput = TInput>(
|
|
57
|
-
unique<TOutput = TInput>(
|
|
54
|
+
chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
|
|
55
|
+
split(chunkAmount: number): ICollection<ICollection<TInput>>;
|
|
56
|
+
partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
|
|
57
|
+
sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
|
|
58
|
+
groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
|
|
59
|
+
countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
|
|
60
|
+
unique<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
58
61
|
difference<TOutput = TInput>(iterable: Iterable<TInput>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
59
62
|
repeat(amount: number): ICollection<TInput>;
|
|
60
63
|
padStart<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
|
|
61
64
|
padEnd<TExtended = TInput>(maxLength: number, fillItems: Iterable<TExtended>): ICollection<TInput | TExtended>;
|
|
62
|
-
slice(
|
|
65
|
+
slice(start?: number, end?: number): ICollection<TInput>;
|
|
63
66
|
prepend<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
64
67
|
append<TExtended = TInput>(iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
65
|
-
insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended
|
|
66
|
-
insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended
|
|
67
|
-
crossJoin<TExtended
|
|
68
|
+
insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
69
|
+
insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
70
|
+
crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
|
|
68
71
|
zip<TExtended>(iterable: Iterable<TExtended>): ICollection<RecordItem<TInput, TExtended>>;
|
|
69
72
|
sort(comparator?: Comparator<TInput>): ICollection<TInput>;
|
|
70
|
-
reverse(
|
|
71
|
-
shuffle(): ICollection<TInput>;
|
|
72
|
-
first<TOutput extends TInput>(
|
|
73
|
-
firstOr<TOutput extends TInput, TExtended = TInput>(
|
|
74
|
-
firstOrFail<TOutput extends TInput>(
|
|
75
|
-
last<TOutput extends TInput>(
|
|
76
|
-
lastOr<TOutput extends TInput, TExtended = TInput>(
|
|
77
|
-
lastOrFail<TOutput extends TInput>(
|
|
78
|
-
before(predicateFn: Predicate<TInput, ICollection<TInput
|
|
79
|
-
beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput
|
|
80
|
-
beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput
|
|
81
|
-
after(predicateFn: Predicate<TInput, ICollection<TInput
|
|
82
|
-
afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput
|
|
83
|
-
afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput
|
|
84
|
-
sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput
|
|
73
|
+
reverse(_chunkSize?: number): ICollection<TInput>;
|
|
74
|
+
shuffle(mathRandom?: () => number): ICollection<TInput>;
|
|
75
|
+
first<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
|
|
76
|
+
firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
|
|
77
|
+
firstOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
|
|
78
|
+
last<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
|
|
79
|
+
lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
|
|
80
|
+
lastOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
|
|
81
|
+
before(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
|
|
82
|
+
beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
|
|
83
|
+
beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
|
|
84
|
+
after(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
|
|
85
|
+
afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
|
|
86
|
+
afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
|
|
87
|
+
sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
|
|
85
88
|
nth(step: number): ICollection<TInput>;
|
|
86
|
-
count(predicateFn: Predicate<TInput, ICollection<TInput
|
|
87
|
-
size(
|
|
89
|
+
count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
90
|
+
size(): number;
|
|
88
91
|
isEmpty(): boolean;
|
|
89
92
|
isNotEmpty(): boolean;
|
|
90
|
-
searchFirst(predicateFn: Predicate<TInput, ICollection<TInput
|
|
91
|
-
searchLast(predicateFn: Predicate<TInput, ICollection<TInput
|
|
92
|
-
forEach(callback: ForEach<TInput, ICollection<TInput
|
|
93
|
+
searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
94
|
+
searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
95
|
+
forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
|
|
93
96
|
toArray(): TInput[];
|
|
94
97
|
}
|
|
@@ -16,147 +16,42 @@ export declare class UnexpectedCollectionError extends CollectionError {
|
|
|
16
16
|
/**
|
|
17
17
|
* @group Errors
|
|
18
18
|
*/
|
|
19
|
-
export declare class
|
|
19
|
+
export declare class ItemNotFoundCollectionError extends CollectionError {
|
|
20
20
|
constructor(message: string, cause?: unknown);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* @group Errors
|
|
24
24
|
*/
|
|
25
|
-
export declare class
|
|
25
|
+
export declare class MultipleItemsFoundCollectionError extends CollectionError {
|
|
26
26
|
constructor(message: string, cause?: unknown);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* @group Errors
|
|
30
30
|
*/
|
|
31
|
-
export declare class
|
|
31
|
+
export declare class TypeCollectionError extends CollectionError {
|
|
32
32
|
constructor(message: string, cause?: unknown);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @defaultValue false
|
|
43
|
-
*/
|
|
44
|
-
throwOnIndexOverflow?: boolean;
|
|
45
|
-
};
|
|
46
|
-
export type PageSettings = {
|
|
47
|
-
page: number;
|
|
48
|
-
pageSize: number;
|
|
49
|
-
/**
|
|
50
|
-
* @defaultValue false
|
|
51
|
-
*/
|
|
52
|
-
throwOnIndexOverflow?: boolean;
|
|
53
|
-
};
|
|
54
|
-
export type JoinSettings = {
|
|
55
|
-
/**
|
|
56
|
-
* @defaultValue ","
|
|
57
|
-
*/
|
|
58
|
-
seperator?: string;
|
|
59
|
-
/**
|
|
60
|
-
* @defaultValue false
|
|
61
|
-
*/
|
|
62
|
-
throwOnIndexOverflow?: boolean;
|
|
63
|
-
};
|
|
64
|
-
export type SliceSettings = {
|
|
65
|
-
/**
|
|
66
|
-
* @defaultValue 0
|
|
67
|
-
*/
|
|
68
|
-
start?: number;
|
|
69
|
-
/**
|
|
70
|
-
* @defaultValue the size of the collection
|
|
71
|
-
*/
|
|
72
|
-
end?: number;
|
|
73
|
-
/**
|
|
74
|
-
* @defaultValue false
|
|
75
|
-
*/
|
|
76
|
-
throwOnIndexOverflow?: boolean;
|
|
77
|
-
};
|
|
78
|
-
export type SlidingSettings = {
|
|
79
|
-
chunkSize: number;
|
|
80
|
-
/**
|
|
81
|
-
* @defaultValue SlidingSettings.chunkSize - 1
|
|
82
|
-
*/
|
|
83
|
-
step?: number;
|
|
84
|
-
/**
|
|
85
|
-
* @defaultValue false
|
|
86
|
-
*/
|
|
87
|
-
throwOnIndexOverflow?: boolean;
|
|
88
|
-
};
|
|
34
|
+
/**
|
|
35
|
+
* @group Errors
|
|
36
|
+
*/
|
|
37
|
+
export declare class EmptyCollectionError extends CollectionError {
|
|
38
|
+
constructor(message: string, cause?: unknown);
|
|
39
|
+
}
|
|
40
|
+
export type ChangendItem<TInput, TFilterOutput, TMapOutput> = TInput | TFilterOutput | TMapOutput;
|
|
89
41
|
export type Comparator<TItem> = (itemA: TItem, itemB: TItem) => number;
|
|
90
42
|
export type Predicate_<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => boolean;
|
|
91
43
|
export type PredicateGuard<TInput, TCollection, TOutput extends TInput = TInput> = (item: TInput, index: number, collection: TCollection) => item is TOutput;
|
|
92
44
|
export type Predicate<TInput, TCollection, TOutput extends TInput = TInput> = Predicate_<TInput, TCollection> | PredicateGuard<TInput, TCollection, TOutput>;
|
|
93
45
|
export type Reduce<TInput, TCollection, TOutput> = (output: TOutput, item: TInput, index: number, collection: TCollection) => TOutput;
|
|
94
|
-
export type ReduceSettings<TInput, TCollection, TOutput> = {
|
|
95
|
-
reduceFn: Reduce<TInput, TCollection, TOutput>;
|
|
96
|
-
initialValue?: TOutput;
|
|
97
|
-
/**
|
|
98
|
-
* @defaultValue false
|
|
99
|
-
*/
|
|
100
|
-
throwOnIndexOverflow?: boolean;
|
|
101
|
-
};
|
|
102
46
|
export type Map<TInput, TCollection, TOutput> = (item: TInput, index: number, collection: TCollection) => TOutput;
|
|
103
47
|
export type ForEach<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => void;
|
|
104
48
|
export type Modifier<TInput, TOutput> = (collection: TInput) => TOutput;
|
|
105
49
|
export type Tap<TCollection> = (collection: TCollection) => void;
|
|
106
50
|
export type Transform<TInput, TOutput> = (value: TInput) => TOutput;
|
|
107
|
-
export type Lazyable<TValue> = TValue | (() => TValue);
|
|
108
|
-
export type FindSettings<TInput, TCollection, TOutput extends TInput> = {
|
|
109
|
-
predicateFn?: Predicate<TInput, TCollection, TOutput>;
|
|
110
|
-
/**
|
|
111
|
-
* @defaultValue false
|
|
112
|
-
*/
|
|
113
|
-
throwOnIndexOverflow?: boolean;
|
|
114
|
-
};
|
|
115
|
-
export type FindOrSettings<TInput, TCollection, TOutput extends TInput, TDefault> = FindSettings<TInput, TCollection, TOutput> & {
|
|
116
|
-
defaultValue: Lazyable<TDefault>;
|
|
117
|
-
};
|
|
118
|
-
export type GroupBySettings<TInput, TCollection, TOutput> = {
|
|
119
|
-
/**
|
|
120
|
-
* @defaultValue (item: TInput) => item
|
|
121
|
-
*/
|
|
122
|
-
selectFn?: Map<TInput, TCollection, TOutput>;
|
|
123
|
-
/**
|
|
124
|
-
* @defaultValue false
|
|
125
|
-
*/
|
|
126
|
-
throwOnIndexOverflow?: boolean;
|
|
127
|
-
};
|
|
128
|
-
export type CountBySettings<TInput, TCollection, TOutput> = {
|
|
129
|
-
/**
|
|
130
|
-
* @defaultValue (item: TInput) => item
|
|
131
|
-
*/
|
|
132
|
-
selectFn?: Map<TInput, TCollection, TOutput>;
|
|
133
|
-
/**
|
|
134
|
-
* @defaultValue false
|
|
135
|
-
*/
|
|
136
|
-
throwOnIndexOverflow?: boolean;
|
|
137
|
-
};
|
|
138
|
-
export type UniqueSettings<TInput, TCollection, TOutput> = {
|
|
139
|
-
/**
|
|
140
|
-
* @defaultValue (item: TInput) => item
|
|
141
|
-
*/
|
|
142
|
-
selectFn?: Map<TInput, TCollection, TOutput>;
|
|
143
|
-
/**
|
|
144
|
-
* @defaultValue false
|
|
145
|
-
*/
|
|
146
|
-
throwOnIndexOverflow?: boolean;
|
|
147
|
-
};
|
|
148
51
|
export type AsyncPredicate_<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => Promise<boolean>;
|
|
149
52
|
export type AsyncPredicate<TInput, TCollection, TOutput extends TInput = TInput> = AsyncPredicate_<TInput, TCollection> | Predicate<TInput, TCollection, TOutput>;
|
|
150
53
|
export type AsyncReduce_<TInput, TCollection, TOutput> = (output: TOutput, item: TInput, index: number, collection: TCollection) => Promise<TOutput>;
|
|
151
54
|
export type AsyncReduce<TInput, TCollection, TOutput> = AsyncReduce_<TInput, TCollection, TOutput> | Reduce<TInput, TCollection, TOutput>;
|
|
152
|
-
export type AsyncReduceSettings<TInput, TCollection, TOutput> = {
|
|
153
|
-
reduceFn: AsyncReduce<TInput, TCollection, TOutput>;
|
|
154
|
-
initialValue?: TOutput;
|
|
155
|
-
/**
|
|
156
|
-
* @defaultValue false
|
|
157
|
-
*/
|
|
158
|
-
throwOnIndexOverflow?: boolean;
|
|
159
|
-
};
|
|
160
55
|
export type AsyncMap_<TInput, TCollection, TOutput> = (item: TInput, index: number, collection: TCollection) => Promise<TOutput>;
|
|
161
56
|
export type AsyncMap<TInput, TCollection, TOutput> = AsyncMap_<TInput, TCollection, TOutput> | Map<TInput, TCollection, TOutput>;
|
|
162
57
|
export type AsyncForEach_<TInput, TCollection> = (item: TInput, index: number, collection: TCollection) => Promise<void>;
|
|
@@ -167,46 +62,7 @@ export type AsyncTap_<TCollection> = (collection: TCollection) => Promise<void>;
|
|
|
167
62
|
export type AsyncTap<TCollection> = Tap<TCollection> | AsyncTap_<TCollection>;
|
|
168
63
|
export type AsyncTransform_<TInput, TOutput> = (value: TInput) => Promise<TOutput>;
|
|
169
64
|
export type AsyncTransform<TInput, TOutput> = Transform<TInput, TOutput> | AsyncTransform_<TInput, TOutput>;
|
|
170
|
-
export type
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @defaultValue false
|
|
176
|
-
*/
|
|
177
|
-
throwOnIndexOverflow?: boolean;
|
|
178
|
-
};
|
|
179
|
-
export type AsyncFindOrSettings<TInput, TCollection, TOutput extends TInput, TDefault> = AsyncFindSettings<TInput, TCollection, TOutput> & {
|
|
180
|
-
defaultValue: AsyncLazyable<TDefault>;
|
|
181
|
-
};
|
|
182
|
-
export type AsyncGroupBySettings<TInput, TCollection, TOutput> = {
|
|
183
|
-
/**
|
|
184
|
-
* @defaultValue (item: TInput) => item
|
|
185
|
-
*/
|
|
186
|
-
selectFn?: AsyncMap<TInput, TCollection, TOutput>;
|
|
187
|
-
chunkSize?: number;
|
|
188
|
-
/**
|
|
189
|
-
* @defaultValue false
|
|
190
|
-
*/
|
|
191
|
-
throwOnIndexOverflow?: boolean;
|
|
192
|
-
};
|
|
193
|
-
export type AsyncCountBySettings<TInput, TCollection, TOutput> = {
|
|
194
|
-
/**
|
|
195
|
-
* @defaultValue (item: TInput) => item
|
|
196
|
-
*/
|
|
197
|
-
selectFn?: AsyncMap<TInput, TCollection, TOutput>;
|
|
198
|
-
/**
|
|
199
|
-
* @defaultValue false
|
|
200
|
-
*/
|
|
201
|
-
throwOnIndexOverflow?: boolean;
|
|
202
|
-
};
|
|
203
|
-
export type AsyncUniqueSettings<TInput, TCollection, TOutput> = {
|
|
204
|
-
/**
|
|
205
|
-
* @defaultValue (item: TInput) => item
|
|
206
|
-
*/
|
|
207
|
-
selectFn?: AsyncMap<TInput, TCollection, TOutput>;
|
|
208
|
-
/**
|
|
209
|
-
* @defaultValue false
|
|
210
|
-
*/
|
|
211
|
-
throwOnIndexOverflow?: boolean;
|
|
212
|
-
};
|
|
65
|
+
export type CrossJoinResult<TInput, TExtended> = TInput extends [
|
|
66
|
+
infer R,
|
|
67
|
+
...infer L
|
|
68
|
+
] ? [R, ...L, TExtended] : [TInput, TExtended];
|