@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,29 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Storage
|
|
3
3
|
*/
|
|
4
|
-
import type { AsyncLazyable } from "../_shared/types";
|
|
5
4
|
import { type IStorageAdapter } from "../contracts/storage/_module";
|
|
6
|
-
import type { UsableStorageAdapter } from "../storage/usable-storage-adapter";
|
|
7
5
|
/**
|
|
8
6
|
* @internal
|
|
9
7
|
*/
|
|
10
8
|
export declare class NamespaceStorageAdapter<TType> implements Required<Omit<IStorageAdapter<TType>, "clear" | "getOrAdd">> {
|
|
11
|
-
private readonly
|
|
9
|
+
private readonly storageAdapter;
|
|
12
10
|
private readonly namespace;
|
|
13
|
-
constructor(
|
|
11
|
+
constructor(storageAdapter: IStorageAdapter<TType>, namespace: string);
|
|
14
12
|
private withNamespace;
|
|
15
13
|
private withNamespaceArray;
|
|
16
14
|
private withNamespaceObject;
|
|
17
15
|
private withoutNamespace;
|
|
18
16
|
private withoutNamespaceObject;
|
|
19
|
-
existsMany<TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, boolean>>;
|
|
20
17
|
getMany<TValues extends TType, TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, TValues | null>>;
|
|
21
18
|
addMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
22
19
|
updateMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
23
20
|
putMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
24
21
|
removeMany<TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, boolean>>;
|
|
25
|
-
getAndRemove<TValue extends TType>(key: string): Promise<TValue | null>;
|
|
26
|
-
getOrAdd<TValue extends TType, TExtended extends TType>(key: string, valueToAdd: AsyncLazyable<TExtended>): Promise<TValue | TExtended>;
|
|
27
22
|
increment(key: string, value: number): Promise<boolean>;
|
|
28
23
|
decrement(key: string, value: number): Promise<boolean>;
|
|
29
24
|
clear(): Promise<void>;
|
|
@@ -5,7 +5,6 @@ import { type ISerializer } from "../../contracts/serializer/_module";
|
|
|
5
5
|
import { type IStorageAdapter } from "../../contracts/storage/_module";
|
|
6
6
|
import type Redis from "ioredis";
|
|
7
7
|
import { type Result } from "ioredis";
|
|
8
|
-
import type { GetOrAddResult } from "../../_shared/types";
|
|
9
8
|
declare module "ioredis" {
|
|
10
9
|
interface RedisCommander<Context> {
|
|
11
10
|
daiso_storage_increment(key: string, number: string): Result<number, Context>;
|
|
@@ -34,8 +33,6 @@ export declare class RedisStorageAdapter<TType> implements IStorageAdapter<TType
|
|
|
34
33
|
updateMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
35
34
|
putMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
36
35
|
removeMany<TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, boolean>>;
|
|
37
|
-
getAndRemove<TValue extends TType>(key: string): Promise<TValue | null>;
|
|
38
|
-
getOrAdd<TValue extends TType, TExtended extends TType>(key: string, valueToAdd: TExtended): Promise<GetOrAddResult<TValue | TExtended>>;
|
|
39
36
|
increment(key: string, value: number): Promise<boolean>;
|
|
40
37
|
clear(prefix: string): Promise<void>;
|
|
41
38
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { type IStorageAdapter } from "../../../contracts/storage/storage-adapter.contract";
|
|
5
5
|
import { type Generated, type Kysely } from "kysely";
|
|
6
6
|
import { type ISerializer } from "../../../contracts/serializer/_module";
|
|
7
|
-
import type { GetOrAddResult } from "../../../_shared/types";
|
|
8
7
|
import { type IInitizable } from "../../../_shared/types";
|
|
9
8
|
/**
|
|
10
9
|
* @internal
|
|
@@ -33,8 +32,6 @@ export declare class BaseSqliteStorageAdapter<TType> implements IStorageAdapter<
|
|
|
33
32
|
addMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
34
33
|
updateMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
35
34
|
removeMany<TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, boolean>>;
|
|
36
|
-
getAndRemove<TValue extends TType>(key: string): Promise<TValue | null>;
|
|
37
|
-
getOrAdd<TValue extends TType, TExtended extends TType>(key: string, valueToAdd: TExtended): Promise<GetOrAddResult<TValue | TExtended>>;
|
|
38
35
|
putMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
39
36
|
increment(key: string, value: number): Promise<boolean>;
|
|
40
37
|
clear(prefix: string): Promise<void>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { type IStorageAdapter } from "../contracts/storage/_module";
|
|
5
5
|
import { type StorageValue, type IStorage } from "../contracts/storage/_module";
|
|
6
6
|
import { type AsyncLazyable, type GetOrAddValue } from "../_shared/types";
|
|
7
|
+
import { LazyPromise } from "../async/_module";
|
|
7
8
|
export type StorageSettings = {
|
|
8
9
|
namespace?: string;
|
|
9
10
|
};
|
|
@@ -11,28 +12,28 @@ export declare class Storage<TType = unknown> implements IStorage<TType> {
|
|
|
11
12
|
private readonly storageAdapter;
|
|
12
13
|
private readonly namespaceStorageAdapter;
|
|
13
14
|
private readonly settings;
|
|
14
|
-
constructor(storageAdapter: IStorageAdapter<TType>,
|
|
15
|
+
constructor(storageAdapter: IStorageAdapter<TType>, { namespace }?: StorageSettings);
|
|
15
16
|
namespace<TNamespaceType extends TType>(name: string): IStorage<TNamespaceType>;
|
|
16
|
-
exists(key: string):
|
|
17
|
-
existsMany<TKeys extends string>(keys: TKeys[]):
|
|
18
|
-
missing(key: string):
|
|
19
|
-
missingMany<TKeys extends string>(keys: TKeys[]):
|
|
20
|
-
get<TValue extends TType>(key: string):
|
|
21
|
-
getMany<TValues extends TType, TKeys extends string>(keys: TKeys[]):
|
|
22
|
-
getOr<TValue extends TType, TExtended extends TType>(key: string, defaultValue: AsyncLazyable<TExtended>):
|
|
23
|
-
getOrMany<TValues extends TType, TExtended extends TType, TKeys extends string>(keysWithDefaults: Record<TKeys, AsyncLazyable<TExtended>>):
|
|
24
|
-
getOrFail<TValue extends TType>(key: string):
|
|
25
|
-
add<TValue extends TType>(key: string, value: StorageValue<TValue>):
|
|
26
|
-
addMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, StorageValue<TValues>>):
|
|
27
|
-
update<TValue extends TType>(key: string, value: TValue):
|
|
28
|
-
updateMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>):
|
|
29
|
-
put<TValue extends TType>(key: string, value: StorageValue<TValue>):
|
|
30
|
-
putMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, StorageValue<TValues>>):
|
|
31
|
-
remove(key: string):
|
|
32
|
-
removeMany<TKeys extends string>(keys: TKeys[]):
|
|
33
|
-
getAndRemove<TValue extends TType>(key: string):
|
|
34
|
-
getOrAdd<TValue extends TType, TExtended extends TType>(key: string, valueToAdd: AsyncLazyable<StorageValue<GetOrAddValue<TExtended>>>):
|
|
35
|
-
increment(key: string, value?: number):
|
|
36
|
-
decrement(key: string, value?: number):
|
|
37
|
-
clear():
|
|
17
|
+
exists(key: string): LazyPromise<boolean>;
|
|
18
|
+
existsMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, boolean>>;
|
|
19
|
+
missing(key: string): LazyPromise<boolean>;
|
|
20
|
+
missingMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, boolean>>;
|
|
21
|
+
get<TValue extends TType>(key: string): LazyPromise<TValue | null>;
|
|
22
|
+
getMany<TValues extends TType, TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, TValues | null>>;
|
|
23
|
+
getOr<TValue extends TType, TExtended extends TType>(key: string, defaultValue: AsyncLazyable<TExtended>): LazyPromise<TValue | TExtended>;
|
|
24
|
+
getOrMany<TValues extends TType, TExtended extends TType, TKeys extends string>(keysWithDefaults: Record<TKeys, AsyncLazyable<TExtended>>): LazyPromise<Record<TKeys, TValues | TExtended>>;
|
|
25
|
+
getOrFail<TValue extends TType>(key: string): LazyPromise<TValue>;
|
|
26
|
+
add<TValue extends TType>(key: string, value: StorageValue<TValue>): LazyPromise<boolean>;
|
|
27
|
+
addMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, StorageValue<TValues>>): LazyPromise<Record<TKeys, boolean>>;
|
|
28
|
+
update<TValue extends TType>(key: string, value: TValue): LazyPromise<boolean>;
|
|
29
|
+
updateMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): LazyPromise<Record<TKeys, boolean>>;
|
|
30
|
+
put<TValue extends TType>(key: string, value: StorageValue<TValue>): LazyPromise<boolean>;
|
|
31
|
+
putMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, StorageValue<TValues>>): LazyPromise<Record<TKeys, boolean>>;
|
|
32
|
+
remove(key: string): LazyPromise<boolean>;
|
|
33
|
+
removeMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, boolean>>;
|
|
34
|
+
getAndRemove<TValue extends TType>(key: string): LazyPromise<TValue | null>;
|
|
35
|
+
getOrAdd<TValue extends TType, TExtended extends TType>(key: string, valueToAdd: AsyncLazyable<StorageValue<GetOrAddValue<TExtended>>>): LazyPromise<TValue | TExtended>;
|
|
36
|
+
increment(key: string, value?: number): LazyPromise<boolean>;
|
|
37
|
+
decrement(key: string, value?: number): LazyPromise<boolean>;
|
|
38
|
+
clear(): LazyPromise<void>;
|
|
38
39
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncAbortIterable = void 0;
|
|
4
|
-
class AsyncAbortIterable {
|
|
5
|
-
collection;
|
|
6
|
-
signal;
|
|
7
|
-
constructor(collection, signal) {
|
|
8
|
-
this.collection = collection;
|
|
9
|
-
this.signal = signal;
|
|
10
|
-
}
|
|
11
|
-
async *[Symbol.asyncIterator]() {
|
|
12
|
-
let hasAborted = false;
|
|
13
|
-
this.signal.addEventListener("abort", () => {
|
|
14
|
-
hasAborted = true;
|
|
15
|
-
});
|
|
16
|
-
for await (const item of this.collection) {
|
|
17
|
-
if (hasAborted) {
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
yield item;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.AsyncAbortIterable = AsyncAbortIterable;
|
|
25
|
-
//# sourceMappingURL=async-abort-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-abort-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-abort-iterable.ts"],"names":[],"mappings":";;;AAKA,MAAa,kBAAkB;IAEf;IACA;IAFZ,YACY,UAAoC,EACpC,MAAmB;QADnB,eAAU,GAAV,UAAU,CAA0B;QACpC,WAAM,GAAN,MAAM,CAAa;IAC5B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACvC,UAAU,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAEvC,IAAI,UAAU,EAAE,CAAC;gBACb,MAAM;YACV,CAAC;YACD,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;CACJ;AAnBD,gDAmBC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncDelayIterable = void 0;
|
|
4
|
-
class AsyncDelayIterable {
|
|
5
|
-
collection;
|
|
6
|
-
timeInMs;
|
|
7
|
-
constructor(collection, timeInMs) {
|
|
8
|
-
this.collection = collection;
|
|
9
|
-
this.timeInMs = timeInMs;
|
|
10
|
-
}
|
|
11
|
-
async *[Symbol.asyncIterator]() {
|
|
12
|
-
let isFirstIteration = true;
|
|
13
|
-
for await (const item of this.collection) {
|
|
14
|
-
if (!isFirstIteration) {
|
|
15
|
-
await new Promise((resolve) => setTimeout(resolve, this.timeInMs));
|
|
16
|
-
}
|
|
17
|
-
if (isFirstIteration) {
|
|
18
|
-
isFirstIteration = false;
|
|
19
|
-
}
|
|
20
|
-
yield item;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.AsyncDelayIterable = AsyncDelayIterable;
|
|
25
|
-
//# sourceMappingURL=async-delay-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-delay-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-delay-iterable.ts"],"names":[],"mappings":";;;AAKA,MAAa,kBAAkB;IAEf;IACA;IAFZ,YACY,UAAoC,EACpC,QAAgB;QADhB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAAQ;IACzB,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,gBAAgB,GAAG,IAAI,CAAC;QAC5B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACvC,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACpB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1B,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CACrC,CAAC;YACN,CAAC;YACD,IAAI,gBAAgB,EAAE,CAAC;gBACnB,gBAAgB,GAAG,KAAK,CAAC;YAC7B,CAAC;YACD,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;CACJ;AApBD,gDAoBC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncTimeoutIterable = void 0;
|
|
4
|
-
class AsyncTimeoutIterable {
|
|
5
|
-
collection;
|
|
6
|
-
timeInMs;
|
|
7
|
-
constructor(collection, timeInMs) {
|
|
8
|
-
this.collection = collection;
|
|
9
|
-
this.timeInMs = timeInMs;
|
|
10
|
-
}
|
|
11
|
-
async *[Symbol.asyncIterator]() {
|
|
12
|
-
const abortController = new AbortController();
|
|
13
|
-
const timeout = setTimeout(() => {
|
|
14
|
-
abortController.abort();
|
|
15
|
-
}, this.timeInMs);
|
|
16
|
-
yield* this.collection.abort(abortController.signal);
|
|
17
|
-
clearTimeout(timeout);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.AsyncTimeoutIterable = AsyncTimeoutIterable;
|
|
21
|
-
//# sourceMappingURL=async-timeout-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-timeout-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-timeout-iterable.ts"],"names":[],"mappings":";;;AAKA,MAAa,oBAAoB;IAEjB;IACA;IAFZ,YACY,UAAoC,EACpC,QAAgB;QADhB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAAQ;IACzB,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,eAAe,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClB,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACrD,YAAY,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACJ;AAdD,oDAcC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UsableStorageAdapter = void 0;
|
|
4
|
-
const utilities_1 = require("../_shared/utilities");
|
|
5
|
-
const _module_1 = require("../contracts/storage/_module");
|
|
6
|
-
class UsableStorageAdapter {
|
|
7
|
-
storageAdapter;
|
|
8
|
-
constructor(storageAdapter) {
|
|
9
|
-
this.storageAdapter = storageAdapter;
|
|
10
|
-
}
|
|
11
|
-
async existsMany(keys) {
|
|
12
|
-
if (this.storageAdapter.existsMany !== undefined) {
|
|
13
|
-
return await this.storageAdapter.existsMany(keys);
|
|
14
|
-
}
|
|
15
|
-
const getResult = await this.getMany(keys);
|
|
16
|
-
const results = {};
|
|
17
|
-
for (const key in getResult) {
|
|
18
|
-
results[key] = getResult[key] !== null;
|
|
19
|
-
}
|
|
20
|
-
return results;
|
|
21
|
-
}
|
|
22
|
-
async getMany(keys) {
|
|
23
|
-
return await this.storageAdapter.getMany(keys);
|
|
24
|
-
}
|
|
25
|
-
async addMany(values) {
|
|
26
|
-
return await this.storageAdapter.addMany(values);
|
|
27
|
-
}
|
|
28
|
-
async updateMany(values) {
|
|
29
|
-
return await this.storageAdapter.updateMany(values);
|
|
30
|
-
}
|
|
31
|
-
async putMany(values) {
|
|
32
|
-
if (this.storageAdapter.putMany !== undefined) {
|
|
33
|
-
return await this.storageAdapter.putMany(values);
|
|
34
|
-
}
|
|
35
|
-
const removeResults = await this.removeMany(Object.keys(values));
|
|
36
|
-
await this.addMany(values);
|
|
37
|
-
return removeResults;
|
|
38
|
-
}
|
|
39
|
-
async removeMany(keys) {
|
|
40
|
-
return await this.storageAdapter.removeMany(keys);
|
|
41
|
-
}
|
|
42
|
-
async increment(key, value) {
|
|
43
|
-
if (this.storageAdapter.increment !== undefined) {
|
|
44
|
-
return await this.storageAdapter.increment(key, value);
|
|
45
|
-
}
|
|
46
|
-
const { [key]: previousValue } = await this.getMany([key]);
|
|
47
|
-
if (previousValue === undefined) {
|
|
48
|
-
throw new _module_1.UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
49
|
-
}
|
|
50
|
-
if (previousValue === null) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
if (typeof previousValue !== "number") {
|
|
54
|
-
throw new _module_1.TypeStorageError(`Unable to increment or decrement none number type key "${key}"`);
|
|
55
|
-
}
|
|
56
|
-
const newValue = previousValue + value;
|
|
57
|
-
await this.updateMany({
|
|
58
|
-
[key]: newValue,
|
|
59
|
-
});
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
async getAndRemove(key) {
|
|
63
|
-
if (this.storageAdapter.getAndRemove !== undefined) {
|
|
64
|
-
return await this.storageAdapter.getAndRemove(key);
|
|
65
|
-
}
|
|
66
|
-
const { [key]: value } = await this.getMany([key]);
|
|
67
|
-
if (value === undefined) {
|
|
68
|
-
throw new _module_1.UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
69
|
-
}
|
|
70
|
-
await this.removeMany([key]);
|
|
71
|
-
return value;
|
|
72
|
-
}
|
|
73
|
-
async getOrAdd(key, valueToAdd) {
|
|
74
|
-
if (typeof valueToAdd !== "function" &&
|
|
75
|
-
this.storageAdapter.getOrAdd !== undefined) {
|
|
76
|
-
return await this.storageAdapter.getOrAdd(key, valueToAdd);
|
|
77
|
-
}
|
|
78
|
-
const { [key]: value } = await this.getMany([key]);
|
|
79
|
-
if (value === undefined) {
|
|
80
|
-
throw new _module_1.UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
81
|
-
}
|
|
82
|
-
if (value === null) {
|
|
83
|
-
const valueToAddSimplified = await (0, utilities_1.simplifyAsyncLazyable)(valueToAdd);
|
|
84
|
-
await this.addMany({
|
|
85
|
-
[key]: valueToAddSimplified,
|
|
86
|
-
});
|
|
87
|
-
return {
|
|
88
|
-
hasKey: false,
|
|
89
|
-
value: valueToAddSimplified,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
hasKey: true,
|
|
94
|
-
value,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
async clear(prefix) {
|
|
98
|
-
await this.storageAdapter.clear(prefix);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.UsableStorageAdapter = UsableStorageAdapter;
|
|
102
|
-
//# sourceMappingURL=usable-storage-adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usable-storage-adapter.js","sourceRoot":"","sources":["../../../src/storage/usable-storage-adapter.ts"],"names":[],"mappings":";;;AAKA,mDAA4D;AAC5D,yDAIqC;AAKrC,MAAa,oBAAoB;IAGA;IAA7B,YAA6B,cAAsC;QAAtC,mBAAc,GAAd,cAAc,CAAwB;IAAG,CAAC;IAEvE,KAAK,CAAC,UAAU,CACZ,IAAa;QAEb,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAC/C,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,EAA4B,CAAC;QAC7C,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;QAC3C,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO,CACT,IAAa;QAEb,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,OAAO,CACT,MAA8B;QAE9B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,UAAU,CACZ,MA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AAqB,EAAC,UAAU,CAAC,CAAC;YAC5C,MAAM,IAAI,CAAC,OAAO,CAAC;gBACf,CAAC,GAAG,CAAC,EAAE,oBAAoB;aAC9B,CAAC,CAAC;YACH,OAAO;gBACH,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,oBAAoB;aAC9B,CAAC;QACN,CAAC;QACD,OAAO;YACH,MAAM,EAAE,IAAI;YACZ,KAAK;SACR,CAAC;IACN,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAc;QACtB,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ;AAxID,oDAwIC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class AsyncAbortIterable {
|
|
2
|
-
collection;
|
|
3
|
-
signal;
|
|
4
|
-
constructor(collection, signal) {
|
|
5
|
-
this.collection = collection;
|
|
6
|
-
this.signal = signal;
|
|
7
|
-
}
|
|
8
|
-
async *[Symbol.asyncIterator]() {
|
|
9
|
-
let hasAborted = false;
|
|
10
|
-
this.signal.addEventListener("abort", () => {
|
|
11
|
-
hasAborted = true;
|
|
12
|
-
});
|
|
13
|
-
for await (const item of this.collection) {
|
|
14
|
-
if (hasAborted) {
|
|
15
|
-
break;
|
|
16
|
-
}
|
|
17
|
-
yield item;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=async-abort-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-abort-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-abort-iterable.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAkB;IAEf;IACA;IAFZ,YACY,UAAoC,EACpC,MAAmB;QADnB,eAAU,GAAV,UAAU,CAA0B;QACpC,WAAM,GAAN,MAAM,CAAa;IAC5B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACvC,UAAU,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAEvC,IAAI,UAAU,EAAE,CAAC;gBACb,MAAM;YACV,CAAC;YACD,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class AsyncDelayIterable {
|
|
2
|
-
collection;
|
|
3
|
-
timeInMs;
|
|
4
|
-
constructor(collection, timeInMs) {
|
|
5
|
-
this.collection = collection;
|
|
6
|
-
this.timeInMs = timeInMs;
|
|
7
|
-
}
|
|
8
|
-
async *[Symbol.asyncIterator]() {
|
|
9
|
-
let isFirstIteration = true;
|
|
10
|
-
for await (const item of this.collection) {
|
|
11
|
-
if (!isFirstIteration) {
|
|
12
|
-
await new Promise((resolve) => setTimeout(resolve, this.timeInMs));
|
|
13
|
-
}
|
|
14
|
-
if (isFirstIteration) {
|
|
15
|
-
isFirstIteration = false;
|
|
16
|
-
}
|
|
17
|
-
yield item;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=async-delay-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-delay-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-delay-iterable.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAkB;IAEf;IACA;IAFZ,YACY,UAAoC,EACpC,QAAgB;QADhB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAAQ;IACzB,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,gBAAgB,GAAG,IAAI,CAAC;QAC5B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACvC,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACpB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1B,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CACrC,CAAC;YACN,CAAC;YACD,IAAI,gBAAgB,EAAE,CAAC;gBACnB,gBAAgB,GAAG,KAAK,CAAC;YAC7B,CAAC;YACD,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export class AsyncTimeoutIterable {
|
|
2
|
-
collection;
|
|
3
|
-
timeInMs;
|
|
4
|
-
constructor(collection, timeInMs) {
|
|
5
|
-
this.collection = collection;
|
|
6
|
-
this.timeInMs = timeInMs;
|
|
7
|
-
}
|
|
8
|
-
async *[Symbol.asyncIterator]() {
|
|
9
|
-
const abortController = new AbortController();
|
|
10
|
-
const timeout = setTimeout(() => {
|
|
11
|
-
abortController.abort();
|
|
12
|
-
}, this.timeInMs);
|
|
13
|
-
yield* this.collection.abort(abortController.signal);
|
|
14
|
-
clearTimeout(timeout);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=async-timeout-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-timeout-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/async-iterable-collection/_shared/async-timeout-iterable.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,oBAAoB;IAEjB;IACA;IAFZ,YACY,UAAoC,EACpC,QAAgB;QADhB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAAQ;IACzB,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,eAAe,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClB,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACrD,YAAY,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACJ"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { simplifyAsyncLazyable } from "../_shared/utilities";
|
|
2
|
-
import { TypeStorageError, UnexpectedStorageError, } from "../contracts/storage/_module";
|
|
3
|
-
export class UsableStorageAdapter {
|
|
4
|
-
storageAdapter;
|
|
5
|
-
constructor(storageAdapter) {
|
|
6
|
-
this.storageAdapter = storageAdapter;
|
|
7
|
-
}
|
|
8
|
-
async existsMany(keys) {
|
|
9
|
-
if (this.storageAdapter.existsMany !== undefined) {
|
|
10
|
-
return await this.storageAdapter.existsMany(keys);
|
|
11
|
-
}
|
|
12
|
-
const getResult = await this.getMany(keys);
|
|
13
|
-
const results = {};
|
|
14
|
-
for (const key in getResult) {
|
|
15
|
-
results[key] = getResult[key] !== null;
|
|
16
|
-
}
|
|
17
|
-
return results;
|
|
18
|
-
}
|
|
19
|
-
async getMany(keys) {
|
|
20
|
-
return await this.storageAdapter.getMany(keys);
|
|
21
|
-
}
|
|
22
|
-
async addMany(values) {
|
|
23
|
-
return await this.storageAdapter.addMany(values);
|
|
24
|
-
}
|
|
25
|
-
async updateMany(values) {
|
|
26
|
-
return await this.storageAdapter.updateMany(values);
|
|
27
|
-
}
|
|
28
|
-
async putMany(values) {
|
|
29
|
-
if (this.storageAdapter.putMany !== undefined) {
|
|
30
|
-
return await this.storageAdapter.putMany(values);
|
|
31
|
-
}
|
|
32
|
-
const removeResults = await this.removeMany(Object.keys(values));
|
|
33
|
-
await this.addMany(values);
|
|
34
|
-
return removeResults;
|
|
35
|
-
}
|
|
36
|
-
async removeMany(keys) {
|
|
37
|
-
return await this.storageAdapter.removeMany(keys);
|
|
38
|
-
}
|
|
39
|
-
async increment(key, value) {
|
|
40
|
-
if (this.storageAdapter.increment !== undefined) {
|
|
41
|
-
return await this.storageAdapter.increment(key, value);
|
|
42
|
-
}
|
|
43
|
-
const { [key]: previousValue } = await this.getMany([key]);
|
|
44
|
-
if (previousValue === undefined) {
|
|
45
|
-
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
46
|
-
}
|
|
47
|
-
if (previousValue === null) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
if (typeof previousValue !== "number") {
|
|
51
|
-
throw new TypeStorageError(`Unable to increment or decrement none number type key "${key}"`);
|
|
52
|
-
}
|
|
53
|
-
const newValue = previousValue + value;
|
|
54
|
-
await this.updateMany({
|
|
55
|
-
[key]: newValue,
|
|
56
|
-
});
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
async getAndRemove(key) {
|
|
60
|
-
if (this.storageAdapter.getAndRemove !== undefined) {
|
|
61
|
-
return await this.storageAdapter.getAndRemove(key);
|
|
62
|
-
}
|
|
63
|
-
const { [key]: value } = await this.getMany([key]);
|
|
64
|
-
if (value === undefined) {
|
|
65
|
-
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
66
|
-
}
|
|
67
|
-
await this.removeMany([key]);
|
|
68
|
-
return value;
|
|
69
|
-
}
|
|
70
|
-
async getOrAdd(key, valueToAdd) {
|
|
71
|
-
if (typeof valueToAdd !== "function" &&
|
|
72
|
-
this.storageAdapter.getOrAdd !== undefined) {
|
|
73
|
-
return await this.storageAdapter.getOrAdd(key, valueToAdd);
|
|
74
|
-
}
|
|
75
|
-
const { [key]: value } = await this.getMany([key]);
|
|
76
|
-
if (value === undefined) {
|
|
77
|
-
throw new UnexpectedStorageError(`Destructed field "key" is undefined`);
|
|
78
|
-
}
|
|
79
|
-
if (value === null) {
|
|
80
|
-
const valueToAddSimplified = await simplifyAsyncLazyable(valueToAdd);
|
|
81
|
-
await this.addMany({
|
|
82
|
-
[key]: valueToAddSimplified,
|
|
83
|
-
});
|
|
84
|
-
return {
|
|
85
|
-
hasKey: false,
|
|
86
|
-
value: valueToAddSimplified,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
hasKey: true,
|
|
91
|
-
value,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
async clear(prefix) {
|
|
95
|
-
await this.storageAdapter.clear(prefix);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=usable-storage-adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usable-storage-adapter.js","sourceRoot":"","sources":["../../../src/storage/usable-storage-adapter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAEH,gBAAgB,EAChB,sBAAsB,GACzB,MAAM,6BAA6B,CAAC;AAKrC,MAAM,OAAO,oBAAoB;IAGA;IAA7B,YAA6B,cAAsC;QAAtC,mBAAc,GAAd,cAAc,CAAwB;IAAG,CAAC;IAEvE,KAAK,CAAC,UAAU,CACZ,IAAa;QAEb,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAC/C,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,EAA4B,CAAC;QAC7C,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;QAC3C,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,K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AAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CACvC,CAAC,GAAG,CAAC,CACR,CAAC;QACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,sBAAsB,CAC5B,qCAAqC,CACxC,CAAC;QACN,CAAC;QACD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACjB,MAAM,oBAAoB,GACtB,MAAM,qBAAqB,CAAC,UAAU,CAAC,CAAC;YAC5C,MAAM,IAAI,CAAC,OAAO,CAAC;gBACf,CAAC,GAAG,CAAC,EAAE,oBAAoB;aAC9B,CAAC,CAAC;YACH,OAAO;gBACH,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,oBAAoB;aAC9B,CAAC;QACN,CAAC;QACD,OAAO;YACH,MAAM,EAAE,IAAI;YACZ,KAAK;SACR,CAAC;IACN,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAc;QACtB,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type IAsyncCollection } from "../../../contracts/collection/_module";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare class AsyncAbortIterable<TInput> implements AsyncIterable<TInput> {
|
|
6
|
-
private collection;
|
|
7
|
-
private signal;
|
|
8
|
-
constructor(collection: IAsyncCollection<TInput>, signal: AbortSignal);
|
|
9
|
-
[Symbol.asyncIterator](): AsyncIterator<TInput>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type IAsyncCollection } from "../../../contracts/collection/_module";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare class AsyncDelayIterable<TInput> implements AsyncIterable<TInput> {
|
|
6
|
-
private collection;
|
|
7
|
-
private timeInMs;
|
|
8
|
-
constructor(collection: IAsyncCollection<TInput>, timeInMs: number);
|
|
9
|
-
[Symbol.asyncIterator](): AsyncIterator<TInput>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type IAsyncCollection } from "../../../contracts/collection/_module";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare class AsyncTimeoutIterable<TInput> implements AsyncIterable<TInput> {
|
|
6
|
-
private collection;
|
|
7
|
-
private timeInMs;
|
|
8
|
-
constructor(collection: IAsyncCollection<TInput>, timeInMs: number);
|
|
9
|
-
[Symbol.asyncIterator](): AsyncIterator<TInput>;
|
|
10
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Storage
|
|
3
|
-
*/
|
|
4
|
-
import type { AsyncLazyable, GetOrAddResult } from "../_shared/types";
|
|
5
|
-
import { type IStorageAdapter } from "../contracts/storage/_module";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare class UsableStorageAdapter<TType> implements Required<Omit<IStorageAdapter<TType>, "getOrAdd">> {
|
|
10
|
-
private readonly storageAdapter;
|
|
11
|
-
constructor(storageAdapter: IStorageAdapter<TType>);
|
|
12
|
-
existsMany<TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, boolean>>;
|
|
13
|
-
getMany<TValues extends TType, TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, TValues | null>>;
|
|
14
|
-
addMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
15
|
-
updateMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
16
|
-
putMany<TValues extends TType, TKeys extends string>(values: Record<TKeys, TValues>): Promise<Record<TKeys, boolean>>;
|
|
17
|
-
removeMany<TKeys extends string>(keys: TKeys[]): Promise<Record<TKeys, boolean>>;
|
|
18
|
-
increment(key: string, value: number): Promise<boolean>;
|
|
19
|
-
getAndRemove<TValue extends TType>(key: string): Promise<TValue | null>;
|
|
20
|
-
getOrAdd<TValue extends TType, TExtended extends TType>(key: string, valueToAdd: AsyncLazyable<TExtended>): Promise<GetOrAddResult<TValue | TExtended>>;
|
|
21
|
-
clear(prefix: string): Promise<void>;
|
|
22
|
-
}
|