@daiso-tech/core 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/async/_module.js +1 -0
- package/dist/cjs/async/_module.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/_module.js +1 -3
- package/dist/cjs/collection/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js +14 -23
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js +12 -21
- package/dist/cjs/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js +5 -14
- package/dist/cjs/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js +9 -18
- package/dist/cjs/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +18 -27
- package/dist/cjs/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-error-handler-iterable.js +31 -0
- package/dist/cjs/collection/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -0
- package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js +3 -12
- package/dist/cjs/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +2 -11
- package/dist/cjs/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +8 -17
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +8 -17
- package/dist/cjs/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js +2 -11
- package/dist/cjs/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js +2 -11
- package/dist/cjs/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js +9 -18
- package/dist/cjs/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js +4 -13
- package/dist/cjs/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js +3 -12
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +7 -16
- package/dist/cjs/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js +9 -18
- package/dist/cjs/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js +17 -26
- package/dist/cjs/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js +3 -12
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js +4 -13
- package/dist/cjs/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js +2 -11
- package/dist/cjs/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js +6 -15
- package/dist/cjs/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js +5 -14
- package/dist/cjs/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js +4 -13
- package/dist/cjs/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
- package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +177 -265
- package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js +14 -23
- package/dist/cjs/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/chunk-while-iterable.js +12 -21
- package/dist/cjs/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js +5 -14
- package/dist/cjs/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js +9 -18
- package/dist/cjs/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js +19 -31
- package/dist/cjs/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js +4 -13
- package/dist/cjs/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js +3 -12
- package/dist/cjs/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js +2 -11
- package/dist/cjs/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js +9 -18
- package/dist/cjs/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js +6 -16
- package/dist/cjs/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js +6 -16
- package/dist/cjs/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js +2 -11
- package/dist/cjs/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js +2 -11
- package/dist/cjs/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js +11 -20
- package/dist/cjs/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js +11 -20
- package/dist/cjs/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js +9 -18
- package/dist/cjs/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js +4 -13
- package/dist/cjs/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js +4 -13
- package/dist/cjs/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js +9 -18
- package/dist/cjs/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js +3 -12
- package/dist/cjs/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js +6 -15
- package/dist/cjs/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js +15 -24
- package/dist/cjs/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js +9 -18
- package/dist/cjs/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js +1 -10
- package/dist/cjs/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js +17 -26
- package/dist/cjs/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js +3 -12
- package/dist/cjs/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js +4 -13
- package/dist/cjs/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js +2 -11
- package/dist/cjs/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js +6 -15
- package/dist/cjs/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js +5 -14
- package/dist/cjs/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js +4 -13
- package/dist/cjs/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js +6 -15
- package/dist/cjs/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/cjs/collection/iterable-collection/iterable-collection.js +154 -346
- package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/cjs/collection/list-collection/list-collection.js +348 -931
- package/dist/cjs/collection/list-collection/list-collection.js.map +1 -1
- package/dist/cjs/storage/memory-storage-adapter/memory-storage-adapter.js +23 -0
- package/dist/cjs/storage/memory-storage-adapter/memory-storage-adapter.js.map +1 -1
- package/dist/cjs/storage/mongodb-storage-adapter/mongodb-storage-adapter.js +0 -70
- package/dist/cjs/storage/mongodb-storage-adapter/mongodb-storage-adapter.js.map +1 -1
- package/dist/cjs/storage/namespace-storage-adapter.js +11 -21
- package/dist/cjs/storage/namespace-storage-adapter.js.map +1 -1
- package/dist/cjs/storage/redis-storage-adapter/redis-storage-adapter.js +0 -20
- package/dist/cjs/storage/redis-storage-adapter/redis-storage-adapter.js.map +1 -1
- package/dist/cjs/storage/sqlite/_shared/base-sqlite-storage-adapter.js +0 -34
- package/dist/cjs/storage/sqlite/_shared/base-sqlite-storage-adapter.js.map +1 -1
- package/dist/cjs/storage/storage.js +104 -188
- package/dist/cjs/storage/storage.js.map +1 -1
- package/dist/esm/async/_module.js +1 -0
- package/dist/esm/async/_module.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/_module.js +1 -3
- package/dist/esm/collection/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js +14 -23
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js +12 -21
- package/dist/esm/collection/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js +5 -14
- package/dist/esm/collection/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js +9 -18
- package/dist/esm/collection/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js +17 -26
- package/dist/esm/collection/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-error-handler-iterable.js +27 -0
- package/dist/esm/collection/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -0
- package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js +3 -12
- package/dist/esm/collection/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js +2 -11
- package/dist/esm/collection/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js +8 -17
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js +8 -17
- package/dist/esm/collection/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js +2 -11
- package/dist/esm/collection/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js +2 -11
- package/dist/esm/collection/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js +9 -18
- package/dist/esm/collection/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js +4 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js +3 -12
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js +7 -16
- package/dist/esm/collection/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js +9 -18
- package/dist/esm/collection/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js +17 -26
- package/dist/esm/collection/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js +3 -12
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js +4 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js +2 -11
- package/dist/esm/collection/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js +6 -15
- package/dist/esm/collection/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js +5 -14
- package/dist/esm/collection/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js +4 -13
- package/dist/esm/collection/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
- package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +179 -267
- package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js +14 -23
- package/dist/esm/collection/iterable-collection/_shared/chunk-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/chunk-while-iterable.js +12 -21
- package/dist/esm/collection/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js +5 -14
- package/dist/esm/collection/iterable-collection/_shared/collapse-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js +9 -18
- package/dist/esm/collection/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js +19 -31
- package/dist/esm/collection/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js +4 -13
- package/dist/esm/collection/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js +3 -12
- package/dist/esm/collection/iterable-collection/_shared/filter-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js +2 -11
- package/dist/esm/collection/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js +9 -18
- package/dist/esm/collection/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js +6 -16
- package/dist/esm/collection/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js +6 -16
- package/dist/esm/collection/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/map-iterable.js +2 -11
- package/dist/esm/collection/iterable-collection/_shared/map-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js +2 -11
- package/dist/esm/collection/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js +11 -20
- package/dist/esm/collection/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js +11 -20
- package/dist/esm/collection/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js +9 -18
- package/dist/esm/collection/iterable-collection/_shared/partion-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js +4 -13
- package/dist/esm/collection/iterable-collection/_shared/repeat-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js +4 -13
- package/dist/esm/collection/iterable-collection/_shared/reverse-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js +9 -18
- package/dist/esm/collection/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js +3 -12
- package/dist/esm/collection/iterable-collection/_shared/skip-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js +6 -15
- package/dist/esm/collection/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js +15 -24
- package/dist/esm/collection/iterable-collection/_shared/slice-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js +9 -18
- package/dist/esm/collection/iterable-collection/_shared/sliding-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js +1 -10
- package/dist/esm/collection/iterable-collection/_shared/sort-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/split-iterable.js +17 -26
- package/dist/esm/collection/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/take-iterable.js +3 -12
- package/dist/esm/collection/iterable-collection/_shared/take-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js +4 -13
- package/dist/esm/collection/iterable-collection/_shared/take-until-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js +2 -11
- package/dist/esm/collection/iterable-collection/_shared/tap-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js +6 -15
- package/dist/esm/collection/iterable-collection/_shared/unique-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/update-iterable.js +5 -14
- package/dist/esm/collection/iterable-collection/_shared/update-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/when-iterable.js +4 -13
- package/dist/esm/collection/iterable-collection/_shared/when-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js +6 -15
- package/dist/esm/collection/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/esm/collection/iterable-collection/iterable-collection.js +155 -347
- package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/esm/collection/list-collection/list-collection.js +349 -932
- package/dist/esm/collection/list-collection/list-collection.js.map +1 -1
- package/dist/esm/storage/memory-storage-adapter/memory-storage-adapter.js +23 -0
- package/dist/esm/storage/memory-storage-adapter/memory-storage-adapter.js.map +1 -1
- package/dist/esm/storage/mongodb-storage-adapter/mongodb-storage-adapter.js +0 -70
- package/dist/esm/storage/mongodb-storage-adapter/mongodb-storage-adapter.js.map +1 -1
- package/dist/esm/storage/namespace-storage-adapter.js +11 -21
- package/dist/esm/storage/namespace-storage-adapter.js.map +1 -1
- package/dist/esm/storage/redis-storage-adapter/redis-storage-adapter.js +0 -20
- package/dist/esm/storage/redis-storage-adapter/redis-storage-adapter.js.map +1 -1
- package/dist/esm/storage/sqlite/_shared/base-sqlite-storage-adapter.js +0 -34
- package/dist/esm/storage/sqlite/_shared/base-sqlite-storage-adapter.js.map +1 -1
- package/dist/esm/storage/storage.js +105 -189
- package/dist/esm/storage/storage.js.map +1 -1
- package/dist/types/_shared/types.d.ts +2 -6
- package/dist/types/async/_module.d.ts +1 -0
- package/dist/types/collection/async-iterable-collection/_shared/_module.d.ts +1 -3
- package/dist/types/collection/async-iterable-collection/_shared/async-error-handler-iterable.d.ts +6 -0
- package/dist/types/collection/async-iterable-collection/_shared/async-when-iterable.d.ts +1 -1
- package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +39 -37
- package/dist/types/contracts/collection/_shared.d.ts +7 -7
- package/dist/types/contracts/collection/async-collection.contract.d.ts +51 -39
- package/dist/types/contracts/storage/storage-adapter.contract.d.ts +7 -26
- package/dist/types/contracts/storage/storage.contract.d.ts +22 -22
- package/dist/types/storage/memory-storage-adapter/memory-storage-adapter.d.ts +2 -0
- package/dist/types/storage/mongodb-storage-adapter/mongodb-storage-adapter.d.ts +0 -3
- package/dist/types/storage/namespace-storage-adapter.d.ts +2 -7
- package/dist/types/storage/redis-storage-adapter/redis-storage-adapter.d.ts +0 -3
- package/dist/types/storage/sqlite/_shared/base-sqlite-storage-adapter.d.ts +0 -3
- package/dist/types/storage/storage.d.ts +24 -23
- package/package.json +1 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-abort-iterable.js +0 -25
- package/dist/cjs/collection/async-iterable-collection/_shared/async-abort-iterable.js.map +0 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-delay-iterable.js +0 -25
- package/dist/cjs/collection/async-iterable-collection/_shared/async-delay-iterable.js.map +0 -1
- package/dist/cjs/collection/async-iterable-collection/_shared/async-timeout-iterable.js +0 -21
- package/dist/cjs/collection/async-iterable-collection/_shared/async-timeout-iterable.js.map +0 -1
- package/dist/cjs/storage/usable-storage-adapter.js +0 -102
- package/dist/cjs/storage/usable-storage-adapter.js.map +0 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-abort-iterable.js +0 -21
- package/dist/esm/collection/async-iterable-collection/_shared/async-abort-iterable.js.map +0 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-delay-iterable.js +0 -21
- package/dist/esm/collection/async-iterable-collection/_shared/async-delay-iterable.js.map +0 -1
- package/dist/esm/collection/async-iterable-collection/_shared/async-timeout-iterable.js +0 -17
- package/dist/esm/collection/async-iterable-collection/_shared/async-timeout-iterable.js.map +0 -1
- package/dist/esm/storage/usable-storage-adapter.js +0 -98
- package/dist/esm/storage/usable-storage-adapter.js.map +0 -1
- package/dist/types/collection/async-iterable-collection/_shared/async-abort-iterable.d.ts +0 -10
- package/dist/types/collection/async-iterable-collection/_shared/async-delay-iterable.d.ts +0 -10
- package/dist/types/collection/async-iterable-collection/_shared/async-timeout-iterable.d.ts +0 -10
- package/dist/types/storage/usable-storage-adapter.d.ts +0 -22
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { KeyNotFoundStorageError,
|
|
2
|
-
import { UsableStorageAdapter } from "../storage/usable-storage-adapter";
|
|
1
|
+
import { KeyNotFoundStorageError, UnexpectedStorageError, } from "../contracts/storage/_module";
|
|
3
2
|
import { NamespaceStorageAdapter } from "../storage/namespace-storage-adapter";
|
|
4
3
|
import { simplifyAsyncLazyable } from "../_shared/utilities";
|
|
4
|
+
import { LazyPromise } from "../async/_module";
|
|
5
5
|
export class Storage {
|
|
6
6
|
storageAdapter;
|
|
7
7
|
namespaceStorageAdapter;
|
|
8
8
|
settings;
|
|
9
|
-
constructor(storageAdapter,
|
|
9
|
+
constructor(storageAdapter, { namespace = "" } = {}) {
|
|
10
10
|
this.storageAdapter = storageAdapter;
|
|
11
11
|
this.settings = {
|
|
12
|
-
namespace
|
|
13
|
-
...settings,
|
|
12
|
+
namespace,
|
|
14
13
|
};
|
|
15
|
-
this.namespaceStorageAdapter = new NamespaceStorageAdapter(
|
|
14
|
+
this.namespaceStorageAdapter = new NamespaceStorageAdapter(this.storageAdapter, this.settings.namespace);
|
|
16
15
|
}
|
|
17
16
|
namespace(name) {
|
|
18
17
|
return new Storage(this.storageAdapter, {
|
|
@@ -20,73 +19,55 @@ export class Storage {
|
|
|
20
19
|
namespace: `${this.settings.namespace}${name}`,
|
|
21
20
|
});
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
exists(key) {
|
|
23
|
+
return new LazyPromise(async () => {
|
|
25
24
|
const { [key]: hasKey } = await this.existsMany([key]);
|
|
26
25
|
if (hasKey === undefined) {
|
|
27
26
|
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
28
27
|
}
|
|
29
28
|
return hasKey;
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
if (error instanceof StorageError) {
|
|
33
|
-
throw error;
|
|
34
|
-
}
|
|
35
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
36
|
-
}
|
|
29
|
+
});
|
|
37
30
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
throw error;
|
|
31
|
+
existsMany(keys) {
|
|
32
|
+
return new LazyPromise(async () => {
|
|
33
|
+
const getResult = await this.getMany(keys);
|
|
34
|
+
const results = {};
|
|
35
|
+
for (const key in getResult) {
|
|
36
|
+
results[key] = getResult[key] !== null;
|
|
45
37
|
}
|
|
46
|
-
|
|
47
|
-
}
|
|
38
|
+
return results;
|
|
39
|
+
});
|
|
48
40
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
missing(key) {
|
|
42
|
+
return new LazyPromise(async () => {
|
|
43
|
+
const { [key]: hasKey } = await this.missingMany([key]);
|
|
44
|
+
if (hasKey === undefined) {
|
|
45
|
+
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
46
|
+
}
|
|
47
|
+
return hasKey;
|
|
48
|
+
});
|
|
55
49
|
}
|
|
56
|
-
|
|
57
|
-
return
|
|
58
|
-
key,
|
|
59
|
-
|
|
60
|
-
]));
|
|
50
|
+
missingMany(keys) {
|
|
51
|
+
return new LazyPromise(async () => {
|
|
52
|
+
return Object.fromEntries(Object.entries(await this.existsMany(keys)).map(([key, hasKey]) => [key, !hasKey]));
|
|
53
|
+
});
|
|
61
54
|
}
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
get(key) {
|
|
56
|
+
return new LazyPromise(async () => {
|
|
64
57
|
const { [key]: value } = await this.getMany([key]);
|
|
65
58
|
if (value === undefined) {
|
|
66
59
|
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
67
60
|
}
|
|
68
61
|
return value;
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
if (error instanceof StorageError) {
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
75
|
-
}
|
|
62
|
+
});
|
|
76
63
|
}
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
getMany(keys) {
|
|
65
|
+
return new LazyPromise(async () => {
|
|
79
66
|
return await this.namespaceStorageAdapter.getMany(keys);
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
if (error instanceof StorageError) {
|
|
83
|
-
throw error;
|
|
84
|
-
}
|
|
85
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
86
|
-
}
|
|
67
|
+
});
|
|
87
68
|
}
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
getOr(key, defaultValue) {
|
|
70
|
+
return new LazyPromise(async () => {
|
|
90
71
|
const { [key]: value } = await this.getOrMany({
|
|
91
72
|
[key]: defaultValue,
|
|
92
73
|
});
|
|
@@ -94,16 +75,10 @@ export class Storage {
|
|
|
94
75
|
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
95
76
|
}
|
|
96
77
|
return value;
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
if (error instanceof StorageError) {
|
|
100
|
-
throw error;
|
|
101
|
-
}
|
|
102
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
103
|
-
}
|
|
78
|
+
});
|
|
104
79
|
}
|
|
105
|
-
|
|
106
|
-
|
|
80
|
+
getOrMany(keysWithDefaults) {
|
|
81
|
+
return new LazyPromise(async () => {
|
|
107
82
|
const getManyResult = await this.getMany(Object.keys(keysWithDefaults));
|
|
108
83
|
const result = {};
|
|
109
84
|
for (const key in getManyResult) {
|
|
@@ -120,31 +95,19 @@ export class Storage {
|
|
|
120
95
|
}
|
|
121
96
|
}
|
|
122
97
|
return result;
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
if (error instanceof StorageError) {
|
|
126
|
-
throw error;
|
|
127
|
-
}
|
|
128
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
129
|
-
}
|
|
98
|
+
});
|
|
130
99
|
}
|
|
131
|
-
|
|
132
|
-
|
|
100
|
+
getOrFail(key) {
|
|
101
|
+
return new LazyPromise(async () => {
|
|
133
102
|
const value = await this.get(key);
|
|
134
103
|
if (value === null) {
|
|
135
104
|
throw new KeyNotFoundStorageError(`Key "${key}" is not found`);
|
|
136
105
|
}
|
|
137
106
|
return value;
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
if (error instanceof StorageError) {
|
|
141
|
-
throw error;
|
|
142
|
-
}
|
|
143
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
144
|
-
}
|
|
107
|
+
});
|
|
145
108
|
}
|
|
146
|
-
|
|
147
|
-
|
|
109
|
+
add(key, value) {
|
|
110
|
+
return new LazyPromise(async () => {
|
|
148
111
|
const { [key]: hasAdded } = await this.addMany({
|
|
149
112
|
[key]: value,
|
|
150
113
|
});
|
|
@@ -152,39 +115,31 @@ export class Storage {
|
|
|
152
115
|
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
153
116
|
}
|
|
154
117
|
return hasAdded;
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
if (error instanceof StorageError) {
|
|
158
|
-
throw error;
|
|
159
|
-
}
|
|
160
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
161
|
-
}
|
|
118
|
+
});
|
|
162
119
|
}
|
|
163
|
-
|
|
164
|
-
|
|
120
|
+
addMany(values) {
|
|
121
|
+
return new LazyPromise(async () => {
|
|
165
122
|
return await this.namespaceStorageAdapter.addMany(values);
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
if (error instanceof StorageError) {
|
|
169
|
-
throw error;
|
|
170
|
-
}
|
|
171
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
172
|
-
}
|
|
123
|
+
});
|
|
173
124
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
[key]:
|
|
125
|
+
update(key, value) {
|
|
126
|
+
return new LazyPromise(async () => {
|
|
127
|
+
const { [key]: hasKey } = await this.updateMany({
|
|
128
|
+
[key]: value,
|
|
129
|
+
});
|
|
130
|
+
if (hasKey === undefined) {
|
|
131
|
+
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
132
|
+
}
|
|
133
|
+
return hasKey;
|
|
177
134
|
});
|
|
178
|
-
if (hasKey === undefined) {
|
|
179
|
-
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
180
|
-
}
|
|
181
|
-
return hasKey;
|
|
182
135
|
}
|
|
183
|
-
|
|
184
|
-
return
|
|
136
|
+
updateMany(values) {
|
|
137
|
+
return new LazyPromise(async () => {
|
|
138
|
+
return await this.namespaceStorageAdapter.updateMany(values);
|
|
139
|
+
});
|
|
185
140
|
}
|
|
186
|
-
|
|
187
|
-
|
|
141
|
+
put(key, value) {
|
|
142
|
+
return new LazyPromise(async () => {
|
|
188
143
|
const { [key]: hasAdded } = await this.putMany({
|
|
189
144
|
[key]: value,
|
|
190
145
|
});
|
|
@@ -192,106 +147,67 @@ export class Storage {
|
|
|
192
147
|
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
193
148
|
}
|
|
194
149
|
return hasAdded;
|
|
195
|
-
}
|
|
196
|
-
catch (error) {
|
|
197
|
-
if (error instanceof StorageError) {
|
|
198
|
-
throw error;
|
|
199
|
-
}
|
|
200
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
201
|
-
}
|
|
150
|
+
});
|
|
202
151
|
}
|
|
203
|
-
|
|
204
|
-
|
|
152
|
+
putMany(values) {
|
|
153
|
+
return new LazyPromise(async () => {
|
|
205
154
|
return await this.namespaceStorageAdapter.putMany(values);
|
|
206
|
-
}
|
|
207
|
-
catch (error) {
|
|
208
|
-
if (error instanceof StorageError) {
|
|
209
|
-
throw error;
|
|
210
|
-
}
|
|
211
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
212
|
-
}
|
|
155
|
+
});
|
|
213
156
|
}
|
|
214
|
-
|
|
215
|
-
|
|
157
|
+
remove(key) {
|
|
158
|
+
return new LazyPromise(async () => {
|
|
216
159
|
const { [key]: hasAdded } = await this.removeMany([key]);
|
|
217
160
|
if (hasAdded === undefined) {
|
|
218
161
|
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
219
162
|
}
|
|
220
163
|
return hasAdded;
|
|
221
|
-
}
|
|
222
|
-
catch (error) {
|
|
223
|
-
if (error instanceof StorageError) {
|
|
224
|
-
throw error;
|
|
225
|
-
}
|
|
226
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
227
|
-
}
|
|
164
|
+
});
|
|
228
165
|
}
|
|
229
|
-
|
|
230
|
-
|
|
166
|
+
removeMany(keys) {
|
|
167
|
+
return new LazyPromise(async () => {
|
|
231
168
|
return await this.namespaceStorageAdapter.removeMany(keys);
|
|
232
|
-
}
|
|
233
|
-
catch (error) {
|
|
234
|
-
if (error instanceof StorageError) {
|
|
235
|
-
throw error;
|
|
236
|
-
}
|
|
237
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
238
|
-
}
|
|
169
|
+
});
|
|
239
170
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (error instanceof StorageError) {
|
|
246
|
-
throw error;
|
|
171
|
+
getAndRemove(key) {
|
|
172
|
+
return new LazyPromise(async () => {
|
|
173
|
+
const { [key]: value } = await this.getMany([key]);
|
|
174
|
+
if (value === undefined) {
|
|
175
|
+
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
247
176
|
}
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
async getOrAdd(key, valueToAdd) {
|
|
252
|
-
try {
|
|
253
|
-
const value = await this.namespaceStorageAdapter.getOrAdd(key, valueToAdd);
|
|
177
|
+
await this.namespaceStorageAdapter.removeMany([key]);
|
|
254
178
|
return value;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
getOrAdd(key, valueToAdd) {
|
|
182
|
+
return new LazyPromise(async () => {
|
|
183
|
+
const { [key]: value } = await this.getMany([key]);
|
|
184
|
+
if (value === undefined) {
|
|
185
|
+
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
259
186
|
}
|
|
260
|
-
|
|
261
|
-
|
|
187
|
+
if (value === null) {
|
|
188
|
+
const valueToAddSimplified = (await simplifyAsyncLazyable(valueToAdd));
|
|
189
|
+
await this.namespaceStorageAdapter.addMany({
|
|
190
|
+
[key]: valueToAddSimplified,
|
|
191
|
+
});
|
|
192
|
+
return valueToAddSimplified;
|
|
193
|
+
}
|
|
194
|
+
return value;
|
|
195
|
+
});
|
|
262
196
|
}
|
|
263
|
-
|
|
264
|
-
|
|
197
|
+
increment(key, value = 1) {
|
|
198
|
+
return new LazyPromise(async () => {
|
|
265
199
|
return await this.namespaceStorageAdapter.increment(key, value);
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
if (error instanceof StorageError) {
|
|
269
|
-
throw error;
|
|
270
|
-
}
|
|
271
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
272
|
-
}
|
|
200
|
+
});
|
|
273
201
|
}
|
|
274
|
-
|
|
275
|
-
|
|
202
|
+
decrement(key, value = 1) {
|
|
203
|
+
return new LazyPromise(async () => {
|
|
276
204
|
return await this.namespaceStorageAdapter.increment(key, -value);
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
if (error instanceof StorageError) {
|
|
280
|
-
throw error;
|
|
281
|
-
}
|
|
282
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
283
|
-
}
|
|
205
|
+
});
|
|
284
206
|
}
|
|
285
|
-
|
|
286
|
-
|
|
207
|
+
clear() {
|
|
208
|
+
return new LazyPromise(async () => {
|
|
287
209
|
await this.namespaceStorageAdapter.clear();
|
|
288
|
-
}
|
|
289
|
-
catch (error) {
|
|
290
|
-
if (error instanceof StorageError) {
|
|
291
|
-
throw error;
|
|
292
|
-
}
|
|
293
|
-
throw new UnexpectedStorageError(`Unexpected error "${String(error)}" occured`, error);
|
|
294
|
-
}
|
|
210
|
+
});
|
|
295
211
|
}
|
|
296
212
|
}
|
|
297
213
|
//# sourceMappingURL=storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage/storage.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage/storage.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,uBAAuB,EACvB,sBAAsB,GAEzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C,MAAM,OAAO,OAAO;IAKK;IAJJ,uBAAuB,CAAiC;IACxD,QAAQ,CAA4B;IAErD,YACqB,cAAsC,EACvD,EAAE,SAAS,GAAG,EAAE,KAAsB,EAAE;QADvB,mBAAc,GAAd,cAAc,CAAwB;QAGvD,IAAI,CAAC,QAAQ,GAAG;YACZ,SAAS;SACZ,CAAC;QACF,IAAI,CAAC,uBAAuB,GAAG,IAAI,uBAAuB,CACtD,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAC1B,CAAC;IACN,CAAC;IAED,SAAS,CACL,IAAY;QAEZ,OAAO,IAAI,OAAO,CAAiB,IAAI,CAAC,cAAc,EAAE;YACpD,GAAG,IAAI,CAAC,QAAQ;YAChB,SAAS,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI,EAAE;SAC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IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QAC/C,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -4,16 +4,12 @@
|
|
|
4
4
|
export type EnsureType<TValue, TType> = Exclude<TValue, TType> extends never ? TValue : never;
|
|
5
5
|
export type RecordItem<TKey, TValue> = [key: TKey, value: TValue];
|
|
6
6
|
export type Lazyable<TValue> = TValue | (() => TValue);
|
|
7
|
-
export type Promisable<TValue> = TValue |
|
|
7
|
+
export type Promisable<TValue> = TValue | PromiseLike<TValue>;
|
|
8
8
|
export type AsyncLazyable<TValue> = TValue | (() => Promisable<TValue>);
|
|
9
9
|
export type AsyncIterableValue<TInput> = Iterable<TInput> | AsyncIterable<TInput>;
|
|
10
10
|
export type AnyFunction = (...parameters: unknown[]) => unknown;
|
|
11
11
|
export type IInitizable = {
|
|
12
|
-
init():
|
|
12
|
+
init(): PromiseLike<void>;
|
|
13
13
|
};
|
|
14
14
|
export type Func<TArgs extends unknown[], TReturn> = (...args_: TArgs) => TReturn;
|
|
15
15
|
export type GetOrAddValue<TValue> = Awaited<TValue extends AnyFunction ? ReturnType<TValue> : TValue>;
|
|
16
|
-
export type GetOrAddResult<TValue> = {
|
|
17
|
-
value: TValue;
|
|
18
|
-
hasKey: boolean;
|
|
19
|
-
};
|
|
@@ -4,6 +4,7 @@ export * from "../../../collection/async-iterable-collection/_shared/async-colla
|
|
|
4
4
|
export * from "../../../collection/async-iterable-collection/_shared/async-count-by-iterable";
|
|
5
5
|
export * from "../../../collection/async-iterable-collection/_shared/async-cross-join-iterable";
|
|
6
6
|
export * from "../../../collection/async-iterable-collection/_shared/async-entries-iterable";
|
|
7
|
+
export * from "../../../collection/async-iterable-collection/_shared/async-error-handler-iterable";
|
|
7
8
|
export * from "../../../collection/async-iterable-collection/_shared/async-filter-iterable";
|
|
8
9
|
export * from "../../../collection/async-iterable-collection/_shared/async-flat-map-iterable";
|
|
9
10
|
export * from "../../../collection/async-iterable-collection/_shared/async-group-by-iterable";
|
|
@@ -30,6 +31,3 @@ export * from "../../../collection/async-iterable-collection/_shared/async-uniqu
|
|
|
30
31
|
export * from "../../../collection/async-iterable-collection/_shared/async-update-iterable";
|
|
31
32
|
export * from "../../../collection/async-iterable-collection/_shared/async-when-iterable";
|
|
32
33
|
export * from "../../../collection/async-iterable-collection/_shared/async-zip-iterable";
|
|
33
|
-
export * from "../../../collection/async-iterable-collection/_shared/async-timeout-iterable";
|
|
34
|
-
export * from "../../../collection/async-iterable-collection/_shared/async-delay-iterable";
|
|
35
|
-
export * from "../../../collection/async-iterable-collection/_shared/async-abort-iterable";
|
package/dist/types/collection/async-iterable-collection/_shared/async-error-handler-iterable.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class AsyncErrorHandlerIterable<TInput> implements AsyncIterable<TInput> {
|
|
2
|
+
private readonly iterable;
|
|
3
|
+
private readonly errorPasser;
|
|
4
|
+
constructor(iterable: AsyncIterable<TInput>, errorPasser: (error: unknown) => boolean);
|
|
5
|
+
[Symbol.asyncIterator](): AsyncIterator<TInput>;
|
|
6
|
+
}
|
|
@@ -6,6 +6,6 @@ export declare class AsyncWhenIterable<TInput, TExtended> implements AsyncIterab
|
|
|
6
6
|
private collection;
|
|
7
7
|
private condition;
|
|
8
8
|
private callback;
|
|
9
|
-
constructor(collection: IAsyncCollection<TInput>, condition: () => boolean |
|
|
9
|
+
constructor(collection: IAsyncCollection<TInput>, condition: () => boolean | PromiseLike<boolean>, callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>);
|
|
10
10
|
[Symbol.asyncIterator](): AsyncIterator<TInput | TExtended>;
|
|
11
11
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { type AsyncCollapse, type AsyncPredicate, type AsyncForEach, type AsyncMap, type AsyncModifier, type AsyncTap, type AsyncTransform, type Comparator, type IAsyncCollection, type ChangendItem, type AsyncReduce, type CrossJoinResult } from "../../contracts/collection/_module";
|
|
5
5
|
import { type AsyncIterableValue, type AsyncLazyable, type EnsureType } from "../../_shared/types";
|
|
6
6
|
import { type RecordItem } from "../../_shared/types";
|
|
7
|
+
import type { TimeSpan } from "../../_module";
|
|
8
|
+
import { LazyPromise } from "../../_module";
|
|
7
9
|
/**
|
|
8
10
|
* All methods that return <i>{@link IAsyncCollection}</i> are executed lazly which means they will be executed when the <i>AsyncIterableCollection</i> is iterated with <i>forEach</i> method or "for await of" loop.
|
|
9
11
|
* The rest of the methods are executed eagerly.
|
|
@@ -25,22 +27,22 @@ export declare class AsyncIterableCollection<TInput> implements IAsyncCollection
|
|
|
25
27
|
filter<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TOutput>;
|
|
26
28
|
reject<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<Exclude<TInput, TOutput>>;
|
|
27
29
|
map<TOutput>(mapFn: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TOutput>;
|
|
28
|
-
reduce(reduceFn: AsyncReduce<TInput, IAsyncCollection<TInput>, TInput>):
|
|
29
|
-
reduce(reduceFn: AsyncReduce<TInput, IAsyncCollection<TInput>, TInput>, initialValue: TInput):
|
|
30
|
-
reduce<TOutput>(reduceFn: AsyncReduce<TInput, IAsyncCollection<TInput>, TOutput>, initialValue: TOutput):
|
|
31
|
-
join(separator?: string):
|
|
30
|
+
reduce(reduceFn: AsyncReduce<TInput, IAsyncCollection<TInput>, TInput>): LazyPromise<TInput>;
|
|
31
|
+
reduce(reduceFn: AsyncReduce<TInput, IAsyncCollection<TInput>, TInput>, initialValue: TInput): LazyPromise<TInput>;
|
|
32
|
+
reduce<TOutput>(reduceFn: AsyncReduce<TInput, IAsyncCollection<TInput>, TOutput>, initialValue: TOutput): LazyPromise<TOutput>;
|
|
33
|
+
join(separator?: string): LazyPromise<EnsureType<TInput, string>>;
|
|
32
34
|
collapse(): IAsyncCollection<AsyncCollapse<TInput>>;
|
|
33
35
|
flatMap<TOutput>(mapFn: AsyncMap<TInput, IAsyncCollection<TInput>, Iterable<TOutput>>): IAsyncCollection<TOutput>;
|
|
34
36
|
change<TFilterOutput extends TInput, TMapOutput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TFilterOutput>, mapFn: AsyncMap<TFilterOutput, IAsyncCollection<TInput>, TMapOutput>): IAsyncCollection<ChangendItem<TInput, TFilterOutput, TMapOutput>>;
|
|
35
37
|
page(page: number, pageSize: number): IAsyncCollection<TInput>;
|
|
36
|
-
sum():
|
|
37
|
-
average():
|
|
38
|
-
median():
|
|
39
|
-
min():
|
|
40
|
-
max():
|
|
41
|
-
percentage(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
42
|
-
some<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
43
|
-
every<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
38
|
+
sum(): LazyPromise<EnsureType<TInput, number>>;
|
|
39
|
+
average(): LazyPromise<EnsureType<TInput, number>>;
|
|
40
|
+
median(): LazyPromise<EnsureType<TInput, number>>;
|
|
41
|
+
min(): LazyPromise<EnsureType<TInput, number>>;
|
|
42
|
+
max(): LazyPromise<EnsureType<TInput, number>>;
|
|
43
|
+
percentage(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<number>;
|
|
44
|
+
some<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<boolean>;
|
|
45
|
+
every<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<boolean>;
|
|
44
46
|
take(limit: number): IAsyncCollection<TInput>;
|
|
45
47
|
takeUntil(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
|
|
46
48
|
takeWhile(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
|
|
@@ -51,7 +53,7 @@ export declare class AsyncIterableCollection<TInput> implements IAsyncCollection
|
|
|
51
53
|
whenEmpty<TExtended = TInput>(callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
52
54
|
whenNot<TExtended = TInput>(condition: boolean, callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
53
55
|
whenNotEmpty<TExtended = TInput>(callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
|
|
54
|
-
pipe<TOutput = TInput>(callback: AsyncTransform<IAsyncCollection<TInput>, TOutput>):
|
|
56
|
+
pipe<TOutput = TInput>(callback: AsyncTransform<IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput>;
|
|
55
57
|
tap(callback: AsyncTap<IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
|
|
56
58
|
chunk(chunkSize: number): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
57
59
|
chunkWhile(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<IAsyncCollection<TInput>>;
|
|
@@ -75,29 +77,29 @@ export declare class AsyncIterableCollection<TInput> implements IAsyncCollection
|
|
|
75
77
|
sort(comparator?: Comparator<TInput>): IAsyncCollection<TInput>;
|
|
76
78
|
reverse(chunkSize?: number): IAsyncCollection<TInput>;
|
|
77
79
|
shuffle(mathRandom?: () => number): IAsyncCollection<TInput>;
|
|
78
|
-
first<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
79
|
-
firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
80
|
-
firstOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
81
|
-
last<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
82
|
-
lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
83
|
-
lastOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
84
|
-
before(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
85
|
-
beforeOr<TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
86
|
-
beforeOrFail(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
87
|
-
after(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
88
|
-
afterOr<TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
89
|
-
afterOrFail(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
90
|
-
sole<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>):
|
|
80
|
+
first<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput | null>;
|
|
81
|
+
firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput | TExtended>;
|
|
82
|
+
firstOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput>;
|
|
83
|
+
last<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput | null>;
|
|
84
|
+
lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput | TExtended>;
|
|
85
|
+
lastOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput>;
|
|
86
|
+
before(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput | null>;
|
|
87
|
+
beforeOr<TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput | TExtended>;
|
|
88
|
+
beforeOrFail(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput>;
|
|
89
|
+
after(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput | null>;
|
|
90
|
+
afterOr<TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput | TExtended>;
|
|
91
|
+
afterOrFail(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput>;
|
|
92
|
+
sole<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput>;
|
|
91
93
|
nth(step: number): IAsyncCollection<TInput>;
|
|
92
|
-
delay(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
count(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
96
|
-
size():
|
|
97
|
-
isEmpty():
|
|
98
|
-
isNotEmpty():
|
|
99
|
-
searchFirst(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
100
|
-
searchLast(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>):
|
|
101
|
-
forEach(callback: AsyncForEach<TInput, IAsyncCollection<TInput>>):
|
|
102
|
-
toArray():
|
|
94
|
+
delay(time: TimeSpan): IAsyncCollection<TInput>;
|
|
95
|
+
takeUntilAbort(abortSignal: AbortSignal): IAsyncCollection<TInput>;
|
|
96
|
+
takeUntilTimeout(timeInMs: TimeSpan): IAsyncCollection<TInput>;
|
|
97
|
+
count(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<number>;
|
|
98
|
+
size(): LazyPromise<number>;
|
|
99
|
+
isEmpty(): LazyPromise<boolean>;
|
|
100
|
+
isNotEmpty(): LazyPromise<boolean>;
|
|
101
|
+
searchFirst(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<number>;
|
|
102
|
+
searchLast(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<number>;
|
|
103
|
+
forEach(callback: AsyncForEach<TInput, IAsyncCollection<TInput>>): LazyPromise<void>;
|
|
104
|
+
toArray(): LazyPromise<TInput[]>;
|
|
103
105
|
}
|