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