@daiso-tech/core 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -45
- package/dist/async/_module-exports.d.ts +1 -1
- package/dist/async/_module-exports.js +1 -1
- package/dist/async/_module-exports.js.map +1 -1
- package/dist/async/async.errors.d.ts +27 -19
- package/dist/async/async.errors.js +33 -20
- package/dist/async/async.errors.js.map +1 -1
- package/dist/async/backof-policies/_shared.d.ts +6 -2
- package/dist/async/backof-policies/_shared.js +1 -0
- package/dist/async/backof-policies/_shared.js.map +1 -1
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +2 -2
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js +1 -1
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +2 -2
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +1 -1
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +2 -2
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js +1 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +2 -2
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +1 -1
- package/dist/async/middlewares/_module.d.ts +8 -0
- package/dist/async/middlewares/_module.js +9 -0
- package/dist/async/middlewares/_module.js.map +1 -0
- package/dist/async/middlewares/_shared.d.ts +10 -0
- package/dist/async/middlewares/_shared.js +5 -0
- package/dist/async/middlewares/_shared.js.map +1 -0
- package/dist/async/middlewares/bulkhead/_module.d.ts +1 -0
- package/dist/async/middlewares/bulkhead/_module.js +2 -0
- package/dist/async/middlewares/bulkhead/_module.js.map +1 -0
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +80 -0
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.js +46 -0
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.js.map +1 -0
- package/dist/async/middlewares/dynamic/_module.d.ts +1 -0
- package/dist/async/middlewares/dynamic/_module.js +2 -0
- package/dist/async/middlewares/dynamic/_module.js.map +1 -0
- package/dist/async/middlewares/dynamic/dynamic.middleware.d.ts +34 -0
- package/dist/async/middlewares/dynamic/dynamic.middleware.js +36 -0
- package/dist/async/middlewares/dynamic/dynamic.middleware.js.map +1 -0
- package/dist/async/middlewares/fallback/_module.d.ts +1 -0
- package/dist/async/middlewares/fallback/_module.js +2 -0
- package/dist/async/middlewares/fallback/_module.js.map +1 -0
- package/dist/async/middlewares/fallback/fallback.middleware.d.ts +78 -0
- package/dist/async/middlewares/fallback/fallback.middleware.js +52 -0
- package/dist/async/middlewares/fallback/fallback.middleware.js.map +1 -0
- package/dist/async/middlewares/hedging/_module.d.ts +2 -0
- package/dist/async/middlewares/hedging/_module.js +3 -0
- package/dist/async/middlewares/hedging/_module.js.map +1 -0
- package/dist/async/middlewares/hedging/_shared.d.ts +93 -0
- package/dist/async/middlewares/hedging/_shared.js +5 -0
- package/dist/async/middlewares/hedging/_shared.js.map +1 -0
- package/dist/async/middlewares/hedging/concurrent-hedging/_module.d.ts +1 -0
- package/dist/async/middlewares/hedging/concurrent-hedging/_module.js +2 -0
- package/dist/async/middlewares/hedging/concurrent-hedging/_module.js.map +1 -0
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.d.ts +51 -0
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js +138 -0
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js.map +1 -0
- package/dist/async/middlewares/hedging/sequential-hedging/_module.d.ts +1 -0
- package/dist/async/middlewares/hedging/sequential-hedging/_module.js +2 -0
- package/dist/async/middlewares/hedging/sequential-hedging/_module.js.map +1 -0
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.d.ts +51 -0
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js +104 -0
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js.map +1 -0
- package/dist/async/middlewares/observe/_module.d.ts +1 -0
- package/dist/async/middlewares/observe/_module.js +2 -0
- package/dist/async/middlewares/observe/_module.js.map +1 -0
- package/dist/async/middlewares/observe/observe.middleware.d.ts +130 -0
- package/dist/async/middlewares/observe/observe.middleware.js +80 -0
- package/dist/async/middlewares/observe/observe.middleware.js.map +1 -0
- package/dist/async/middlewares/retry/_module.d.ts +1 -0
- package/dist/async/middlewares/retry/_module.js +2 -0
- package/dist/async/middlewares/retry/_module.js.map +1 -0
- package/dist/async/middlewares/retry/retry.middleware.d.ts +117 -0
- package/dist/async/middlewares/retry/retry.middleware.js +82 -0
- package/dist/async/middlewares/retry/retry.middleware.js.map +1 -0
- package/dist/async/middlewares/timeout/_module.d.ts +1 -0
- package/dist/async/middlewares/timeout/_module.js +2 -0
- package/dist/async/middlewares/timeout/_module.js.map +1 -0
- package/dist/async/middlewares/timeout/timeout.middleware.d.ts +83 -0
- package/dist/async/middlewares/timeout/timeout.middleware.js +60 -0
- package/dist/async/middlewares/timeout/timeout.middleware.js.map +1 -0
- package/dist/async/utilities/_module.d.ts +3 -4
- package/dist/async/utilities/_module.js +3 -4
- package/dist/async/utilities/_module.js.map +1 -1
- package/dist/async/utilities/abort-and-fail/_module.d.ts +1 -0
- package/dist/async/utilities/abort-and-fail/_module.js +2 -0
- package/dist/async/utilities/abort-and-fail/_module.js.map +1 -0
- package/dist/async/utilities/abort-and-fail/abort-and-fail.d.ts +7 -0
- package/dist/async/utilities/{abort → abort-and-fail}/abort-and-fail.js +6 -6
- package/dist/async/utilities/abort-and-fail/abort-and-fail.js.map +1 -0
- package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +37 -194
- package/dist/async/utilities/lazy-promise/lazy-promise.js +62 -359
- package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
- package/dist/async/utilities/promise-queue/_module.d.ts +1 -0
- package/dist/async/utilities/promise-queue/_module.js +2 -0
- package/dist/async/utilities/promise-queue/_module.js.map +1 -0
- package/dist/async/utilities/promise-queue/promise-queue.d.ts +32 -0
- package/dist/async/utilities/promise-queue/promise-queue.js +107 -0
- package/dist/async/utilities/promise-queue/promise-queue.js.map +1 -0
- package/dist/async/utilities/timeout-and-fail/_module.d.ts +1 -0
- package/dist/async/utilities/timeout-and-fail/_module.js +2 -0
- package/dist/async/utilities/timeout-and-fail/_module.js.map +1 -0
- package/dist/async/utilities/timeout-and-fail/timeout-and-fail.d.ts +7 -0
- package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js +19 -0
- package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js.map +1 -0
- package/dist/cache/contracts/cache-adapter.contract.d.ts +14 -14
- package/dist/cache/contracts/cache-factory.contract.d.ts +3 -3
- package/dist/cache/contracts/cache.contract.d.ts +73 -73
- package/dist/cache/contracts/cache.errors.d.ts +7 -7
- package/dist/cache/contracts/cache.errors.js +7 -7
- package/dist/cache/contracts/cache.events.d.ts +54 -58
- package/dist/cache/contracts/cache.events.js +6 -104
- package/dist/cache/contracts/cache.events.js.map +1 -1
- package/dist/cache/contracts/database-cache-adapter.contract.d.ts +16 -16
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +3 -3
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +2 -2
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +3 -9
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +3 -9
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +4 -4
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +3 -3
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +2 -2
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +2 -2
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +3 -3
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +2 -2
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +3 -3
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +2 -2
- package/dist/cache/implementations/derivables/cache/cache.d.ts +26 -27
- package/dist/cache/implementations/derivables/cache/cache.js +102 -91
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +5 -4
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +2 -1
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +3 -3
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +2 -2
- package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +3 -3
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +140 -149
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +3 -3
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +2 -2
- package/dist/collection/contracts/_shared/compartor.type.d.ts +1 -1
- package/dist/collection/contracts/_shared/cross-join-result.type.d.ts +1 -1
- package/dist/collection/contracts/_shared/ensure-map.type.d.ts +1 -1
- package/dist/collection/contracts/_shared/ensure-record.type.d.ts +1 -1
- package/dist/collection/contracts/_shared/foreach.type.d.ts +2 -2
- package/dist/collection/contracts/_shared/map.type.d.ts +2 -2
- package/dist/collection/contracts/_shared/modifier.type.d.ts +2 -2
- package/dist/collection/contracts/_shared/predicate.type.d.ts +7 -7
- package/dist/collection/contracts/_shared/reduce.type.d.ts +2 -2
- package/dist/collection/contracts/_shared/tap.type.d.ts +2 -2
- package/dist/collection/contracts/_shared/transform.type.d.ts +2 -2
- package/dist/collection/contracts/async-collection.contract.d.ts +109 -198
- package/dist/collection/contracts/collection.contract.d.ts +103 -103
- package/dist/collection/contracts/collection.errors.d.ts +11 -11
- package/dist/collection/contracts/collection.errors.js +11 -11
- package/dist/collection/implementations/_shared.d.ts +8 -8
- package/dist/collection/implementations/_shared.js +8 -8
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.d.ts +0 -4
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.js +0 -4
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js +21 -19
- package/dist/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +15 -19
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +15 -30
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/cross-join-iterable.d.ts +3 -3
- package/dist/collection/implementations/iterable-collection/_shared/cross-join-iterable.js +18 -20
- package/dist/collection/implementations/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +11 -12
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +11 -12
- package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/collection/implementations/list-collection/list-collection.d.ts +11 -11
- package/dist/collection/implementations/list-collection/list-collection.js +24 -30
- package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/event-bus/contracts/_module-exports.d.ts +0 -1
- package/dist/event-bus/contracts/_module-exports.js +0 -1
- package/dist/event-bus/contracts/_module-exports.js.map +1 -1
- package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +13 -8
- package/dist/event-bus/contracts/event-bus-factory.contract.d.ts +6 -7
- package/dist/event-bus/contracts/event-bus-factory.contract.js.map +1 -1
- package/dist/event-bus/contracts/event-bus.contract.d.ts +30 -41
- package/dist/event-bus/contracts/event-bus.errors.d.ts +8 -8
- package/dist/event-bus/contracts/event-bus.errors.js +8 -8
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +3 -3
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +3 -3
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +2 -2
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +2 -2
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +3 -3
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +2 -2
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +15 -15
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +32 -32
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +17 -10
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +13 -6
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +3 -5
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +15 -22
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +3 -5
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +189 -209
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +9 -9
- package/dist/lock/contracts/lock-adapter.contract.d.ts +7 -7
- package/dist/lock/contracts/lock-provider-factory.contract.d.ts +4 -4
- package/dist/lock/contracts/lock-provider.contract.d.ts +14 -14
- package/dist/lock/contracts/lock.contract.d.ts +22 -22
- package/dist/lock/contracts/lock.errors.d.ts +10 -10
- package/dist/lock/contracts/lock.errors.js +10 -10
- package/dist/lock/contracts/lock.events.d.ts +45 -54
- package/dist/lock/contracts/lock.events.js +9 -91
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +5 -5
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +4 -4
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +3 -3
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +3 -3
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +5 -5
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +4 -4
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +2 -2
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +2 -2
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +3 -3
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +3 -3
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +5 -5
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +4 -4
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +33 -33
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +30 -30
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +2 -2
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock.js +77 -58
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +5 -4
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +2 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +3 -3
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +2 -2
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +3 -3
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +2 -2
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +3 -3
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +214 -214
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/contracts/deserializer.contract.d.ts +2 -2
- package/dist/serde/contracts/flexible-serde-adapter.contract.d.ts +4 -4
- package/dist/serde/contracts/flexible-serde.contract.d.ts +8 -19
- package/dist/serde/contracts/serde.contract.d.ts +2 -2
- package/dist/serde/contracts/serde.errors.d.ts +4 -4
- package/dist/serde/contracts/serde.errors.js +4 -4
- package/dist/serde/contracts/serializable.contract.d.ts +2 -2
- package/dist/serde/contracts/serializer.contract.d.ts +2 -2
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +2 -2
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +2 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +4 -35
- package/dist/serde/implementations/derivables/serde.js +2 -47
- package/dist/serde/implementations/derivables/serde.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +3 -3
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +2 -2
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +3 -3
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +2 -2
- package/dist/utilities/classes/_module.d.ts +1 -1
- package/dist/utilities/classes/_module.js +1 -1
- package/dist/utilities/classes/_module.js.map +1 -1
- package/dist/utilities/classes/hooks/_module.d.ts +3 -0
- package/dist/utilities/classes/hooks/_module.js +4 -0
- package/dist/utilities/classes/hooks/_module.js.map +1 -0
- package/dist/utilities/classes/hooks/async-hooks.d.ts +209 -0
- package/dist/utilities/classes/hooks/async-hooks.js +145 -0
- package/dist/utilities/classes/hooks/async-hooks.js.map +1 -0
- package/dist/utilities/classes/hooks/hooks.d.ts +139 -0
- package/dist/utilities/classes/hooks/hooks.js +116 -0
- package/dist/utilities/classes/hooks/hooks.js.map +1 -0
- package/dist/utilities/classes/hooks/types.d.ts +9 -0
- package/dist/utilities/classes/hooks/types.js +5 -0
- package/dist/utilities/classes/hooks/types.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +3 -3
- package/dist/utilities/classes/key-prefixer/key-prefixer.js +4 -4
- package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -1
- package/dist/utilities/classes/time-span/time-span.d.ts +5 -5
- package/dist/utilities/classes/time-span/time-span.js +5 -5
- package/dist/utilities/contracts/_module.d.ts +0 -1
- package/dist/utilities/contracts/_module.js +0 -1
- package/dist/utilities/contracts/_module.js.map +1 -1
- package/dist/utilities/contracts/deinitizable.contract.d.ts +1 -1
- package/dist/utilities/contracts/initizable.contract.d.ts +1 -1
- package/dist/utilities/contracts/prunable.contract.d.ts +1 -1
- package/dist/utilities/contracts/serialized-error.contract.d.ts +1 -1
- package/dist/utilities/contracts/sqlite-database.contract.d.ts +2 -2
- package/dist/utilities/errors.d.ts +5 -5
- package/dist/utilities/errors.js +5 -5
- package/dist/utilities/functions/factory.js +3 -3
- package/dist/utilities/functions/factory.js.map +1 -1
- package/dist/utilities/functions/invokable.d.ts +9 -5
- package/dist/utilities/functions/invokable.js +12 -2
- package/dist/utilities/functions/invokable.js.map +1 -1
- package/dist/utilities/functions/lazy.d.ts +5 -0
- package/dist/utilities/functions/lazy.js +12 -3
- package/dist/utilities/functions/lazy.js.map +1 -1
- package/dist/utilities/types/async-iterable-value.type.d.ts +1 -1
- package/dist/utilities/types/at-least-one.type.d.ts +1 -1
- package/dist/utilities/types/factory.type.d.ts +8 -8
- package/dist/utilities/types/invokable.type.d.ts +3 -3
- package/dist/utilities/types/items.type.d.ts +1 -1
- package/dist/utilities/types/lazy.type.d.ts +5 -5
- package/dist/utilities/types/none-func.type.d.ts +1 -1
- package/dist/utilities/types/one-or-more.type.d.ts +1 -1
- package/dist/utilities/types/promiseable.type.d.ts +1 -1
- package/dist/utilities/types/result.type.d.ts +1 -1
- package/package.json +22 -2
- package/dist/async/async.events.d.ts +0 -105
- package/dist/async/async.events.js +0 -82
- package/dist/async/async.events.js.map +0 -1
- package/dist/async/utilities/abort/_module.d.ts +0 -2
- package/dist/async/utilities/abort/_module.js +0 -3
- package/dist/async/utilities/abort/_module.js.map +0 -1
- package/dist/async/utilities/abort/abort-and-fail.d.ts +0 -4
- package/dist/async/utilities/abort/abort-and-fail.js.map +0 -1
- package/dist/async/utilities/abort/abort.d.ts +0 -9
- package/dist/async/utilities/abort/abort.js +0 -18
- package/dist/async/utilities/abort/abort.js.map +0 -1
- package/dist/async/utilities/delay/_module.d.ts +0 -1
- package/dist/async/utilities/delay/_module.js +0 -2
- package/dist/async/utilities/delay/_module.js.map +0 -1
- package/dist/async/utilities/delay/delay.d.ts +0 -10
- package/dist/async/utilities/delay/delay.js +0 -34
- package/dist/async/utilities/delay/delay.js.map +0 -1
- package/dist/async/utilities/retry/_module.d.ts +0 -2
- package/dist/async/utilities/retry/_module.js +0 -3
- package/dist/async/utilities/retry/_module.js.map +0 -1
- package/dist/async/utilities/retry/retry-or-fail.d.ts +0 -29
- package/dist/async/utilities/retry/retry-or-fail.js +0 -39
- package/dist/async/utilities/retry/retry-or-fail.js.map +0 -1
- package/dist/async/utilities/retry/retry.d.ts +0 -10
- package/dist/async/utilities/retry/retry.js +0 -21
- package/dist/async/utilities/retry/retry.js.map +0 -1
- package/dist/async/utilities/timeout/_module.d.ts +0 -2
- package/dist/async/utilities/timeout/_module.js +0 -3
- package/dist/async/utilities/timeout/_module.js.map +0 -1
- package/dist/async/utilities/timeout/timeout-and-fail.d.ts +0 -5
- package/dist/async/utilities/timeout/timeout-and-fail.js +0 -28
- package/dist/async/utilities/timeout/timeout-and-fail.js.map +0 -1
- package/dist/async/utilities/timeout/timeout.d.ts +0 -10
- package/dist/async/utilities/timeout/timeout.js +0 -21
- package/dist/async/utilities/timeout/timeout.js.map +0 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.d.ts +0 -13
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +0 -30
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +0 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.d.ts +0 -13
- package/dist/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +0 -36
- package/dist/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +0 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.d.ts +0 -9
- package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +0 -39
- package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +0 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.d.ts +0 -13
- package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +0 -52
- package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +0 -1
- package/dist/event-bus/contracts/_shared.d.ts +0 -12
- package/dist/event-bus/contracts/_shared.js +0 -15
- package/dist/event-bus/contracts/_shared.js.map +0 -1
- package/dist/utilities/classes/sync-event-bus/_module.d.ts +0 -1
- package/dist/utilities/classes/sync-event-bus/_module.js +0 -2
- package/dist/utilities/classes/sync-event-bus/_module.js.map +0 -1
- package/dist/utilities/classes/sync-event-bus/sync-event-bus.d.ts +0 -16
- package/dist/utilities/classes/sync-event-bus/sync-event-bus.js +0 -53
- package/dist/utilities/classes/sync-event-bus/sync-event-bus.js.map +0 -1
- package/dist/utilities/contracts/sync-event-bus-listenable.d.ts +0 -13
- package/dist/utilities/contracts/sync-event-bus-listenable.js +0 -5
- package/dist/utilities/contracts/sync-event-bus-listenable.js.map +0 -1
|
@@ -5,7 +5,7 @@ import type { IFlexibleSerde, ISerializable } from "../../serde/contracts/_modul
|
|
|
5
5
|
import { type ISerializedError, type OneOrMore } from "../../utilities/_module-exports.js";
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
|
-
* IMPORT_PATH:
|
|
8
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
9
9
|
* @group Errors
|
|
10
10
|
*/
|
|
11
11
|
export declare class CollectionError extends Error implements ISerializable<ISerializedError> {
|
|
@@ -15,7 +15,7 @@ export declare class CollectionError extends Error implements ISerializable<ISer
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
|
-
* IMPORT_PATH:
|
|
18
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
19
19
|
* @group Errors
|
|
20
20
|
*/
|
|
21
21
|
export declare class UnexpectedCollectionError extends CollectionError {
|
|
@@ -25,7 +25,7 @@ export declare class UnexpectedCollectionError extends CollectionError {
|
|
|
25
25
|
/**
|
|
26
26
|
* The error is thrown when the item is not found.
|
|
27
27
|
*
|
|
28
|
-
* IMPORT_PATH:
|
|
28
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
29
29
|
* @group Errors
|
|
30
30
|
*/
|
|
31
31
|
export declare class ItemNotFoundCollectionError extends CollectionError {
|
|
@@ -35,7 +35,7 @@ export declare class ItemNotFoundCollectionError extends CollectionError {
|
|
|
35
35
|
/**
|
|
36
36
|
* The error is thrown when multiple items are found.
|
|
37
37
|
*
|
|
38
|
-
* IMPORT_PATH:
|
|
38
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
39
39
|
* @group Errors
|
|
40
40
|
*/
|
|
41
41
|
export declare class MultipleItemsFoundCollectionError extends CollectionError {
|
|
@@ -43,9 +43,9 @@ export declare class MultipleItemsFoundCollectionError extends CollectionError {
|
|
|
43
43
|
constructor(message: string, cause?: unknown);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* The error is thrown when calling a method that needs all items to be of a specific type. For example, the
|
|
46
|
+
* The error is thrown when calling a method that needs all items to be of a specific type. For example, the `sum` method requires all items to be numbers.
|
|
47
47
|
*
|
|
48
|
-
* IMPORT_PATH:
|
|
48
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
49
49
|
* @group Errors
|
|
50
50
|
*/
|
|
51
51
|
export declare class TypeCollectionError extends CollectionError {
|
|
@@ -53,9 +53,9 @@ export declare class TypeCollectionError extends CollectionError {
|
|
|
53
53
|
constructor(message: string, cause?: unknown);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* The error is thrown when calling a method that needs the collection not to be empty. For example, the
|
|
56
|
+
* The error is thrown when calling a method that needs the collection not to be empty. For example, the `average` method requires the collection not to be empty.
|
|
57
57
|
*
|
|
58
|
-
* IMPORT_PATH:
|
|
58
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
59
59
|
* @group Errors
|
|
60
60
|
*/
|
|
61
61
|
export declare class EmptyCollectionError extends CollectionError {
|
|
@@ -64,7 +64,7 @@ export declare class EmptyCollectionError extends CollectionError {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
*
|
|
67
|
-
* IMPORT_PATH:
|
|
67
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
68
68
|
* @group Errors
|
|
69
69
|
*/
|
|
70
70
|
export declare const COLLECTION_ERRORS: {
|
|
@@ -76,9 +76,9 @@ export declare const COLLECTION_ERRORS: {
|
|
|
76
76
|
readonly Empty: typeof EmptyCollectionError;
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
|
-
* The
|
|
79
|
+
* The `registerCollectionErrorsToSerde` function registers all `ICollection` related errors with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized.
|
|
80
80
|
*
|
|
81
|
-
* IMPORT_PATH:
|
|
81
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
82
82
|
* @group Errors
|
|
83
83
|
*/
|
|
84
84
|
export declare function registerCollectionErrorsToSerde(serde: OneOrMore<IFlexibleSerde>): void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { CORE, resolveOneOrMore, } from "../../utilities/_module-exports.js";
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
|
-
* IMPORT_PATH:
|
|
7
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
8
8
|
* @group Errors
|
|
9
9
|
*/
|
|
10
10
|
export class CollectionError extends Error {
|
|
@@ -25,7 +25,7 @@ export class CollectionError extends Error {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
*
|
|
28
|
-
* IMPORT_PATH:
|
|
28
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
29
29
|
* @group Errors
|
|
30
30
|
*/
|
|
31
31
|
export class UnexpectedCollectionError extends CollectionError {
|
|
@@ -40,7 +40,7 @@ export class UnexpectedCollectionError extends CollectionError {
|
|
|
40
40
|
/**
|
|
41
41
|
* The error is thrown when the item is not found.
|
|
42
42
|
*
|
|
43
|
-
* IMPORT_PATH:
|
|
43
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
44
44
|
* @group Errors
|
|
45
45
|
*/
|
|
46
46
|
export class ItemNotFoundCollectionError extends CollectionError {
|
|
@@ -55,7 +55,7 @@ export class ItemNotFoundCollectionError extends CollectionError {
|
|
|
55
55
|
/**
|
|
56
56
|
* The error is thrown when multiple items are found.
|
|
57
57
|
*
|
|
58
|
-
* IMPORT_PATH:
|
|
58
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
59
59
|
* @group Errors
|
|
60
60
|
*/
|
|
61
61
|
export class MultipleItemsFoundCollectionError extends CollectionError {
|
|
@@ -68,9 +68,9 @@ export class MultipleItemsFoundCollectionError extends CollectionError {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
|
-
* The error is thrown when calling a method that needs all items to be of a specific type. For example, the
|
|
71
|
+
* The error is thrown when calling a method that needs all items to be of a specific type. For example, the `sum` method requires all items to be numbers.
|
|
72
72
|
*
|
|
73
|
-
* IMPORT_PATH:
|
|
73
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
74
74
|
* @group Errors
|
|
75
75
|
*/
|
|
76
76
|
export class TypeCollectionError extends CollectionError {
|
|
@@ -83,9 +83,9 @@ export class TypeCollectionError extends CollectionError {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
* The error is thrown when calling a method that needs the collection not to be empty. For example, the
|
|
86
|
+
* The error is thrown when calling a method that needs the collection not to be empty. For example, the `average` method requires the collection not to be empty.
|
|
87
87
|
*
|
|
88
|
-
* IMPORT_PATH:
|
|
88
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
89
89
|
* @group Errors
|
|
90
90
|
*/
|
|
91
91
|
export class EmptyCollectionError extends CollectionError {
|
|
@@ -99,7 +99,7 @@ export class EmptyCollectionError extends CollectionError {
|
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
*
|
|
102
|
-
* IMPORT_PATH:
|
|
102
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
103
103
|
* @group Errors
|
|
104
104
|
*/
|
|
105
105
|
export const COLLECTION_ERRORS = {
|
|
@@ -111,9 +111,9 @@ export const COLLECTION_ERRORS = {
|
|
|
111
111
|
Empty: EmptyCollectionError,
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
|
-
* The
|
|
114
|
+
* The `registerCollectionErrorsToSerde` function registers all `ICollection` related errors with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized.
|
|
115
115
|
*
|
|
116
|
-
* IMPORT_PATH:
|
|
116
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
117
117
|
* @group Errors
|
|
118
118
|
*/
|
|
119
119
|
export function registerCollectionErrorsToSerde(serde) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { IFlexibleSerde } from "../../serde/contracts/_module-exports.js";
|
|
5
5
|
import { type OneOrMore } from "../../utilities/_module-exports.js";
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
7
|
+
* The `range` function return a {@link Iterable | `Iterable`} of numbers, starting from `from`,increments by 1 and stops at `to`.
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
|
10
10
|
* import { ListCollection, range } from "@daiso-tech/core/collection";
|
|
@@ -14,28 +14,28 @@ import { type OneOrMore } from "../../utilities/_module-exports.js";
|
|
|
14
14
|
* // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
* IMPORT_PATH:
|
|
17
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
18
18
|
* @group Utilities
|
|
19
19
|
*/
|
|
20
20
|
export declare function range(from: number, to: number): Iterable<number>;
|
|
21
21
|
/**
|
|
22
|
-
* The
|
|
22
|
+
* The `isIterable` returns true if the value is {@link Iterable | `Iterable`}.
|
|
23
23
|
*
|
|
24
|
-
* IMPORT_PATH:
|
|
24
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
25
25
|
* @group Utilities
|
|
26
26
|
*/
|
|
27
27
|
export declare function isIterable<TItem>(value: any): value is Iterable<TItem>;
|
|
28
28
|
/**
|
|
29
|
-
* The
|
|
29
|
+
* The `isAsyncIterable` returns true if the value is {@link AsyncIterable | `AsyncIterable`}.
|
|
30
30
|
*
|
|
31
|
-
* IMPORT_PATH:
|
|
31
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
32
32
|
* @group Utilities
|
|
33
33
|
*/
|
|
34
34
|
export declare function isAsyncIterable<TItem>(value: any): value is AsyncIterable<TItem>;
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
36
|
+
* The `registerCollectionsToSerde` function registers the `ListCollection` and `IterableCollection` classes with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized.
|
|
37
37
|
*
|
|
38
|
-
* IMPORT_PATH:
|
|
38
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
39
39
|
* @group Errors
|
|
40
40
|
*/
|
|
41
41
|
export declare function registerCollectionsToSerde(serde: OneOrMore<IFlexibleSerde>): void;
|
|
@@ -20,7 +20,7 @@ class RangeIterable {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* The
|
|
23
|
+
* The `range` function return a {@link Iterable | `Iterable`} of numbers, starting from `from`,increments by 1 and stops at `to`.
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
26
26
|
* import { ListCollection, range } from "@daiso-tech/core/collection";
|
|
@@ -30,16 +30,16 @@ class RangeIterable {
|
|
|
30
30
|
* // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* IMPORT_PATH:
|
|
33
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
34
34
|
* @group Utilities
|
|
35
35
|
*/
|
|
36
36
|
export function range(from, to) {
|
|
37
37
|
return new RangeIterable(from, to);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* The
|
|
40
|
+
* The `isIterable` returns true if the value is {@link Iterable | `Iterable`}.
|
|
41
41
|
*
|
|
42
|
-
* IMPORT_PATH:
|
|
42
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
43
43
|
* @group Utilities
|
|
44
44
|
*/
|
|
45
45
|
export function isIterable(
|
|
@@ -50,9 +50,9 @@ value) {
|
|
|
50
50
|
typeof value[Symbol.iterator] === "function");
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* The
|
|
53
|
+
* The `isAsyncIterable` returns true if the value is {@link AsyncIterable | `AsyncIterable`}.
|
|
54
54
|
*
|
|
55
|
-
* IMPORT_PATH:
|
|
55
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
56
56
|
* @group Utilities
|
|
57
57
|
*/
|
|
58
58
|
export function isAsyncIterable(
|
|
@@ -63,9 +63,9 @@ value) {
|
|
|
63
63
|
typeof value[Symbol.asyncIterator] === "function");
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* The
|
|
66
|
+
* The `registerCollectionsToSerde` function registers the `ListCollection` and `IterableCollection` classes with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized.
|
|
67
67
|
*
|
|
68
|
-
* IMPORT_PATH:
|
|
68
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
69
69
|
* @group Errors
|
|
70
70
|
*/
|
|
71
71
|
export function registerCollectionsToSerde(serde) {
|
|
@@ -30,7 +30,3 @@ export * from "../../../../collection/implementations/async-iterable-collection/
|
|
|
30
30
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-update-iterable.js";
|
|
31
31
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-when-iterable.js";
|
|
32
32
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js";
|
|
33
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js";
|
|
34
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js";
|
|
35
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js";
|
|
36
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js";
|
|
@@ -30,8 +30,4 @@ export * from "../../../../collection/implementations/async-iterable-collection/
|
|
|
30
30
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-update-iterable.js";
|
|
31
31
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-when-iterable.js";
|
|
32
32
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js";
|
|
33
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js";
|
|
34
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js";
|
|
35
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js";
|
|
36
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js";
|
|
37
33
|
//# sourceMappingURL=_module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/_module.ts"],"names":[],"mappings":"AAAA,cAAc,wFAAwF,CAAC;AACvG,cAAc,8FAA8F,CAAC;AAC7G,cAAc,2FAA2F,CAAC;AAC1G,cAAc,2FAA2F,CAAC;AAC1G,cAAc,6FAA6F,CAAC;AAC5G,cAAc,0FAA0F,CAAC;AACzG,cAAc,yFAAyF,CAAC;AACxG,cAAc,2FAA2F,CAAC;AAC1G,cAAc,2FAA2F,CAAC;AAC1G,cAAc,+FAA+F,CAAC;AAC9G,cAAc,gGAAgG,CAAC;AAC/G,cAAc,sFAAsF,CAAC;AACrG,cAAc,wFAAwF,CAAC;AACvG,cAAc,0FAA0F,CAAC;AACzG,cAAc,4FAA4F,CAAC;AAC3G,cAAc,0FAA0F,CAAC;AACzG,cAAc,yFAAyF,CAAC;AACxG,cAAc,0FAA0F,CAAC;AACzG,cAAc,0FAA0F,CAAC;AACzG,cAAc,uFAAuF,CAAC;AACtG,cAAc,6FAA6F,CAAC;AAC5G,cAAc,wFAAwF,CAAC;AACvG,cAAc,0FAA0F,CAAC;AACzG,cAAc,uFAAuF,CAAC;AACtG,cAAc,wFAAwF,CAAC;AACvG,cAAc,uFAAuF,CAAC;AACtG,cAAc,6FAA6F,CAAC;AAC5G,cAAc,sFAAsF,CAAC;AACrG,cAAc,yFAAyF,CAAC;AACxG,cAAc,yFAAyF,CAAC;AACxG,cAAc,uFAAuF,CAAC;AACtG,cAAc,sFAAsF,CAAC
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/_module.ts"],"names":[],"mappings":"AAAA,cAAc,wFAAwF,CAAC;AACvG,cAAc,8FAA8F,CAAC;AAC7G,cAAc,2FAA2F,CAAC;AAC1G,cAAc,2FAA2F,CAAC;AAC1G,cAAc,6FAA6F,CAAC;AAC5G,cAAc,0FAA0F,CAAC;AACzG,cAAc,yFAAyF,CAAC;AACxG,cAAc,2FAA2F,CAAC;AAC1G,cAAc,2FAA2F,CAAC;AAC1G,cAAc,+FAA+F,CAAC;AAC9G,cAAc,gGAAgG,CAAC;AAC/G,cAAc,sFAAsF,CAAC;AACrG,cAAc,wFAAwF,CAAC;AACvG,cAAc,0FAA0F,CAAC;AACzG,cAAc,4FAA4F,CAAC;AAC3G,cAAc,0FAA0F,CAAC;AACzG,cAAc,yFAAyF,CAAC;AACxG,cAAc,0FAA0F,CAAC;AACzG,cAAc,0FAA0F,CAAC;AACzG,cAAc,uFAAuF,CAAC;AACtG,cAAc,6FAA6F,CAAC;AAC5G,cAAc,wFAAwF,CAAC;AACvG,cAAc,0FAA0F,CAAC;AACzG,cAAc,uFAAuF,CAAC;AACtG,cAAc,wFAAwF,CAAC;AACvG,cAAc,uFAAuF,CAAC;AACtG,cAAc,6FAA6F,CAAC;AAC5G,cAAc,sFAAsF,CAAC;AACrG,cAAc,yFAAyF,CAAC;AACxG,cAAc,yFAAyF,CAAC;AACxG,cAAc,uFAAuF,CAAC;AACtG,cAAc,sFAAsF,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {} from "../../../../collection/contracts/_module-exports.js";
|
|
5
5
|
import {} from "../../../../utilities/_module-exports.js";
|
|
6
|
-
import { isIterable } from "../../../../collection/implementations/_shared.js";
|
|
6
|
+
import { isAsyncIterable, isIterable, } from "../../../../collection/implementations/_shared.js";
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
@@ -17,24 +17,26 @@ export class AsyncCrossJoinIterable {
|
|
|
17
17
|
this.makeCollection = makeCollection;
|
|
18
18
|
}
|
|
19
19
|
async *[Symbol.asyncIterator]() {
|
|
20
|
-
const
|
|
21
|
-
this.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
for await (const itemA of this.collection) {
|
|
21
|
+
for await (const itemB of this.iterable) {
|
|
22
|
+
let collection = this.makeCollection([]);
|
|
23
|
+
if (isIterable(itemA) ||
|
|
24
|
+
isAsyncIterable(itemA)) {
|
|
25
|
+
collection = collection.append(itemA);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
collection = collection.append([itemA]);
|
|
29
|
+
}
|
|
30
|
+
if (isIterable(itemB) ||
|
|
31
|
+
isAsyncIterable(itemB)) {
|
|
32
|
+
collection = collection.append(itemB);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
collection = collection.append([itemB]);
|
|
36
|
+
}
|
|
37
|
+
yield (await collection.toArray());
|
|
38
|
+
}
|
|
39
|
+
}
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
//# sourceMappingURL=async-cross-join-iterable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-cross-join-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAyB,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAA2B,MAAM,gCAAgC,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"async-cross-join-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAyB,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAA2B,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACH,eAAe,EACf,UAAU,GACb,MAAM,yCAAyC,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAInB;IACA;IACA;IAHZ,YACY,UAAoC,EACpC,QAAuC,EACvC,cAEqB;QAJrB,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAA+B;QACvC,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAGzB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACtC,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,CAAqB,EAAE,CAAC,CAAC;gBAC7D,IACI,UAAU,CAAqB,KAAK,CAAC;oBACrC,eAAe,CAAqB,KAAK,CAAC,EAC5C,CAAC;oBACC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC1C,CAAC;qBAAM,CAAC;oBACJ,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC5C,CAAC;gBACD,IACI,UAAU,CAAqB,KAAK,CAAC;oBACrC,eAAe,CAAqB,KAAK,CAAC,EAC5C,CAAC;oBACC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC1C,CAAC;qBAAM,CAAC;oBACJ,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC5C,CAAC;gBACD,MAAM,CAAC,MAAM,UAAU,CAAC,OAAO,EAAE,CAGhC,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts
CHANGED
|
@@ -4,26 +4,26 @@
|
|
|
4
4
|
import type { EnsureMap, EnsureRecord } from "../../../collection/contracts/_module-exports.js";
|
|
5
5
|
import { type AsyncCollapse, type AsyncPredicate, type AsyncForEach, type AsyncMap, type AsyncModifier, type AsyncTap, type AsyncTransform, type Comparator, type IAsyncCollection, type AsyncReduce, type CrossJoinResult } from "../../../collection/contracts/_module-exports.js";
|
|
6
6
|
import { type AsyncIterableValue, type AsyncLazyable } from "../../../utilities/_module-exports.js";
|
|
7
|
-
import type { AsyncLazy, Factory
|
|
7
|
+
import type { AsyncLazy, Factory } from "../../../utilities/_module-exports.js";
|
|
8
8
|
import { LazyPromise } from "../../../async/_module-exports.js";
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
|
-
* IMPORT_PATH:
|
|
11
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
12
12
|
* @group Adapters
|
|
13
13
|
*/
|
|
14
14
|
export type AsyncIterableCollectionSettings = {
|
|
15
15
|
lazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* All methods that return
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* All methods that return {@link IAsyncCollection | `IAsyncCollection`} are executed lazly, meaning the execution will occur iterating the items withthe `forEach` method or `for await` loop.
|
|
19
|
+
*
|
|
20
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
21
21
|
* @group Adapters
|
|
22
22
|
*/
|
|
23
23
|
export declare class AsyncIterableCollection<TInput = unknown> implements IAsyncCollection<TInput> {
|
|
24
24
|
private readonly iterable;
|
|
25
25
|
/**
|
|
26
|
-
* The
|
|
26
|
+
* The `concat` static method is a convenient utility for easily concatenating multiple {@link Iterable | `Iterable`} or {@link AsyncIterable | `AsyncIterable`}.
|
|
27
27
|
* @example
|
|
28
28
|
* ```ts
|
|
29
29
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -57,7 +57,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
57
57
|
*/
|
|
58
58
|
static concat<TValue>(iterables: AsyncIterableValue<AsyncIterableValue<TValue>>): IAsyncCollection<TValue>;
|
|
59
59
|
/**
|
|
60
|
-
* The
|
|
60
|
+
* The `difference` static method is used to compute the difference between two {@link Iterable | `Iterable`} instances. By default, the equality check is performed on each item.
|
|
61
61
|
* @example
|
|
62
62
|
* ```ts
|
|
63
63
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -96,7 +96,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
96
96
|
*/
|
|
97
97
|
static difference<TValue, TSelect>(iterableA: AsyncIterableValue<TValue>, iterableB: AsyncIterableValue<TValue>, selectFn?: AsyncMap<TValue, IAsyncCollection<TValue>, TSelect>): IAsyncCollection<TValue>;
|
|
98
98
|
/**
|
|
99
|
-
* The
|
|
99
|
+
* The `zip` static method merges together the values of `iterableA` with the values of the `iterableB` at their corresponding index.
|
|
100
100
|
* The returned collection has size of the shortest collection.
|
|
101
101
|
* @example
|
|
102
102
|
* ```ts
|
|
@@ -125,13 +125,12 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
125
125
|
*/
|
|
126
126
|
static zip<TValueA, TValueB>(iterableA: AsyncIterableValue<TValueA>, iterableB: AsyncIterableValue<TValueB>): IAsyncCollection<[TValueA, TValueB]>;
|
|
127
127
|
private static DEFAULT_CHUNK_SIZE;
|
|
128
|
-
private static defaultRetryPolicy;
|
|
129
128
|
private static makeCollection;
|
|
130
129
|
private readonly lazyPromiseFactory;
|
|
131
130
|
/**
|
|
132
|
-
* The
|
|
131
|
+
* The `constructor` takes an {@link Iterable | `Iterable`} or {@link AsyncIterable | `AsyncIterable`}.
|
|
133
132
|
*
|
|
134
|
-
* Works with
|
|
133
|
+
* Works with `Array`.
|
|
135
134
|
* @example
|
|
136
135
|
* ```ts
|
|
137
136
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -139,7 +138,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
139
138
|
* const collection = new AsyncIterableCollection([1, 2, 3, 4]);
|
|
140
139
|
* ```
|
|
141
140
|
*
|
|
142
|
-
* Works with
|
|
141
|
+
* Works with `String`.
|
|
143
142
|
* @example
|
|
144
143
|
* ```ts
|
|
145
144
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -147,7 +146,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
147
146
|
* const collection = new AsyncIterableCollection("ABCDE");
|
|
148
147
|
* ```
|
|
149
148
|
*
|
|
150
|
-
* Works with
|
|
149
|
+
* Works with `Set`.
|
|
151
150
|
* @example
|
|
152
151
|
* ```ts
|
|
153
152
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -155,7 +154,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
155
154
|
* const collection = new AsyncIterableCollection(new Set([1, 2, 2 4]));
|
|
156
155
|
* ```
|
|
157
156
|
*
|
|
158
|
-
* Works with
|
|
157
|
+
* Works with `Map`.
|
|
159
158
|
* @example
|
|
160
159
|
* ```ts
|
|
161
160
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -163,7 +162,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
163
162
|
* const collection = new AsyncIterableCollection(new Map([["a", 1], ["b", 2]]));
|
|
164
163
|
* ```
|
|
165
164
|
*
|
|
166
|
-
* Works with any
|
|
165
|
+
* Works with any `Iterable`.
|
|
167
166
|
* @example
|
|
168
167
|
* ```ts
|
|
169
168
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -178,7 +177,7 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
178
177
|
* const collection = new AsyncIterableCollection(new MyIterable());
|
|
179
178
|
* ```
|
|
180
179
|
*
|
|
181
|
-
* Works with any
|
|
180
|
+
* Works with any `AsyncIterable`.
|
|
182
181
|
* @example
|
|
183
182
|
* ```ts
|
|
184
183
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -270,9 +269,6 @@ export declare class AsyncIterableCollection<TInput = unknown> implements IAsync
|
|
|
270
269
|
afterOrFail(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<TInput>;
|
|
271
270
|
sole<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): LazyPromise<TOutput>;
|
|
272
271
|
nth(step: number): IAsyncCollection<TInput>;
|
|
273
|
-
delay(time: TimeSpan): IAsyncCollection<TInput>;
|
|
274
|
-
takeUntilAbort(abortSignal: AbortSignal): IAsyncCollection<TInput>;
|
|
275
|
-
takeUntilTimeout(time: TimeSpan): IAsyncCollection<TInput>;
|
|
276
272
|
count(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<number>;
|
|
277
273
|
size(): LazyPromise<number>;
|
|
278
274
|
isEmpty(): LazyPromise<boolean>;
|
package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { ItemNotFoundCollectionError, MultipleItemsFoundCollectionError, UnexpectedCollectionError, TypeCollectionError, EmptyCollectionError, } from "../../../collection/contracts/_module-exports.js";
|
|
5
|
-
import { AsyncCrossJoinIterable, AsyncSlidingIteralbe, AsyncShuffleIterable, AsyncEntriesIterable, AsyncFilterIterable, AsyncChunkIterable, AsyncChunkWhileIterable, AsyncCollapseIterable, AsyncCountByIterable, AsyncFlatMapIterable, AsyncGroupByIterable, AsyncInsertAfterIterable, AsyncInsertBeforeIterable, AsyncMapIterable, AsyncMergeIterable, AsyncPadEndIterable, AsyncPadStartIterable, AsyncPartionIterable, AsyncSkipIterable, AsyncSkipUntilIterable, AsyncSortIterable, AsyncSplitIterable, AsyncTakeIterable, AsyncTakeUntilIterable, AsyncTapIterable, AsyncUniqueIterable, AsyncChangeIterable, AsyncWhenIterable, AsyncZipIterable, AsyncReverseIterable, AsyncSliceIterable, AsyncRepeatIterable,
|
|
5
|
+
import { AsyncCrossJoinIterable, AsyncSlidingIteralbe, AsyncShuffleIterable, AsyncEntriesIterable, AsyncFilterIterable, AsyncChunkIterable, AsyncChunkWhileIterable, AsyncCollapseIterable, AsyncCountByIterable, AsyncFlatMapIterable, AsyncGroupByIterable, AsyncInsertAfterIterable, AsyncInsertBeforeIterable, AsyncMapIterable, AsyncMergeIterable, AsyncPadEndIterable, AsyncPadStartIterable, AsyncPartionIterable, AsyncSkipIterable, AsyncSkipUntilIterable, AsyncSortIterable, AsyncSplitIterable, AsyncTakeIterable, AsyncTakeUntilIterable, AsyncTapIterable, AsyncUniqueIterable, AsyncChangeIterable, AsyncWhenIterable, AsyncZipIterable, AsyncReverseIterable, AsyncSliceIterable, AsyncRepeatIterable, } from "../../../collection/implementations/async-iterable-collection/_shared/_module.js";
|
|
6
6
|
import { isInvokable, resolveFactory, resolveInvokable, } from "../../../utilities/_module-exports.js";
|
|
7
7
|
import { resolveAsyncLazyable } from "../../../utilities/_module-exports.js";
|
|
8
8
|
import { LazyPromise } from "../../../async/_module-exports.js";
|
|
9
9
|
/**
|
|
10
|
-
* All methods that return
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* All methods that return {@link IAsyncCollection | `IAsyncCollection`} are executed lazly, meaning the execution will occur iterating the items withthe `forEach` method or `for await` loop.
|
|
11
|
+
*
|
|
12
|
+
* IMPORT_PATH: `"@daiso-tech/core/collection"`
|
|
13
13
|
* @group Adapters
|
|
14
14
|
*/
|
|
15
15
|
export class AsyncIterableCollection {
|
|
16
16
|
iterable;
|
|
17
17
|
/**
|
|
18
|
-
* The
|
|
18
|
+
* The `concat` static method is a convenient utility for easily concatenating multiple {@link Iterable | `Iterable`} or {@link AsyncIterable | `AsyncIterable`}.
|
|
19
19
|
* @example
|
|
20
20
|
* ```ts
|
|
21
21
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -51,7 +51,7 @@ export class AsyncIterableCollection {
|
|
|
51
51
|
return new AsyncIterableCollection(new AsyncMergeIterable(iterables));
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* The
|
|
54
|
+
* The `difference` static method is used to compute the difference between two {@link Iterable | `Iterable`} instances. By default, the equality check is performed on each item.
|
|
55
55
|
* @example
|
|
56
56
|
* ```ts
|
|
57
57
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -92,7 +92,7 @@ export class AsyncIterableCollection {
|
|
|
92
92
|
return new AsyncIterableCollection(iterableA).difference(iterableB, selectFn);
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* The
|
|
95
|
+
* The `zip` static method merges together the values of `iterableA` with the values of the `iterableB` at their corresponding index.
|
|
96
96
|
* The returned collection has size of the shortest collection.
|
|
97
97
|
* @example
|
|
98
98
|
* ```ts
|
|
@@ -123,20 +123,14 @@ export class AsyncIterableCollection {
|
|
|
123
123
|
return new AsyncIterableCollection(iterableA).zip(iterableB);
|
|
124
124
|
}
|
|
125
125
|
static DEFAULT_CHUNK_SIZE = 1024;
|
|
126
|
-
static defaultRetryPolicy = (error) => {
|
|
127
|
-
return !(error instanceof ItemNotFoundCollectionError ||
|
|
128
|
-
error instanceof MultipleItemsFoundCollectionError ||
|
|
129
|
-
error instanceof TypeCollectionError ||
|
|
130
|
-
error instanceof EmptyCollectionError);
|
|
131
|
-
};
|
|
132
126
|
static makeCollection = (iterable) => {
|
|
133
127
|
return new AsyncIterableCollection(iterable);
|
|
134
128
|
};
|
|
135
129
|
lazyPromiseFactory;
|
|
136
130
|
/**
|
|
137
|
-
* The
|
|
131
|
+
* The `constructor` takes an {@link Iterable | `Iterable`} or {@link AsyncIterable | `AsyncIterable`}.
|
|
138
132
|
*
|
|
139
|
-
* Works with
|
|
133
|
+
* Works with `Array`.
|
|
140
134
|
* @example
|
|
141
135
|
* ```ts
|
|
142
136
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -144,7 +138,7 @@ export class AsyncIterableCollection {
|
|
|
144
138
|
* const collection = new AsyncIterableCollection([1, 2, 3, 4]);
|
|
145
139
|
* ```
|
|
146
140
|
*
|
|
147
|
-
* Works with
|
|
141
|
+
* Works with `String`.
|
|
148
142
|
* @example
|
|
149
143
|
* ```ts
|
|
150
144
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -152,7 +146,7 @@ export class AsyncIterableCollection {
|
|
|
152
146
|
* const collection = new AsyncIterableCollection("ABCDE");
|
|
153
147
|
* ```
|
|
154
148
|
*
|
|
155
|
-
* Works with
|
|
149
|
+
* Works with `Set`.
|
|
156
150
|
* @example
|
|
157
151
|
* ```ts
|
|
158
152
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -160,7 +154,7 @@ export class AsyncIterableCollection {
|
|
|
160
154
|
* const collection = new AsyncIterableCollection(new Set([1, 2, 2 4]));
|
|
161
155
|
* ```
|
|
162
156
|
*
|
|
163
|
-
* Works with
|
|
157
|
+
* Works with `Map`.
|
|
164
158
|
* @example
|
|
165
159
|
* ```ts
|
|
166
160
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -168,7 +162,7 @@ export class AsyncIterableCollection {
|
|
|
168
162
|
* const collection = new AsyncIterableCollection(new Map([["a", 1], ["b", 2]]));
|
|
169
163
|
* ```
|
|
170
164
|
*
|
|
171
|
-
* Works with any
|
|
165
|
+
* Works with any `Iterable`.
|
|
172
166
|
* @example
|
|
173
167
|
* ```ts
|
|
174
168
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -183,7 +177,7 @@ export class AsyncIterableCollection {
|
|
|
183
177
|
* const collection = new AsyncIterableCollection(new MyIterable());
|
|
184
178
|
* ```
|
|
185
179
|
*
|
|
186
|
-
* Works with any
|
|
180
|
+
* Works with any `AsyncIterable`.
|
|
187
181
|
* @example
|
|
188
182
|
* ```ts
|
|
189
183
|
* import { AsyncIterableCollection } from "@daiso-tech/core";
|
|
@@ -204,7 +198,7 @@ export class AsyncIterableCollection {
|
|
|
204
198
|
this.lazyPromiseFactory = resolveFactory(lazyPromiseFactory);
|
|
205
199
|
}
|
|
206
200
|
createLazyPromise(asyncFn) {
|
|
207
|
-
return this.lazyPromiseFactory(asyncFn)
|
|
201
|
+
return this.lazyPromiseFactory(asyncFn);
|
|
208
202
|
}
|
|
209
203
|
async *[Symbol.asyncIterator]() {
|
|
210
204
|
yield* this.iterable;
|
|
@@ -681,15 +675,6 @@ export class AsyncIterableCollection {
|
|
|
681
675
|
nth(step) {
|
|
682
676
|
return this.filter((_item, index) => index % step === 0);
|
|
683
677
|
}
|
|
684
|
-
delay(time) {
|
|
685
|
-
return new AsyncIterableCollection(new AsyncDelayIterable(this, time));
|
|
686
|
-
}
|
|
687
|
-
takeUntilAbort(abortSignal) {
|
|
688
|
-
return new AsyncIterableCollection(new AsyncTakeUntilAbortIterable(this, abortSignal));
|
|
689
|
-
}
|
|
690
|
-
takeUntilTimeout(time) {
|
|
691
|
-
return new AsyncIterableCollection(new AsyncTakeUntilTimeoutIterable(this, time));
|
|
692
|
-
}
|
|
693
678
|
count(predicateFn) {
|
|
694
679
|
return this.createLazyPromise(async () => {
|
|
695
680
|
let size = 0;
|