@daiso-tech/core 0.1.0 → 0.1.2
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/dist/cjs/_module.js +19 -0
- package/dist/cjs/_module.js.map +1 -0
- package/dist/cjs/collection/_module.js +21 -0
- package/dist/cjs/collection/_module.js.map +1 -0
- package/dist/cjs/collection/_shared.js +28 -0
- package/dist/cjs/collection/_shared.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/_module.js +18 -0
- package/dist/cjs/collection/async-iterable-collection/_module.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +669 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/_module.js +52 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/_module.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js +25 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js +43 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js +43 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js +32 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js +39 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js +43 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js +25 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js +24 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js +32 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js +30 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js +30 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js +43 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js +43 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js +30 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js +27 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js +34 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js +34 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js +45 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js +32 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js +28 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js +25 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js +33 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js +41 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js +36 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js +45 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js +16 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js +49 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js +33 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js +33 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js +27 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js +21 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js +35 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js +37 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js +32 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js +37 -0
- package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/_module.js +18 -0
- package/dist/cjs/collection/iterable-collection/_module.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-collection.js +749 -0
- package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/_module.js +49 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/_module.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-iterable.js +43 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js +43 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/collapse-iterable.js +32 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/collapse-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/count-by-iterable.js +39 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/count-by-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/cross-join-iterable.js +43 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/cross-join-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/entries-iterable.js +34 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/entries-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/filter-iterable.js +32 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/filter-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/flat-map-iterable.js +30 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/flat-map-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/group-by-iterable.js +40 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/group-by-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-after-iterable.js +37 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-after-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-before-iterable.js +37 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/insert-before-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/map-iterable.js +30 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/map-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/merge-iterable.js +27 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/merge-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-end-iterable.js +44 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-end-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-start-iterable.js +44 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/pad-start-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/partion-iterable.js +40 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/partion-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/repeat-iterable.js +32 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/repeat-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/reverse-iterable.js +38 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/reverse-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/shuffle-iterable.js +35 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/shuffle-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-iterable.js +32 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-until-iterable.js +36 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/skip-until-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/slice-iterable.js +46 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/slice-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/sliding-iterable.js +45 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/sliding-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/sort-iterable.js +26 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/sort-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/split-iterable.js +49 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/split-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/take-iterable.js +32 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/take-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/take-until-iterable.js +33 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/take-until-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/tap-iterable.js +27 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/tap-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/unique-iterable.js +35 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/unique-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/update-iterable.js +37 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/update-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/when-iterable.js +32 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/when-iterable.js.map +1 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/zip-iterable.js +33 -0
- package/dist/cjs/collection/iterable-collection/iterable-helpers/zip-iterable.js.map +1 -0
- package/dist/cjs/collection/list-collection/_module.js +18 -0
- package/dist/cjs/collection/list-collection/_module.js.map +1 -0
- package/dist/cjs/collection/list-collection/list-collection.js +1264 -0
- package/dist/cjs/collection/list-collection/list-collection.js.map +1 -0
- package/dist/cjs/contracts/_module.js +18 -0
- package/dist/cjs/contracts/_module.js.map +1 -0
- package/dist/cjs/contracts/collection/_module.js +20 -0
- package/dist/cjs/contracts/collection/_module.js.map +1 -0
- package/dist/cjs/contracts/collection/_shared.js +39 -0
- package/dist/cjs/contracts/collection/_shared.js.map +1 -0
- package/dist/cjs/contracts/collection/async-collection.contract.js +3 -0
- package/dist/cjs/contracts/collection/async-collection.contract.js.map +1 -0
- package/dist/cjs/contracts/collection/collection.contract.js +3 -0
- package/dist/cjs/contracts/collection/collection.contract.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/_module.js +3 -0
- package/dist/esm/_module.js.map +1 -0
- package/dist/esm/collection/_module.js +5 -0
- package/dist/esm/collection/_module.js.map +1 -0
- package/dist/esm/collection/_shared.js +23 -0
- package/dist/esm/collection/_shared.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/_module.js +2 -0
- package/dist/esm/collection/async-iterable-collection/_module.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +665 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/_module.js +36 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/_module.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js +21 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js +39 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js +39 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js +28 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js +35 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js +39 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js +21 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js +20 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js +28 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js +26 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js +26 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js +39 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js +39 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js +26 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js +23 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js +30 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js +30 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js +41 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js +28 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js +24 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.js.map +1 -0
- package/{src/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.ts → dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js} +7 -9
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js +29 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js +37 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.js.map +1 -0
- package/{src/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.ts → dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js} +13 -14
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js +41 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js +12 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js +45 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js +29 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js +29 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js +23 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js +17 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js +31 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js +33 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js +28 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js +33 -0
- package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/_module.js +2 -0
- package/dist/esm/collection/iterable-collection/_module.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-collection.js +745 -0
- package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/_module.js +33 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/_module.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-iterable.js +39 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js +39 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/collapse-iterable.js +28 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/collapse-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/count-by-iterable.js +35 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/count-by-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/cross-join-iterable.js +39 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/cross-join-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/entries-iterable.js +30 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/entries-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/filter-iterable.js +28 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/filter-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/flat-map-iterable.js +26 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/flat-map-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/group-by-iterable.js +36 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/group-by-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/insert-after-iterable.js +33 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/insert-after-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/insert-before-iterable.js +33 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/insert-before-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/map-iterable.js +26 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/map-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/merge-iterable.js +23 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/merge-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/pad-end-iterable.js +40 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/pad-end-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/pad-start-iterable.js +40 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/pad-start-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/partion-iterable.js +36 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/partion-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/repeat-iterable.js +28 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/repeat-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/reverse-iterable.js +34 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/reverse-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/shuffle-iterable.js +31 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/shuffle-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/skip-iterable.js +28 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/skip-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/skip-until-iterable.js +32 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/skip-until-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/slice-iterable.js +42 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/slice-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/sliding-iterable.js +41 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/sliding-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/sort-iterable.js +22 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/sort-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/split-iterable.js +45 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/split-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/take-iterable.js +28 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/take-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/take-until-iterable.js +29 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/take-until-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/tap-iterable.js +23 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/tap-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/unique-iterable.js +31 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/unique-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/update-iterable.js +33 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/update-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/when-iterable.js +28 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/when-iterable.js.map +1 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/zip-iterable.js +29 -0
- package/dist/esm/collection/iterable-collection/iterable-helpers/zip-iterable.js.map +1 -0
- package/dist/esm/collection/list-collection/_module.js +2 -0
- package/dist/esm/collection/list-collection/_module.js.map +1 -0
- package/dist/esm/collection/list-collection/list-collection.js +1260 -0
- package/dist/esm/collection/list-collection/list-collection.js.map +1 -0
- package/dist/esm/contracts/_module.js +2 -0
- package/dist/esm/contracts/_module.js.map +1 -0
- package/dist/esm/contracts/collection/_module.js +4 -0
- package/dist/esm/contracts/collection/_module.js.map +1 -0
- package/dist/esm/contracts/collection/_shared.js +31 -0
- package/dist/esm/contracts/collection/_shared.js.map +1 -0
- package/dist/esm/contracts/collection/async-collection.contract.js +1 -0
- package/dist/esm/contracts/collection/async-collection.contract.js.map +1 -0
- package/dist/esm/contracts/collection/collection.contract.js +1 -0
- package/dist/esm/contracts/collection/collection.contract.js.map +1 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/types/_module.d.ts +2 -0
- package/dist/types/collection/_module.d.ts +4 -0
- package/dist/types/collection/_shared.d.ts +16 -0
- package/dist/types/collection/async-iterable-collection/_module.d.ts +1 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +92 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/_module.d.ts +35 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.d.ts +10 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.d.ts +9 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.d.ts +10 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.d.ts +10 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.d.ts +9 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.d.ts +10 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.d.ts +10 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.d.ts +10 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.d.ts +12 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.d.ts +11 -0
- package/dist/types/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.d.ts +10 -0
- package/dist/types/collection/iterable-collection/_module.d.ts +1 -0
- package/dist/types/collection/iterable-collection/iterable-collection.d.ts +89 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/_module.d.ts +32 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/chunk-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/collapse-iterable.d.ts +6 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/count-by-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/cross-join-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/entries-iterable.d.ts +7 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/filter-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/flat-map-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/group-by-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/insert-after-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/insert-before-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/map-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/merge-iterable.d.ts +6 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/pad-end-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/pad-start-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/partion-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/repeat-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/reverse-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/shuffle-iterable.d.ts +5 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/skip-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/skip-until-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/slice-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/sliding-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/sort-iterable.d.ts +7 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/split-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/take-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/take-until-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/tap-iterable.d.ts +7 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/unique-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/update-iterable.d.ts +9 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/when-iterable.d.ts +8 -0
- package/dist/types/collection/iterable-collection/iterable-helpers/zip-iterable.d.ts +7 -0
- package/dist/types/collection/list-collection/_module.d.ts +1 -0
- package/dist/types/collection/list-collection/list-collection.d.ts +86 -0
- package/dist/types/contracts/_module.d.ts +1 -0
- package/dist/types/contracts/collection/_module.d.ts +3 -0
- package/{src/contracts/collection/_shared.ts → dist/types/contracts/collection/_shared.d.ts} +31 -118
- package/{src/contracts/collection/async-collection.contract.ts → dist/types/contracts/collection/async-collection.contract.d.ts} +84 -356
- package/{src/contracts/collection/collection.contract.ts → dist/types/contracts/collection/collection.contract.d.ts} +54 -311
- package/dist/types/types.d.ts +1 -0
- package/package.json +5 -2
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -50
- package/.gitattributes +0 -6
- package/.github/workflows/main.yaml +0 -54
- package/.github/workflows/release.yaml +0 -31
- package/.prettierignore +0 -4
- package/.prettierrc.json +0 -4
- package/.vscode/settings.json +0 -46
- package/CHANGELOG.md +0 -7
- package/docs-api/.nojekyll +0 -1
- package/docs-api/assets/highlight.css +0 -92
- package/docs-api/assets/icons.js +0 -18
- package/docs-api/assets/icons.svg +0 -1
- package/docs-api/assets/main.js +0 -60
- package/docs-api/assets/navigation.js +0 -1
- package/docs-api/assets/search.js +0 -1
- package/docs-api/assets/style.css +0 -1448
- package/docs-api/classes/AsyncIterableCollection.html +0 -437
- package/docs-api/classes/CollectionError.html +0 -12
- package/docs-api/classes/IndexOverflowError.html +0 -12
- package/docs-api/classes/ItemNotFoundError.html +0 -12
- package/docs-api/classes/IterableCollection.html +0 -434
- package/docs-api/classes/ListCollection.html +0 -434
- package/docs-api/classes/MultipleItemsFoundError.html +0 -12
- package/docs-api/classes/UnexpectedCollectionError.html +0 -12
- package/docs-api/functions/isAsyncIterable.html +0 -1
- package/docs-api/functions/isIterable.html +0 -1
- package/docs-api/functions/range.html +0 -4
- package/docs-api/hierarchy.html +0 -1
- package/docs-api/index.html +0 -1
- package/docs-api/modules.html +0 -60
- package/docs-api/types/AsyncCollapse.html +0 -1
- package/docs-api/types/AsyncFilter.html +0 -1
- package/docs-api/types/AsyncFilter_.html +0 -1
- package/docs-api/types/AsyncFindOrSettings.html +0 -1
- package/docs-api/types/AsyncFindSettings.html +0 -1
- package/docs-api/types/AsyncForEach.html +0 -1
- package/docs-api/types/AsyncForEach_.html +0 -1
- package/docs-api/types/AsyncGroupBySettings.html +0 -1
- package/docs-api/types/AsyncIterableValue.html +0 -1
- package/docs-api/types/AsyncLazyable.html +0 -1
- package/docs-api/types/AsyncLazyable_.html +0 -1
- package/docs-api/types/AsyncMap.html +0 -1
- package/docs-api/types/AsyncMap_.html +0 -1
- package/docs-api/types/AsyncModifier.html +0 -1
- package/docs-api/types/AsyncModifier_.html +0 -1
- package/docs-api/types/AsyncReduce.html +0 -1
- package/docs-api/types/AsyncReduceSettings.html +0 -1
- package/docs-api/types/AsyncReduce_.html +0 -1
- package/docs-api/types/AsyncTap.html +0 -1
- package/docs-api/types/AsyncTap_.html +0 -1
- package/docs-api/types/AsyncTransform.html +0 -1
- package/docs-api/types/AsyncTransform_.html +0 -1
- package/docs-api/types/Collapse.html +0 -1
- package/docs-api/types/Comparator.html +0 -1
- package/docs-api/types/EnsureType.html +0 -1
- package/docs-api/types/Filter.html +0 -1
- package/docs-api/types/FilterGuard.html +0 -1
- package/docs-api/types/Filter_.html +0 -1
- package/docs-api/types/FindOrSettings.html +0 -1
- package/docs-api/types/FindSettings.html +0 -1
- package/docs-api/types/ForEach.html +0 -1
- package/docs-api/types/GroupBySettings.html +0 -1
- package/docs-api/types/IAsyncCollection.html +0 -357
- package/docs-api/types/ICollection.html +0 -357
- package/docs-api/types/JoinSettings.html +0 -1
- package/docs-api/types/Lazyable.html +0 -1
- package/docs-api/types/Map.html +0 -1
- package/docs-api/types/Modifier.html +0 -1
- package/docs-api/types/PageSettings.html +0 -1
- package/docs-api/types/RecordItem.html +0 -1
- package/docs-api/types/Reduce.html +0 -1
- package/docs-api/types/ReduceSettings.html +0 -1
- package/docs-api/types/ReverseSettings.html +0 -1
- package/docs-api/types/SliceSettings.html +0 -1
- package/docs-api/types/SlidingSettings.html +0 -1
- package/docs-api/types/Tap.html +0 -1
- package/docs-api/types/Transform.html +0 -1
- package/docs-api/types/UpdatedItem.html +0 -1
- package/src/_module.ts +0 -2
- package/src/collection/_module.ts +0 -4
- package/src/collection/_shared.ts +0 -45
- package/src/collection/async-iterable-collection/_module.ts +0 -1
- package/src/collection/async-iterable-collection/async-iterable-collection.test.ts +0 -3195
- package/src/collection/async-iterable-collection/async-iterable-collection.ts +0 -1276
- package/src/collection/async-iterable-collection/async-iterable-helpers/_module.ts +0 -35
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.ts +0 -25
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.ts +0 -57
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.ts +0 -54
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.ts +0 -40
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.ts +0 -58
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.ts +0 -69
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.ts +0 -19
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.ts +0 -28
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.ts +0 -42
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.ts +0 -44
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.ts +0 -48
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.ts +0 -57
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.ts +0 -57
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.ts +0 -40
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.ts +0 -35
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.ts +0 -41
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.ts +0 -41
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.ts +0 -63
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.ts +0 -40
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.ts +0 -35
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.ts +0 -41
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.ts +0 -55
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.ts +0 -54
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.ts +0 -18
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.ts +0 -64
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.ts +0 -41
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.ts +0 -41
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.ts +0 -34
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.ts +0 -20
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.ts +0 -49
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.ts +0 -64
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.ts +0 -43
- package/src/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.ts +0 -45
- package/src/collection/iterable-collection/_module.ts +0 -1
- package/src/collection/iterable-collection/iterable-collection.test.ts +0 -2379
- package/src/collection/iterable-collection/iterable-collection.ts +0 -1317
- package/src/collection/iterable-collection/iterable-helpers/_module.ts +0 -32
- package/src/collection/iterable-collection/iterable-helpers/chunk-iterable.ts +0 -49
- package/src/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.ts +0 -51
- package/src/collection/iterable-collection/iterable-helpers/collapse-iterable.ts +0 -35
- package/src/collection/iterable-collection/iterable-helpers/count-by-iterable.ts +0 -49
- package/src/collection/iterable-collection/iterable-helpers/cross-join-iterable.ts +0 -57
- package/src/collection/iterable-collection/iterable-helpers/entries-iterable.ts +0 -42
- package/src/collection/iterable-collection/iterable-helpers/filter-iterable.ts +0 -39
- package/src/collection/iterable-collection/iterable-helpers/flat-map-iterable.ts +0 -35
- package/src/collection/iterable-collection/iterable-helpers/group-by-iterable.ts +0 -52
- package/src/collection/iterable-collection/iterable-helpers/insert-after-iterable.ts +0 -43
- package/src/collection/iterable-collection/iterable-helpers/insert-before-iterable.ts +0 -43
- package/src/collection/iterable-collection/iterable-helpers/map-iterable.ts +0 -35
- package/src/collection/iterable-collection/iterable-helpers/merge-iterable.ts +0 -31
- package/src/collection/iterable-collection/iterable-helpers/pad-end-iterable.ts +0 -52
- package/src/collection/iterable-collection/iterable-helpers/pad-start-iterable.ts +0 -52
- package/src/collection/iterable-collection/iterable-helpers/partion-iterable.ts +0 -46
- package/src/collection/iterable-collection/iterable-helpers/repeat-iterable.ts +0 -36
- package/src/collection/iterable-collection/iterable-helpers/reverse-iterable.ts +0 -46
- package/src/collection/iterable-collection/iterable-helpers/shuffle-iterable.ts +0 -36
- package/src/collection/iterable-collection/iterable-helpers/skip-iterable.ts +0 -37
- package/src/collection/iterable-collection/iterable-helpers/skip-until-iterable.ts +0 -41
- package/src/collection/iterable-collection/iterable-helpers/slice-iterable.ts +0 -47
- package/src/collection/iterable-collection/iterable-helpers/sliding-iterable.ts +0 -49
- package/src/collection/iterable-collection/iterable-helpers/sort-iterable.ts +0 -29
- package/src/collection/iterable-collection/iterable-helpers/split-iterable.ts +0 -58
- package/src/collection/iterable-collection/iterable-helpers/take-iterable.ts +0 -37
- package/src/collection/iterable-collection/iterable-helpers/take-until-iterable.ts +0 -38
- package/src/collection/iterable-collection/iterable-helpers/tap-iterable.ts +0 -31
- package/src/collection/iterable-collection/iterable-helpers/unique-iterable.ts +0 -43
- package/src/collection/iterable-collection/iterable-helpers/update-iterable.ts +0 -50
- package/src/collection/iterable-collection/iterable-helpers/when-iterable.ts +0 -37
- package/src/collection/iterable-collection/iterable-helpers/zip-iterable.ts +0 -41
- package/src/collection/list-collection/_module.ts +0 -1
- package/src/collection/list-collection/list-collection.test.ts +0 -2280
- package/src/collection/list-collection/list-collection.ts +0 -1883
- package/src/contracts/_module.ts +0 -1
- package/src/contracts/collection/_module.ts +0 -3
- package/src/types.ts +0 -2
- package/tsconfig.base.json +0 -31
- package/tsconfig.cjs.json +0 -12
- package/tsconfig.esm.json +0 -12
- package/tsconfig.json +0 -10
- package/tsconfig.types.json +0 -12
- package/vite.config.ts +0 -6
|
@@ -1,52 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type SlidingSettings,
|
|
4
|
-
type AsyncFilter,
|
|
5
|
-
type AsyncFindOrSettings,
|
|
6
|
-
type AsyncFindSettings,
|
|
7
|
-
type AsyncForEach,
|
|
8
|
-
type AsyncGroupBySettings,
|
|
9
|
-
type AsyncLazyable,
|
|
10
|
-
type AsyncMap,
|
|
11
|
-
type AsyncModifier,
|
|
12
|
-
type AsyncReduceSettings,
|
|
13
|
-
type AsyncTap,
|
|
14
|
-
type AsyncTransform,
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
-
type CollectionError,
|
|
17
|
-
type Comparator,
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
-
type ItemNotFoundError,
|
|
20
|
-
type JoinSettings,
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
-
type MultipleItemsFoundError,
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
-
type IndexOverflowError,
|
|
25
|
-
type PageSettings,
|
|
26
|
-
type RecordItem,
|
|
27
|
-
type ReverseSettings,
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
-
type UnexpectedCollectionError,
|
|
30
|
-
type UpdatedItem,
|
|
31
|
-
} from "@/contracts/collection/_shared";
|
|
32
|
-
import { type EnsureType } from "@/types";
|
|
33
|
-
|
|
1
|
+
import { type SliceSettings, type SlidingSettings, type AsyncFilter, type AsyncFindOrSettings, type AsyncFindSettings, type AsyncForEach, type AsyncGroupBySettings, type AsyncLazyable, type AsyncMap, type AsyncModifier, type AsyncReduceSettings, type AsyncTap, type AsyncTransform, type Comparator, type JoinSettings, type PageSettings, type RecordItem, type ReverseSettings, type UpdatedItem } from "../../contracts/collection/_shared";
|
|
2
|
+
import { type EnsureType } from "../../types";
|
|
34
3
|
/**
|
|
35
4
|
* @group Collections
|
|
36
5
|
*/
|
|
37
|
-
export type AsyncIterableValue<TInput> =
|
|
38
|
-
| Iterable<TInput>
|
|
39
|
-
| AsyncIterable<TInput>;
|
|
6
|
+
export type AsyncIterableValue<TInput> = Iterable<TInput> | AsyncIterable<TInput>;
|
|
40
7
|
/**
|
|
41
8
|
* @group Collections
|
|
42
9
|
*/
|
|
43
|
-
export type AsyncCollapse<TValue> = TValue extends
|
|
44
|
-
| Array<infer TItem>
|
|
45
|
-
| Iterable<infer TItem>
|
|
46
|
-
| IAsyncCollection<infer TItem>
|
|
47
|
-
? TItem
|
|
48
|
-
: TValue;
|
|
49
|
-
|
|
10
|
+
export type AsyncCollapse<TValue> = TValue extends Array<infer TItem> | Iterable<infer TItem> | IAsyncCollection<infer TItem> ? TItem : TValue;
|
|
50
11
|
/**
|
|
51
12
|
* IAsyncCollection is immutable and all the methods return new copies
|
|
52
13
|
* @throws {CollectionError}
|
|
@@ -59,15 +20,9 @@ export type AsyncCollapse<TValue> = TValue extends
|
|
|
59
20
|
*/
|
|
60
21
|
export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
61
22
|
iterator(): AsyncIterator<TInput, void>;
|
|
62
|
-
|
|
63
|
-
entries(
|
|
64
|
-
throwOnNumberLimit?: boolean,
|
|
65
|
-
): IAsyncCollection<RecordItem<number, TInput>>;
|
|
66
|
-
|
|
23
|
+
entries(throwOnNumberLimit?: boolean): IAsyncCollection<RecordItem<number, TInput>>;
|
|
67
24
|
keys(throwOnNumberLimit?: boolean): IAsyncCollection<number>;
|
|
68
|
-
|
|
69
25
|
values(): IAsyncCollection<TInput>;
|
|
70
|
-
|
|
71
26
|
/**
|
|
72
27
|
* The filter method filters the collection using the given callback, keeping only those items that pass a given truth test:
|
|
73
28
|
* @example
|
|
@@ -76,11 +31,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
76
31
|
* await filtered.toArray();
|
|
77
32
|
* // [3, 4]
|
|
78
33
|
*/
|
|
79
|
-
filter<TOutput extends TInput>(
|
|
80
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
81
|
-
throwOnNumberLimit?: boolean,
|
|
82
|
-
): IAsyncCollection<TOutput>;
|
|
83
|
-
|
|
34
|
+
filter<TOutput extends TInput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): IAsyncCollection<TOutput>;
|
|
84
35
|
/**
|
|
85
36
|
* The map method iterates through the collection and passes each value to the given callback.
|
|
86
37
|
* The mapFunction is free to modify the item and return it, thus forming a new collection of modified items:
|
|
@@ -90,24 +41,12 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
90
41
|
* await mapped.toArray();
|
|
91
42
|
* // [2, 4, 6, 8, 10]
|
|
92
43
|
*/
|
|
93
|
-
map<TOutput>(
|
|
94
|
-
|
|
95
|
-
throwOnNumberLimit?: boolean,
|
|
96
|
-
): IAsyncCollection<TOutput>;
|
|
97
|
-
|
|
98
|
-
reduce<TOutput = TInput>(
|
|
99
|
-
settings: AsyncReduceSettings<
|
|
100
|
-
TInput,
|
|
101
|
-
IAsyncCollection<TInput>,
|
|
102
|
-
TOutput
|
|
103
|
-
>,
|
|
104
|
-
): Promise<TOutput>;
|
|
105
|
-
|
|
44
|
+
map<TOutput>(map: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): IAsyncCollection<TOutput>;
|
|
45
|
+
reduce<TOutput = TInput>(settings: AsyncReduceSettings<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
|
|
106
46
|
/**
|
|
107
47
|
* @throws {TypeError}
|
|
108
48
|
*/
|
|
109
49
|
join(settings?: JoinSettings): Promise<string>;
|
|
110
|
-
|
|
111
50
|
/**
|
|
112
51
|
* The collapse method collapses a collection of arrays into a single, flat collection:
|
|
113
52
|
* @example
|
|
@@ -117,7 +56,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
117
56
|
* // [1, 2, 3, 4]
|
|
118
57
|
*/
|
|
119
58
|
collapse(): IAsyncCollection<AsyncCollapse<TInput>>;
|
|
120
|
-
|
|
121
59
|
/**
|
|
122
60
|
* The flatMap method returns a new array formed by applying a given callback function to each element of the array, and then collapses the result by one level.
|
|
123
61
|
* It is identical to a map() followed by a collapse()
|
|
@@ -126,15 +64,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
126
64
|
* await collection.toArray();
|
|
127
65
|
* // [2, "a", "b", 2, "c", "d"]
|
|
128
66
|
*/
|
|
129
|
-
flatMap<TOutput>(
|
|
130
|
-
map: AsyncMap<
|
|
131
|
-
TInput,
|
|
132
|
-
IAsyncCollection<TInput>,
|
|
133
|
-
AsyncIterableValue<TOutput>
|
|
134
|
-
>,
|
|
135
|
-
throwOnNumberLimit?: boolean,
|
|
136
|
-
): IAsyncCollection<TOutput>;
|
|
137
|
-
|
|
67
|
+
flatMap<TOutput>(map: AsyncMap<TInput, IAsyncCollection<TInput>, AsyncIterableValue<TOutput>>, throwOnNumberLimit?: boolean): IAsyncCollection<TOutput>;
|
|
138
68
|
/**
|
|
139
69
|
* The update method filters the collection using the given callback, keeping only those items that pass a given truth test and thereafter updates the filtered items:
|
|
140
70
|
* @example
|
|
@@ -143,12 +73,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
143
73
|
* await updateCollection.toArray();
|
|
144
74
|
* // [1, 4, 3, 8, 5]
|
|
145
75
|
*/
|
|
146
|
-
update<TFilterOutput extends TInput, TMapOutput>(
|
|
147
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TFilterOutput>,
|
|
148
|
-
map: AsyncMap<TFilterOutput, IAsyncCollection<TInput>, TMapOutput>,
|
|
149
|
-
throwOnNumberLimit?: boolean,
|
|
150
|
-
): IAsyncCollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
|
|
151
|
-
|
|
76
|
+
update<TFilterOutput extends TInput, TMapOutput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TFilterOutput>, map: AsyncMap<TFilterOutput, IAsyncCollection<TInput>, TMapOutput>, throwOnNumberLimit?: boolean): IAsyncCollection<UpdatedItem<TInput, TFilterOutput, TMapOutput>>;
|
|
152
77
|
/**
|
|
153
78
|
* The page method returns a new collection containing the items that would be present on a given page number.
|
|
154
79
|
* The method accepts the page number as its first argument and the number of items to show per page as its second argument:
|
|
@@ -162,7 +87,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
162
87
|
* // [4, 5, 6]
|
|
163
88
|
*/
|
|
164
89
|
page(settings: PageSettings): IAsyncCollection<TInput>;
|
|
165
|
-
|
|
166
90
|
/**
|
|
167
91
|
* The sum method returns the sum of all items in the collection. If the collection contains nested arrays or objects,
|
|
168
92
|
* you should pass a map function that returns a number to be used in sum calculation.
|
|
@@ -173,11 +97,9 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
173
97
|
* // 6
|
|
174
98
|
* @throws {CollectionError} {@link CollectionError}
|
|
175
99
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
176
|
-
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
177
100
|
* @throws {TypeError} {@link TypeError}
|
|
178
101
|
*/
|
|
179
|
-
sum(
|
|
180
|
-
|
|
102
|
+
sum(): Promise<EnsureType<TInput, number>>;
|
|
181
103
|
/**
|
|
182
104
|
* The average method returns the average of all items in the collection. If the collection contains nested arrays or objects,
|
|
183
105
|
* you should pass a map function that returns a number to be used in average calculation.
|
|
@@ -188,11 +110,9 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
188
110
|
* // 2
|
|
189
111
|
* @throws {CollectionError} {@link CollectionError}
|
|
190
112
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
191
|
-
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
192
113
|
* @throws {TypeError} {@link TypeError}
|
|
193
114
|
*/
|
|
194
|
-
average(
|
|
195
|
-
|
|
115
|
+
average(): Promise<EnsureType<TInput, number>>;
|
|
196
116
|
/**
|
|
197
117
|
* The median method returns the median of all items in the collection. If the collection contains nested arrays or objects,
|
|
198
118
|
* you should pass a map function that returns a number to be used in median calculation.
|
|
@@ -207,7 +127,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
207
127
|
* @throws {TypeError} {@link TypeError}
|
|
208
128
|
*/
|
|
209
129
|
median(throwOnNumberLimit?: boolean): Promise<EnsureType<TInput, number>>;
|
|
210
|
-
|
|
211
130
|
/**
|
|
212
131
|
* The min method returns the min of all items in the collection. If the collection contains nested arrays or objects,
|
|
213
132
|
* you should pass a map function that returns a number to be used in min calculation.
|
|
@@ -221,7 +140,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
221
140
|
* @throws {TypeError} {@link TypeError}
|
|
222
141
|
*/
|
|
223
142
|
min(): Promise<EnsureType<TInput, number>>;
|
|
224
|
-
|
|
225
143
|
/**
|
|
226
144
|
* The max method returns the max of all items in the collection. If the collection contains nested arrays or objects,
|
|
227
145
|
* you should pass a map function that returns a number to be used in max calculation.
|
|
@@ -235,7 +153,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
235
153
|
* @throws {TypeError} {@link TypeError}
|
|
236
154
|
*/
|
|
237
155
|
max(): Promise<EnsureType<TInput, number>>;
|
|
238
|
-
|
|
239
156
|
/**
|
|
240
157
|
* The percentage method may be used to quickly determine the percentage of items in the collection that pass a given truth test
|
|
241
158
|
* @example
|
|
@@ -246,11 +163,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
246
163
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
247
164
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
248
165
|
*/
|
|
249
|
-
percentage(
|
|
250
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
251
|
-
throwOnNumberLimit?: boolean,
|
|
252
|
-
): Promise<number>;
|
|
253
|
-
|
|
166
|
+
percentage(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<number>;
|
|
254
167
|
/**
|
|
255
168
|
* The some method determines whether the collection has a given item.
|
|
256
169
|
* You must pass a closure to the some method to determine if an element exists in the collection matching a given truth test:
|
|
@@ -262,11 +175,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
262
175
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
263
176
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
264
177
|
*/
|
|
265
|
-
some<TOutput extends TInput>(
|
|
266
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
267
|
-
throwOnNumberLimit?: boolean,
|
|
268
|
-
): Promise<boolean>;
|
|
269
|
-
|
|
178
|
+
some<TOutput extends TInput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): Promise<boolean>;
|
|
270
179
|
/**
|
|
271
180
|
* The every method may be used to verify that all elements of a collection pass a given truth test:
|
|
272
181
|
* @example
|
|
@@ -277,11 +186,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
277
186
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
278
187
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
279
188
|
*/
|
|
280
|
-
every<TOutput extends TInput>(
|
|
281
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
282
|
-
throwOnNumberLimit?: boolean,
|
|
283
|
-
): Promise<boolean>;
|
|
284
|
-
|
|
189
|
+
every<TOutput extends TInput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): Promise<boolean>;
|
|
285
190
|
/**
|
|
286
191
|
* The take method returns items in the collection until the given callback returns true:
|
|
287
192
|
* @example
|
|
@@ -296,7 +201,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
296
201
|
* // [4, 5]
|
|
297
202
|
*/
|
|
298
203
|
take(limit: number, throwOnNumberLimit?: boolean): IAsyncCollection<TInput>;
|
|
299
|
-
|
|
300
204
|
/**
|
|
301
205
|
* The takeUntil method returns items in the collection until the given callback returns true:
|
|
302
206
|
* @example
|
|
@@ -305,11 +209,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
305
209
|
* await chunk.toArray();
|
|
306
210
|
* // [1, 2]
|
|
307
211
|
*/
|
|
308
|
-
takeUntil(
|
|
309
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
310
|
-
throwOnNumberLimit?: boolean,
|
|
311
|
-
): IAsyncCollection<TInput>;
|
|
312
|
-
|
|
212
|
+
takeUntil(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): IAsyncCollection<TInput>;
|
|
313
213
|
/**
|
|
314
214
|
* The takeWhile method returns items in the collection until the given callback returns false:
|
|
315
215
|
* @example
|
|
@@ -318,11 +218,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
318
218
|
* await chunk.toArray();
|
|
319
219
|
* // [1, 2]
|
|
320
220
|
*/
|
|
321
|
-
takeWhile(
|
|
322
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
323
|
-
throwOnNumberLimit?: boolean,
|
|
324
|
-
): IAsyncCollection<TInput>;
|
|
325
|
-
|
|
221
|
+
takeWhile(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): IAsyncCollection<TInput>;
|
|
326
222
|
/**
|
|
327
223
|
* The skip method returns a new collection, with the given number of elements removed from the beginning of the collection:
|
|
328
224
|
* @example
|
|
@@ -330,11 +226,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
330
226
|
* await collection.toArray();
|
|
331
227
|
* // [5, 6, 7, 8, 9, 10]
|
|
332
228
|
*/
|
|
333
|
-
skip(
|
|
334
|
-
offset: number,
|
|
335
|
-
throwOnNumberLimit?: boolean,
|
|
336
|
-
): IAsyncCollection<TInput>;
|
|
337
|
-
|
|
229
|
+
skip(offset: number, throwOnNumberLimit?: boolean): IAsyncCollection<TInput>;
|
|
338
230
|
/**
|
|
339
231
|
* The skipUntil method skips over items from the collection until the given callback returns true
|
|
340
232
|
* and then returns the remaining items in the collection as a new collection instance:
|
|
@@ -343,11 +235,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
343
235
|
* await collection.toArray();
|
|
344
236
|
* // [3, 4]
|
|
345
237
|
*/
|
|
346
|
-
skipUntil(
|
|
347
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
348
|
-
throwOnNumberLimit?: boolean,
|
|
349
|
-
): IAsyncCollection<TInput>;
|
|
350
|
-
|
|
238
|
+
skipUntil(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): IAsyncCollection<TInput>;
|
|
351
239
|
/**
|
|
352
240
|
* The skipWhile method skips over items from the collection while the given callback returns false and then returns the remaining items in the collection as a new collection:
|
|
353
241
|
* @example
|
|
@@ -355,11 +243,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
355
243
|
* await collection.toArray();
|
|
356
244
|
* // [4]
|
|
357
245
|
*/
|
|
358
|
-
skipWhile(
|
|
359
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
360
|
-
throwOnNumberLimit?: boolean,
|
|
361
|
-
): IAsyncCollection<TInput>;
|
|
362
|
-
|
|
246
|
+
skipWhile(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): IAsyncCollection<TInput>;
|
|
363
247
|
/**
|
|
364
248
|
* The when method will execute the given callback when the first argument given to the method evaluates to true:
|
|
365
249
|
* @example
|
|
@@ -369,14 +253,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
369
253
|
* await collection.toArray();
|
|
370
254
|
* // [1, 2, 3, 4, -3]
|
|
371
255
|
*/
|
|
372
|
-
when<TExtended = TInput>(
|
|
373
|
-
condition: boolean,
|
|
374
|
-
callback: AsyncModifier<
|
|
375
|
-
IAsyncCollection<TInput>,
|
|
376
|
-
IAsyncCollection<TExtended>
|
|
377
|
-
>,
|
|
378
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
379
|
-
|
|
256
|
+
when<TExtended = TInput>(condition: boolean, callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
380
257
|
/**
|
|
381
258
|
* The whenEmpty method will execute the given callback when the collection is empty:
|
|
382
259
|
* @example
|
|
@@ -390,13 +267,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
390
267
|
* await collection.toArray();
|
|
391
268
|
* // [1]
|
|
392
269
|
*/
|
|
393
|
-
whenEmpty<TExtended = TInput>(
|
|
394
|
-
callback: AsyncModifier<
|
|
395
|
-
IAsyncCollection<TInput>,
|
|
396
|
-
IAsyncCollection<TExtended>
|
|
397
|
-
>,
|
|
398
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
399
|
-
|
|
270
|
+
whenEmpty<TExtended = TInput>(callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
400
271
|
/**
|
|
401
272
|
* The whenNot method will execute the given callback when the first argument given to the method evaluates to false:
|
|
402
273
|
* @example
|
|
@@ -406,14 +277,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
406
277
|
* await collection.toArray();
|
|
407
278
|
* // [1, 2, 3, 4, 20]
|
|
408
279
|
*/
|
|
409
|
-
whenNot<TExtended = TInput>(
|
|
410
|
-
condition: boolean,
|
|
411
|
-
callback: AsyncModifier<
|
|
412
|
-
IAsyncCollection<TInput>,
|
|
413
|
-
IAsyncCollection<TExtended>
|
|
414
|
-
>,
|
|
415
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
416
|
-
|
|
280
|
+
whenNot<TExtended = TInput>(condition: boolean, callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
417
281
|
/**
|
|
418
282
|
* The whenNotEmpty method will execute the given callback when the collection is empty:
|
|
419
283
|
* @example
|
|
@@ -427,13 +291,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
427
291
|
* await collection.toArray();
|
|
428
292
|
* // [1, -3]
|
|
429
293
|
*/
|
|
430
|
-
whenNotEmpty<TExtended = TInput>(
|
|
431
|
-
callback: AsyncModifier<
|
|
432
|
-
IAsyncCollection<TInput>,
|
|
433
|
-
IAsyncCollection<TExtended>
|
|
434
|
-
>,
|
|
435
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
436
|
-
|
|
294
|
+
whenNotEmpty<TExtended = TInput>(callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
437
295
|
/**
|
|
438
296
|
* The pipe method passes the collection to the given closure and returns the result of the executed closure:
|
|
439
297
|
* @example
|
|
@@ -441,10 +299,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
441
299
|
* const piped = await collection.pipe(collection => collection.sum());
|
|
442
300
|
* // 6
|
|
443
301
|
*/
|
|
444
|
-
pipe<TOutput = TInput>(
|
|
445
|
-
callback: AsyncTransform<IAsyncCollection<TInput>, TOutput>,
|
|
446
|
-
): Promise<TOutput>;
|
|
447
|
-
|
|
302
|
+
pipe<TOutput = TInput>(callback: AsyncTransform<IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
|
|
448
303
|
/**
|
|
449
304
|
* The tap method passes the collection to the given callback, allowing you to "tap" into the collection at a specific point
|
|
450
305
|
* and do something with the items while not affecting the collection itself.The collection is then returned by the tap method:
|
|
@@ -459,7 +314,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
459
314
|
* // [1, 2, 3, 4, 5, 6]
|
|
460
315
|
*/
|
|
461
316
|
tap(callback: AsyncTap<IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
|
|
462
|
-
|
|
463
317
|
/**
|
|
464
318
|
* The chunk method breaks the collection into multiple, smaller collections of a given size:
|
|
465
319
|
* @example
|
|
@@ -469,7 +323,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
469
323
|
* // [[1, 2, 3, 4], [5, 6, 7]]
|
|
470
324
|
*/
|
|
471
325
|
chunk(chunkSize: number): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
472
|
-
|
|
473
326
|
/**
|
|
474
327
|
* The chunkWhile method breaks the collection into multiple, smaller collections based on the evaluation of the given callback.
|
|
475
328
|
* The chunk variable passed to the closure may be used to inspect the previous element:
|
|
@@ -481,11 +334,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
481
334
|
* await chunks.toArray();
|
|
482
335
|
* // [["A", "A"], ["B", "B"], ["C", "C", "C"], ["D"]]
|
|
483
336
|
*/
|
|
484
|
-
chunkWhile(
|
|
485
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
486
|
-
throwOnNumberLimit?: boolean,
|
|
487
|
-
): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
488
|
-
|
|
337
|
+
chunkWhile(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
489
338
|
/**
|
|
490
339
|
* The split method breaks a collection into the given number of groups:
|
|
491
340
|
* @example
|
|
@@ -494,11 +343,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
494
343
|
* await chunks.toArray();
|
|
495
344
|
* // [[1, 2], [3, 4], [5]]
|
|
496
345
|
*/
|
|
497
|
-
split(
|
|
498
|
-
chunkAmount: number,
|
|
499
|
-
throwOnNumberLimit?: boolean,
|
|
500
|
-
): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
501
|
-
|
|
346
|
+
split(chunkAmount: number, throwOnNumberLimit?: boolean): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
502
347
|
/**
|
|
503
348
|
* The partition method is used to separate elements that pass a given truth test from those that do not:
|
|
504
349
|
* @example
|
|
@@ -507,11 +352,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
507
352
|
* await collection.toArray();
|
|
508
353
|
* // [[1, 2], [3, 4, 5, 6]]
|
|
509
354
|
*/
|
|
510
|
-
partition(
|
|
511
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
512
|
-
throwOnNumberLimit?: boolean,
|
|
513
|
-
): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
514
|
-
|
|
355
|
+
partition(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
515
356
|
/**
|
|
516
357
|
* The sliding method returns a new collection of chunks representing a "sliding window" view of the items in the collection:
|
|
517
358
|
* @experimental
|
|
@@ -520,10 +361,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
520
361
|
* await collection.toArray();
|
|
521
362
|
* // [[1, 2], [2, 3], [3, 4], [4, 5]]
|
|
522
363
|
*/
|
|
523
|
-
sliding(
|
|
524
|
-
settings: SlidingSettings,
|
|
525
|
-
): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
526
|
-
|
|
364
|
+
sliding(settings: SlidingSettings): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
527
365
|
/**
|
|
528
366
|
* The groupBy method groups the collection's items by a given map function:
|
|
529
367
|
* @example
|
|
@@ -539,14 +377,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
539
377
|
* .map(([key, value]) => [key, await value.toArray()]).toArray();
|
|
540
378
|
* // [["gmail.com", ["alice@gmail.com", "carlos@gmail.com"]], ["yahoo.com", ["bob@yahoo.com"]]]
|
|
541
379
|
*/
|
|
542
|
-
groupBy<TOutput = TInput>(
|
|
543
|
-
settings?: AsyncGroupBySettings<
|
|
544
|
-
TInput,
|
|
545
|
-
IAsyncCollection<TInput>,
|
|
546
|
-
TOutput
|
|
547
|
-
>,
|
|
548
|
-
): IAsyncCollection<RecordItem<TOutput, IAsyncCollection<TInput>>>;
|
|
549
|
-
|
|
380
|
+
groupBy<TOutput = TInput>(settings?: AsyncGroupBySettings<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<RecordItem<TOutput, IAsyncCollection<TInput>>>;
|
|
550
381
|
/**
|
|
551
382
|
* The countBy method counts the occurrences of values in the collection.
|
|
552
383
|
* By default, the method counts the occurrences of every element, allowing you to count certain "types" of elements in the collection:
|
|
@@ -559,14 +390,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
559
390
|
* const count = await collection.countBy(item => item.split("@")[1])
|
|
560
391
|
* // [["gmail.com", 2], ["yahoo.com", 1]]
|
|
561
392
|
*/
|
|
562
|
-
countBy<TOutput = TInput>(
|
|
563
|
-
settings?: AsyncGroupBySettings<
|
|
564
|
-
TInput,
|
|
565
|
-
IAsyncCollection<TInput>,
|
|
566
|
-
TOutput
|
|
567
|
-
>,
|
|
568
|
-
): IAsyncCollection<RecordItem<TOutput, number>>;
|
|
569
|
-
|
|
393
|
+
countBy<TOutput = TInput>(settings?: AsyncGroupBySettings<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<RecordItem<TOutput, number>>;
|
|
570
394
|
/**
|
|
571
395
|
* The unique method removes all duplicate values from the collection:
|
|
572
396
|
* @example
|
|
@@ -588,14 +412,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
588
412
|
* { name: "Galaxy S6", brand: "Samsung", type: "phone" },
|
|
589
413
|
* ]
|
|
590
414
|
*/
|
|
591
|
-
unique<TOutput = TInput>(
|
|
592
|
-
settings?: AsyncGroupBySettings<
|
|
593
|
-
TInput,
|
|
594
|
-
IAsyncCollection<TInput>,
|
|
595
|
-
TOutput
|
|
596
|
-
>,
|
|
597
|
-
): IAsyncCollection<TInput>;
|
|
598
|
-
|
|
415
|
+
unique<TOutput = TInput>(settings?: AsyncGroupBySettings<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TInput>;
|
|
599
416
|
/**
|
|
600
417
|
* The diff method will return the values in the original collection that are not present in the given iterable:
|
|
601
418
|
* @example
|
|
@@ -604,11 +421,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
604
421
|
* await difference.toArray();
|
|
605
422
|
* // [1, 3, 5]
|
|
606
423
|
*/
|
|
607
|
-
difference<TOutput = TInput>(
|
|
608
|
-
iterable: AsyncIterableValue<TInput>,
|
|
609
|
-
map?: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
610
|
-
): IAsyncCollection<TInput>;
|
|
611
|
-
|
|
424
|
+
difference<TOutput = TInput>(iterable: AsyncIterableValue<TInput>, map?: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TInput>;
|
|
612
425
|
/**
|
|
613
426
|
* The repeat method will repat the current collection given amount
|
|
614
427
|
* @example
|
|
@@ -618,7 +431,6 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
618
431
|
* // [1, 2, 3, 1, 2, 3, 1, 2, 3]
|
|
619
432
|
*/
|
|
620
433
|
repeat(amount: number): IAsyncCollection<TInput>;
|
|
621
|
-
|
|
622
434
|
/**
|
|
623
435
|
* The padStart method pads this collection with another item (multiple times, if needed) until the resulting collection reaches the given length.
|
|
624
436
|
* The padding is applied from the start of this collection:
|
|
@@ -635,11 +447,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
635
447
|
* new ListCollection("abc").padStart(1, "_").join({ seperator: "" });
|
|
636
448
|
* // "abc"
|
|
637
449
|
*/
|
|
638
|
-
padStart<TExtended = TInput>(
|
|
639
|
-
maxLength: number,
|
|
640
|
-
fillItems: AsyncIterableValue<TExtended>,
|
|
641
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
642
|
-
|
|
450
|
+
padStart<TExtended = TInput>(maxLength: number, fillItems: AsyncIterableValue<TExtended>): IAsyncCollection<TInput | TExtended>;
|
|
643
451
|
/**
|
|
644
452
|
* The padEnd method pads this collection with another item (multiple times, if needed) until the resulting collection reaches the given length.
|
|
645
453
|
* The padding is applied from the end of this collection:
|
|
@@ -656,17 +464,12 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
656
464
|
* new ListCollection("abc").padEnd(1, "_").join({ seperator: "" });
|
|
657
465
|
* // "abc"
|
|
658
466
|
*/
|
|
659
|
-
padEnd<TExtended = TInput>(
|
|
660
|
-
maxLength: number,
|
|
661
|
-
fillItems: AsyncIterableValue<TExtended>,
|
|
662
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
663
|
-
|
|
467
|
+
padEnd<TExtended = TInput>(maxLength: number, fillItems: AsyncIterableValue<TExtended>): IAsyncCollection<TInput | TExtended>;
|
|
664
468
|
/**
|
|
665
469
|
* The slice is the same as Array.slice method. Se documentation on mdn:
|
|
666
470
|
* @link {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice}
|
|
667
471
|
*/
|
|
668
472
|
slice(settings?: SliceSettings): IAsyncCollection<TInput>;
|
|
669
|
-
|
|
670
473
|
/**
|
|
671
474
|
* The prepend method adds items to the beginning of the collection:
|
|
672
475
|
* @example
|
|
@@ -674,10 +477,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
674
477
|
* await collection.toArray();
|
|
675
478
|
* // [-1, 20, 1, 2, 3, 4, 5]
|
|
676
479
|
*/
|
|
677
|
-
prepend<TExtended = TInput>(
|
|
678
|
-
iterable: AsyncIterableValue<TInput | TExtended>,
|
|
679
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
680
|
-
|
|
480
|
+
prepend<TExtended = TInput>(iterable: AsyncIterableValue<TInput | TExtended>): IAsyncCollection<TInput | TExtended>;
|
|
681
481
|
/**
|
|
682
482
|
* The append method adds items to the end of the collection:
|
|
683
483
|
* @example
|
|
@@ -685,10 +485,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
685
485
|
* await collection.toArray();
|
|
686
486
|
* // [1, 2, 3, 4, 5, -1, -2,]
|
|
687
487
|
*/
|
|
688
|
-
append<TExtended = TInput>(
|
|
689
|
-
iterable: AsyncIterableValue<TInput | TExtended>,
|
|
690
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
691
|
-
|
|
488
|
+
append<TExtended = TInput>(iterable: AsyncIterableValue<TInput | TExtended>): IAsyncCollection<TInput | TExtended>;
|
|
692
489
|
/**
|
|
693
490
|
* The insertBefore method adds items before a specific filtered item:
|
|
694
491
|
* @example
|
|
@@ -696,12 +493,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
696
493
|
* await collection.toArray();
|
|
697
494
|
* // [1, -1, 20, 2, 2, 3, 4, 5]
|
|
698
495
|
*/
|
|
699
|
-
insertBefore<TExtended = TInput>(
|
|
700
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
701
|
-
iterable: AsyncIterableValue<TInput | TExtended>,
|
|
702
|
-
throwOnNumberLimit?: boolean,
|
|
703
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
704
|
-
|
|
496
|
+
insertBefore<TExtended = TInput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, iterable: AsyncIterableValue<TInput | TExtended>, throwOnNumberLimit?: boolean): IAsyncCollection<TInput | TExtended>;
|
|
705
497
|
/**
|
|
706
498
|
* The insertAfter method adds items after a specific filtered item:
|
|
707
499
|
* @example
|
|
@@ -709,12 +501,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
709
501
|
* await collection.toArray();
|
|
710
502
|
* // [1, 2, -1, 20, 2, 3, 4, 5]
|
|
711
503
|
*/
|
|
712
|
-
insertAfter<TExtended = TInput>(
|
|
713
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
714
|
-
iterable: AsyncIterableValue<TInput | TExtended>,
|
|
715
|
-
throwOnNumberLimit?: boolean,
|
|
716
|
-
): IAsyncCollection<TInput | TExtended>;
|
|
717
|
-
|
|
504
|
+
insertAfter<TExtended = TInput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, iterable: AsyncIterableValue<TInput | TExtended>, throwOnNumberLimit?: boolean): IAsyncCollection<TInput | TExtended>;
|
|
718
505
|
/**
|
|
719
506
|
* The crossJoin method cross joins the collection's values among the given arrays or collections, returning a Cartesian product with all possible permutations:
|
|
720
507
|
* @example
|
|
@@ -742,10 +529,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
742
529
|
* // [2, "b", "II"],
|
|
743
530
|
* // ]
|
|
744
531
|
*/
|
|
745
|
-
crossJoin<TExtended = TInput>(
|
|
746
|
-
...iterables: Array<AsyncIterableValue<TExtended>>
|
|
747
|
-
): IAsyncCollection<IAsyncCollection<TInput | TExtended>>;
|
|
748
|
-
|
|
532
|
+
crossJoin<TExtended = TInput>(...iterables: Array<AsyncIterableValue<TExtended>>): IAsyncCollection<IAsyncCollection<TInput | TExtended>>;
|
|
749
533
|
/**
|
|
750
534
|
* The zip method merges together the values of the given array with the values of the original collection at their corresponding index:
|
|
751
535
|
* @example
|
|
@@ -754,16 +538,10 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
754
538
|
* await zipped.toArray();
|
|
755
539
|
* // [["Chari", 100], ["Desk", 200]]
|
|
756
540
|
*/
|
|
757
|
-
zip<TExtended>(
|
|
758
|
-
iterable: AsyncIterableValue<TExtended>,
|
|
759
|
-
): IAsyncCollection<RecordItem<TInput, TExtended>>;
|
|
760
|
-
|
|
541
|
+
zip<TExtended>(iterable: AsyncIterableValue<TExtended>): IAsyncCollection<RecordItem<TInput, TExtended>>;
|
|
761
542
|
sort(compare?: Comparator<TInput>): IAsyncCollection<TInput>;
|
|
762
|
-
|
|
763
543
|
reverse(settings?: ReverseSettings): IAsyncCollection<TInput>;
|
|
764
|
-
|
|
765
544
|
shuffle(): IAsyncCollection<TInput>;
|
|
766
|
-
|
|
767
545
|
/**
|
|
768
546
|
* The first method returns the first element in the collection that passes a given truth test. By default it will get the first element:
|
|
769
547
|
* @example
|
|
@@ -774,25 +552,14 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
774
552
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
775
553
|
* // 3
|
|
776
554
|
*/
|
|
777
|
-
first<TOutput extends TInput>(
|
|
778
|
-
settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
779
|
-
): Promise<TOutput | null>;
|
|
780
|
-
|
|
555
|
+
first<TOutput extends TInput>(settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | null>;
|
|
781
556
|
/**
|
|
782
557
|
* The firstOr method is the same as first method but will return a provided default value if not found
|
|
783
558
|
* @throws {CollectionError} {@link CollectionError}
|
|
784
559
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
785
560
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
786
561
|
*/
|
|
787
|
-
firstOr<TOutput extends TInput, TExtended = TInput>(
|
|
788
|
-
settings: AsyncFindOrSettings<
|
|
789
|
-
TInput,
|
|
790
|
-
IAsyncCollection<TInput>,
|
|
791
|
-
TOutput,
|
|
792
|
-
TExtended
|
|
793
|
-
>,
|
|
794
|
-
): Promise<TOutput | TExtended>;
|
|
795
|
-
|
|
562
|
+
firstOr<TOutput extends TInput, TExtended = TInput>(settings: AsyncFindOrSettings<TInput, IAsyncCollection<TInput>, TOutput, TExtended>): Promise<TOutput | TExtended>;
|
|
796
563
|
/**
|
|
797
564
|
* The firstOrFail method is the same as first method but will throw an Error if not found
|
|
798
565
|
* @throws {CollectionError} {@link CollectionError}
|
|
@@ -800,10 +567,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
800
567
|
* @throws {ItemNotFoundError} {@link ItemNotFoundError}
|
|
801
568
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
802
569
|
*/
|
|
803
|
-
firstOrFail<TOutput extends TInput>(
|
|
804
|
-
settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
805
|
-
): Promise<TOutput>;
|
|
806
|
-
|
|
570
|
+
firstOrFail<TOutput extends TInput>(settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
|
|
807
571
|
/**
|
|
808
572
|
* The last method returns the last element in the collection that passes a given truth test. By default it will get the last element:
|
|
809
573
|
* @example
|
|
@@ -814,25 +578,14 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
814
578
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
815
579
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
816
580
|
*/
|
|
817
|
-
last<TOutput extends TInput>(
|
|
818
|
-
settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
819
|
-
): Promise<TOutput | null>;
|
|
820
|
-
|
|
581
|
+
last<TOutput extends TInput>(settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | null>;
|
|
821
582
|
/**
|
|
822
583
|
* The lastOr method is the same as last method but will return a provided default value if not found
|
|
823
584
|
* @throws {CollectionError} {@link CollectionError}
|
|
824
585
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
825
586
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
826
587
|
*/
|
|
827
|
-
lastOr<TOutput extends TInput, TExtended = TInput>(
|
|
828
|
-
settings: AsyncFindOrSettings<
|
|
829
|
-
TInput,
|
|
830
|
-
IAsyncCollection<TInput>,
|
|
831
|
-
TOutput,
|
|
832
|
-
TExtended
|
|
833
|
-
>,
|
|
834
|
-
): Promise<TOutput | TExtended>;
|
|
835
|
-
|
|
588
|
+
lastOr<TOutput extends TInput, TExtended = TInput>(settings: AsyncFindOrSettings<TInput, IAsyncCollection<TInput>, TOutput, TExtended>): Promise<TOutput | TExtended>;
|
|
836
589
|
/**
|
|
837
590
|
* The lastOrFail method is the same as last method but will throw an Error if not found
|
|
838
591
|
* @throws {CollectionError} {@link CollectionError}
|
|
@@ -840,10 +593,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
840
593
|
* @throws {ItemNotFoundError} {@link ItemNotFoundError}
|
|
841
594
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
842
595
|
*/
|
|
843
|
-
lastOrFail<TOutput extends TInput>(
|
|
844
|
-
settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
845
|
-
): Promise<TOutput>;
|
|
846
|
-
|
|
596
|
+
lastOrFail<TOutput extends TInput>(settings?: AsyncFindSettings<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
|
|
847
597
|
/**
|
|
848
598
|
* The before method is the opposite of the after method. It returns the item before the given item. null is returned if the given item is not found or is the first item:
|
|
849
599
|
* @example
|
|
@@ -858,23 +608,14 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
858
608
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
859
609
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
860
610
|
*/
|
|
861
|
-
before(
|
|
862
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
863
|
-
throwOnNumberLimit?: boolean,
|
|
864
|
-
): Promise<TInput | null>;
|
|
865
|
-
|
|
611
|
+
before(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<TInput | null>;
|
|
866
612
|
/**
|
|
867
613
|
* The beforeOr method is the same as before method but will return a provided default value if not found
|
|
868
614
|
* @throws {CollectionError} {@link CollectionError}
|
|
869
615
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
870
616
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
871
617
|
*/
|
|
872
|
-
beforeOr<TExtended = TInput>(
|
|
873
|
-
defaultValue: AsyncLazyable<TExtended>,
|
|
874
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
875
|
-
throwOnNumberLimit?: boolean,
|
|
876
|
-
): Promise<TInput | TExtended>;
|
|
877
|
-
|
|
618
|
+
beforeOr<TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<TInput | TExtended>;
|
|
878
619
|
/**
|
|
879
620
|
* The beforeOrFail method is the same as before method but will throw an Error if not found
|
|
880
621
|
* @throws {CollectionError} {@link CollectionError}
|
|
@@ -882,11 +623,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
882
623
|
* @throws {ItemNotFoundError} {@link ItemNotFoundError}
|
|
883
624
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
884
625
|
*/
|
|
885
|
-
beforeOrFail(
|
|
886
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
887
|
-
throwOnNumberLimit?: boolean,
|
|
888
|
-
): Promise<TInput>;
|
|
889
|
-
|
|
626
|
+
beforeOrFail(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<TInput>;
|
|
890
627
|
/**
|
|
891
628
|
* The after method returns the item after the given item. null is returned if the given item is not found or is the last item:
|
|
892
629
|
* @example
|
|
@@ -901,23 +638,14 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
901
638
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
902
639
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
903
640
|
*/
|
|
904
|
-
after(
|
|
905
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
906
|
-
throwOnNumberLimit?: boolean,
|
|
907
|
-
): Promise<TInput | null>;
|
|
908
|
-
|
|
641
|
+
after(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<TInput | null>;
|
|
909
642
|
/**
|
|
910
643
|
* The afterOr method is the same as after method but will return a provided default value if not found
|
|
911
644
|
* @throws {CollectionError} {@link CollectionError}
|
|
912
645
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
913
646
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
914
647
|
*/
|
|
915
|
-
afterOr<TExtended = TInput>(
|
|
916
|
-
defaultValue: AsyncLazyable<TExtended>,
|
|
917
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
918
|
-
throwOnNumberLimit?: boolean,
|
|
919
|
-
): Promise<TInput | TExtended>;
|
|
920
|
-
|
|
648
|
+
afterOr<TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<TInput | TExtended>;
|
|
921
649
|
/**
|
|
922
650
|
* The afterOrFail method is the same as after method but will throw an Error if not found
|
|
923
651
|
* @throws {CollectionError} {@link CollectionError}
|
|
@@ -925,11 +653,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
925
653
|
* @throws {ItemNotFoundError} {@link ItemNotFoundError}
|
|
926
654
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
927
655
|
*/
|
|
928
|
-
afterOrFail(
|
|
929
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
930
|
-
throwOnNumberLimit?: boolean,
|
|
931
|
-
): Promise<TInput>;
|
|
932
|
-
|
|
656
|
+
afterOrFail(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<TInput>;
|
|
933
657
|
/**
|
|
934
658
|
* The sole method returns the first element in the collection that passes a given truth test, but only if the truth test matches exactly one element:
|
|
935
659
|
* @example
|
|
@@ -942,11 +666,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
942
666
|
* @throws {MultipleItemsFoundError} {@link MultipleItemsFoundError}
|
|
943
667
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
944
668
|
*/
|
|
945
|
-
sole<TOutput extends TInput>(
|
|
946
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>,
|
|
947
|
-
throwOnNumberLimit?: boolean,
|
|
948
|
-
): Promise<TOutput>;
|
|
949
|
-
|
|
669
|
+
sole<TOutput extends TInput>(filter: AsyncFilter<TInput, IAsyncCollection<TInput>, TOutput>, throwOnNumberLimit?: boolean): Promise<TOutput>;
|
|
950
670
|
/**
|
|
951
671
|
* The nth method creates a new collection consisting of every n-th element:
|
|
952
672
|
* @example
|
|
@@ -955,13 +675,36 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
955
675
|
* // ["a", "e"]
|
|
956
676
|
*/
|
|
957
677
|
nth(step: number): IAsyncCollection<TInput>;
|
|
958
|
-
|
|
678
|
+
/**
|
|
679
|
+
* The delay method will delay collection such that each value is returned after the specified number of seconds.
|
|
680
|
+
* This method is especially useful for situations where you may be interacting with external APIs that rate limit incoming requests:
|
|
681
|
+
* @example
|
|
682
|
+
* // An iterator that will fetch all users from a specific api
|
|
683
|
+
* class ApiIterator implements AsyncIterable<IUser> { ... }
|
|
684
|
+
* const apiIterator = new ApiIterator();
|
|
685
|
+
* const collection = new AsyncIterableCollection(apiIterator);
|
|
686
|
+
* await collection.delay(1000).forEach(user => console.log(user))
|
|
687
|
+
*/
|
|
959
688
|
delay(timeInMs: number): IAsyncCollection<TInput>;
|
|
960
|
-
|
|
961
689
|
abort(signal: AbortSignal): IAsyncCollection<TInput>;
|
|
962
|
-
|
|
690
|
+
/**
|
|
691
|
+
* The timeout method returns a new collection that will iterate values until the specified time.
|
|
692
|
+
* After that time, the collection will then stop iterating:
|
|
693
|
+
* @example
|
|
694
|
+
* class AsyncInfiniteIterable implements AsyncIterable<number> {
|
|
695
|
+
* async *[Symbol.asyncIterator]() {
|
|
696
|
+
* while(true) {
|
|
697
|
+
* yield 1;
|
|
698
|
+
* }
|
|
699
|
+
* }
|
|
700
|
+
* }
|
|
701
|
+
* const asyncInfiniteIterable = new AsyncInfiniteIterable();
|
|
702
|
+
* const collection = new AsyncIterableCollection(asyncInfiniteIterable);
|
|
703
|
+
* collection
|
|
704
|
+
* .timeout(1000)
|
|
705
|
+
* .forEach(nbr => console.log(nbr))
|
|
706
|
+
*/
|
|
963
707
|
timeout(timeInMs: number): IAsyncCollection<TInput>;
|
|
964
|
-
|
|
965
708
|
/**
|
|
966
709
|
* The count method returns the total number of items in the collection:
|
|
967
710
|
* @example
|
|
@@ -972,53 +715,38 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
972
715
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
973
716
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
974
717
|
*/
|
|
975
|
-
count(
|
|
976
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
977
|
-
throwOnNumberLimit?: boolean,
|
|
978
|
-
): Promise<number>;
|
|
979
|
-
|
|
718
|
+
count(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<number>;
|
|
980
719
|
/**
|
|
981
720
|
* @throws {CollectionError} {@link CollectionError}
|
|
982
721
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
983
722
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
984
723
|
*/
|
|
985
724
|
size(throwOnNumberLimit?: boolean): Promise<number>;
|
|
986
|
-
|
|
987
725
|
/**
|
|
988
726
|
* @throws {CollectionError} {@link CollectionError}
|
|
989
727
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
990
728
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
991
729
|
*/
|
|
992
730
|
empty(): Promise<boolean>;
|
|
993
|
-
|
|
994
731
|
/**
|
|
995
732
|
* @throws {CollectionError} {@link CollectionError}
|
|
996
733
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
997
734
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
998
735
|
*/
|
|
999
736
|
notEmpty(): Promise<boolean>;
|
|
1000
|
-
|
|
1001
737
|
/**
|
|
1002
738
|
* The search method searches the collection for the given value and returns its index if found. If the item is not found, -1 is returned:
|
|
1003
739
|
* @throws {CollectionError} {@link CollectionError}
|
|
1004
740
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
1005
741
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
1006
742
|
*/
|
|
1007
|
-
search(
|
|
1008
|
-
filter: AsyncFilter<TInput, IAsyncCollection<TInput>>,
|
|
1009
|
-
throwOnNumberLimit?: boolean,
|
|
1010
|
-
): Promise<number>;
|
|
1011
|
-
|
|
743
|
+
search(filter: AsyncFilter<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<number>;
|
|
1012
744
|
/**
|
|
1013
745
|
* @throws {CollectionError} {@link CollectionError}
|
|
1014
746
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|
|
1015
747
|
* @throws {IndexOverflowError} {@link IndexOverflowError}
|
|
1016
748
|
*/
|
|
1017
|
-
forEach(
|
|
1018
|
-
callback: AsyncForEach<TInput, IAsyncCollection<TInput>>,
|
|
1019
|
-
throwOnNumberLimit?: boolean,
|
|
1020
|
-
): Promise<void>;
|
|
1021
|
-
|
|
749
|
+
forEach(callback: AsyncForEach<TInput, IAsyncCollection<TInput>>, throwOnNumberLimit?: boolean): Promise<void>;
|
|
1022
750
|
/**
|
|
1023
751
|
* @throws {CollectionError} {@link CollectionError}
|
|
1024
752
|
* @throws {UnexpectedCollectionError} {@link UnexpectedCollectionError}
|