@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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
import { type IInvokableObject, type Invokable, type InvokableFn, type OneOrMore } from "../../../utilities/_module-exports.js";
|
|
5
|
+
import type { HookContext } from "../../../utilities/classes/hooks/types.js";
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
9
|
+
* @group Hooks
|
|
10
|
+
*/
|
|
11
|
+
export type NextFunc<TParameters extends unknown[] = unknown[], TReturn = unknown> = InvokableFn<TParameters, TReturn>;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
15
|
+
* @group Hooks
|
|
16
|
+
*/
|
|
17
|
+
export type Context<TContext extends HookContext = HookContext> = {
|
|
18
|
+
name: string;
|
|
19
|
+
context: TContext;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
24
|
+
* @group Hooks
|
|
25
|
+
*/
|
|
26
|
+
export type MiddlewareFn<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = InvokableFn<[
|
|
27
|
+
arguments_: TParameters,
|
|
28
|
+
next: NextFunc<TParameters, TReturn>,
|
|
29
|
+
settings: Context<TContext>
|
|
30
|
+
], TReturn>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
34
|
+
* @group Hooks
|
|
35
|
+
*/
|
|
36
|
+
export type IMiddlewareObject<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = IInvokableObject<[
|
|
37
|
+
arguments_: TParameters,
|
|
38
|
+
next: NextFunc<TParameters, TReturn>,
|
|
39
|
+
settings: Context<TContext>
|
|
40
|
+
], TReturn>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
44
|
+
* @group Hooks
|
|
45
|
+
*/
|
|
46
|
+
export type Middleware<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = IMiddlewareObject<TParameters, TReturn, TContext> | MiddlewareFn<TParameters, TReturn, TContext>;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
50
|
+
* @group Hooks
|
|
51
|
+
*/
|
|
52
|
+
export type HooksSettings<TContext extends HookContext = HookContext> = {
|
|
53
|
+
/**
|
|
54
|
+
* The name of the function which can be used for logging inside the middleware.
|
|
55
|
+
* By default, it takes the function or method name. If an anonymous function is provided, the name defaults to "func".
|
|
56
|
+
*/
|
|
57
|
+
name?: string;
|
|
58
|
+
/**
|
|
59
|
+
* You can provide addtional context that can be used in the middleware.
|
|
60
|
+
*/
|
|
61
|
+
context?: TContext;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of both only sync functions.
|
|
65
|
+
* For example `Hooks` class can be used to log function arguments and return values. Note this class will always return promise and is immutable.
|
|
66
|
+
*
|
|
67
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
68
|
+
* @group Hooks
|
|
69
|
+
*/
|
|
70
|
+
export declare class Hooks<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> implements IInvokableObject<TParameters, TReturn> {
|
|
71
|
+
private readonly invokable;
|
|
72
|
+
private readonly middlewares;
|
|
73
|
+
private readonly settings;
|
|
74
|
+
private static init;
|
|
75
|
+
private readonly func;
|
|
76
|
+
/**
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { Hooks, type MiddlewareFn } from "@daiso-tech/core/utilities";
|
|
80
|
+
*
|
|
81
|
+
* function log<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn, { funcName: string; }> {
|
|
82
|
+
* return (args, next, { name: funcName }) => {
|
|
83
|
+
* console.log("FUNCTION_NAME:", funcName);
|
|
84
|
+
* console.log("ARGUMENTS:", args);
|
|
85
|
+
* const value = next(...args);
|
|
86
|
+
* console.log("RETURN:", value);
|
|
87
|
+
* return value;
|
|
88
|
+
* }
|
|
89
|
+
* }
|
|
90
|
+
*
|
|
91
|
+
* function time<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn> {
|
|
92
|
+
* return (args, next) => {
|
|
93
|
+
* const start = performance.now();
|
|
94
|
+
* const value = next(...args);
|
|
95
|
+
* const end = performance.now();
|
|
96
|
+
* const time = end - start;
|
|
97
|
+
* console.log("TIME:", `${String(time)}ms`);
|
|
98
|
+
* return value;
|
|
99
|
+
* }
|
|
100
|
+
* }
|
|
101
|
+
*
|
|
102
|
+
* function add(a: number, b: number): number {
|
|
103
|
+
* return a + b;
|
|
104
|
+
* }
|
|
105
|
+
*
|
|
106
|
+
* const enhancedAdd = new Hooks(add, [
|
|
107
|
+
* log(),
|
|
108
|
+
* time()
|
|
109
|
+
* ], {
|
|
110
|
+
* // You can provide addtional data to be used the middleware.
|
|
111
|
+
* context: {},
|
|
112
|
+
* });
|
|
113
|
+
*
|
|
114
|
+
* // Will log the function name, arguments and return value.
|
|
115
|
+
* // Will also log the execution time.
|
|
116
|
+
* const result = enhancedAdd.invoke(1, 2);
|
|
117
|
+
*
|
|
118
|
+
* // Will be 3.
|
|
119
|
+
* console.log(result);
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
constructor(invokable: Invokable<TParameters, TReturn>, middlewares: NoInfer<OneOrMore<Middleware<TParameters, TReturn, TContext>>>, settings?: HooksSettings<TContext>);
|
|
123
|
+
/**
|
|
124
|
+
* The `pipe` method returns a new `Hooks` instance with the additional `middlewares` applied.
|
|
125
|
+
*/
|
|
126
|
+
pipe(middlewares: OneOrMore<Middleware<TParameters, TReturn, TContext>>): Hooks<TParameters, TReturn, TContext>;
|
|
127
|
+
/**
|
|
128
|
+
* The `pipeWhen` method conditionally applies additional `middlewares`, returning a new `Hooks` instance only if the specified condition is met.
|
|
129
|
+
*/
|
|
130
|
+
pipeWhen(condition: boolean, middlewares: OneOrMore<Middleware<TParameters, TReturn, TContext>>): Hooks<TParameters, TReturn, TContext>;
|
|
131
|
+
/**
|
|
132
|
+
* The `toFunc` will return the function with all middlewares applied.
|
|
133
|
+
*/
|
|
134
|
+
toFunc(): InvokableFn<TParameters, TReturn>;
|
|
135
|
+
/**
|
|
136
|
+
* The `invoke` method executes the constructor's input function, applying all middlewares.
|
|
137
|
+
*/
|
|
138
|
+
invoke(...arguments_: TParameters): TReturn;
|
|
139
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "../../../utilities/_module-exports.js";
|
|
5
|
+
/**
|
|
6
|
+
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of both only sync functions.
|
|
7
|
+
* For example `Hooks` class can be used to log function arguments and return values. Note this class will always return promise and is immutable.
|
|
8
|
+
*
|
|
9
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
10
|
+
* @group Hooks
|
|
11
|
+
*/
|
|
12
|
+
export class Hooks {
|
|
13
|
+
invokable;
|
|
14
|
+
middlewares;
|
|
15
|
+
settings;
|
|
16
|
+
static init(invokable, middlewares, { name = getInvokableName(invokable), context = {}, }) {
|
|
17
|
+
let func = resolveInvokable(invokable);
|
|
18
|
+
for (const hook of resolveOneOrMore(middlewares)
|
|
19
|
+
.map(resolveInvokable)
|
|
20
|
+
.reverse()) {
|
|
21
|
+
const prevFunc = func;
|
|
22
|
+
const next = (...arguments_) => prevFunc(...arguments_);
|
|
23
|
+
func = (...arguments_) => {
|
|
24
|
+
return hook(arguments_, next, {
|
|
25
|
+
name,
|
|
26
|
+
context,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return func;
|
|
31
|
+
}
|
|
32
|
+
func;
|
|
33
|
+
/**
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { Hooks, type MiddlewareFn } from "@daiso-tech/core/utilities";
|
|
37
|
+
*
|
|
38
|
+
* function log<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn, { funcName: string; }> {
|
|
39
|
+
* return (args, next, { name: funcName }) => {
|
|
40
|
+
* console.log("FUNCTION_NAME:", funcName);
|
|
41
|
+
* console.log("ARGUMENTS:", args);
|
|
42
|
+
* const value = next(...args);
|
|
43
|
+
* console.log("RETURN:", value);
|
|
44
|
+
* return value;
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
*
|
|
48
|
+
* function time<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn> {
|
|
49
|
+
* return (args, next) => {
|
|
50
|
+
* const start = performance.now();
|
|
51
|
+
* const value = next(...args);
|
|
52
|
+
* const end = performance.now();
|
|
53
|
+
* const time = end - start;
|
|
54
|
+
* console.log("TIME:", `${String(time)}ms`);
|
|
55
|
+
* return value;
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* function add(a: number, b: number): number {
|
|
60
|
+
* return a + b;
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
* const enhancedAdd = new Hooks(add, [
|
|
64
|
+
* log(),
|
|
65
|
+
* time()
|
|
66
|
+
* ], {
|
|
67
|
+
* // You can provide addtional data to be used the middleware.
|
|
68
|
+
* context: {},
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* // Will log the function name, arguments and return value.
|
|
72
|
+
* // Will also log the execution time.
|
|
73
|
+
* const result = enhancedAdd.invoke(1, 2);
|
|
74
|
+
*
|
|
75
|
+
* // Will be 3.
|
|
76
|
+
* console.log(result);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
constructor(invokable, middlewares, settings = {}) {
|
|
80
|
+
this.invokable = invokable;
|
|
81
|
+
this.middlewares = middlewares;
|
|
82
|
+
this.settings = settings;
|
|
83
|
+
this.func = Hooks.init(invokable, middlewares, this.settings);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The `pipe` method returns a new `Hooks` instance with the additional `middlewares` applied.
|
|
87
|
+
*/
|
|
88
|
+
pipe(middlewares) {
|
|
89
|
+
return new Hooks(this.invokable, [
|
|
90
|
+
...resolveOneOrMore(this.middlewares),
|
|
91
|
+
...resolveOneOrMore(middlewares),
|
|
92
|
+
], this.settings);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The `pipeWhen` method conditionally applies additional `middlewares`, returning a new `Hooks` instance only if the specified condition is met.
|
|
96
|
+
*/
|
|
97
|
+
pipeWhen(condition, middlewares) {
|
|
98
|
+
if (condition) {
|
|
99
|
+
return this.pipe(middlewares);
|
|
100
|
+
}
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The `toFunc` will return the function with all middlewares applied.
|
|
105
|
+
*/
|
|
106
|
+
toFunc() {
|
|
107
|
+
return (...args) => this.invoke(...args);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The `invoke` method executes the constructor's input function, applying all middlewares.
|
|
111
|
+
*/
|
|
112
|
+
invoke(...arguments_) {
|
|
113
|
+
return this.func(...arguments_);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/utilities/classes/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAKnB,MAAM,gCAAgC,CAAC;AA0FxC;;;;;;GAMG;AACH,MAAM,OAAO,KAAK;IAoFO;IACA;IAGA;IAlFb,MAAM,CAAC,IAAI,CAKf,SAA0C,EAC1C,WAAkE,EAClE,EACI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAClC,OAAO,GAAG,EAAc,GACF;QAE1B,IAAI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,gBAAgB,CAAC,WAAW,CAAC;aAC3C,GAAG,CAAC,gBAAgB,CAAC;aACrB,OAAO,EAAE,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,IAAI,CAAC;YACtB,MAAM,IAAI,GAAG,CAAC,GAAG,UAAuB,EAAE,EAAE,CACxC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC;YAC5B,IAAI,GAAG,CAAC,GAAG,UAAuB,EAAE,EAAE;gBAClC,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE;oBAC1B,IAAI;oBACJ,OAAO;iBACV,CAAC,CAAC;YACP,CAAC,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEgB,IAAI,CAAoC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,YACqB,SAA0C,EAC1C,WAEhB,EACgB,WAAoC,EAAE;QAJtC,cAAS,GAAT,SAAS,CAAiC;QAC1C,gBAAW,GAAX,WAAW,CAE3B;QACgB,aAAQ,GAAR,QAAQ,CAA8B;QAEvD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,IAAI,CACA,WAAkE;QAElE,OAAO,IAAI,KAAK,CACZ,IAAI,CAAC,SAAS,EACd;YACI,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC;YACrC,GAAG,gBAAgB,CAAC,WAAW,CAAC;SACnC,EACD,IAAI,CAAC,QAAQ,CAChB,CAAC;IACN,CAAC;IAED;;OAEG;IACH,QAAQ,CACJ,SAAkB,EAClB,WAAkE;QAElE,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACF,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,GAAG,UAAuB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IACpC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/utilities/classes/hooks/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -13,7 +13,7 @@ type KeySettings = {
|
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
|
-
* IMPORT_PATH:
|
|
16
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
17
17
|
* @group KeyPrefixer
|
|
18
18
|
*/
|
|
19
19
|
export declare class Key {
|
|
@@ -32,7 +32,7 @@ export declare class Key {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
|
-
* IMPORT_PATH:
|
|
35
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
36
36
|
* @group KeyPrefixer
|
|
37
37
|
*/
|
|
38
38
|
export type KeyPrefixerSettings = {
|
|
@@ -44,7 +44,7 @@ export type KeyPrefixerSettings = {
|
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
|
-
* IMPORT_PATH:
|
|
47
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
48
48
|
* @group KeyPrefixer
|
|
49
49
|
*/
|
|
50
50
|
export declare class KeyPrefixer {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { resolveOneOrMoreStr } from "../../../utilities/_module-exports.js";
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
|
-
* IMPORT_PATH:
|
|
7
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
8
8
|
* @group KeyPrefixer
|
|
9
9
|
*/
|
|
10
10
|
export class Key {
|
|
@@ -38,7 +38,7 @@ export class Key {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
*
|
|
41
|
-
* IMPORT_PATH:
|
|
41
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
42
42
|
* @group KeyPrefixer
|
|
43
43
|
*/
|
|
44
44
|
export class KeyPrefixer {
|
|
@@ -65,10 +65,10 @@ export class KeyPrefixer {
|
|
|
65
65
|
validate(key) {
|
|
66
66
|
const resolvedKey = resolveOneOrMoreStr(key);
|
|
67
67
|
if (resolvedKey.includes(this.rootIdentifier)) {
|
|
68
|
-
throw new Error("
|
|
68
|
+
throw new Error(`Resolved key "${resolvedKey}" cannot not include "${this.rootIdentifier}"`);
|
|
69
69
|
}
|
|
70
70
|
if (resolvedKey.includes(this.keyIdentifier)) {
|
|
71
|
-
throw new Error("
|
|
71
|
+
throw new Error(`Resolved key "${resolvedKey}" cannot not include "${this.keyIdentifier}"`);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
getKeyPrefixArray() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-prefixer.js","sourceRoot":"","sources":["../../../../src/utilities/classes/key-prefixer/key-prefixer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAatE;;;;GAIG;AACH,MAAM,OAAO,GAAG;IACK,SAAS,CAAqB;IAC9B,GAAG,CAAoB;IACvB,mBAAmB,CAAS;IAC5B,YAAY,CAAS;IAEtC;;;OAGG;IACH,YAAY,QAAqB;QAC7B,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;QACvE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,mBAAmB,CACtB;YACI,GAAG,IAAI,CAAC,SAAS;YACjB,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC;SACnD,EACD,IAAI,CAAC,mBAAmB,CAC3B,CAAC;IACN,CAAC;CACJ;AAeD;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAOC;IANJ,mBAAmB,CAAS;IAC5B,YAAY,CAAS;IACrB,cAAc,CAAS;IACvB,aAAa,CAAS;IAEvC,YACqB,WAA8B,EAC/C,WAAgC,EAAE;QADjB,gBAAW,GAAX,WAAW,CAAmB;QAG/C,MAAM,EACF,mBAAmB,GAAG,GAAG,EACzB,YAAY,GAAG,GAAG,EAClB,aAAa,GAAG,KAAK,EACrB,cAAc,GAAG,KAAK,GACzB,GAAG,QAAQ,CAAC;QACb,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,kBAAkB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAI,kBAAkB;QAClB,OAAO,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAEO,QAAQ,CAAC,GAAsB;QACnC,MAAM,WAAW,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"key-prefixer.js","sourceRoot":"","sources":["../../../../src/utilities/classes/key-prefixer/key-prefixer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAatE;;;;GAIG;AACH,MAAM,OAAO,GAAG;IACK,SAAS,CAAqB;IAC9B,GAAG,CAAoB;IACvB,mBAAmB,CAAS;IAC5B,YAAY,CAAS;IAEtC;;;OAGG;IACH,YAAY,QAAqB;QAC7B,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;QACvE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,mBAAmB,CACtB;YACI,GAAG,IAAI,CAAC,SAAS;YACjB,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC;SACnD,EACD,IAAI,CAAC,mBAAmB,CAC3B,CAAC;IACN,CAAC;CACJ;AAeD;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAOC;IANJ,mBAAmB,CAAS;IAC5B,YAAY,CAAS;IACrB,cAAc,CAAS;IACvB,aAAa,CAAS;IAEvC,YACqB,WAA8B,EAC/C,WAAgC,EAAE;QADjB,gBAAW,GAAX,WAAW,CAAmB;QAG/C,MAAM,EACF,mBAAmB,GAAG,GAAG,EACzB,YAAY,GAAG,GAAG,EAClB,aAAa,GAAG,KAAK,EACrB,cAAc,GAAG,KAAK,GACzB,GAAG,QAAQ,CAAC;QACb,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,kBAAkB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAI,kBAAkB;QAClB,OAAO,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAEO,QAAQ,CAAC,GAAsB;QACnC,MAAM,WAAW,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACX,iBAAiB,WAAW,yBAAyB,IAAI,CAAC,cAAc,GAAG,CAC9E,CAAC;QACN,CAAC;QACD,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CACX,iBAAiB,WAAW,yBAAyB,IAAI,CAAC,aAAa,GAAG,CAC7E,CAAC;QACN,CAAC;IACL,CAAC;IAEO,iBAAiB;QACrB,OAAO;YACH,mBAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC;YACxD,IAAI,CAAC,cAAc;SACtB,CAAC;IACN,CAAC;IAED,IAAI,SAAS;QACT,OAAO,mBAAmB,CACtB,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,mBAAmB,CAC3B,CAAC;IACN,CAAC;IAED,MAAM,CAAC,GAAsB;QACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,IAAI,GAAG,CAAC;YACX,GAAG;YACH,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE;SACtC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ISerializable } from "../../../serde/contracts/_module-exports.js";
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
6
|
+
* The `TimeSpan` class is used for representing time interval that is the difference between two times measured in a number of days, hours, minutes, and seconds.
|
|
7
|
+
* `TimeSpan` cannot be negative.
|
|
8
8
|
*
|
|
9
|
-
* IMPORT_PATH:
|
|
9
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
10
10
|
* @group TimeSpan
|
|
11
11
|
*/
|
|
12
12
|
export declare class TimeSpan implements ISerializable<number> {
|
|
@@ -46,12 +46,12 @@ export declare class TimeSpan implements ISerializable<number> {
|
|
|
46
46
|
toDays(): number;
|
|
47
47
|
toUTCTimestamp(): number;
|
|
48
48
|
/**
|
|
49
|
-
* Will return endDate relative to a given
|
|
49
|
+
* Will return endDate relative to a given `startDate` argument.
|
|
50
50
|
* @default {new Date()} - current date
|
|
51
51
|
*/
|
|
52
52
|
toEndDate(startDate?: Date): Date;
|
|
53
53
|
/**
|
|
54
|
-
* Will return startDate relative to a given
|
|
54
|
+
* Will return startDate relative to a given `endDate` argument.
|
|
55
55
|
* @default {new Date()} - current date
|
|
56
56
|
*/
|
|
57
57
|
toStartDate(endDate?: Date): Date;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
5
|
+
* The `TimeSpan` class is used for representing time interval that is the difference between two times measured in a number of days, hours, minutes, and seconds.
|
|
6
|
+
* `TimeSpan` cannot be negative.
|
|
7
7
|
*
|
|
8
|
-
* IMPORT_PATH:
|
|
8
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
9
9
|
* @group TimeSpan
|
|
10
10
|
*/
|
|
11
11
|
export class TimeSpan {
|
|
@@ -106,14 +106,14 @@ export class TimeSpan {
|
|
|
106
106
|
return Math.round(this.toMilliseconds() / 1000);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* Will return endDate relative to a given
|
|
109
|
+
* Will return endDate relative to a given `startDate` argument.
|
|
110
110
|
* @default {new Date()} - current date
|
|
111
111
|
*/
|
|
112
112
|
toEndDate(startDate = new Date()) {
|
|
113
113
|
return new Date(startDate.getTime() + this.toMilliseconds());
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* Will return startDate relative to a given
|
|
116
|
+
* Will return startDate relative to a given `endDate` argument.
|
|
117
117
|
* @default {new Date()} - current date
|
|
118
118
|
*/
|
|
119
119
|
toStartDate(endDate = new Date()) {
|
|
@@ -3,4 +3,3 @@ export * from "../../utilities/contracts/initizable.contract.js";
|
|
|
3
3
|
export * from "../../utilities/contracts/prunable.contract.js";
|
|
4
4
|
export * from "../../utilities/contracts/serialized-error.contract.js";
|
|
5
5
|
export * from "../../utilities/contracts/sqlite-database.contract.js";
|
|
6
|
-
export * from "../../utilities/contracts/sync-event-bus-listenable.js";
|
|
@@ -3,5 +3,4 @@ export * from "../../utilities/contracts/initizable.contract.js";
|
|
|
3
3
|
export * from "../../utilities/contracts/prunable.contract.js";
|
|
4
4
|
export * from "../../utilities/contracts/serialized-error.contract.js";
|
|
5
5
|
export * from "../../utilities/contracts/sqlite-database.contract.js";
|
|
6
|
-
export * from "../../utilities/contracts/sync-event-bus-listenable.js";
|
|
7
6
|
//# sourceMappingURL=_module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/contracts/_module.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/contracts/_module.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
|
-
* IMPORT_PATH:
|
|
6
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
7
7
|
* @group Contracts
|
|
8
8
|
*/
|
|
9
9
|
export type ISqliteStatement = {
|
|
@@ -17,7 +17,7 @@ export type ISqliteStatement = {
|
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
|
-
* IMPORT_PATH:
|
|
20
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
21
21
|
* @group Contracts
|
|
22
22
|
*/
|
|
23
23
|
export type ISqliteDatabase = {
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
|
-
* IMPORT_PATH:
|
|
6
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
7
7
|
* @group Errors
|
|
8
8
|
*/
|
|
9
9
|
export declare class FactoryError extends Error {
|
|
10
10
|
constructor(message: string, cause?: unknown);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* The error occurs when attempting to access the default adapter of the
|
|
13
|
+
* The error occurs when attempting to access the default adapter of the `Factory` class instance, which has not been defined.
|
|
14
14
|
*
|
|
15
|
-
* IMPORT_PATH:
|
|
15
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
16
16
|
* @group Errors
|
|
17
17
|
*/
|
|
18
18
|
export declare class DefaultAdapterNotDefinedError extends FactoryError {
|
|
19
19
|
constructor(factoryName: string);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* The error occurs when attempting to access the an adapter of the
|
|
22
|
+
* The error occurs when attempting to access the an adapter of the `Factory` class instance, which has not been registered.
|
|
23
23
|
*
|
|
24
|
-
* IMPORT_PATH:
|
|
24
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
25
25
|
* @group Errors
|
|
26
26
|
*/
|
|
27
27
|
export declare class UnregisteredAdapterError extends FactoryError {
|
package/dist/utilities/errors.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
|
-
* IMPORT_PATH:
|
|
6
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
7
7
|
* @group Errors
|
|
8
8
|
*/
|
|
9
9
|
export class FactoryError extends Error {
|
|
@@ -13,9 +13,9 @@ export class FactoryError extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* The error occurs when attempting to access the default adapter of the
|
|
16
|
+
* The error occurs when attempting to access the default adapter of the `Factory` class instance, which has not been defined.
|
|
17
17
|
*
|
|
18
|
-
* IMPORT_PATH:
|
|
18
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
19
19
|
* @group Errors
|
|
20
20
|
*/
|
|
21
21
|
export class DefaultAdapterNotDefinedError extends FactoryError {
|
|
@@ -25,9 +25,9 @@ export class DefaultAdapterNotDefinedError extends FactoryError {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* The error occurs when attempting to access the an adapter of the
|
|
28
|
+
* The error occurs when attempting to access the an adapter of the `Factory` class instance, which has not been registered.
|
|
29
29
|
*
|
|
30
|
-
* IMPORT_PATH:
|
|
30
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
31
31
|
* @group Errors
|
|
32
32
|
*/
|
|
33
33
|
export class UnregisteredAdapterError extends FactoryError {
|
|
@@ -46,7 +46,7 @@ export function isAsyncFactory(factoryable) {
|
|
|
46
46
|
*/
|
|
47
47
|
export function resolveFactory(factory) {
|
|
48
48
|
if (isFactoryObject(factory)) {
|
|
49
|
-
return factory.use
|
|
49
|
+
return (value) => factory.use(value);
|
|
50
50
|
}
|
|
51
51
|
return factory;
|
|
52
52
|
}
|
|
@@ -55,9 +55,9 @@ export function resolveFactory(factory) {
|
|
|
55
55
|
*/
|
|
56
56
|
export function resolveAsyncFactory(factory) {
|
|
57
57
|
if (isAsyncFactoryObject(factory)) {
|
|
58
|
-
return factory.use
|
|
58
|
+
return (value) => factory.use(value);
|
|
59
59
|
}
|
|
60
|
-
return factory;
|
|
60
|
+
return (value) => factory(value);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/utilities/functions/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;GAEG;AACH,MAAM,UAAU,WAAW,CACvB,OAAqC;IAErC,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC3B,OAAqC;IAErC,OAAO,CACH,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,OAAQ,OAA+B,CAAC,KAAK,CAAC,KAAK,UAAU,CAChE,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CACrB,WAAyC;IAEzC,OAAO,WAAW,CAAC,WAAW,CAAC,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC5B,OAA0C;IAE1C,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAChC,OAA0C;IAE1C,OAAO,CACH,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,OAAQ,OAA+B,CAAC,KAAK,CAAC,KAAK,UAAU,CAChE,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC1B,WAA8C;IAE9C,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC1B,OAAiC;IAEjC,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/utilities/functions/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;GAEG;AACH,MAAM,UAAU,WAAW,CACvB,OAAqC;IAErC,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC3B,OAAqC;IAErC,OAAO,CACH,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,OAAQ,OAA+B,CAAC,KAAK,CAAC,KAAK,UAAU,CAChE,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CACrB,WAAyC;IAEzC,OAAO,WAAW,CAAC,WAAW,CAAC,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC5B,OAA0C;IAE1C,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAChC,OAA0C;IAE1C,OAAO,CACH,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,OAAQ,OAA+B,CAAC,KAAK,CAAC,KAAK,UAAU,CAChE,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC1B,WAA8C;IAE9C,OAAO,gBAAgB,CAAC,WAAW,CAAC,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC1B,OAAiC;IAEjC,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAC/B,OAAsC;IAEtC,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAC9B,WAAyC,EACzC,KAAa;IAEb,IAAI,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACzB,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,WAAW,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,WAA8C,EAC9C,KAAa;IAEb,IAAI,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,mBAAmB,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -5,20 +5,24 @@ import type { Invokable, InvokableFn, IInvokableObject } from "../../utilities/t
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export declare function isInvokableObject<TValue,
|
|
8
|
+
export declare function isInvokableObject<TValue, TParameters extends unknown[], TReturn>(invokable: TValue | Invokable<TParameters, TReturn>): invokable is IInvokableObject<TParameters, TReturn>;
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
export declare function isInvokableFn<TValue,
|
|
12
|
+
export declare function isInvokableFn<TValue, TParameters extends unknown[], TReturn>(invokable: TValue | Invokable<TParameters, TReturn>): invokable is InvokableFn<TParameters, TReturn>;
|
|
13
13
|
/**
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
export declare function isInvokable<TValue,
|
|
16
|
+
export declare function isInvokable<TValue, TParameters extends unknown[], TReturn>(invokable: TValue | Invokable<TParameters, TReturn>): invokable is Invokable<TParameters, TReturn>;
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
export declare function resolveInvokable<
|
|
20
|
+
export declare function resolveInvokable<TParameters extends unknown[], TReturn>(invokable: Invokable<TParameters, TReturn>): InvokableFn<TParameters, TReturn>;
|
|
21
21
|
/**
|
|
22
22
|
* @internal
|
|
23
23
|
*/
|
|
24
|
-
export declare function callInvokable<
|
|
24
|
+
export declare function callInvokable<TParameters extends unknown[], TReturn>(invokable: Invokable<TParameters, TReturn>, ...args: TParameters): TReturn;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function getInvokableName<TParameters extends unknown[], TReturn>(invokable: Invokable<TParameters, TReturn>): string;
|