@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
package/README.md
CHANGED
|
@@ -28,4 +28,4 @@ In the future the following components will be added:
|
|
|
28
28
|
|
|
29
29
|
This library is heavily inspired laravel but built in modular way where you can choose which part to use.
|
|
30
30
|
|
|
31
|
-
## Visit the [docs](https://yousif-khalil-abdulkarim.github.io/daiso-core/
|
|
31
|
+
## Visit the [docs](https://yousif-khalil-abdulkarim.github.io/daiso-core/) for more information!
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.simplifyLazyable = simplifyLazyable;
|
|
4
|
+
exports.simplifyAsyncLazyable = simplifyAsyncLazyable;
|
|
5
|
+
function simplifyLazyable(lazyable) {
|
|
6
|
+
if (typeof lazyable === "function") {
|
|
7
|
+
const getValue = lazyable;
|
|
8
|
+
return getValue();
|
|
9
|
+
}
|
|
10
|
+
return lazyable;
|
|
11
|
+
}
|
|
12
|
+
async function simplifyAsyncLazyable(lazyable) {
|
|
13
|
+
if (typeof lazyable === "function") {
|
|
14
|
+
const getValue = lazyable;
|
|
15
|
+
return getValue();
|
|
16
|
+
}
|
|
17
|
+
return lazyable;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/_shared/utilities.ts"],"names":[],"mappings":";;AAEA,4CAMC;AACD,sDAQC;AAfD,SAAgB,gBAAgB,CAAS,QAA0B;IAC/D,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,QAAwB,CAAC;QAC1C,OAAO,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AACM,KAAK,UAAU,qBAAqB,CACvC,QAA+B;IAE/B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,QAAiC,CAAC;QACnD,OAAO,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -20,9 +20,11 @@ function range(from, to) {
|
|
|
20
20
|
return new RangeIterable(from, to);
|
|
21
21
|
}
|
|
22
22
|
function isIterable(value) {
|
|
23
|
-
return typeof value
|
|
23
|
+
return (typeof value === "object" &&
|
|
24
|
+
typeof value[Symbol.iterator] === "function");
|
|
24
25
|
}
|
|
25
26
|
function isAsyncIterable(value) {
|
|
26
|
-
return typeof value
|
|
27
|
+
return (typeof value === "object" &&
|
|
28
|
+
typeof value[Symbol.asyncIterator] === "function");
|
|
27
29
|
}
|
|
28
30
|
//# sourceMappingURL=_shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../../src/collection/_shared.ts"],"names":[],"mappings":";;AA2BA,sBAEC;AAMD,
|
|
1
|
+
{"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../../src/collection/_shared.ts"],"names":[],"mappings":";;AA2BA,sBAEC;AAMD,gCASC;AAMD,0CASC;AApDD,MAAM,aAAa;IAEH;IACA;IAFZ,YACY,IAAY,EACZ,EAAU;QADV,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;IACnB,CAAC;IAEJ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,CAAC,CAAC;QACZ,CAAC;IACL,CAAC;CACJ;AASD,SAAgB,KAAK,CAAC,IAAY,EAAE,EAAU;IAC1C,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC;AAMD,SAAgB,UAAU,CAEtB,KAAU;IAEV,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QAEzB,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAC/C,CAAC;AACN,CAAC;AAMD,SAAgB,eAAe,CAE3B,KAAU;IAEV,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QAEzB,OAAO,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,CACpD,CAAC;AACN,CAAC"}
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("../../../collection/async-iterable-collection/_shared/async-chunk-iterable"), exports);
|
|
18
|
-
__exportStar(require("../../../collection/async-iterable-collection/_shared/async-chunk-
|
|
18
|
+
__exportStar(require("../../../collection/async-iterable-collection/_shared/async-chunk-while-iterable"), exports);
|
|
19
19
|
__exportStar(require("../../../collection/async-iterable-collection/_shared/async-collapse-iterable"), exports);
|
|
20
20
|
__exportStar(require("../../../collection/async-iterable-collection/_shared/async-count-by-iterable"), exports);
|
|
21
21
|
__exportStar(require("../../../collection/async-iterable-collection/_shared/async-cross-join-iterable"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/_module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sGAAoF;AACpF,
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/_module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sGAAoF;AACpF,4GAA0F;AAC1F,yGAAuF;AACvF,yGAAuF;AACvF,2GAAyF;AACzF,wGAAsF;AACtF,uGAAqF;AACrF,yGAAuF;AACvF,yGAAuF;AACvF,6GAA2F;AAC3F,8GAA4F;AAC5F,oGAAkF;AAClF,sGAAoF;AACpF,wGAAsF;AACtF,0GAAwF;AACxF,wGAAsF;AACtF,uGAAqF;AACrF,wGAAsF;AACtF,wGAAsF;AACtF,qGAAmF;AACnF,2GAAyF;AACzF,sGAAoF;AACpF,wGAAsF;AACtF,qGAAmF;AACnF,sGAAoF;AACpF,qGAAmF;AACnF,2GAAyF;AACzF,oGAAkF;AAClF,uGAAqF;AACrF,uGAAqF;AACrF,qGAAmF;AACnF,oGAAkF;AAClF,wGAAsF;AACtF,sGAAoF;AACpF,sGAAoF"}
|
|
@@ -13,26 +13,27 @@ class AsyncChunkIterable {
|
|
|
13
13
|
}
|
|
14
14
|
async *[Symbol.asyncIterator]() {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
const array = [];
|
|
17
|
+
let currentChunkSize = 0;
|
|
18
|
+
let isFirstIteration = true;
|
|
17
19
|
for await (const item of this.collection) {
|
|
18
20
|
currentChunkSize %= this.chunkSize;
|
|
19
21
|
const isFilled = currentChunkSize === 0;
|
|
20
22
|
if (!isFirstIteration && isFilled) {
|
|
21
|
-
yield
|
|
22
|
-
|
|
23
|
+
yield this.makeCollection(array);
|
|
24
|
+
array.length = 0;
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
array.push(item);
|
|
25
27
|
currentChunkSize++;
|
|
26
28
|
isFirstIteration = false;
|
|
27
29
|
}
|
|
28
30
|
const hasRest = currentChunkSize !== 0;
|
|
29
31
|
if (hasRest) {
|
|
30
|
-
yield
|
|
32
|
+
yield this.makeCollection(array);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
catch (error) {
|
|
34
|
-
if (error instanceof _module_1.CollectionError
|
|
35
|
-
error instanceof TypeError) {
|
|
36
|
+
if (error instanceof _module_1.CollectionError) {
|
|
36
37
|
throw error;
|
|
37
38
|
}
|
|
38
39
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-chunk-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-chunk-iterable.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"async-chunk-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-chunk-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAIwC;AAMxC,MAAa,kBAAkB;IAIf;IACA;IACA;IAHZ,YACY,UAAoC,EACpC,SAAiB,EACjB,cAEqB;QAJrB,eAAU,GAAV,UAAU,CAA0B;QACpC,cAAS,GAAT,SAAS,CAAQ;QACjB,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,MAAM,KAAK,GAAa,EAAE,CAAC;YAC3B,IAAI,gBAAgB,GAAG,CAAC,CAAC;YACzB,IAAI,gBAAgB,GAAG,IAAI,CAAC;YAC5B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACvC,gBAAgB,IAAI,IAAI,CAAC,SAAS,CAAC;gBACnC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,CAAC,CAAC;gBACxC,IAAI,CAAC,gBAAgB,IAAI,QAAQ,EAAE,CAAC;oBAChC,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBACjC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBACrB,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,gBAAgB,EAAE,CAAC;gBACnB,gBAAgB,GAAG,KAAK,CAAC;YAC7B,CAAC;YACD,MAAM,OAAO,GAAG,gBAAgB,KAAK,CAAC,CAAC;YACvC,IAAI,OAAO,EAAE,CAAC;gBACV,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACrC,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAzCD,gDAyCC"}
|
|
@@ -4,35 +4,33 @@ exports.AsyncChunkWhileIterable = void 0;
|
|
|
4
4
|
const _module_1 = require("../../../contracts/collection/_module");
|
|
5
5
|
class AsyncChunkWhileIterable {
|
|
6
6
|
collection;
|
|
7
|
-
|
|
8
|
-
throwOnIndexOverflow;
|
|
7
|
+
predicateFn;
|
|
9
8
|
makeCollection;
|
|
10
|
-
constructor(collection,
|
|
9
|
+
constructor(collection, predicateFn, makeCollection) {
|
|
11
10
|
this.collection = collection;
|
|
12
|
-
this.
|
|
13
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
11
|
+
this.predicateFn = predicateFn;
|
|
14
12
|
this.makeCollection = makeCollection;
|
|
15
13
|
}
|
|
16
14
|
async *[Symbol.asyncIterator]() {
|
|
17
15
|
try {
|
|
18
|
-
|
|
19
|
-
for await (const [index, item] of this.collection.entries(
|
|
16
|
+
const array = [];
|
|
17
|
+
for await (const [index, item] of this.collection.entries()) {
|
|
20
18
|
if (index === 0) {
|
|
21
|
-
|
|
19
|
+
array.push(item);
|
|
22
20
|
}
|
|
23
|
-
else if (await this.
|
|
24
|
-
|
|
21
|
+
else if (await this.predicateFn(item, index, this.makeCollection(array))) {
|
|
22
|
+
array.push(item);
|
|
25
23
|
}
|
|
26
24
|
else {
|
|
27
|
-
yield
|
|
28
|
-
|
|
25
|
+
yield this.makeCollection(array);
|
|
26
|
+
array.length = 0;
|
|
27
|
+
array.push(item);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
yield
|
|
30
|
+
yield this.makeCollection(array);
|
|
32
31
|
}
|
|
33
32
|
catch (error) {
|
|
34
|
-
if (error instanceof _module_1.CollectionError
|
|
35
|
-
error instanceof TypeError) {
|
|
33
|
+
if (error instanceof _module_1.CollectionError) {
|
|
36
34
|
throw error;
|
|
37
35
|
}
|
|
38
36
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
|
@@ -40,4 +38,4 @@ class AsyncChunkWhileIterable {
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
exports.AsyncChunkWhileIterable = AsyncChunkWhileIterable;
|
|
43
|
-
//# sourceMappingURL=async-chunk-
|
|
41
|
+
//# sourceMappingURL=async-chunk-while-iterable.js.map
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-chunk-while-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-chunk-while-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAMxC,MAAa,uBAAuB;IAIpB;IACA;IAEA;IAJZ,YACY,UAAoC,EACpC,WAA6D,EAE7D,cAEqB;QALrB,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAAkD;QAE7D,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,MAAM,KAAK,GAAa,EAAE,CAAC;YAC3B,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC1D,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;oBACd,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrB,CAAC;qBAAM,IACH,MAAM,IAAI,CAAC,WAAW,CAClB,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAC7B,EACH,CAAC;oBACC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrB,CAAC;qBAAM,CAAC;oBACJ,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBACjC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;oBACjB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrB,CAAC;YACL,CAAC;YACD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AA3CD,0DA2CC"}
|
|
@@ -20,8 +20,7 @@ class AsyncCollapseIterable {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
catch (error) {
|
|
23
|
-
if (error instanceof _module_1.CollectionError
|
|
24
|
-
error instanceof TypeError) {
|
|
23
|
+
if (error instanceof _module_1.CollectionError) {
|
|
25
24
|
throw error;
|
|
26
25
|
}
|
|
27
26
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-collapse-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-collapse-iterable.ts"],"names":[],"mappings":";;;AAAA,kDAAmE;AACnE,4DAKwC;AAKxC,MAAa,qBAAqB;IAGV;IAApB,YAAoB,UAAoC;QAApC,eAAU,GAAV,UAAU,CAA0B;IAAG,CAAC;IAE5D,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACvC,IAAI,IAAA,oBAAU,EAAS,IAAI,CAAC,IAAI,IAAA,yBAAe,EAAS,IAAI,CAAC,EAAE,CAAC;oBAE5D,KAAK,CAAC,CAAC,IAAW,CAAC;gBACvB,CAAC;qBAAM,CAAC;oBACJ,MAAM,IAA6B,CAAC;gBACxC,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,
|
|
1
|
+
{"version":3,"file":"async-collapse-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-collapse-iterable.ts"],"names":[],"mappings":";;;AAAA,kDAAmE;AACnE,4DAKwC;AAKxC,MAAa,qBAAqB;IAGV;IAApB,YAAoB,UAAoC;QAApC,eAAU,GAAV,UAAU,CAA0B;IAAG,CAAC;IAE5D,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACvC,IAAI,IAAA,oBAAU,EAAS,IAAI,CAAC,IAAI,IAAA,yBAAe,EAAS,IAAI,CAAC,EAAE,CAAC;oBAE5D,KAAK,CAAC,CAAC,IAAW,CAAC;gBACvB,CAAC;qBAAM,CAAC;oBACJ,MAAM,IAA6B,CAAC;gBACxC,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAzBD,sDAyBC"}
|
|
@@ -5,16 +5,14 @@ const _module_1 = require("../../../contracts/collection/_module");
|
|
|
5
5
|
class AsyncCountByIterable {
|
|
6
6
|
collection;
|
|
7
7
|
callback;
|
|
8
|
-
|
|
9
|
-
constructor(collection, callback = (item) => item, throwOnIndexOverflow) {
|
|
8
|
+
constructor(collection, callback = (item) => item) {
|
|
10
9
|
this.collection = collection;
|
|
11
10
|
this.callback = callback;
|
|
12
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
13
11
|
}
|
|
14
12
|
async *[Symbol.asyncIterator]() {
|
|
15
13
|
try {
|
|
16
14
|
const map = new Map();
|
|
17
|
-
for await (const [index, item] of this.collection.entries(
|
|
15
|
+
for await (const [index, item] of this.collection.entries()) {
|
|
18
16
|
const key = await this.callback(item, index, this.collection);
|
|
19
17
|
if (!map.has(key)) {
|
|
20
18
|
map.set(key, 0);
|
|
@@ -27,8 +25,7 @@ class AsyncCountByIterable {
|
|
|
27
25
|
yield* map;
|
|
28
26
|
}
|
|
29
27
|
catch (error) {
|
|
30
|
-
if (error instanceof _module_1.CollectionError
|
|
31
|
-
error instanceof TypeError) {
|
|
28
|
+
if (error instanceof _module_1.CollectionError) {
|
|
32
29
|
throw error;
|
|
33
30
|
}
|
|
34
31
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-count-by-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-count-by-iterable.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"async-count-by-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-count-by-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,oBAAoB;IAIjB;IACA;IAFZ,YACY,UAAoC,EACpC,WAIJ,CAAC,IAAI,EAAE,EAAE,CAET,IAAW;QAPP,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAMD;IAChB,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAGzB,IAAI,CAAC;YACD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;YACvC,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC1D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC9D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBAChB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBACpB,CAAC;gBACD,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC7B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;oBACxB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;gBAC9B,CAAC;YACL,CAAC;YACD,KAAK,CAAC,CAAC,GAAG,CAAC;QACf,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAxCD,oDAwCC"}
|
|
@@ -2,37 +2,38 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AsyncCrossJoinIterable = void 0;
|
|
4
4
|
const _module_1 = require("../../../contracts/collection/_module");
|
|
5
|
+
const _module_2 = require("../../../collection/_module");
|
|
5
6
|
class AsyncCrossJoinIterable {
|
|
6
7
|
collection;
|
|
7
|
-
|
|
8
|
+
iterable;
|
|
8
9
|
makeCollection;
|
|
9
|
-
constructor(collection,
|
|
10
|
+
constructor(collection, iterable, makeCollection) {
|
|
10
11
|
this.collection = collection;
|
|
11
|
-
this.
|
|
12
|
+
this.iterable = iterable;
|
|
12
13
|
this.makeCollection = makeCollection;
|
|
13
14
|
}
|
|
14
15
|
async *[Symbol.asyncIterator]() {
|
|
15
16
|
try {
|
|
16
|
-
|
|
17
|
+
const combinations = (await this.makeCollection([
|
|
17
18
|
this.collection,
|
|
18
|
-
|
|
19
|
-
]).reduce({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return x
|
|
24
|
-
}))
|
|
25
|
-
.reduce({
|
|
26
|
-
reduceFn: (c, b) => c.append(b),
|
|
27
|
-
initialValue: this.makeCollection([]),
|
|
19
|
+
this.makeCollection(this.iterable),
|
|
20
|
+
]).reduce(async (a, b) => {
|
|
21
|
+
return await a
|
|
22
|
+
.map((x) => {
|
|
23
|
+
return b.map((y) => {
|
|
24
|
+
return [...x, y];
|
|
28
25
|
});
|
|
29
|
-
}
|
|
30
|
-
|
|
26
|
+
})
|
|
27
|
+
.reduce((c, b) => c.append(b), this.makeCollection([]));
|
|
28
|
+
}, this.makeCollection([[]]))).map((combination) => {
|
|
29
|
+
return combination.reduce((a, b) => {
|
|
30
|
+
return [...a, ...((0, _module_2.isIterable)(b) ? b : [b])];
|
|
31
|
+
}, []);
|
|
31
32
|
});
|
|
33
|
+
yield* combinations;
|
|
32
34
|
}
|
|
33
35
|
catch (error) {
|
|
34
|
-
if (error instanceof _module_1.CollectionError
|
|
35
|
-
error instanceof TypeError) {
|
|
36
|
+
if (error instanceof _module_1.CollectionError) {
|
|
36
37
|
throw error;
|
|
37
38
|
}
|
|
38
39
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-cross-join-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-cross-join-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;
|
|
1
|
+
{"version":3,"file":"async-cross-join-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-cross-join-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAExC,kDAAkD;AAKlD,MAAa,sBAAsB;IAInB;IACA;IACA;IAHZ,YACY,UAAoC,EACpC,QAAuC,EACvC,cAEqB;QAJrB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAA+B;QACvC,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAGzB,IAAI,CAAC;YACD,MAAM,YAAY,GAAG,CACjB,MAAM,IAAI,CAAC,cAAc,CAAC;gBACtB,IAAI,CAAC,UAAU;gBACf,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;aACK,CAAC,CAAC,MAAM,CAG/C,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;gBACX,OAAO,MAAM,CAAC;qBACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;oBACP,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;wBACf,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;oBACrB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC;qBACD,MAAM,CAGH,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EACrB,IAAI,CAAC,cAAc,CACf,EAAE,CACL,CACJ,CAAC;YACV,CAAC,EACD,IAAI,CAAC,cAAc,CAAC,CAAC,EAA+B,CAAC,CAAC,CACzD,CACJ,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;gBAElB,OAAO,WAAW,CAAC,MAAM,CAA4B,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;oBAC1D,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAA,oBAAU,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAEzC,CAAC;gBACN,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,CAAC,CAAC,CAAC;YAEH,KAAK,CAAC,CAAC,YAEN,CAAC;QACN,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AA9DD,wDA8DC"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AsyncEntriesIterable = void 0;
|
|
4
|
-
const _shared_1 = require("../../../contracts/collection/_shared");
|
|
5
4
|
class AsyncEntriesIterable {
|
|
6
5
|
iterable;
|
|
7
|
-
|
|
8
|
-
constructor(iterable, throwOnIndexOverflow) {
|
|
6
|
+
constructor(iterable) {
|
|
9
7
|
this.iterable = iterable;
|
|
10
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
11
8
|
}
|
|
12
9
|
async *[Symbol.asyncIterator]() {
|
|
13
10
|
let index = 0;
|
|
14
11
|
for await (const item of this.iterable) {
|
|
15
|
-
if (this.throwOnIndexOverflow &&
|
|
16
|
-
index === Number.MAX_SAFE_INTEGER) {
|
|
17
|
-
throw new _shared_1.IndexOverflowError("Index has overflowed");
|
|
18
|
-
}
|
|
19
12
|
yield [index, item];
|
|
20
13
|
index++;
|
|
21
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-entries-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-entries-iterable.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"async-entries-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-entries-iterable.ts"],"names":[],"mappings":";;;AAMA,MAAa,oBAAoB;IAGT;IAApB,YAAoB,QAAoC;QAApC,aAAQ,GAAR,QAAQ,CAA4B;IAAG,CAAC;IAE5D,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACpB,KAAK,EAAE,CAAC;QACZ,CAAC;IACL,CAAC;CACJ;AAZD,oDAYC"}
|
|
@@ -4,24 +4,21 @@ exports.AsyncFilterIterable = void 0;
|
|
|
4
4
|
const _module_1 = require("../../../contracts/collection/_module");
|
|
5
5
|
class AsyncFilterIterable {
|
|
6
6
|
collection;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(collection, filter, throwOnIndexOverflow) {
|
|
7
|
+
predicateFn;
|
|
8
|
+
constructor(collection, predicateFn) {
|
|
10
9
|
this.collection = collection;
|
|
11
|
-
this.
|
|
12
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
10
|
+
this.predicateFn = predicateFn;
|
|
13
11
|
}
|
|
14
12
|
async *[Symbol.asyncIterator]() {
|
|
15
13
|
try {
|
|
16
|
-
for await (const [index, item] of this.collection.entries(
|
|
17
|
-
if (await this.
|
|
14
|
+
for await (const [index, item] of this.collection.entries()) {
|
|
15
|
+
if (await this.predicateFn(item, index, this.collection)) {
|
|
18
16
|
yield item;
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
catch (error) {
|
|
23
|
-
if (error instanceof _module_1.CollectionError
|
|
24
|
-
error instanceof TypeError) {
|
|
21
|
+
if (error instanceof _module_1.CollectionError) {
|
|
25
22
|
throw error;
|
|
26
23
|
}
|
|
27
24
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-filter-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-filter-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,mBAAmB;IAIhB;IACA;
|
|
1
|
+
{"version":3,"file":"async-filter-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-filter-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,mBAAmB;IAIhB;IACA;IAFZ,YACY,UAAoC,EACpC,WAIP;QALO,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAIlB;IACF,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC1D,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;oBACvD,MAAM,IAAe,CAAC;gBAC1B,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AA7BD,kDA6BC"}
|
|
@@ -5,21 +5,18 @@ const _module_1 = require("../../../contracts/collection/_module");
|
|
|
5
5
|
class AsyncFlatMapIterable {
|
|
6
6
|
collection;
|
|
7
7
|
mapFn;
|
|
8
|
-
|
|
9
|
-
constructor(collection, mapFn, throwOnIndexOverflow) {
|
|
8
|
+
constructor(collection, mapFn) {
|
|
10
9
|
this.collection = collection;
|
|
11
10
|
this.mapFn = mapFn;
|
|
12
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
13
11
|
}
|
|
14
12
|
async *[Symbol.asyncIterator]() {
|
|
15
13
|
try {
|
|
16
|
-
for await (const [index, item] of this.collection.entries(
|
|
14
|
+
for await (const [index, item] of this.collection.entries()) {
|
|
17
15
|
yield* await this.mapFn(item, index, this.collection);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
catch (error) {
|
|
21
|
-
if (error instanceof _module_1.CollectionError
|
|
22
|
-
error instanceof TypeError) {
|
|
19
|
+
if (error instanceof _module_1.CollectionError) {
|
|
23
20
|
throw error;
|
|
24
21
|
}
|
|
25
22
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-flat-map-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-flat-map-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,oBAAoB;IAIjB;IACA;
|
|
1
|
+
{"version":3,"file":"async-flat-map-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-flat-map-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,oBAAoB;IAIjB;IACA;IAFZ,YACY,UAAoC,EACpC,KAIP;QALO,eAAU,GAAV,UAAU,CAA0B;QACpC,UAAK,GAAL,KAAK,CAIZ;IACF,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC1D,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1D,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AA3BD,oDA2BC"}
|
|
@@ -3,27 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AsyncGroupByIterable = void 0;
|
|
4
4
|
class AsyncGroupByIterable {
|
|
5
5
|
collection;
|
|
6
|
-
|
|
7
|
-
throwOnIndexOverflow;
|
|
6
|
+
selectFn;
|
|
8
7
|
makeCollection;
|
|
9
|
-
constructor(collection,
|
|
8
|
+
constructor(collection, selectFn = (item) => item, makeCollection) {
|
|
10
9
|
this.collection = collection;
|
|
11
|
-
this.
|
|
12
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
10
|
+
this.selectFn = selectFn;
|
|
13
11
|
this.makeCollection = makeCollection;
|
|
14
12
|
}
|
|
15
13
|
async *[Symbol.asyncIterator]() {
|
|
16
14
|
const map = new Map();
|
|
17
|
-
for await (const [index, item] of this.collection.entries(
|
|
18
|
-
const key = await this.
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
map.set(key,
|
|
15
|
+
for await (const [index, item] of this.collection.entries()) {
|
|
16
|
+
const key = await this.selectFn(item, index, this.collection);
|
|
17
|
+
let array = map.get(key);
|
|
18
|
+
if (array === undefined) {
|
|
19
|
+
array = [];
|
|
20
|
+
map.set(key, array);
|
|
23
21
|
}
|
|
24
|
-
|
|
22
|
+
array.push(item);
|
|
23
|
+
map.set(key, array);
|
|
25
24
|
}
|
|
26
|
-
yield* map;
|
|
25
|
+
yield* this.makeCollection(map).map(([key, value]) => [key, this.makeCollection(value)]);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
exports.AsyncGroupByIterable = AsyncGroupByIterable;
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-group-by-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-group-by-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-group-by-iterable.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"async-group-by-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-group-by-iterable.ts"],"names":[],"mappings":";;;AASA,MAAa,oBAAoB;IAIjB;IACA;IAQA;IAVZ,YACY,UAAoC,EACpC,WAIJ,CAAC,IAAI,EAAE,EAAE,CAET,IAAW,EAEP,cAEqB;QAXrB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAMD;QAEP,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAGzB,MAAM,GAAG,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC9C,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9D,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACzB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,KAAK,GAAG,EAAE,CAAC;gBACX,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxB,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACxB,CAAC;QACD,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAEjC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ;AApCD,oDAoCC"}
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js
CHANGED
|
@@ -4,26 +4,20 @@ exports.AsyncInsertAfterIterable = void 0;
|
|
|
4
4
|
const _module_1 = require("../../../contracts/collection/_module");
|
|
5
5
|
class AsyncInsertAfterIterable {
|
|
6
6
|
collection;
|
|
7
|
-
|
|
7
|
+
predicateFn;
|
|
8
8
|
iterable;
|
|
9
|
-
|
|
10
|
-
constructor(collection, filter, iterable, throwOnIndexOverflow) {
|
|
9
|
+
constructor(collection, predicateFn, iterable) {
|
|
11
10
|
this.collection = collection;
|
|
12
|
-
this.
|
|
11
|
+
this.predicateFn = predicateFn;
|
|
13
12
|
this.iterable = iterable;
|
|
14
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
15
13
|
}
|
|
16
14
|
async *[Symbol.asyncIterator]() {
|
|
17
15
|
try {
|
|
18
16
|
let hasMatched = false, index = 0;
|
|
19
17
|
for await (const item of this.collection) {
|
|
20
|
-
if (this.throwOnIndexOverflow &&
|
|
21
|
-
index === Number.MAX_SAFE_INTEGER) {
|
|
22
|
-
throw new _module_1.IndexOverflowError("Index has overflowed");
|
|
23
|
-
}
|
|
24
18
|
yield item;
|
|
25
19
|
if (!hasMatched &&
|
|
26
|
-
(await this.
|
|
20
|
+
(await this.predicateFn(item, index, this.collection))) {
|
|
27
21
|
yield* this.iterable;
|
|
28
22
|
hasMatched = true;
|
|
29
23
|
}
|
|
@@ -31,8 +25,7 @@ class AsyncInsertAfterIterable {
|
|
|
31
25
|
}
|
|
32
26
|
}
|
|
33
27
|
catch (error) {
|
|
34
|
-
if (error instanceof _module_1.CollectionError
|
|
35
|
-
error instanceof TypeError) {
|
|
28
|
+
if (error instanceof _module_1.CollectionError) {
|
|
36
29
|
throw error;
|
|
37
30
|
}
|
|
38
31
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-insert-after-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-insert-after-iterable.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"async-insert-after-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-insert-after-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAMxC,MAAa,wBAAwB;IAIrB;IACA;IACA;IAHZ,YACY,UAAoC,EACpC,WAA6D,EAC7D,QAAgD;QAFhD,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAAkD;QAC7D,aAAQ,GAAR,QAAQ,CAAwC;IACzD,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,UAAU,GAAG,KAAK,EAClB,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACvC,MAAM,IAAI,CAAC;gBACX,IACI,CAAC,UAAU;oBACX,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,EACxD,CAAC;oBACC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;oBACrB,UAAU,GAAG,IAAI,CAAC;gBACtB,CAAC;gBACD,KAAK,EAAE,CAAC;YACZ,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAlCD,4DAkCC"}
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js
CHANGED
|
@@ -4,25 +4,19 @@ exports.AsyncInsertBeforeIterable = void 0;
|
|
|
4
4
|
const _module_1 = require("../../../contracts/collection/_module");
|
|
5
5
|
class AsyncInsertBeforeIterable {
|
|
6
6
|
collection;
|
|
7
|
-
|
|
7
|
+
predicateFn;
|
|
8
8
|
iterable;
|
|
9
|
-
|
|
10
|
-
constructor(collection, filter, iterable, throwOnIndexOverflow) {
|
|
9
|
+
constructor(collection, predicateFn, iterable) {
|
|
11
10
|
this.collection = collection;
|
|
12
|
-
this.
|
|
11
|
+
this.predicateFn = predicateFn;
|
|
13
12
|
this.iterable = iterable;
|
|
14
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
15
13
|
}
|
|
16
14
|
async *[Symbol.asyncIterator]() {
|
|
17
15
|
try {
|
|
18
16
|
let hasMatched = false, index = 0;
|
|
19
17
|
for await (const item of this.collection) {
|
|
20
|
-
if (this.throwOnIndexOverflow &&
|
|
21
|
-
index === Number.MAX_SAFE_INTEGER) {
|
|
22
|
-
throw new _module_1.IndexOverflowError("Index has overflowed");
|
|
23
|
-
}
|
|
24
18
|
if (!hasMatched &&
|
|
25
|
-
(await this.
|
|
19
|
+
(await this.predicateFn(item, index, this.collection))) {
|
|
26
20
|
yield* this.iterable;
|
|
27
21
|
hasMatched = true;
|
|
28
22
|
}
|
|
@@ -31,8 +25,7 @@ class AsyncInsertBeforeIterable {
|
|
|
31
25
|
}
|
|
32
26
|
}
|
|
33
27
|
catch (error) {
|
|
34
|
-
if (error instanceof _module_1.CollectionError
|
|
35
|
-
error instanceof TypeError) {
|
|
28
|
+
if (error instanceof _module_1.CollectionError) {
|
|
36
29
|
throw error;
|
|
37
30
|
}
|
|
38
31
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-insert-before-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-insert-before-iterable.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"async-insert-before-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-insert-before-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAMxC,MAAa,yBAAyB;IAItB;IACA;IACA;IAHZ,YACY,UAAoC,EACpC,WAA6D,EAC7D,QAAgD;QAFhD,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAAkD;QAC7D,aAAQ,GAAR,QAAQ,CAAwC;IACzD,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,UAAU,GAAG,KAAK,EAClB,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACvC,IACI,CAAC,UAAU;oBACX,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,EACxD,CAAC;oBACC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;oBACrB,UAAU,GAAG,IAAI,CAAC;gBACtB,CAAC;gBACD,MAAM,IAAI,CAAC;gBACX,KAAK,EAAE,CAAC;YACZ,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAlCD,8DAkCC"}
|
|
@@ -5,21 +5,18 @@ const _module_1 = require("../../../contracts/collection/_module");
|
|
|
5
5
|
class AsyncMapIterable {
|
|
6
6
|
collection;
|
|
7
7
|
mapFn;
|
|
8
|
-
|
|
9
|
-
constructor(collection, mapFn, throwOnIndexOverflow) {
|
|
8
|
+
constructor(collection, mapFn) {
|
|
10
9
|
this.collection = collection;
|
|
11
10
|
this.mapFn = mapFn;
|
|
12
|
-
this.throwOnIndexOverflow = throwOnIndexOverflow;
|
|
13
11
|
}
|
|
14
12
|
async *[Symbol.asyncIterator]() {
|
|
15
13
|
try {
|
|
16
|
-
for await (const [index, item] of this.collection.entries(
|
|
14
|
+
for await (const [index, item] of this.collection.entries()) {
|
|
17
15
|
yield this.mapFn(item, index, this.collection);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
catch (error) {
|
|
21
|
-
if (error instanceof _module_1.CollectionError
|
|
22
|
-
error instanceof TypeError) {
|
|
19
|
+
if (error instanceof _module_1.CollectionError) {
|
|
23
20
|
throw error;
|
|
24
21
|
}
|
|
25
22
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-map-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-map-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,gBAAgB;IAIb;IACA;
|
|
1
|
+
{"version":3,"file":"async-map-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-map-iterable.ts"],"names":[],"mappings":";;;AAAA,4DAKwC;AAKxC,MAAa,gBAAgB;IAIb;IACA;IAFZ,YACY,UAAoC,EACpC,KAA0D;QAD1D,eAAU,GAAV,UAAU,CAA0B;QACpC,UAAK,GAAL,KAAK,CAAqD;IACnE,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC1D,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACnD,CAAC;QACL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,KAAK,YAAY,yBAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mCAAyB,CAC/B,qBAAqB,MAAM,CAAC,KAAK,CAAC,WAAW,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAvBD,4CAuBC"}
|
|
@@ -15,8 +15,7 @@ class AsyncMergeIterable {
|
|
|
15
15
|
yield* this.iterableB;
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
|
-
if (error instanceof _module_1.CollectionError
|
|
19
|
-
error instanceof TypeError) {
|
|
18
|
+
if (error instanceof _module_1.CollectionError) {
|
|
20
19
|
throw error;
|
|
21
20
|
}
|
|
22
21
|
throw new _module_1.UnexpectedCollectionError(`Unexpected error "${String(error)}" occured`, error);
|