From 521ce21ed077754c61c00ab4bbc8cdcd3ce80b5b Mon Sep 17 00:00:00 2001 From: Yousif Date: Thu, 26 Dec 2024 23:44:21 +0100 Subject: [PATCH] Refactored all code be grouped based on features --- src/_module.ts | 11 ++++--- src/async/_module.ts | 11 ------- src/async/abortable-iterable/_module.ts | 1 - src/async/abortable/_module.ts | 1 - src/async/backof-policies/_module.ts | 5 --- .../constant-backoff-policy/_module.ts | 1 - .../exponential-backoff-policy/_module.ts | 1 - .../linear-backoff-policy/_module.ts | 1 - .../polynomial-backoff-policy/_module.ts | 1 - src/async/delay-iterable/_module.ts | 1 - src/async/delay/_module.ts | 1 - src/async/lazy-promise/_module.ts | 1 - src/async/retry-iterable/_module.ts | 1 - src/async/retry/_module.ts | 1 - src/async/timeout-iterable/_module.ts | 1 - src/async/timeout/_module.ts | 1 - src/collection/_module.ts | 4 --- .../async-iterable-collection/_module.ts | 1 - .../_shared/_module.ts | 33 ------------------- src/collection/contracts/_module.ts | 3 ++ .../contracts}/_shared.ts | 0 .../contracts}/async-collection.contract.ts | 4 +-- .../contracts}/collection.contract.ts | 2 +- src/collection/implementations/_module.ts | 4 +++ .../{ => implementations}/_shared.ts | 0 .../async-iterable-collection/_module.ts | 1 + .../_shared/_module.ts | 33 +++++++++++++++++++ .../_shared/async-chunk-iterable.ts | 2 +- .../_shared/async-chunk-while-iterable.ts | 2 +- .../_shared/async-collapse-iterable.ts | 7 ++-- .../_shared/async-count-by-iterable.ts | 6 ++-- .../_shared/async-cross-join-iterable.ts | 6 ++-- .../_shared/async-entries-iterable.ts | 0 .../_shared/async-error-handler-iterable.ts | 0 .../_shared/async-filter-iterable.ts | 2 +- .../_shared/async-flat-map-iterable.ts | 2 +- .../_shared/async-group-by-iterable.ts | 6 ++-- .../_shared/async-insert-after-iterable.ts | 2 +- .../_shared/async-insert-before-iterable.ts | 2 +- .../_shared/async-map-iterable.ts | 2 +- .../_shared/async-merge-iterable.ts | 2 +- .../_shared/async-pad-end-iterable.ts | 2 +- .../_shared/async-pad-start-iterable.ts | 2 +- .../_shared/async-partion-iterable.ts | 2 +- .../_shared/async-repeat-iterable.ts | 2 +- .../_shared/async-reverse-iterable.ts | 2 +- .../_shared/async-shuffle-iterable.ts | 2 +- .../_shared/async-skip-iterable.ts | 2 +- .../_shared/async-skip-until-iterable.ts | 2 +- .../_shared/async-slice-iterable.ts | 2 +- .../_shared/async-sliding-iterable.ts | 2 +- .../_shared/async-sort-iterable.ts | 2 +- .../_shared/async-split-iterable.ts | 2 +- .../_shared/async-take-iterable.ts | 2 +- .../_shared/async-take-until-iterable.ts | 2 +- .../_shared/async-tap-iterable.ts | 2 +- .../_shared/async-unique-iterable.ts | 6 ++-- .../_shared/async-update-iterable.ts | 2 +- .../_shared/async-when-iterable.ts | 2 +- .../_shared/async-zip-iterable.ts | 2 +- .../async-iterable-collection.test.ts | 4 +-- .../async-iterable-collection.ts | 18 +++++----- .../iterable-collection/_module.ts | 1 + .../iterable-collection/_shared/_module.ts | 32 ++++++++++++++++++ .../_shared/chunk-iterable.ts | 2 +- .../_shared/chunk-while-iterable.ts | 2 +- .../_shared/collapse-iterable.ts | 4 +-- .../_shared/count-by-iterable.ts | 5 ++- .../_shared/cross-join-iterable.ts | 6 ++-- .../_shared/entries-iterable.ts | 2 +- .../_shared/filter-iterable.ts | 2 +- .../_shared/flat-map-iterable.ts | 2 +- .../_shared/group-by-iterable.ts | 5 ++- .../_shared/insert-after-iterable.ts | 2 +- .../_shared/insert-before-iterable.ts | 2 +- .../_shared/map-iterable.ts | 2 +- .../_shared/merge-iterable.ts | 2 +- .../_shared/pad-end-iterable.ts | 2 +- .../_shared/pad-start-iterable.ts | 2 +- .../_shared/partion-iterable.ts | 2 +- .../_shared/repeat-iterable.ts | 2 +- .../_shared/reverse-iterable.ts | 2 +- .../_shared/shuffle-iterable.ts | 2 +- .../_shared/skip-iterable.ts | 2 +- .../_shared/skip-until-iterable.ts | 2 +- .../_shared/slice-iterable.ts | 2 +- .../_shared/sliding-iterable.ts | 2 +- .../_shared/sort-iterable.ts | 2 +- .../_shared/split-iterable.ts | 2 +- .../_shared/take-iterable.ts | 2 +- .../_shared/take-until-iterable.ts | 2 +- .../_shared/tap-iterable.ts | 2 +- .../_shared/unique-iterable.ts | 5 ++- .../_shared/update-iterable.ts | 2 +- .../_shared/when-iterable.ts | 2 +- .../_shared/zip-iterable.ts | 2 +- .../iterable-collection.test.ts | 4 +-- .../iterable-collection.ts | 7 ++-- .../list-collection/_module.ts | 1 + .../list-collection/list-collection.test.ts | 4 +-- .../list-collection/list-collection.ts | 16 ++++----- src/collection/iterable-collection/_module.ts | 1 - .../iterable-collection/_shared/_module.ts | 32 ------------------ src/collection/list-collection/_module.ts | 1 - src/contracts/_module.ts | 3 -- src/contracts/collection/_module.ts | 3 -- src/contracts/serializer/_module.ts | 1 - src/contracts/storage/_module.ts | 3 -- src/serializer/_module.ts | 10 +++--- .../_shared/test-utilities/_module.ts | 1 - src/serializer/contracts/_module.ts | 1 + .../contracts}/serializer.contract.ts | 0 src/serializer/implementations/_module.ts | 5 +++ .../_shared/test-utilities/_module.ts | 1 + .../test-utilities/serializer.test-suite.ts | 2 +- .../mongodb-serializer/_module.ts | 1 + .../mongodb-serializer.test.ts | 12 +++++++ .../mongodb-serializer/mongodb-serializer.ts | 2 +- .../redis-serializer/_module.ts | 1 + .../redis-serializer/redis-serializer.test.ts | 12 +++++++ .../redis-serializer/redis-serializer.ts | 2 +- .../implementations/sql-serializer/_module.ts | 1 + .../sql-serializer/sql-serializer.test.ts | 12 +++++++ .../sql-serializer/sql-serializer.ts | 2 +- .../super-json-serializer/_module.ts | 1 + .../super-json-serializer.test.ts | 4 +-- .../super-json-serializer.ts | 2 +- src/serializer/mongodb-serializer/_module.ts | 1 - .../mongodb-serializer.test.ts | 12 ------- src/serializer/redis-serializer/_module.ts | 1 - .../redis-serializer/redis-serializer.test.ts | 12 ------- src/serializer/sql-serializer/_module.ts | 1 - .../sql-serializer/sql-serializer.test.ts | 12 ------- .../super-json-serializer/_module.ts | 1 - src/storage/_module.ts | 6 ---- src/storage/_shared/test-utilities/_module.ts | 1 - src/storage/contracts/_module.ts | 3 ++ .../storage => storage/contracts}/_shared.ts | 0 .../contracts}/storage-adapter.contract.ts | 2 +- .../contracts}/storage.contract.ts | 2 +- src/storage/implementations/_module.ts | 6 ++++ .../_shared/test-utilities/_module.ts | 1 + .../test-utilities/storage-api.test-suite.ts | 4 +-- .../storage-namespace.test-suite.ts | 4 +-- .../storage-value.test-suite.ts | 4 +-- .../test-utilities/storage.test-suite.ts | 8 ++--- .../memory-storage-adapter/_module.ts | 1 + .../memory-storage-adapter.test.ts | 4 +-- .../memory-storage-adapter.ts | 4 +-- .../mongodb-storage-adapter/_module.ts | 4 +++ .../mongodb-storage-adapter.test.ts | 4 +-- .../mongodb-storage-adapter.ts | 9 +++-- .../namespace-storage-adapter.ts | 2 +- .../redis-storage-adapter/_module.ts | 1 + .../redis-storage-adapter.test.ts | 4 +-- .../redis-storage-adapter.ts | 11 ++++--- src/storage/implementations/sqlite/_module.ts | 2 ++ .../implementations/sqlite/_shared/_module.ts | 1 + .../_shared/base-sqlite-storage-adapter.ts | 6 ++-- .../sqlite/libsql-storage-adapter/_module.ts | 1 + .../libsql-storage-adapter.test.ts | 4 +-- .../libsql-storage-adapter.ts | 9 ++--- .../sqlite/sqlite-storage-adapter/_module.ts | 1 + .../sqlite-storage-adapter.test.ts | 4 +-- .../sqlite-storage-adapter.ts | 9 ++--- src/storage/{ => implementations}/storage.ts | 8 ++--- src/storage/memory-storage-adapter/_module.ts | 1 - .../mongodb-storage-adapter/_module.ts | 4 --- src/storage/redis-storage-adapter/_module.ts | 1 - src/storage/sqlite/_module.ts | 2 -- src/storage/sqlite/_shared/_module.ts | 1 - .../sqlite/libsql-storage-adapter/_module.ts | 1 - .../sqlite/sqlite-storage-adapter/_module.ts | 1 - src/utilities/_module.ts | 1 + src/utilities/async/_module.ts | 11 +++++++ src/{ => utilities}/async/_shared.ts | 0 .../async/abortable-iterable/_module.ts | 1 + .../abortable-iterable.test.ts | 4 +-- .../abortable-iterable/abortable-iterable.ts | 4 +-- src/utilities/async/abortable/_module.ts | 1 + .../async/abortable/abortable.test.ts | 4 +-- .../async/abortable/abortable.ts | 4 +-- .../async/backof-policies/_module.ts | 5 +++ .../async/backof-policies/_shared.ts | 0 .../constant-backoff-policy/_module.ts | 1 + .../constant-backoff-policy.ts | 2 +- .../exponential-backoff-policy/_module.ts | 1 + .../exponential-backoff-policy.ts | 4 +-- .../linear-backoff-policy/_module.ts | 1 + .../linear-backoff-policy.ts | 4 +-- .../polynomial-backoff-policy/_module.ts | 1 + .../polynomial-backoff-policy.ts | 4 +-- src/utilities/async/delay-iterable/_module.ts | 1 + .../delay-iterable/delay-iterable.test.ts | 6 ++-- .../async/delay-iterable/delay-iterable.ts | 8 ++--- src/utilities/async/delay/_module.ts | 1 + src/{ => utilities}/async/delay/delay.test.ts | 6 ++-- src/{ => utilities}/async/delay/delay.ts | 6 ++-- src/utilities/async/lazy-promise/_module.ts | 1 + .../async/lazy-promise/lazy-promise.test.ts | 2 +- .../async/lazy-promise/lazy-promise.ts | 0 src/utilities/async/retry-iterable/_module.ts | 1 + .../async/retry-iterable/retry-iterable.ts | 6 ++-- src/utilities/async/retry/_module.ts | 1 + src/{ => utilities}/async/retry/retry.test.ts | 6 ++-- src/{ => utilities}/async/retry/retry.ts | 12 +++---- .../async/timeout-iterable/_module.ts | 1 + .../timeout-iterable/timeout-iterable.test.ts | 6 ++-- .../timeout-iterable/timeout-iterable.ts | 4 +-- src/utilities/async/timeout/_module.ts | 1 + .../async/timeout/timeout.test.ts | 6 ++-- src/{ => utilities}/async/timeout/timeout.ts | 6 ++-- src/utilities/time-span/time-span.ts | 4 +-- 213 files changed, 406 insertions(+), 403 deletions(-) delete mode 100644 src/async/_module.ts delete mode 100644 src/async/abortable-iterable/_module.ts delete mode 100644 src/async/abortable/_module.ts delete mode 100644 src/async/backof-policies/_module.ts delete mode 100644 src/async/backof-policies/constant-backoff-policy/_module.ts delete mode 100644 src/async/backof-policies/exponential-backoff-policy/_module.ts delete mode 100644 src/async/backof-policies/linear-backoff-policy/_module.ts delete mode 100644 src/async/backof-policies/polynomial-backoff-policy/_module.ts delete mode 100644 src/async/delay-iterable/_module.ts delete mode 100644 src/async/delay/_module.ts delete mode 100644 src/async/lazy-promise/_module.ts delete mode 100644 src/async/retry-iterable/_module.ts delete mode 100644 src/async/retry/_module.ts delete mode 100644 src/async/timeout-iterable/_module.ts delete mode 100644 src/async/timeout/_module.ts delete mode 100644 src/collection/_module.ts delete mode 100644 src/collection/async-iterable-collection/_module.ts delete mode 100644 src/collection/async-iterable-collection/_shared/_module.ts create mode 100644 src/collection/contracts/_module.ts rename src/{contracts/collection => collection/contracts}/_shared.ts (100%) rename src/{contracts/collection => collection/contracts}/async-collection.contract.ts (99%) rename src/{contracts/collection => collection/contracts}/collection.contract.ts (99%) create mode 100644 src/collection/implementations/_module.ts rename src/collection/{ => implementations}/_shared.ts (100%) create mode 100644 src/collection/implementations/async-iterable-collection/_module.ts create mode 100644 src/collection/implementations/async-iterable-collection/_shared/_module.ts rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-chunk-iterable.ts (94%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-chunk-while-iterable.ts (96%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-collapse-iterable.ts (83%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-count-by-iterable.ts (83%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-cross-join-iterable.ts (90%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-entries-iterable.ts (100%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-error-handler-iterable.ts (100%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-filter-iterable.ts (94%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-flat-map-iterable.ts (93%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-group-by-iterable.ts (86%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-insert-after-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-insert-before-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-map-iterable.ts (92%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-merge-iterable.ts (90%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-pad-end-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-pad-start-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-partion-iterable.ts (96%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-repeat-iterable.ts (91%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-reverse-iterable.ts (92%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-shuffle-iterable.ts (92%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-skip-iterable.ts (88%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-skip-until-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-slice-iterable.ts (92%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-sliding-iterable.ts (92%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-sort-iterable.ts (91%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-split-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-take-iterable.ts (88%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-take-until-iterable.ts (93%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-tap-iterable.ts (91%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-unique-iterable.ts (78%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-update-iterable.ts (96%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-when-iterable.ts (94%) rename src/collection/{ => implementations}/async-iterable-collection/_shared/async-zip-iterable.ts (95%) rename src/collection/{ => implementations}/async-iterable-collection/async-iterable-collection.test.ts (99%) rename src/collection/{ => implementations}/async-iterable-collection/async-iterable-collection.ts (98%) create mode 100644 src/collection/implementations/iterable-collection/_module.ts create mode 100644 src/collection/implementations/iterable-collection/_shared/_module.ts rename src/collection/{ => implementations}/iterable-collection/_shared/chunk-iterable.ts (94%) rename src/collection/{ => implementations}/iterable-collection/_shared/chunk-while-iterable.ts (96%) rename src/collection/{ => implementations}/iterable-collection/_shared/collapse-iterable.ts (84%) rename src/collection/{ => implementations}/iterable-collection/_shared/count-by-iterable.ts (79%) rename src/collection/{ => implementations}/iterable-collection/_shared/cross-join-iterable.ts (91%) rename src/collection/{ => implementations}/iterable-collection/_shared/entries-iterable.ts (89%) rename src/collection/{ => implementations}/iterable-collection/_shared/filter-iterable.ts (93%) rename src/collection/{ => implementations}/iterable-collection/_shared/flat-map-iterable.ts (85%) rename src/collection/{ => implementations}/iterable-collection/_shared/group-by-iterable.ts (84%) rename src/collection/{ => implementations}/iterable-collection/_shared/insert-after-iterable.ts (94%) rename src/collection/{ => implementations}/iterable-collection/_shared/insert-before-iterable.ts (94%) rename src/collection/{ => implementations}/iterable-collection/_shared/map-iterable.ts (84%) rename src/collection/{ => implementations}/iterable-collection/_shared/merge-iterable.ts (88%) rename src/collection/{ => implementations}/iterable-collection/_shared/pad-end-iterable.ts (95%) rename src/collection/{ => implementations}/iterable-collection/_shared/pad-start-iterable.ts (95%) rename src/collection/{ => implementations}/iterable-collection/_shared/partion-iterable.ts (95%) rename src/collection/{ => implementations}/iterable-collection/_shared/repeat-iterable.ts (90%) rename src/collection/{ => implementations}/iterable-collection/_shared/reverse-iterable.ts (91%) rename src/collection/{ => implementations}/iterable-collection/_shared/shuffle-iterable.ts (93%) rename src/collection/{ => implementations}/iterable-collection/_shared/skip-iterable.ts (87%) rename src/collection/{ => implementations}/iterable-collection/_shared/skip-until-iterable.ts (93%) rename src/collection/{ => implementations}/iterable-collection/_shared/slice-iterable.ts (92%) rename src/collection/{ => implementations}/iterable-collection/_shared/sliding-iterable.ts (91%) rename src/collection/{ => implementations}/iterable-collection/_shared/sort-iterable.ts (83%) rename src/collection/{ => implementations}/iterable-collection/_shared/split-iterable.ts (95%) rename src/collection/{ => implementations}/iterable-collection/_shared/take-iterable.ts (87%) rename src/collection/{ => implementations}/iterable-collection/_shared/take-until-iterable.ts (92%) rename src/collection/{ => implementations}/iterable-collection/_shared/tap-iterable.ts (81%) rename src/collection/{ => implementations}/iterable-collection/_shared/unique-iterable.ts (73%) rename src/collection/{ => implementations}/iterable-collection/_shared/update-iterable.ts (95%) rename src/collection/{ => implementations}/iterable-collection/_shared/when-iterable.ts (93%) rename src/collection/{ => implementations}/iterable-collection/_shared/zip-iterable.ts (94%) rename src/collection/{ => implementations}/iterable-collection/iterable-collection.test.ts (99%) rename src/collection/{ => implementations}/iterable-collection/iterable-collection.ts (99%) create mode 100644 src/collection/implementations/list-collection/_module.ts rename src/collection/{ => implementations}/list-collection/list-collection.test.ts (99%) rename src/collection/{ => implementations}/list-collection/list-collection.ts (97%) delete mode 100644 src/collection/iterable-collection/_module.ts delete mode 100644 src/collection/iterable-collection/_shared/_module.ts delete mode 100644 src/collection/list-collection/_module.ts delete mode 100644 src/contracts/_module.ts delete mode 100644 src/contracts/collection/_module.ts delete mode 100644 src/contracts/serializer/_module.ts delete mode 100644 src/contracts/storage/_module.ts delete mode 100644 src/serializer/_shared/test-utilities/_module.ts create mode 100644 src/serializer/contracts/_module.ts rename src/{contracts/serializer => serializer/contracts}/serializer.contract.ts (100%) create mode 100644 src/serializer/implementations/_module.ts create mode 100644 src/serializer/implementations/_shared/test-utilities/_module.ts rename src/serializer/{ => implementations}/_shared/test-utilities/serializer.test-suite.ts (99%) create mode 100644 src/serializer/implementations/mongodb-serializer/_module.ts create mode 100644 src/serializer/implementations/mongodb-serializer/mongodb-serializer.test.ts rename src/serializer/{ => implementations}/mongodb-serializer/mongodb-serializer.ts (96%) create mode 100644 src/serializer/implementations/redis-serializer/_module.ts create mode 100644 src/serializer/implementations/redis-serializer/redis-serializer.test.ts rename src/serializer/{ => implementations}/redis-serializer/redis-serializer.ts (96%) create mode 100644 src/serializer/implementations/sql-serializer/_module.ts create mode 100644 src/serializer/implementations/sql-serializer/sql-serializer.test.ts rename src/serializer/{ => implementations}/sql-serializer/sql-serializer.ts (96%) create mode 100644 src/serializer/implementations/super-json-serializer/_module.ts rename src/serializer/{ => implementations}/super-json-serializer/super-json-serializer.test.ts (51%) rename src/serializer/{ => implementations}/super-json-serializer/super-json-serializer.ts (99%) delete mode 100644 src/serializer/mongodb-serializer/_module.ts delete mode 100644 src/serializer/mongodb-serializer/mongodb-serializer.test.ts delete mode 100644 src/serializer/redis-serializer/_module.ts delete mode 100644 src/serializer/redis-serializer/redis-serializer.test.ts delete mode 100644 src/serializer/sql-serializer/_module.ts delete mode 100644 src/serializer/sql-serializer/sql-serializer.test.ts delete mode 100644 src/serializer/super-json-serializer/_module.ts delete mode 100644 src/storage/_module.ts delete mode 100644 src/storage/_shared/test-utilities/_module.ts create mode 100644 src/storage/contracts/_module.ts rename src/{contracts/storage => storage/contracts}/_shared.ts (100%) rename src/{contracts/storage => storage/contracts}/storage-adapter.contract.ts (98%) rename src/{contracts/storage => storage/contracts}/storage.contract.ts (99%) create mode 100644 src/storage/implementations/_module.ts create mode 100644 src/storage/implementations/_shared/test-utilities/_module.ts rename src/storage/{ => implementations}/_shared/test-utilities/storage-api.test-suite.ts (99%) rename src/storage/{ => implementations}/_shared/test-utilities/storage-namespace.test-suite.ts (98%) rename src/storage/{ => implementations}/_shared/test-utilities/storage-value.test-suite.ts (99%) rename src/storage/{ => implementations}/_shared/test-utilities/storage.test-suite.ts (61%) create mode 100644 src/storage/implementations/memory-storage-adapter/_module.ts rename src/storage/{ => implementations}/memory-storage-adapter/memory-storage-adapter.test.ts (61%) rename src/storage/{ => implementations}/memory-storage-adapter/memory-storage-adapter.ts (97%) create mode 100644 src/storage/implementations/mongodb-storage-adapter/_module.ts rename src/storage/{ => implementations}/mongodb-storage-adapter/mongodb-storage-adapter.test.ts (84%) rename src/storage/{ => implementations}/mongodb-storage-adapter/mongodb-storage-adapter.ts (97%) rename src/storage/{ => implementations}/namespace-storage-adapter.ts (98%) create mode 100644 src/storage/implementations/redis-storage-adapter/_module.ts rename src/storage/{ => implementations}/redis-storage-adapter/redis-storage-adapter.test.ts (80%) rename src/storage/{ => implementations}/redis-storage-adapter/redis-storage-adapter.ts (97%) create mode 100644 src/storage/implementations/sqlite/_module.ts create mode 100644 src/storage/implementations/sqlite/_shared/_module.ts rename src/storage/{ => implementations}/sqlite/_shared/base-sqlite-storage-adapter.ts (97%) create mode 100644 src/storage/implementations/sqlite/libsql-storage-adapter/_module.ts rename src/storage/{ => implementations}/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts (80%) rename src/storage/{ => implementations}/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts (87%) create mode 100644 src/storage/implementations/sqlite/sqlite-storage-adapter/_module.ts rename src/storage/{ => implementations}/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts (77%) rename src/storage/{ => implementations}/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts (87%) rename src/storage/{ => implementations}/storage.ts (97%) delete mode 100644 src/storage/memory-storage-adapter/_module.ts delete mode 100644 src/storage/mongodb-storage-adapter/_module.ts delete mode 100644 src/storage/redis-storage-adapter/_module.ts delete mode 100644 src/storage/sqlite/_module.ts delete mode 100644 src/storage/sqlite/_shared/_module.ts delete mode 100644 src/storage/sqlite/libsql-storage-adapter/_module.ts delete mode 100644 src/storage/sqlite/sqlite-storage-adapter/_module.ts create mode 100644 src/utilities/async/_module.ts rename src/{ => utilities}/async/_shared.ts (100%) create mode 100644 src/utilities/async/abortable-iterable/_module.ts rename src/{ => utilities}/async/abortable-iterable/abortable-iterable.test.ts (96%) rename src/{ => utilities}/async/abortable-iterable/abortable-iterable.ts (95%) create mode 100644 src/utilities/async/abortable/_module.ts rename src/{ => utilities}/async/abortable/abortable.test.ts (95%) rename src/{ => utilities}/async/abortable/abortable.ts (96%) create mode 100644 src/utilities/async/backof-policies/_module.ts rename src/{ => utilities}/async/backof-policies/_shared.ts (100%) create mode 100644 src/utilities/async/backof-policies/constant-backoff-policy/_module.ts rename src/{ => utilities}/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts (95%) create mode 100644 src/utilities/async/backof-policies/exponential-backoff-policy/_module.ts rename src/{ => utilities}/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts (90%) create mode 100644 src/utilities/async/backof-policies/linear-backoff-policy/_module.ts rename src/{ => utilities}/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts (89%) create mode 100644 src/utilities/async/backof-policies/polynomial-backoff-policy/_module.ts rename src/{ => utilities}/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts (90%) create mode 100644 src/utilities/async/delay-iterable/_module.ts rename src/{ => utilities}/async/delay-iterable/delay-iterable.test.ts (93%) rename src/{ => utilities}/async/delay-iterable/delay-iterable.ts (92%) create mode 100644 src/utilities/async/delay/_module.ts rename src/{ => utilities}/async/delay/delay.test.ts (86%) rename src/{ => utilities}/async/delay/delay.ts (91%) create mode 100644 src/utilities/async/lazy-promise/_module.ts rename src/{ => utilities}/async/lazy-promise/lazy-promise.test.ts (94%) rename src/{ => utilities}/async/lazy-promise/lazy-promise.ts (100%) create mode 100644 src/utilities/async/retry-iterable/_module.ts rename src/{ => utilities}/async/retry-iterable/retry-iterable.ts (96%) create mode 100644 src/utilities/async/retry/_module.ts rename src/{ => utilities}/async/retry/retry.test.ts (95%) rename src/{ => utilities}/async/retry/retry.ts (92%) create mode 100644 src/utilities/async/timeout-iterable/_module.ts rename src/{ => utilities}/async/timeout-iterable/timeout-iterable.test.ts (97%) rename src/{ => utilities}/async/timeout-iterable/timeout-iterable.ts (93%) create mode 100644 src/utilities/async/timeout/_module.ts rename src/{ => utilities}/async/timeout/timeout.test.ts (96%) rename src/{ => utilities}/async/timeout/timeout.ts (93%) diff --git a/src/_module.ts b/src/_module.ts index af8048a3..53b02357 100644 --- a/src/_module.ts +++ b/src/_module.ts @@ -1,6 +1,7 @@ -export * from "@/async/_module"; -export * from "@/contracts/_module"; -export * from "@/collection/_module"; -export * from "@/serializer/_module"; -export * from "@/storage/_module"; +export * from "@/collection/implementations/_module"; +export * from "@/collection/contracts/_module"; +export * from "@/serializer/implementations/_module"; +export * from "@/serializer/contracts/_module"; +export * from "@/storage/implementations/_module"; +export * from "@/storage/contracts/_module"; export * from "@/utilities/_module"; diff --git a/src/async/_module.ts b/src/async/_module.ts deleted file mode 100644 index 08dbea66..00000000 --- a/src/async/_module.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from "@/async/_shared"; -export * from "@/async/abortable/_module"; -export * from "@/async/abortable-iterable/_module"; -export * from "@/async/backof-policies/_module"; -export * from "@/async/delay/_module"; -export * from "@/async/delay-iterable/_module"; -export * from "@/async/lazy-promise/_module"; -export * from "@/async/retry/_module"; -export { retryIterable as unstable_retryIterable } from "@/async/retry-iterable/_module"; -export * from "@/async/timeout/_module"; -export * from "@/async/timeout-iterable/_module"; diff --git a/src/async/abortable-iterable/_module.ts b/src/async/abortable-iterable/_module.ts deleted file mode 100644 index c3e8a911..00000000 --- a/src/async/abortable-iterable/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/abortable-iterable/abortable-iterable"; diff --git a/src/async/abortable/_module.ts b/src/async/abortable/_module.ts deleted file mode 100644 index c38fc453..00000000 --- a/src/async/abortable/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/abortable/abortable"; diff --git a/src/async/backof-policies/_module.ts b/src/async/backof-policies/_module.ts deleted file mode 100644 index 5f1c3264..00000000 --- a/src/async/backof-policies/_module.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { type BackoffPolicy } from "@/async/backof-policies/_shared"; -export * from "@/async/backof-policies/constant-backoff-policy/_module"; -export * from "@/async/backof-policies/exponential-backoff-policy/_module"; -export * from "@/async/backof-policies/linear-backoff-policy/_module"; -export * from "@/async/backof-policies/polynomial-backoff-policy/_module"; diff --git a/src/async/backof-policies/constant-backoff-policy/_module.ts b/src/async/backof-policies/constant-backoff-policy/_module.ts deleted file mode 100644 index b2df75ac..00000000 --- a/src/async/backof-policies/constant-backoff-policy/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/backof-policies/constant-backoff-policy/constant-backoff-policy"; diff --git a/src/async/backof-policies/exponential-backoff-policy/_module.ts b/src/async/backof-policies/exponential-backoff-policy/_module.ts deleted file mode 100644 index be3b782f..00000000 --- a/src/async/backof-policies/exponential-backoff-policy/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy"; diff --git a/src/async/backof-policies/linear-backoff-policy/_module.ts b/src/async/backof-policies/linear-backoff-policy/_module.ts deleted file mode 100644 index 4c396e9b..00000000 --- a/src/async/backof-policies/linear-backoff-policy/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/backof-policies/linear-backoff-policy/linear-backoff-policy"; diff --git a/src/async/backof-policies/polynomial-backoff-policy/_module.ts b/src/async/backof-policies/polynomial-backoff-policy/_module.ts deleted file mode 100644 index c2b7b862..00000000 --- a/src/async/backof-policies/polynomial-backoff-policy/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy"; diff --git a/src/async/delay-iterable/_module.ts b/src/async/delay-iterable/_module.ts deleted file mode 100644 index 18c2631d..00000000 --- a/src/async/delay-iterable/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/delay-iterable/delay-iterable"; diff --git a/src/async/delay/_module.ts b/src/async/delay/_module.ts deleted file mode 100644 index f7c4e395..00000000 --- a/src/async/delay/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/delay/delay"; diff --git a/src/async/lazy-promise/_module.ts b/src/async/lazy-promise/_module.ts deleted file mode 100644 index 18628a0e..00000000 --- a/src/async/lazy-promise/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/lazy-promise/lazy-promise"; diff --git a/src/async/retry-iterable/_module.ts b/src/async/retry-iterable/_module.ts deleted file mode 100644 index c723c072..00000000 --- a/src/async/retry-iterable/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/retry-iterable/retry-iterable"; diff --git a/src/async/retry/_module.ts b/src/async/retry/_module.ts deleted file mode 100644 index 704a1748..00000000 --- a/src/async/retry/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/retry/retry"; diff --git a/src/async/timeout-iterable/_module.ts b/src/async/timeout-iterable/_module.ts deleted file mode 100644 index 31493a5e..00000000 --- a/src/async/timeout-iterable/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/timeout-iterable/timeout-iterable"; diff --git a/src/async/timeout/_module.ts b/src/async/timeout/_module.ts deleted file mode 100644 index 03b7df47..00000000 --- a/src/async/timeout/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/async/timeout/timeout"; diff --git a/src/collection/_module.ts b/src/collection/_module.ts deleted file mode 100644 index eca0327e..00000000 --- a/src/collection/_module.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "@/collection/_shared"; -export * from "@/collection/list-collection/_module"; -export * from "@/collection/iterable-collection/_module"; -export * from "@/collection/async-iterable-collection/_module"; diff --git a/src/collection/async-iterable-collection/_module.ts b/src/collection/async-iterable-collection/_module.ts deleted file mode 100644 index 8e11158a..00000000 --- a/src/collection/async-iterable-collection/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/collection/async-iterable-collection/async-iterable-collection"; diff --git a/src/collection/async-iterable-collection/_shared/_module.ts b/src/collection/async-iterable-collection/_shared/_module.ts deleted file mode 100644 index 29b76860..00000000 --- a/src/collection/async-iterable-collection/_shared/_module.ts +++ /dev/null @@ -1,33 +0,0 @@ -export * from "@/collection/async-iterable-collection/_shared/async-chunk-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-chunk-while-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-collapse-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-count-by-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-cross-join-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-entries-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-error-handler-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-filter-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-flat-map-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-group-by-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-insert-after-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-insert-before-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-map-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-merge-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-pad-end-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-pad-start-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-partion-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-repeat-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-reverse-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-shuffle-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-skip-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-skip-until-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-slice-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-sliding-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-sort-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-split-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-take-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-take-until-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-tap-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-unique-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-update-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-when-iterable"; -export * from "@/collection/async-iterable-collection/_shared/async-zip-iterable"; diff --git a/src/collection/contracts/_module.ts b/src/collection/contracts/_module.ts new file mode 100644 index 00000000..7e90fa18 --- /dev/null +++ b/src/collection/contracts/_module.ts @@ -0,0 +1,3 @@ +export * from "@/collection/contracts/_shared"; +export * from "@/collection/contracts/collection.contract"; +export * from "@/collection/contracts/async-collection.contract"; diff --git a/src/contracts/collection/_shared.ts b/src/collection/contracts/_shared.ts similarity index 100% rename from src/contracts/collection/_shared.ts rename to src/collection/contracts/_shared.ts diff --git a/src/contracts/collection/async-collection.contract.ts b/src/collection/contracts/async-collection.contract.ts similarity index 99% rename from src/contracts/collection/async-collection.contract.ts rename to src/collection/contracts/async-collection.contract.ts index 41de1dd2..a4c1ac17 100644 --- a/src/contracts/collection/async-collection.contract.ts +++ b/src/collection/contracts/async-collection.contract.ts @@ -26,14 +26,14 @@ import type { // eslint-disable-next-line @typescript-eslint/no-unused-vars EmptyCollectionError, ChangendItem, -} from "@/contracts/collection/_shared"; +} from "@/collection/contracts/_shared"; import type { RecordItem, AsyncLazyable, EnsureType, AsyncIterableValue, } from "@/_shared/types"; -import type { TimeSpan } from "@/_module"; +import type { TimeSpan } from "@/utilities/_module"; export type AsyncCollapse = TValue extends | Array diff --git a/src/contracts/collection/collection.contract.ts b/src/collection/contracts/collection.contract.ts similarity index 99% rename from src/contracts/collection/collection.contract.ts rename to src/collection/contracts/collection.contract.ts index a1cc7dda..274c21a2 100644 --- a/src/contracts/collection/collection.contract.ts +++ b/src/collection/contracts/collection.contract.ts @@ -25,7 +25,7 @@ import type { ChangendItem, Reduce, CrossJoinResult, -} from "@/contracts/collection/_shared"; +} from "@/collection/contracts/_shared"; import type { Lazyable, RecordItem, EnsureType } from "@/_shared/types"; export type Collapse = TValue extends diff --git a/src/collection/implementations/_module.ts b/src/collection/implementations/_module.ts new file mode 100644 index 00000000..a9641808 --- /dev/null +++ b/src/collection/implementations/_module.ts @@ -0,0 +1,4 @@ +export * from "@/collection/implementations/_shared"; +export * from "@/collection/implementations/list-collection/_module"; +export * from "@/collection/implementations/iterable-collection/_module"; +export * from "@/collection/implementations/async-iterable-collection/_module"; diff --git a/src/collection/_shared.ts b/src/collection/implementations/_shared.ts similarity index 100% rename from src/collection/_shared.ts rename to src/collection/implementations/_shared.ts diff --git a/src/collection/implementations/async-iterable-collection/_module.ts b/src/collection/implementations/async-iterable-collection/_module.ts new file mode 100644 index 00000000..fa7ffceb --- /dev/null +++ b/src/collection/implementations/async-iterable-collection/_module.ts @@ -0,0 +1 @@ +export * from "@/collection/implementations/async-iterable-collection/async-iterable-collection"; diff --git a/src/collection/implementations/async-iterable-collection/_shared/_module.ts b/src/collection/implementations/async-iterable-collection/_shared/_module.ts new file mode 100644 index 00000000..34a59af2 --- /dev/null +++ b/src/collection/implementations/async-iterable-collection/_shared/_module.ts @@ -0,0 +1,33 @@ +export * from "@/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-entries-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-filter-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-map-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-merge-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-partion-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-skip-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-slice-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-sort-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-split-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-take-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-tap-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-unique-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-update-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-when-iterable"; +export * from "@/collection/implementations/async-iterable-collection/_shared/async-zip-iterable"; diff --git a/src/collection/async-iterable-collection/_shared/async-chunk-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.ts similarity index 94% rename from src/collection/async-iterable-collection/_shared/async-chunk-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.ts index 5e8dddf9..91cc8648 100644 --- a/src/collection/async-iterable-collection/_shared/async-chunk-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-chunk-while-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.ts similarity index 96% rename from src/collection/async-iterable-collection/_shared/async-chunk-while-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.ts index 5afde21d..98539188 100644 --- a/src/collection/async-iterable-collection/_shared/async-chunk-while-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-collapse-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.ts similarity index 83% rename from src/collection/async-iterable-collection/_shared/async-collapse-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.ts index 8c42011b..761d6d4d 100644 --- a/src/collection/async-iterable-collection/_shared/async-collapse-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.ts @@ -1,8 +1,11 @@ -import { isAsyncIterable, isIterable } from "@/collection/_shared"; +import { + isAsyncIterable, + isIterable, +} from "@/collection/implementations/_shared"; import { type AsyncCollapse, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-count-by-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.ts similarity index 83% rename from src/collection/async-iterable-collection/_shared/async-count-by-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.ts index 83a99a65..5fd2ffd9 100644 --- a/src/collection/async-iterable-collection/_shared/async-count-by-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncMap, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type RecordItem } from "@/_shared/types"; /** * @internal @@ -15,9 +15,7 @@ export class AsyncCountByIterable TInput, IAsyncCollection, TOutput - > = (item) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return - item as any, + > = (item) => item as unknown as TOutput, ) {} async *[Symbol.asyncIterator](): AsyncIterator< diff --git a/src/collection/async-iterable-collection/_shared/async-cross-join-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.ts similarity index 90% rename from src/collection/async-iterable-collection/_shared/async-cross-join-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.ts index 0cc8a7f7..306b4cc7 100644 --- a/src/collection/async-iterable-collection/_shared/async-cross-join-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.ts @@ -1,7 +1,7 @@ -import type { CrossJoinResult } from "@/contracts/collection/_module"; -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import type { CrossJoinResult } from "@/collection/contracts/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; -import { isIterable } from "@/collection/_module"; +import { isIterable } from "@/collection/implementations/_shared"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-entries-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.ts similarity index 100% rename from src/collection/async-iterable-collection/_shared/async-entries-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.ts diff --git a/src/collection/async-iterable-collection/_shared/async-error-handler-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.ts similarity index 100% rename from src/collection/async-iterable-collection/_shared/async-error-handler-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.ts diff --git a/src/collection/async-iterable-collection/_shared/async-filter-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.ts similarity index 94% rename from src/collection/async-iterable-collection/_shared/async-filter-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.ts index af99769c..58551309 100644 --- a/src/collection/async-iterable-collection/_shared/async-filter-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-flat-map-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.ts similarity index 93% rename from src/collection/async-iterable-collection/_shared/async-flat-map-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.ts index 6ebe3019..afb9186a 100644 --- a/src/collection/async-iterable-collection/_shared/async-flat-map-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncMap, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-group-by-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.ts similarity index 86% rename from src/collection/async-iterable-collection/_shared/async-group-by-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.ts index 847202a9..279e47eb 100644 --- a/src/collection/async-iterable-collection/_shared/async-group-by-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncMap, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type AsyncIterableValue, type RecordItem } from "@/_shared/types"; /** @@ -16,9 +16,7 @@ export class AsyncGroupByIterable TInput, IAsyncCollection, TOutput - > = (item) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return - item as any, + > = (item) => item as unknown as TOutput, private makeCollection: ( iterable: AsyncIterableValue, diff --git a/src/collection/async-iterable-collection/_shared/async-insert-after-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-insert-after-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.ts index 54d42872..7d3e5d7e 100644 --- a/src/collection/async-iterable-collection/_shared/async-insert-after-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-insert-before-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-insert-before-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.ts index e7127232..8f5ef3fc 100644 --- a/src/collection/async-iterable-collection/_shared/async-insert-before-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-map-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-map-iterable.ts similarity index 92% rename from src/collection/async-iterable-collection/_shared/async-map-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-map-iterable.ts index 963f3828..d60cab0d 100644 --- a/src/collection/async-iterable-collection/_shared/async-map-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-map-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncMap, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-merge-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.ts similarity index 90% rename from src/collection/async-iterable-collection/_shared/async-merge-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.ts index d0071774..620fcb57 100644 --- a/src/collection/async-iterable-collection/_shared/async-merge-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.ts @@ -1,4 +1,4 @@ -import {} from "@/contracts/collection/_module"; +import {} from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-pad-end-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-pad-end-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.ts index f4215c35..ca3b96ba 100644 --- a/src/collection/async-iterable-collection/_shared/async-pad-end-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-pad-start-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-pad-start-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.ts index 250a7169..93d8d439 100644 --- a/src/collection/async-iterable-collection/_shared/async-pad-start-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-partion-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.ts similarity index 96% rename from src/collection/async-iterable-collection/_shared/async-partion-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.ts index 985bbfe0..b3eb966c 100644 --- a/src/collection/async-iterable-collection/_shared/async-partion-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-repeat-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.ts similarity index 91% rename from src/collection/async-iterable-collection/_shared/async-repeat-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.ts index fefe3fde..79dd72bc 100644 --- a/src/collection/async-iterable-collection/_shared/async-repeat-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-reverse-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.ts similarity index 92% rename from src/collection/async-iterable-collection/_shared/async-reverse-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.ts index 42d21c0f..1d54049e 100644 --- a/src/collection/async-iterable-collection/_shared/async-reverse-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-shuffle-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.ts similarity index 92% rename from src/collection/async-iterable-collection/_shared/async-shuffle-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.ts index b4f9575e..9f0a0171 100644 --- a/src/collection/async-iterable-collection/_shared/async-shuffle-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-skip-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.ts similarity index 88% rename from src/collection/async-iterable-collection/_shared/async-skip-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.ts index 904dde95..a5ade71c 100644 --- a/src/collection/async-iterable-collection/_shared/async-skip-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-skip-until-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-skip-until-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.ts index ba41d782..ff82592b 100644 --- a/src/collection/async-iterable-collection/_shared/async-skip-until-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-slice-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.ts similarity index 92% rename from src/collection/async-iterable-collection/_shared/async-slice-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.ts index 400fba40..a36a2c37 100644 --- a/src/collection/async-iterable-collection/_shared/async-slice-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-sliding-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.ts similarity index 92% rename from src/collection/async-iterable-collection/_shared/async-sliding-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.ts index 5efd3a58..10692be0 100644 --- a/src/collection/async-iterable-collection/_shared/async-sliding-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-sort-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.ts similarity index 91% rename from src/collection/async-iterable-collection/_shared/async-sort-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.ts index 41e6b588..4966de02 100644 --- a/src/collection/async-iterable-collection/_shared/async-sort-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.ts @@ -1,7 +1,7 @@ import { type Comparator, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-split-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-split-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-split-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-split-iterable.ts index e71da294..5631516f 100644 --- a/src/collection/async-iterable-collection/_shared/async-split-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-split-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; import { type AsyncIterableValue } from "@/_shared/types"; /** diff --git a/src/collection/async-iterable-collection/_shared/async-take-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-take-iterable.ts similarity index 88% rename from src/collection/async-iterable-collection/_shared/async-take-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-take-iterable.ts index c291d033..d954f4dd 100644 --- a/src/collection/async-iterable-collection/_shared/async-take-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-take-iterable.ts @@ -1,4 +1,4 @@ -import { type IAsyncCollection } from "@/contracts/collection/_module"; +import { type IAsyncCollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-take-until-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.ts similarity index 93% rename from src/collection/async-iterable-collection/_shared/async-take-until-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.ts index 4358ae77..66b15aed 100644 --- a/src/collection/async-iterable-collection/_shared/async-take-until-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncPredicate, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-tap-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.ts similarity index 91% rename from src/collection/async-iterable-collection/_shared/async-tap-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.ts index e136c81b..959445e2 100644 --- a/src/collection/async-iterable-collection/_shared/async-tap-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncTap, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-unique-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.ts similarity index 78% rename from src/collection/async-iterable-collection/_shared/async-unique-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.ts index a24f5077..592ccd45 100644 --- a/src/collection/async-iterable-collection/_shared/async-unique-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncMap, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal @@ -15,9 +15,7 @@ export class AsyncUniqueIterable TInput, IAsyncCollection, TOutput - > = (item) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return - item as any, + > = (item) => item as unknown as TOutput, ) {} async *[Symbol.asyncIterator](): AsyncIterator { diff --git a/src/collection/async-iterable-collection/_shared/async-update-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-update-iterable.ts similarity index 96% rename from src/collection/async-iterable-collection/_shared/async-update-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-update-iterable.ts index 812d4fd3..aebd1fa7 100644 --- a/src/collection/async-iterable-collection/_shared/async-update-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-update-iterable.ts @@ -3,7 +3,7 @@ import { type AsyncMap, type IAsyncCollection, type ChangendItem, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-when-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-when-iterable.ts similarity index 94% rename from src/collection/async-iterable-collection/_shared/async-when-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-when-iterable.ts index b6a29035..b16c1429 100644 --- a/src/collection/async-iterable-collection/_shared/async-when-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-when-iterable.ts @@ -1,7 +1,7 @@ import { type AsyncModifier, type IAsyncCollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/async-iterable-collection/_shared/async-zip-iterable.ts b/src/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.ts similarity index 95% rename from src/collection/async-iterable-collection/_shared/async-zip-iterable.ts rename to src/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.ts index e2a31c5b..8e7a59c4 100644 --- a/src/collection/async-iterable-collection/_shared/async-zip-iterable.ts +++ b/src/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.ts @@ -1,4 +1,4 @@ -import { isIterable } from "@/collection/_shared"; +import { isIterable } from "@/collection/implementations/_shared"; import { type AsyncIterableValue } from "@/_shared/types"; import { type RecordItem } from "@/_shared/types"; diff --git a/src/collection/async-iterable-collection/async-iterable-collection.test.ts b/src/collection/implementations/async-iterable-collection/async-iterable-collection.test.ts similarity index 99% rename from src/collection/async-iterable-collection/async-iterable-collection.test.ts rename to src/collection/implementations/async-iterable-collection/async-iterable-collection.test.ts index 628132f9..4bcf42e4 100644 --- a/src/collection/async-iterable-collection/async-iterable-collection.test.ts +++ b/src/collection/implementations/async-iterable-collection/async-iterable-collection.test.ts @@ -5,8 +5,8 @@ import { TypeCollectionError, ItemNotFoundCollectionError, MultipleItemsFoundCollectionError, -} from "@/contracts/collection/_module"; -import { AsyncIterableCollection } from "@/collection/async-iterable-collection/_module"; +} from "@/collection/contracts/_module"; +import { AsyncIterableCollection } from "@/collection/implementations/async-iterable-collection/_module"; import { type RecordItem } from "@/_shared/types"; describe("class: AsyncIterableCollection", () => { diff --git a/src/collection/async-iterable-collection/async-iterable-collection.ts b/src/collection/implementations/async-iterable-collection/async-iterable-collection.ts similarity index 98% rename from src/collection/async-iterable-collection/async-iterable-collection.ts rename to src/collection/implementations/async-iterable-collection/async-iterable-collection.ts index 9c239a2c..4d7d2fd0 100644 --- a/src/collection/async-iterable-collection/async-iterable-collection.ts +++ b/src/collection/implementations/async-iterable-collection/async-iterable-collection.ts @@ -20,7 +20,7 @@ import { type AsyncReduce, EmptyCollectionError, type CrossJoinResult, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { AsyncErrorHandlerIterable, AsyncCrossJoinIterable, @@ -55,7 +55,7 @@ import { AsyncReverseIterable, AsyncSliceIterable, AsyncRepeatIterable, -} from "@/collection/async-iterable-collection/_shared/_module"; +} from "@/collection/implementations/async-iterable-collection/_shared/_module"; import { type AsyncIterableValue, type AsyncLazyable, @@ -63,13 +63,17 @@ import { } from "@/_shared/types"; import { type RecordItem } from "@/_shared/types"; import { simplifyAsyncLazyable } from "@/_shared/utilities"; -import type { TimeSpan } from "@/_module"; -import { abortableIterable, delayIterable, LazyPromise } from "@/_module"; +import type { TimeSpan } from "@/utilities/_module"; +import { + abortableIterable, + delayIterable, + LazyPromise, +} from "@/utilities/_module"; import { AbortAsyncError, TimeoutAsyncError, timeoutIterable, -} from "@/async/_module"; +} from "@/utilities/async/_module"; /** * All methods that return {@link IAsyncCollection} are executed lazly which means they will be executed when the AsyncIterableCollection is iterated with forEach method or "for await of" loop. @@ -602,9 +606,7 @@ export class AsyncIterableCollection iterable: AsyncIterableValue, selectFn: AsyncMap, TOutput> = ( item, - ) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any - item as any, + ) => item as unknown as TOutput, ): IAsyncCollection { const differenceCollection = new AsyncIterableCollection(iterable); return this.filter(async (item, index, collection) => { diff --git a/src/collection/implementations/iterable-collection/_module.ts b/src/collection/implementations/iterable-collection/_module.ts new file mode 100644 index 00000000..c1389b1e --- /dev/null +++ b/src/collection/implementations/iterable-collection/_module.ts @@ -0,0 +1 @@ +export * from "@/collection/implementations/iterable-collection/iterable-collection"; diff --git a/src/collection/implementations/iterable-collection/_shared/_module.ts b/src/collection/implementations/iterable-collection/_shared/_module.ts new file mode 100644 index 00000000..f56065d2 --- /dev/null +++ b/src/collection/implementations/iterable-collection/_shared/_module.ts @@ -0,0 +1,32 @@ +export * from "@/collection/implementations/iterable-collection/_shared/chunk-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/chunk-while-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/collapse-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/count-by-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/cross-join-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/entries-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/filter-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/flat-map-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/group-by-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/insert-after-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/insert-before-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/map-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/merge-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/pad-end-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/pad-start-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/partion-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/repeat-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/reverse-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/shuffle-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/skip-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/skip-until-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/slice-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/sliding-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/sort-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/split-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/take-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/take-until-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/tap-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/unique-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/update-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/when-iterable"; +export * from "@/collection/implementations/iterable-collection/_shared/zip-iterable"; diff --git a/src/collection/iterable-collection/_shared/chunk-iterable.ts b/src/collection/implementations/iterable-collection/_shared/chunk-iterable.ts similarity index 94% rename from src/collection/iterable-collection/_shared/chunk-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/chunk-iterable.ts index dc2e87fb..3ea93304 100644 --- a/src/collection/iterable-collection/_shared/chunk-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/chunk-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/chunk-while-iterable.ts b/src/collection/implementations/iterable-collection/_shared/chunk-while-iterable.ts similarity index 96% rename from src/collection/iterable-collection/_shared/chunk-while-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/chunk-while-iterable.ts index bce62f28..78f010f5 100644 --- a/src/collection/iterable-collection/_shared/chunk-while-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/chunk-while-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/collapse-iterable.ts b/src/collection/implementations/iterable-collection/_shared/collapse-iterable.ts similarity index 84% rename from src/collection/iterable-collection/_shared/collapse-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/collapse-iterable.ts index 9b1e4420..065b4340 100644 --- a/src/collection/iterable-collection/_shared/collapse-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/collapse-iterable.ts @@ -1,8 +1,8 @@ -import { isIterable } from "@/collection/_shared"; +import { isIterable } from "@/collection/implementations/_shared"; import { type Collapse, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/count-by-iterable.ts b/src/collection/implementations/iterable-collection/_shared/count-by-iterable.ts similarity index 79% rename from src/collection/iterable-collection/_shared/count-by-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/count-by-iterable.ts index 3ee805bf..e5932cb2 100644 --- a/src/collection/iterable-collection/_shared/count-by-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/count-by-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection, type Map } from "@/contracts/collection/_module"; +import { type ICollection, type Map } from "@/collection/contracts/_module"; import { type RecordItem } from "@/_shared/types"; /** @@ -10,8 +10,7 @@ export class CountByIterable constructor( private collection: ICollection, private selectFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return - item as any, + item as unknown as TOutput, ) {} *[Symbol.iterator](): Iterator> { diff --git a/src/collection/iterable-collection/_shared/cross-join-iterable.ts b/src/collection/implementations/iterable-collection/_shared/cross-join-iterable.ts similarity index 91% rename from src/collection/iterable-collection/_shared/cross-join-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/cross-join-iterable.ts index 62533e0e..677deca5 100644 --- a/src/collection/iterable-collection/_shared/cross-join-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/cross-join-iterable.ts @@ -1,9 +1,9 @@ -import { isIterable } from "@/collection/_module"; +import { isIterable } from "@/collection/implementations/_shared"; import type { CrossJoinResult, ICollection, -} from "@/contracts/collection/_module"; -import {} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; +import {} from "@/collection/contracts/_module"; export class CrossJoinIterable implements Iterable> diff --git a/src/collection/iterable-collection/_shared/entries-iterable.ts b/src/collection/implementations/iterable-collection/_shared/entries-iterable.ts similarity index 89% rename from src/collection/iterable-collection/_shared/entries-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/entries-iterable.ts index 3144ebeb..8673df89 100644 --- a/src/collection/iterable-collection/_shared/entries-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/entries-iterable.ts @@ -1,4 +1,4 @@ -import {} from "@/contracts/collection/_shared"; +import {} from "@/collection/contracts/_shared"; import { type RecordItem } from "@/_shared/types"; /** diff --git a/src/collection/iterable-collection/_shared/filter-iterable.ts b/src/collection/implementations/iterable-collection/_shared/filter-iterable.ts similarity index 93% rename from src/collection/iterable-collection/_shared/filter-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/filter-iterable.ts index b8ee2eb4..83732d69 100644 --- a/src/collection/iterable-collection/_shared/filter-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/filter-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/flat-map-iterable.ts b/src/collection/implementations/iterable-collection/_shared/flat-map-iterable.ts similarity index 85% rename from src/collection/iterable-collection/_shared/flat-map-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/flat-map-iterable.ts index 4c65d5cc..819e3431 100644 --- a/src/collection/iterable-collection/_shared/flat-map-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/flat-map-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection, type Map } from "@/contracts/collection/_module"; +import { type ICollection, type Map } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/group-by-iterable.ts b/src/collection/implementations/iterable-collection/_shared/group-by-iterable.ts similarity index 84% rename from src/collection/iterable-collection/_shared/group-by-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/group-by-iterable.ts index 12c1aa1a..aa41d82e 100644 --- a/src/collection/iterable-collection/_shared/group-by-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/group-by-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection, type Map } from "@/contracts/collection/_module"; +import { type ICollection, type Map } from "@/collection/contracts/_module"; import { type RecordItem } from "@/_shared/types"; /** @@ -10,8 +10,7 @@ export class GroupByIterable constructor( private collection: ICollection, private selectFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return - item as any, + item as unknown as TOutput, private makeCollection: ( iterable: Iterable, diff --git a/src/collection/iterable-collection/_shared/insert-after-iterable.ts b/src/collection/implementations/iterable-collection/_shared/insert-after-iterable.ts similarity index 94% rename from src/collection/iterable-collection/_shared/insert-after-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/insert-after-iterable.ts index 8c985159..92257a81 100644 --- a/src/collection/iterable-collection/_shared/insert-after-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/insert-after-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/insert-before-iterable.ts b/src/collection/implementations/iterable-collection/_shared/insert-before-iterable.ts similarity index 94% rename from src/collection/iterable-collection/_shared/insert-before-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/insert-before-iterable.ts index b0461d5f..52ee1355 100644 --- a/src/collection/iterable-collection/_shared/insert-before-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/insert-before-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/map-iterable.ts b/src/collection/implementations/iterable-collection/_shared/map-iterable.ts similarity index 84% rename from src/collection/iterable-collection/_shared/map-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/map-iterable.ts index 81176c08..2c16c3d3 100644 --- a/src/collection/iterable-collection/_shared/map-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/map-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection, type Map } from "@/contracts/collection/_module"; +import { type ICollection, type Map } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/merge-iterable.ts b/src/collection/implementations/iterable-collection/_shared/merge-iterable.ts similarity index 88% rename from src/collection/iterable-collection/_shared/merge-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/merge-iterable.ts index 2ed916a0..68463085 100644 --- a/src/collection/iterable-collection/_shared/merge-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/merge-iterable.ts @@ -1,4 +1,4 @@ -import {} from "@/contracts/collection/_module"; +import {} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/pad-end-iterable.ts b/src/collection/implementations/iterable-collection/_shared/pad-end-iterable.ts similarity index 95% rename from src/collection/iterable-collection/_shared/pad-end-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/pad-end-iterable.ts index 8f0659d4..ecbdb579 100644 --- a/src/collection/iterable-collection/_shared/pad-end-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/pad-end-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/pad-start-iterable.ts b/src/collection/implementations/iterable-collection/_shared/pad-start-iterable.ts similarity index 95% rename from src/collection/iterable-collection/_shared/pad-start-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/pad-start-iterable.ts index e1ceb289..3065b817 100644 --- a/src/collection/iterable-collection/_shared/pad-start-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/pad-start-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/partion-iterable.ts b/src/collection/implementations/iterable-collection/_shared/partion-iterable.ts similarity index 95% rename from src/collection/iterable-collection/_shared/partion-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/partion-iterable.ts index caf6c4e7..b9de0a2b 100644 --- a/src/collection/iterable-collection/_shared/partion-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/partion-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/repeat-iterable.ts b/src/collection/implementations/iterable-collection/_shared/repeat-iterable.ts similarity index 90% rename from src/collection/iterable-collection/_shared/repeat-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/repeat-iterable.ts index cfe954d8..31b259c0 100644 --- a/src/collection/iterable-collection/_shared/repeat-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/repeat-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/reverse-iterable.ts b/src/collection/implementations/iterable-collection/_shared/reverse-iterable.ts similarity index 91% rename from src/collection/iterable-collection/_shared/reverse-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/reverse-iterable.ts index 50ea777c..4c4fef35 100644 --- a/src/collection/iterable-collection/_shared/reverse-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/reverse-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/shuffle-iterable.ts b/src/collection/implementations/iterable-collection/_shared/shuffle-iterable.ts similarity index 93% rename from src/collection/iterable-collection/_shared/shuffle-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/shuffle-iterable.ts index 763d3898..20828cd3 100644 --- a/src/collection/iterable-collection/_shared/shuffle-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/shuffle-iterable.ts @@ -1,4 +1,4 @@ -import {} from "@/contracts/collection/_shared"; +import {} from "@/collection/contracts/_shared"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/skip-iterable.ts b/src/collection/implementations/iterable-collection/_shared/skip-iterable.ts similarity index 87% rename from src/collection/iterable-collection/_shared/skip-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/skip-iterable.ts index 9c0ee280..a167b480 100644 --- a/src/collection/iterable-collection/_shared/skip-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/skip-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/skip-until-iterable.ts b/src/collection/implementations/iterable-collection/_shared/skip-until-iterable.ts similarity index 93% rename from src/collection/iterable-collection/_shared/skip-until-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/skip-until-iterable.ts index 6acd60be..e1320dbb 100644 --- a/src/collection/iterable-collection/_shared/skip-until-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/skip-until-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/slice-iterable.ts b/src/collection/implementations/iterable-collection/_shared/slice-iterable.ts similarity index 92% rename from src/collection/iterable-collection/_shared/slice-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/slice-iterable.ts index c9f6090d..1da5c60f 100644 --- a/src/collection/iterable-collection/_shared/slice-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/slice-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/sliding-iterable.ts b/src/collection/implementations/iterable-collection/_shared/sliding-iterable.ts similarity index 91% rename from src/collection/iterable-collection/_shared/sliding-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/sliding-iterable.ts index bb8f5377..cdb836a9 100644 --- a/src/collection/iterable-collection/_shared/sliding-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/sliding-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/sort-iterable.ts b/src/collection/implementations/iterable-collection/_shared/sort-iterable.ts similarity index 83% rename from src/collection/iterable-collection/_shared/sort-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/sort-iterable.ts index 8a0a6d72..68f83129 100644 --- a/src/collection/iterable-collection/_shared/sort-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/sort-iterable.ts @@ -1,4 +1,4 @@ -import { type Comparator } from "@/contracts/collection/_module"; +import { type Comparator } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/split-iterable.ts b/src/collection/implementations/iterable-collection/_shared/split-iterable.ts similarity index 95% rename from src/collection/iterable-collection/_shared/split-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/split-iterable.ts index c83a3ddd..a344f47f 100644 --- a/src/collection/iterable-collection/_shared/split-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/split-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/take-iterable.ts b/src/collection/implementations/iterable-collection/_shared/take-iterable.ts similarity index 87% rename from src/collection/iterable-collection/_shared/take-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/take-iterable.ts index 96cdf9fa..f29ee437 100644 --- a/src/collection/iterable-collection/_shared/take-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/take-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection } from "@/contracts/collection/_module"; +import { type ICollection } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/take-until-iterable.ts b/src/collection/implementations/iterable-collection/_shared/take-until-iterable.ts similarity index 92% rename from src/collection/iterable-collection/_shared/take-until-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/take-until-iterable.ts index 3137de10..0c26e01b 100644 --- a/src/collection/iterable-collection/_shared/take-until-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/take-until-iterable.ts @@ -1,7 +1,7 @@ import { type Predicate, type ICollection, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/tap-iterable.ts b/src/collection/implementations/iterable-collection/_shared/tap-iterable.ts similarity index 81% rename from src/collection/iterable-collection/_shared/tap-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/tap-iterable.ts index 63378890..7c1dbd53 100644 --- a/src/collection/iterable-collection/_shared/tap-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/tap-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection, type Tap } from "@/contracts/collection/_module"; +import { type ICollection, type Tap } from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/unique-iterable.ts b/src/collection/implementations/iterable-collection/_shared/unique-iterable.ts similarity index 73% rename from src/collection/iterable-collection/_shared/unique-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/unique-iterable.ts index 35896f10..1246b1fd 100644 --- a/src/collection/iterable-collection/_shared/unique-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/unique-iterable.ts @@ -1,4 +1,4 @@ -import { type ICollection, type Map } from "@/contracts/collection/_module"; +import { type ICollection, type Map } from "@/collection/contracts/_module"; /** * @internal @@ -7,8 +7,7 @@ export class UniqueIterable implements Iterable { constructor( private collection: ICollection, private callback: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return - item as any, + item as unknown as TOutput, ) {} *[Symbol.iterator](): Iterator { diff --git a/src/collection/iterable-collection/_shared/update-iterable.ts b/src/collection/implementations/iterable-collection/_shared/update-iterable.ts similarity index 95% rename from src/collection/iterable-collection/_shared/update-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/update-iterable.ts index fb39dc5d..79d70022 100644 --- a/src/collection/iterable-collection/_shared/update-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/update-iterable.ts @@ -3,7 +3,7 @@ import { type ICollection, type Map, type ChangendItem, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/when-iterable.ts b/src/collection/implementations/iterable-collection/_shared/when-iterable.ts similarity index 93% rename from src/collection/iterable-collection/_shared/when-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/when-iterable.ts index d7ebf4ad..6d7b0f54 100644 --- a/src/collection/iterable-collection/_shared/when-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/when-iterable.ts @@ -1,7 +1,7 @@ import { type ICollection, type Modifier, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; /** * @internal diff --git a/src/collection/iterable-collection/_shared/zip-iterable.ts b/src/collection/implementations/iterable-collection/_shared/zip-iterable.ts similarity index 94% rename from src/collection/iterable-collection/_shared/zip-iterable.ts rename to src/collection/implementations/iterable-collection/_shared/zip-iterable.ts index 85599bc8..5c0d2c0a 100644 --- a/src/collection/iterable-collection/_shared/zip-iterable.ts +++ b/src/collection/implementations/iterable-collection/_shared/zip-iterable.ts @@ -1,4 +1,4 @@ -import {} from "@/contracts/collection/_module"; +import {} from "@/collection/contracts/_module"; import { type RecordItem } from "@/_shared/types"; /** diff --git a/src/collection/iterable-collection/iterable-collection.test.ts b/src/collection/implementations/iterable-collection/iterable-collection.test.ts similarity index 99% rename from src/collection/iterable-collection/iterable-collection.test.ts rename to src/collection/implementations/iterable-collection/iterable-collection.test.ts index b1cbdb86..3a88259a 100644 --- a/src/collection/iterable-collection/iterable-collection.test.ts +++ b/src/collection/implementations/iterable-collection/iterable-collection.test.ts @@ -5,8 +5,8 @@ import { TypeCollectionError, ItemNotFoundCollectionError, MultipleItemsFoundCollectionError, -} from "@/contracts/collection/_module"; -import { IterableCollection } from "@/collection/iterable-collection/_module"; +} from "@/collection/contracts/_module"; +import { IterableCollection } from "@/collection/implementations/iterable-collection/_module"; import { type RecordItem } from "@/_shared/types"; describe("class: IterableCollection", () => { diff --git a/src/collection/iterable-collection/iterable-collection.ts b/src/collection/implementations/iterable-collection/iterable-collection.ts similarity index 99% rename from src/collection/iterable-collection/iterable-collection.ts rename to src/collection/implementations/iterable-collection/iterable-collection.ts index 67139dbd..c88d567c 100644 --- a/src/collection/iterable-collection/iterable-collection.ts +++ b/src/collection/implementations/iterable-collection/iterable-collection.ts @@ -20,7 +20,7 @@ import { type Reduce, EmptyCollectionError, type CrossJoinResult, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { CrossJoinIterable, SlidingIteralbe, @@ -54,7 +54,7 @@ import { ReverseIterable, SliceIterable, RepeatIterable, -} from "@/collection/iterable-collection/_shared/_module"; +} from "@/collection/implementations/iterable-collection/_shared/_module"; import { type Lazyable, type EnsureType } from "@/_shared/types"; import { type RecordItem } from "@/_shared/types"; import { simplifyLazyable } from "@/_shared/utilities"; @@ -529,8 +529,7 @@ export class IterableCollection implements ICollection { difference( iterable: Iterable, mapFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any - item as any, + item as unknown as TOutput, ): ICollection { const differenceCollection = new IterableCollection(iterable); return this.filter((item, index, collection) => { diff --git a/src/collection/implementations/list-collection/_module.ts b/src/collection/implementations/list-collection/_module.ts new file mode 100644 index 00000000..842e7fad --- /dev/null +++ b/src/collection/implementations/list-collection/_module.ts @@ -0,0 +1 @@ +export * from "@/collection/implementations/list-collection/list-collection"; diff --git a/src/collection/list-collection/list-collection.test.ts b/src/collection/implementations/list-collection/list-collection.test.ts similarity index 99% rename from src/collection/list-collection/list-collection.test.ts rename to src/collection/implementations/list-collection/list-collection.test.ts index 9189512f..c819aeec 100644 --- a/src/collection/list-collection/list-collection.test.ts +++ b/src/collection/implementations/list-collection/list-collection.test.ts @@ -5,8 +5,8 @@ import { TypeCollectionError, ItemNotFoundCollectionError, MultipleItemsFoundCollectionError, -} from "@/contracts/collection/_module"; -import { ListCollection } from "@/collection/list-collection/_module"; +} from "@/collection/contracts/_module"; +import { ListCollection } from "@/collection/implementations/list-collection/_module"; import { type RecordItem } from "@/_shared/types"; describe("class: ListCollection", () => { diff --git a/src/collection/list-collection/list-collection.ts b/src/collection/implementations/list-collection/list-collection.ts similarity index 97% rename from src/collection/list-collection/list-collection.ts rename to src/collection/implementations/list-collection/list-collection.ts index 638350eb..3ec6b467 100644 --- a/src/collection/list-collection/list-collection.ts +++ b/src/collection/implementations/list-collection/list-collection.ts @@ -2,7 +2,7 @@ * @module Collection */ -import { isIterable } from "@/collection/_shared"; +import { isIterable } from "@/collection/implementations/_shared"; import { type Collapse, type Comparator, @@ -21,7 +21,7 @@ import { type ForEach, EmptyCollectionError, type CrossJoinResult, -} from "@/contracts/collection/_module"; +} from "@/collection/contracts/_module"; import { type EnsureType, type Lazyable } from "@/_shared/types"; import { type RecordItem } from "@/_shared/types"; import { simplifyLazyable } from "@/_shared/utilities"; @@ -487,8 +487,7 @@ export class ListCollection implements ICollection { groupBy( selectFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any - item as any, + item as unknown as TOutput, ): ICollection>> { const map = new Map>(); for (const [index, item] of this.array.entries()) { @@ -507,8 +506,7 @@ export class ListCollection implements ICollection { countBy( selectFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any - item as any, + item as unknown as TOutput, ): ICollection> { const map = new Map(); for (const [index, item] of this.array.entries()) { @@ -526,8 +524,7 @@ export class ListCollection implements ICollection { unique( selectFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any - item as any, + item as unknown as TOutput, ): ICollection { const set = new Set([]), items: TInput[] = []; @@ -544,8 +541,7 @@ export class ListCollection implements ICollection { difference( iterable: Iterable, selectFn: Map, TOutput> = (item) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any - item as any, + item as unknown as TOutput, ): ICollection { const differenceCollection = new ListCollection(iterable); return this.filter((item, index, collection) => { diff --git a/src/collection/iterable-collection/_module.ts b/src/collection/iterable-collection/_module.ts deleted file mode 100644 index 88617262..00000000 --- a/src/collection/iterable-collection/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/collection/iterable-collection/iterable-collection"; diff --git a/src/collection/iterable-collection/_shared/_module.ts b/src/collection/iterable-collection/_shared/_module.ts deleted file mode 100644 index edb98d73..00000000 --- a/src/collection/iterable-collection/_shared/_module.ts +++ /dev/null @@ -1,32 +0,0 @@ -export * from "@/collection/iterable-collection/_shared/chunk-iterable"; -export * from "@/collection/iterable-collection/_shared/chunk-while-iterable"; -export * from "@/collection/iterable-collection/_shared/collapse-iterable"; -export * from "@/collection/iterable-collection/_shared/count-by-iterable"; -export * from "@/collection/iterable-collection/_shared/cross-join-iterable"; -export * from "@/collection/iterable-collection/_shared/entries-iterable"; -export * from "@/collection/iterable-collection/_shared/filter-iterable"; -export * from "@/collection/iterable-collection/_shared/flat-map-iterable"; -export * from "@/collection/iterable-collection/_shared/group-by-iterable"; -export * from "@/collection/iterable-collection/_shared/insert-after-iterable"; -export * from "@/collection/iterable-collection/_shared/insert-before-iterable"; -export * from "@/collection/iterable-collection/_shared/map-iterable"; -export * from "@/collection/iterable-collection/_shared/merge-iterable"; -export * from "@/collection/iterable-collection/_shared/pad-end-iterable"; -export * from "@/collection/iterable-collection/_shared/pad-start-iterable"; -export * from "@/collection/iterable-collection/_shared/partion-iterable"; -export * from "@/collection/iterable-collection/_shared/repeat-iterable"; -export * from "@/collection/iterable-collection/_shared/reverse-iterable"; -export * from "@/collection/iterable-collection/_shared/shuffle-iterable"; -export * from "@/collection/iterable-collection/_shared/skip-iterable"; -export * from "@/collection/iterable-collection/_shared/skip-until-iterable"; -export * from "@/collection/iterable-collection/_shared/slice-iterable"; -export * from "@/collection/iterable-collection/_shared/sliding-iterable"; -export * from "@/collection/iterable-collection/_shared/sort-iterable"; -export * from "@/collection/iterable-collection/_shared/split-iterable"; -export * from "@/collection/iterable-collection/_shared/take-iterable"; -export * from "@/collection/iterable-collection/_shared/take-until-iterable"; -export * from "@/collection/iterable-collection/_shared/tap-iterable"; -export * from "@/collection/iterable-collection/_shared/unique-iterable"; -export * from "@/collection/iterable-collection/_shared/update-iterable"; -export * from "@/collection/iterable-collection/_shared/when-iterable"; -export * from "@/collection/iterable-collection/_shared/zip-iterable"; diff --git a/src/collection/list-collection/_module.ts b/src/collection/list-collection/_module.ts deleted file mode 100644 index 88783846..00000000 --- a/src/collection/list-collection/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/collection/list-collection/list-collection"; diff --git a/src/contracts/_module.ts b/src/contracts/_module.ts deleted file mode 100644 index 52ba440e..00000000 --- a/src/contracts/_module.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "@/contracts/collection/_module"; -export * from "@/contracts/serializer/_module"; -export * from "@/contracts/storage/_module"; diff --git a/src/contracts/collection/_module.ts b/src/contracts/collection/_module.ts deleted file mode 100644 index 40533ba1..00000000 --- a/src/contracts/collection/_module.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "@/contracts/collection/_shared"; -export * from "@/contracts/collection/collection.contract"; -export * from "@/contracts/collection/async-collection.contract"; diff --git a/src/contracts/serializer/_module.ts b/src/contracts/serializer/_module.ts deleted file mode 100644 index 4012818a..00000000 --- a/src/contracts/serializer/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/contracts/serializer/serializer.contract"; diff --git a/src/contracts/storage/_module.ts b/src/contracts/storage/_module.ts deleted file mode 100644 index dfbea1da..00000000 --- a/src/contracts/storage/_module.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "@/contracts/storage/_shared"; -export * from "@/contracts/storage/storage.contract"; -export * from "@/contracts/storage/storage-adapter.contract"; diff --git a/src/serializer/_module.ts b/src/serializer/_module.ts index 4001a6a6..7cce0862 100644 --- a/src/serializer/_module.ts +++ b/src/serializer/_module.ts @@ -1,5 +1,5 @@ -export * from "@/serializer/_shared/test-utilities/_module"; -export * from "@/serializer/mongodb-serializer/_module"; -export * from "@/serializer/redis-serializer/_module"; -export * from "@/serializer/sql-serializer/_module"; -export * from "@/serializer/super-json-serializer/_module"; +export * from "@/serializer/implementations/_shared/test-utilities/_module"; +export * from "@/serializer/implementations/mongodb-serializer/_module"; +export * from "@/serializer/implementations/redis-serializer/_module"; +export * from "@/serializer/implementations/sql-serializer/_module"; +export * from "@/serializer/implementations/super-json-serializer/_module"; diff --git a/src/serializer/_shared/test-utilities/_module.ts b/src/serializer/_shared/test-utilities/_module.ts deleted file mode 100644 index 6610432d..00000000 --- a/src/serializer/_shared/test-utilities/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/serializer/_shared/test-utilities/serializer.test-suite"; diff --git a/src/serializer/contracts/_module.ts b/src/serializer/contracts/_module.ts new file mode 100644 index 00000000..d72102dc --- /dev/null +++ b/src/serializer/contracts/_module.ts @@ -0,0 +1 @@ +export * from "@/serializer/contracts/serializer.contract"; diff --git a/src/contracts/serializer/serializer.contract.ts b/src/serializer/contracts/serializer.contract.ts similarity index 100% rename from src/contracts/serializer/serializer.contract.ts rename to src/serializer/contracts/serializer.contract.ts diff --git a/src/serializer/implementations/_module.ts b/src/serializer/implementations/_module.ts new file mode 100644 index 00000000..7cce0862 --- /dev/null +++ b/src/serializer/implementations/_module.ts @@ -0,0 +1,5 @@ +export * from "@/serializer/implementations/_shared/test-utilities/_module"; +export * from "@/serializer/implementations/mongodb-serializer/_module"; +export * from "@/serializer/implementations/redis-serializer/_module"; +export * from "@/serializer/implementations/sql-serializer/_module"; +export * from "@/serializer/implementations/super-json-serializer/_module"; diff --git a/src/serializer/implementations/_shared/test-utilities/_module.ts b/src/serializer/implementations/_shared/test-utilities/_module.ts new file mode 100644 index 00000000..e5eb774b --- /dev/null +++ b/src/serializer/implementations/_shared/test-utilities/_module.ts @@ -0,0 +1 @@ +export * from "@/serializer/implementations/_shared/test-utilities/serializer.test-suite"; diff --git a/src/serializer/_shared/test-utilities/serializer.test-suite.ts b/src/serializer/implementations/_shared/test-utilities/serializer.test-suite.ts similarity index 99% rename from src/serializer/_shared/test-utilities/serializer.test-suite.ts rename to src/serializer/implementations/_shared/test-utilities/serializer.test-suite.ts index aa80b02f..49082a8f 100644 --- a/src/serializer/_shared/test-utilities/serializer.test-suite.ts +++ b/src/serializer/implementations/_shared/test-utilities/serializer.test-suite.ts @@ -3,7 +3,7 @@ */ import { type TestAPI, type ExpectStatic } from "vitest"; -import { type ISerializer } from "@/contracts/serializer/_module"; +import { type ISerializer } from "@/serializer/contracts/_module"; import { type RecordItem, type Promisable } from "@/_shared/types"; /** diff --git a/src/serializer/implementations/mongodb-serializer/_module.ts b/src/serializer/implementations/mongodb-serializer/_module.ts new file mode 100644 index 00000000..1b96b341 --- /dev/null +++ b/src/serializer/implementations/mongodb-serializer/_module.ts @@ -0,0 +1 @@ +export * from "@/serializer/implementations/mongodb-serializer/mongodb-serializer"; diff --git a/src/serializer/implementations/mongodb-serializer/mongodb-serializer.test.ts b/src/serializer/implementations/mongodb-serializer/mongodb-serializer.test.ts new file mode 100644 index 00000000..e8f88283 --- /dev/null +++ b/src/serializer/implementations/mongodb-serializer/mongodb-serializer.test.ts @@ -0,0 +1,12 @@ +import { describe, expect, test } from "vitest"; +import { serializerTestSuite } from "@/serializer/implementations/_shared/test-utilities/_module"; +import { MongodbSerializer } from "@/serializer/implementations/mongodb-serializer/_module"; +import { SuperJsonSerializer } from "@/serializer/implementations/super-json-serializer/_module"; + +describe("class: MongodbSerializer", () => { + serializerTestSuite({ + createAdapter: () => new MongodbSerializer(new SuperJsonSerializer()), + expect, + test, + }); +}); diff --git a/src/serializer/mongodb-serializer/mongodb-serializer.ts b/src/serializer/implementations/mongodb-serializer/mongodb-serializer.ts similarity index 96% rename from src/serializer/mongodb-serializer/mongodb-serializer.ts rename to src/serializer/implementations/mongodb-serializer/mongodb-serializer.ts index 21f5609e..012f1a00 100644 --- a/src/serializer/mongodb-serializer/mongodb-serializer.ts +++ b/src/serializer/implementations/mongodb-serializer/mongodb-serializer.ts @@ -6,7 +6,7 @@ import { DeserializationError, SerializationError, type ISerializer, -} from "@/contracts/serializer/_module"; +} from "@/serializer/contracts/_module"; /** * @internal diff --git a/src/serializer/implementations/redis-serializer/_module.ts b/src/serializer/implementations/redis-serializer/_module.ts new file mode 100644 index 00000000..00d1e250 --- /dev/null +++ b/src/serializer/implementations/redis-serializer/_module.ts @@ -0,0 +1 @@ +export * from "@/serializer/implementations/redis-serializer/redis-serializer"; diff --git a/src/serializer/implementations/redis-serializer/redis-serializer.test.ts b/src/serializer/implementations/redis-serializer/redis-serializer.test.ts new file mode 100644 index 00000000..e4a8bdd0 --- /dev/null +++ b/src/serializer/implementations/redis-serializer/redis-serializer.test.ts @@ -0,0 +1,12 @@ +import { describe, expect, test } from "vitest"; +import { serializerTestSuite } from "@/serializer/implementations/_shared/test-utilities/_module"; +import { RedisSerializer } from "@/serializer/implementations/redis-serializer/_module"; +import { SuperJsonSerializer } from "@/serializer/implementations/super-json-serializer/_module"; + +describe("class: RedisSerializer", () => { + serializerTestSuite({ + createAdapter: () => new RedisSerializer(new SuperJsonSerializer()), + expect, + test, + }); +}); diff --git a/src/serializer/redis-serializer/redis-serializer.ts b/src/serializer/implementations/redis-serializer/redis-serializer.ts similarity index 96% rename from src/serializer/redis-serializer/redis-serializer.ts rename to src/serializer/implementations/redis-serializer/redis-serializer.ts index 6dabcd8a..f0741936 100644 --- a/src/serializer/redis-serializer/redis-serializer.ts +++ b/src/serializer/implementations/redis-serializer/redis-serializer.ts @@ -5,7 +5,7 @@ import { DeserializationError, SerializationError, type ISerializer, -} from "@/contracts/serializer/_module"; +} from "@/serializer/contracts/_module"; /** * @internal diff --git a/src/serializer/implementations/sql-serializer/_module.ts b/src/serializer/implementations/sql-serializer/_module.ts new file mode 100644 index 00000000..b4d7356b --- /dev/null +++ b/src/serializer/implementations/sql-serializer/_module.ts @@ -0,0 +1 @@ +export * from "@/serializer/implementations/sql-serializer/sql-serializer"; diff --git a/src/serializer/implementations/sql-serializer/sql-serializer.test.ts b/src/serializer/implementations/sql-serializer/sql-serializer.test.ts new file mode 100644 index 00000000..1b0a90b8 --- /dev/null +++ b/src/serializer/implementations/sql-serializer/sql-serializer.test.ts @@ -0,0 +1,12 @@ +import { describe, expect, test } from "vitest"; +import { serializerTestSuite } from "@/serializer/implementations/_shared/test-utilities/_module"; +import { SqlSerializer } from "@/serializer/implementations/sql-serializer/_module"; +import { SuperJsonSerializer } from "@/serializer/implementations/super-json-serializer/_module"; + +describe("class: SqlSerializer", () => { + serializerTestSuite({ + createAdapter: () => new SqlSerializer(new SuperJsonSerializer()), + expect, + test, + }); +}); diff --git a/src/serializer/sql-serializer/sql-serializer.ts b/src/serializer/implementations/sql-serializer/sql-serializer.ts similarity index 96% rename from src/serializer/sql-serializer/sql-serializer.ts rename to src/serializer/implementations/sql-serializer/sql-serializer.ts index 6af464fb..eb302420 100644 --- a/src/serializer/sql-serializer/sql-serializer.ts +++ b/src/serializer/implementations/sql-serializer/sql-serializer.ts @@ -5,7 +5,7 @@ import { DeserializationError, SerializationError, type ISerializer, -} from "@/contracts/serializer/_module"; +} from "@/serializer/contracts/_module"; /** * @internal diff --git a/src/serializer/implementations/super-json-serializer/_module.ts b/src/serializer/implementations/super-json-serializer/_module.ts new file mode 100644 index 00000000..457dee9b --- /dev/null +++ b/src/serializer/implementations/super-json-serializer/_module.ts @@ -0,0 +1 @@ +export * from "@/serializer/implementations/super-json-serializer/super-json-serializer"; diff --git a/src/serializer/super-json-serializer/super-json-serializer.test.ts b/src/serializer/implementations/super-json-serializer/super-json-serializer.test.ts similarity index 51% rename from src/serializer/super-json-serializer/super-json-serializer.test.ts rename to src/serializer/implementations/super-json-serializer/super-json-serializer.test.ts index 6e66ce84..e58a4da0 100644 --- a/src/serializer/super-json-serializer/super-json-serializer.test.ts +++ b/src/serializer/implementations/super-json-serializer/super-json-serializer.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "vitest"; -import { serializerTestSuite } from "@/serializer/_shared/test-utilities/_module"; -import { SuperJsonSerializer } from "@/serializer/super-json-serializer/super-json-serializer"; +import { serializerTestSuite } from "@/serializer/implementations/_shared/test-utilities/_module"; +import { SuperJsonSerializer } from "@/serializer/implementations/super-json-serializer/super-json-serializer"; describe("class: SuperJsonSerializer", () => { serializerTestSuite({ diff --git a/src/serializer/super-json-serializer/super-json-serializer.ts b/src/serializer/implementations/super-json-serializer/super-json-serializer.ts similarity index 99% rename from src/serializer/super-json-serializer/super-json-serializer.ts rename to src/serializer/implementations/super-json-serializer/super-json-serializer.ts index 7c6d720f..b3816cce 100644 --- a/src/serializer/super-json-serializer/super-json-serializer.ts +++ b/src/serializer/implementations/super-json-serializer/super-json-serializer.ts @@ -6,7 +6,7 @@ import { DeserializationError, SerializationError, type ISerializer, -} from "@/contracts/serializer/_module"; +} from "@/serializer/contracts/_module"; import type { SuperJSON } from "superjson"; import type { JSONValue } from "superjson/dist/types"; /** diff --git a/src/serializer/mongodb-serializer/_module.ts b/src/serializer/mongodb-serializer/_module.ts deleted file mode 100644 index 4ebed75a..00000000 --- a/src/serializer/mongodb-serializer/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/serializer/mongodb-serializer/mongodb-serializer"; diff --git a/src/serializer/mongodb-serializer/mongodb-serializer.test.ts b/src/serializer/mongodb-serializer/mongodb-serializer.test.ts deleted file mode 100644 index d3987c2f..00000000 --- a/src/serializer/mongodb-serializer/mongodb-serializer.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { describe, expect, test } from "vitest"; -import { serializerTestSuite } from "@/serializer/_shared/test-utilities/_module"; -import { MongodbSerializer } from "@/serializer/mongodb-serializer/_module"; -import { SuperJsonSerializer } from "@/serializer/super-json-serializer/_module"; - -describe("class: MongodbSerializer", () => { - serializerTestSuite({ - createAdapter: () => new MongodbSerializer(new SuperJsonSerializer()), - expect, - test, - }); -}); diff --git a/src/serializer/redis-serializer/_module.ts b/src/serializer/redis-serializer/_module.ts deleted file mode 100644 index 134db34e..00000000 --- a/src/serializer/redis-serializer/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/serializer/redis-serializer/redis-serializer"; diff --git a/src/serializer/redis-serializer/redis-serializer.test.ts b/src/serializer/redis-serializer/redis-serializer.test.ts deleted file mode 100644 index d36ea8ce..00000000 --- a/src/serializer/redis-serializer/redis-serializer.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { describe, expect, test } from "vitest"; -import { serializerTestSuite } from "@/serializer/_shared/test-utilities/_module"; -import { RedisSerializer } from "@/serializer/redis-serializer/_module"; -import { SuperJsonSerializer } from "@/serializer/super-json-serializer/_module"; - -describe("class: RedisSerializer", () => { - serializerTestSuite({ - createAdapter: () => new RedisSerializer(new SuperJsonSerializer()), - expect, - test, - }); -}); diff --git a/src/serializer/sql-serializer/_module.ts b/src/serializer/sql-serializer/_module.ts deleted file mode 100644 index 3a177d9b..00000000 --- a/src/serializer/sql-serializer/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/serializer/sql-serializer/sql-serializer"; diff --git a/src/serializer/sql-serializer/sql-serializer.test.ts b/src/serializer/sql-serializer/sql-serializer.test.ts deleted file mode 100644 index e4967842..00000000 --- a/src/serializer/sql-serializer/sql-serializer.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { describe, expect, test } from "vitest"; -import { serializerTestSuite } from "@/serializer/_shared/test-utilities/_module"; -import { SqlSerializer } from "@/serializer/sql-serializer/_module"; -import { SuperJsonSerializer } from "@/serializer/super-json-serializer/_module"; - -describe("class: SqlSerializer", () => { - serializerTestSuite({ - createAdapter: () => new SqlSerializer(new SuperJsonSerializer()), - expect, - test, - }); -}); diff --git a/src/serializer/super-json-serializer/_module.ts b/src/serializer/super-json-serializer/_module.ts deleted file mode 100644 index 6e65aa10..00000000 --- a/src/serializer/super-json-serializer/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/serializer/super-json-serializer/super-json-serializer"; diff --git a/src/storage/_module.ts b/src/storage/_module.ts deleted file mode 100644 index 839bd779..00000000 --- a/src/storage/_module.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "@/storage/storage"; -export * from "@/storage/_shared/test-utilities/_module"; -export * from "@/storage/memory-storage-adapter/_module"; -export * from "@/storage/mongodb-storage-adapter/_module"; -export * from "@/storage/redis-storage-adapter/_module"; -export * from "@/storage/sqlite/_module"; diff --git a/src/storage/_shared/test-utilities/_module.ts b/src/storage/_shared/test-utilities/_module.ts deleted file mode 100644 index d7772fc4..00000000 --- a/src/storage/_shared/test-utilities/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/storage/_shared/test-utilities/storage.test-suite"; diff --git a/src/storage/contracts/_module.ts b/src/storage/contracts/_module.ts new file mode 100644 index 00000000..b79aad0c --- /dev/null +++ b/src/storage/contracts/_module.ts @@ -0,0 +1,3 @@ +export * from "@/storage/contracts/_shared"; +export * from "@/storage/contracts/storage.contract"; +export * from "@/storage/contracts/storage-adapter.contract"; diff --git a/src/contracts/storage/_shared.ts b/src/storage/contracts/_shared.ts similarity index 100% rename from src/contracts/storage/_shared.ts rename to src/storage/contracts/_shared.ts diff --git a/src/contracts/storage/storage-adapter.contract.ts b/src/storage/contracts/storage-adapter.contract.ts similarity index 98% rename from src/contracts/storage/storage-adapter.contract.ts rename to src/storage/contracts/storage-adapter.contract.ts index ce68564b..ccf7e350 100644 --- a/src/contracts/storage/storage-adapter.contract.ts +++ b/src/storage/contracts/storage-adapter.contract.ts @@ -9,7 +9,7 @@ import { type TypeStorageError, // eslint-disable-next-line @typescript-eslint/no-unused-vars type UnexpectedStorageError, -} from "@/contracts/storage/_shared"; +} from "@/storage/contracts/_shared"; /** * @throws {StorageError} {@link StorageError} diff --git a/src/contracts/storage/storage.contract.ts b/src/storage/contracts/storage.contract.ts similarity index 99% rename from src/contracts/storage/storage.contract.ts rename to src/storage/contracts/storage.contract.ts index b54178d7..0029f2ab 100644 --- a/src/contracts/storage/storage.contract.ts +++ b/src/storage/contracts/storage.contract.ts @@ -16,7 +16,7 @@ import { type UnexpectedStorageError, // eslint-disable-next-line @typescript-eslint/no-unused-vars type KeyNotFoundStorageError, -} from "@/contracts/storage/_shared"; +} from "@/storage/contracts/_shared"; export type StorageValue = Exclude; diff --git a/src/storage/implementations/_module.ts b/src/storage/implementations/_module.ts new file mode 100644 index 00000000..ffe35a38 --- /dev/null +++ b/src/storage/implementations/_module.ts @@ -0,0 +1,6 @@ +export * from "@/storage/implementations/storage"; +export * from "@/storage/implementations/_shared/test-utilities/_module"; +export * from "@/storage/implementations/memory-storage-adapter/_module"; +export * from "@/storage/implementations/mongodb-storage-adapter/_module"; +export * from "@/storage/implementations/redis-storage-adapter/_module"; +export * from "@/storage/implementations/sqlite/_module"; diff --git a/src/storage/implementations/_shared/test-utilities/_module.ts b/src/storage/implementations/_shared/test-utilities/_module.ts new file mode 100644 index 00000000..5b4d01c7 --- /dev/null +++ b/src/storage/implementations/_shared/test-utilities/_module.ts @@ -0,0 +1 @@ +export * from "@/storage/implementations/_shared/test-utilities/storage.test-suite"; diff --git a/src/storage/_shared/test-utilities/storage-api.test-suite.ts b/src/storage/implementations/_shared/test-utilities/storage-api.test-suite.ts similarity index 99% rename from src/storage/_shared/test-utilities/storage-api.test-suite.ts rename to src/storage/implementations/_shared/test-utilities/storage-api.test-suite.ts index 09fbd992..397451d3 100644 --- a/src/storage/_shared/test-utilities/storage-api.test-suite.ts +++ b/src/storage/implementations/_shared/test-utilities/storage-api.test-suite.ts @@ -13,9 +13,9 @@ import { TypeStorageError, type IStorage, KeyNotFoundStorageError, -} from "@/contracts/storage/_module"; +} from "@/storage/contracts/_module"; import { type Promisable } from "@/_shared/types"; -import { Storage } from "@/storage/_module"; +import { Storage } from "@/storage/implementations/_module"; /** * @internal diff --git a/src/storage/_shared/test-utilities/storage-namespace.test-suite.ts b/src/storage/implementations/_shared/test-utilities/storage-namespace.test-suite.ts similarity index 98% rename from src/storage/_shared/test-utilities/storage-namespace.test-suite.ts rename to src/storage/implementations/_shared/test-utilities/storage-namespace.test-suite.ts index 32949a7f..76114c36 100644 --- a/src/storage/_shared/test-utilities/storage-namespace.test-suite.ts +++ b/src/storage/implementations/_shared/test-utilities/storage-namespace.test-suite.ts @@ -12,9 +12,9 @@ import { KeyNotFoundStorageError, type IStorage, type IStorageAdapter, -} from "@/contracts/storage/_module"; +} from "@/storage/contracts/_module"; import { type Promisable } from "@/_shared/types"; -import { Storage } from "@/storage/_module"; +import { Storage } from "@/storage/implementations/_module"; /** * @internal diff --git a/src/storage/_shared/test-utilities/storage-value.test-suite.ts b/src/storage/implementations/_shared/test-utilities/storage-value.test-suite.ts similarity index 99% rename from src/storage/_shared/test-utilities/storage-value.test-suite.ts rename to src/storage/implementations/_shared/test-utilities/storage-value.test-suite.ts index 21a3abac..74abe949 100644 --- a/src/storage/_shared/test-utilities/storage-value.test-suite.ts +++ b/src/storage/implementations/_shared/test-utilities/storage-value.test-suite.ts @@ -11,9 +11,9 @@ import { import { type IStorage, type IStorageAdapter, -} from "@/contracts/storage/_module"; +} from "@/storage/contracts/_module"; import { type RecordItem, type Promisable } from "@/_shared/types"; -import { Storage } from "@/storage/_module"; +import { Storage } from "@/storage/implementations/_module"; /** * @internal diff --git a/src/storage/_shared/test-utilities/storage.test-suite.ts b/src/storage/implementations/_shared/test-utilities/storage.test-suite.ts similarity index 61% rename from src/storage/_shared/test-utilities/storage.test-suite.ts rename to src/storage/implementations/_shared/test-utilities/storage.test-suite.ts index 2a57eddb..c2288697 100644 --- a/src/storage/_shared/test-utilities/storage.test-suite.ts +++ b/src/storage/implementations/_shared/test-utilities/storage.test-suite.ts @@ -8,11 +8,11 @@ import { type ExpectStatic, type beforeEach, } from "vitest"; -import { type IStorageAdapter } from "@/contracts/storage/_module"; +import { type IStorageAdapter } from "@/storage/contracts/_module"; import { type Promisable } from "@/_shared/types"; -import { storageNamespaceTestSuite } from "@/storage/_shared/test-utilities/storage-namespace.test-suite"; -import { storageValueTestSuite } from "@/storage/_shared/test-utilities/storage-value.test-suite"; -import { storageApiTestSuite } from "@/storage/_shared/test-utilities/storage-api.test-suite"; +import { storageNamespaceTestSuite } from "@/storage/implementations/_shared/test-utilities/storage-namespace.test-suite"; +import { storageValueTestSuite } from "@/storage/implementations/_shared/test-utilities/storage-value.test-suite"; +import { storageApiTestSuite } from "@/storage/implementations/_shared/test-utilities/storage-api.test-suite"; /** * @group Utilities diff --git a/src/storage/implementations/memory-storage-adapter/_module.ts b/src/storage/implementations/memory-storage-adapter/_module.ts new file mode 100644 index 00000000..e657b1f6 --- /dev/null +++ b/src/storage/implementations/memory-storage-adapter/_module.ts @@ -0,0 +1 @@ +export * from "@/storage/implementations/memory-storage-adapter/memory-storage-adapter"; diff --git a/src/storage/memory-storage-adapter/memory-storage-adapter.test.ts b/src/storage/implementations/memory-storage-adapter/memory-storage-adapter.test.ts similarity index 61% rename from src/storage/memory-storage-adapter/memory-storage-adapter.test.ts rename to src/storage/implementations/memory-storage-adapter/memory-storage-adapter.test.ts index 920ad3de..386c4224 100644 --- a/src/storage/memory-storage-adapter/memory-storage-adapter.test.ts +++ b/src/storage/implementations/memory-storage-adapter/memory-storage-adapter.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, test } from "vitest"; -import { storageTestSuite } from "@/storage/_shared/test-utilities/_module"; -import { MemoryStorageAdapter } from "@/storage/memory-storage-adapter/_module"; +import { storageTestSuite } from "@/storage/implementations/_shared/test-utilities/_module"; +import { MemoryStorageAdapter } from "@/storage/implementations/memory-storage-adapter/_module"; describe("class: MemoryStorageAdapter", () => { storageTestSuite({ diff --git a/src/storage/memory-storage-adapter/memory-storage-adapter.ts b/src/storage/implementations/memory-storage-adapter/memory-storage-adapter.ts similarity index 97% rename from src/storage/memory-storage-adapter/memory-storage-adapter.ts rename to src/storage/implementations/memory-storage-adapter/memory-storage-adapter.ts index 0a36b8d2..1bafea48 100644 --- a/src/storage/memory-storage-adapter/memory-storage-adapter.ts +++ b/src/storage/implementations/memory-storage-adapter/memory-storage-adapter.ts @@ -5,8 +5,8 @@ import { TypeStorageError, UnexpectedStorageError, -} from "@/contracts/storage/_shared"; -import { type IStorageAdapter } from "@/contracts/storage/storage-adapter.contract"; +} from "@/storage/contracts/_shared"; +import { type IStorageAdapter } from "@/storage/contracts/storage-adapter.contract"; /** * @group Adapters diff --git a/src/storage/implementations/mongodb-storage-adapter/_module.ts b/src/storage/implementations/mongodb-storage-adapter/_module.ts new file mode 100644 index 00000000..c2eb4791 --- /dev/null +++ b/src/storage/implementations/mongodb-storage-adapter/_module.ts @@ -0,0 +1,4 @@ +export { + MongodbStorageAdapter, + type MongodbStorageAdapterSettings, +} from "@/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter"; diff --git a/src/storage/mongodb-storage-adapter/mongodb-storage-adapter.test.ts b/src/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter.test.ts similarity index 84% rename from src/storage/mongodb-storage-adapter/mongodb-storage-adapter.test.ts rename to src/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter.test.ts index fbe126e8..5512bc48 100644 --- a/src/storage/mongodb-storage-adapter/mongodb-storage-adapter.test.ts +++ b/src/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, test } from "vitest"; -import { storageTestSuite } from "@/storage/_shared/test-utilities/_module"; -import { MongodbStorageAdapter } from "@/storage/mongodb-storage-adapter/_module"; +import { storageTestSuite } from "@/storage/implementations/_shared/test-utilities/_module"; +import { MongodbStorageAdapter } from "@/storage/implementations/mongodb-storage-adapter/_module"; import { MongoDBContainer, type StartedMongoDBContainer, diff --git a/src/storage/mongodb-storage-adapter/mongodb-storage-adapter.ts b/src/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter.ts similarity index 97% rename from src/storage/mongodb-storage-adapter/mongodb-storage-adapter.ts rename to src/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter.ts index 4a806dd5..80c2f038 100644 --- a/src/storage/mongodb-storage-adapter/mongodb-storage-adapter.ts +++ b/src/storage/implementations/mongodb-storage-adapter/mongodb-storage-adapter.ts @@ -2,14 +2,17 @@ * @module Storage */ -import { type ISerializer } from "@/contracts/serializer/_module"; -import { MongodbSerializer, SuperJsonSerializer } from "@/serializer/_module"; +import { type ISerializer } from "@/serializer/contracts/_module"; +import { + MongodbSerializer, + SuperJsonSerializer, +} from "@/serializer/implementations/_module"; import { type IInitizable, type RecordItem } from "@/_shared/types"; import { TypeStorageError, UnexpectedStorageError, type IStorageAdapter, -} from "@/contracts/storage/_module"; +} from "@/storage/contracts/_module"; import escapeStringRegexp from "escape-string-regexp"; import type { MongoBulkWriteError } from "mongodb"; import { type Collection, MongoServerError, ObjectId } from "mongodb"; diff --git a/src/storage/namespace-storage-adapter.ts b/src/storage/implementations/namespace-storage-adapter.ts similarity index 98% rename from src/storage/namespace-storage-adapter.ts rename to src/storage/implementations/namespace-storage-adapter.ts index f824609f..c358b412 100644 --- a/src/storage/namespace-storage-adapter.ts +++ b/src/storage/implementations/namespace-storage-adapter.ts @@ -2,7 +2,7 @@ * @module Storage */ -import { type IStorageAdapter } from "@/contracts/storage/_module"; +import { type IStorageAdapter } from "@/storage/contracts/_module"; /** * @internal diff --git a/src/storage/implementations/redis-storage-adapter/_module.ts b/src/storage/implementations/redis-storage-adapter/_module.ts new file mode 100644 index 00000000..b8433e7b --- /dev/null +++ b/src/storage/implementations/redis-storage-adapter/_module.ts @@ -0,0 +1 @@ +export * from "@/storage/implementations/redis-storage-adapter/redis-storage-adapter"; diff --git a/src/storage/redis-storage-adapter/redis-storage-adapter.test.ts b/src/storage/implementations/redis-storage-adapter/redis-storage-adapter.test.ts similarity index 80% rename from src/storage/redis-storage-adapter/redis-storage-adapter.test.ts rename to src/storage/implementations/redis-storage-adapter/redis-storage-adapter.test.ts index 61ea9a23..a35a466d 100644 --- a/src/storage/redis-storage-adapter/redis-storage-adapter.test.ts +++ b/src/storage/implementations/redis-storage-adapter/redis-storage-adapter.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, test } from "vitest"; -import { storageTestSuite } from "@/storage/_shared/test-utilities/_module"; -import { RedisStorageAdapter } from "@/storage/redis-storage-adapter/_module"; +import { storageTestSuite } from "@/storage/implementations/_shared/test-utilities/_module"; +import { RedisStorageAdapter } from "@/storage/implementations/redis-storage-adapter/_module"; import { RedisContainer, type StartedRedisContainer, diff --git a/src/storage/redis-storage-adapter/redis-storage-adapter.ts b/src/storage/implementations/redis-storage-adapter/redis-storage-adapter.ts similarity index 97% rename from src/storage/redis-storage-adapter/redis-storage-adapter.ts rename to src/storage/implementations/redis-storage-adapter/redis-storage-adapter.ts index 557ee5fc..3408fd7d 100644 --- a/src/storage/redis-storage-adapter/redis-storage-adapter.ts +++ b/src/storage/implementations/redis-storage-adapter/redis-storage-adapter.ts @@ -2,15 +2,18 @@ * @module Storage */ -import { RedisSerializer, SuperJsonSerializer } from "@/serializer/_module"; -import { type ISerializer } from "@/contracts/serializer/_module"; -import { type IStorageAdapter } from "@/contracts/storage/_module"; +import { + RedisSerializer, + SuperJsonSerializer, +} from "@/serializer/implementations/_module"; +import { type ISerializer } from "@/serializer/contracts/_module"; +import { type IStorageAdapter } from "@/storage/contracts/_module"; import type Redis from "ioredis"; import { type Result } from "ioredis"; import { TypeStorageError, UnexpectedStorageError, -} from "@/contracts/storage/_module"; +} from "@/storage/contracts/_module"; import { ClearIterable, escapeRedisChars } from "@/_shared/redis/_module"; import { isRedisTypeError } from "@/_shared/redis/_module"; diff --git a/src/storage/implementations/sqlite/_module.ts b/src/storage/implementations/sqlite/_module.ts new file mode 100644 index 00000000..df7f3fc7 --- /dev/null +++ b/src/storage/implementations/sqlite/_module.ts @@ -0,0 +1,2 @@ +export * from "@/storage/implementations/sqlite/sqlite-storage-adapter/_module"; +export * from "@/storage/implementations/sqlite/libsql-storage-adapter/_module"; diff --git a/src/storage/implementations/sqlite/_shared/_module.ts b/src/storage/implementations/sqlite/_shared/_module.ts new file mode 100644 index 00000000..4c3c2028 --- /dev/null +++ b/src/storage/implementations/sqlite/_shared/_module.ts @@ -0,0 +1 @@ +export * from "@/storage/implementations/sqlite/_shared/base-sqlite-storage-adapter"; diff --git a/src/storage/sqlite/_shared/base-sqlite-storage-adapter.ts b/src/storage/implementations/sqlite/_shared/base-sqlite-storage-adapter.ts similarity index 97% rename from src/storage/sqlite/_shared/base-sqlite-storage-adapter.ts rename to src/storage/implementations/sqlite/_shared/base-sqlite-storage-adapter.ts index 7fbe7d26..5bafed47 100644 --- a/src/storage/sqlite/_shared/base-sqlite-storage-adapter.ts +++ b/src/storage/implementations/sqlite/_shared/base-sqlite-storage-adapter.ts @@ -2,11 +2,11 @@ * @module Storage */ -import { type IStorageAdapter } from "@/contracts/storage/storage-adapter.contract"; +import { type IStorageAdapter } from "@/storage/contracts/storage-adapter.contract"; import { type Generated, type Insertable, type Kysely, sql } from "kysely"; -import { type ISerializer } from "@/contracts/serializer/_module"; +import { type ISerializer } from "@/serializer/contracts/_module"; import { type RecordItem, type IInitizable } from "@/_shared/types"; -import { TypeStorageError } from "@/contracts/storage/_module"; +import { TypeStorageError } from "@/storage/contracts/_module"; /** * @internal diff --git a/src/storage/implementations/sqlite/libsql-storage-adapter/_module.ts b/src/storage/implementations/sqlite/libsql-storage-adapter/_module.ts new file mode 100644 index 00000000..d6dee8dc --- /dev/null +++ b/src/storage/implementations/sqlite/libsql-storage-adapter/_module.ts @@ -0,0 +1 @@ +export * from "@/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter"; diff --git a/src/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts b/src/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts similarity index 80% rename from src/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts rename to src/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts index 670558f3..696aef36 100644 --- a/src/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts +++ b/src/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, test } from "vitest"; -import { storageTestSuite } from "@/storage/_shared/test-utilities/_module"; -import { LibsqlStorageAdapter } from "@/storage/sqlite/libsql-storage-adapter/_module"; +import { storageTestSuite } from "@/storage/implementations/_shared/test-utilities/_module"; +import { LibsqlStorageAdapter } from "@/storage/implementations/sqlite/libsql-storage-adapter/_module"; import { type Client, createClient } from "@libsql/client"; const client = createClient({ diff --git a/src/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts b/src/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts similarity index 87% rename from src/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts rename to src/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts index 16e16e31..9d82b987 100644 --- a/src/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts +++ b/src/storage/implementations/sqlite/libsql-storage-adapter/libsql-storage-adapter.ts @@ -2,10 +2,11 @@ * @module Storage */ -import { SuperJsonSerializer, type ISerializer } from "@/_module"; -import { type IStorageAdapter } from "@/contracts/storage/_module"; -import { SqlSerializer } from "@/serializer/sql-serializer/sql-serializer"; -import { BaseSqliteStorageAdapter } from "@/storage/sqlite/_shared/_module"; +import { SuperJsonSerializer } from "@/serializer/implementations/_module"; +import type { ISerializer } from "@/serializer/contracts/_module"; +import { type IStorageAdapter } from "@/storage/contracts/_module"; +import { SqlSerializer } from "@/serializer/implementations/sql-serializer/sql-serializer"; +import { BaseSqliteStorageAdapter } from "@/storage/implementations/sqlite/_shared/_module"; import { type IInitizable } from "@/_shared/types"; import { Kysely } from "kysely"; import { KyselyTableNameTransformerPlugin } from "@/_shared/kysely/_module"; diff --git a/src/storage/implementations/sqlite/sqlite-storage-adapter/_module.ts b/src/storage/implementations/sqlite/sqlite-storage-adapter/_module.ts new file mode 100644 index 00000000..cbc8006b --- /dev/null +++ b/src/storage/implementations/sqlite/sqlite-storage-adapter/_module.ts @@ -0,0 +1 @@ +export * from "@/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter"; diff --git a/src/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts b/src/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts similarity index 77% rename from src/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts rename to src/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts index fc31ef6c..31ef29c0 100644 --- a/src/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts +++ b/src/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, test } from "vitest"; -import { storageTestSuite } from "@/storage/_shared/test-utilities/_module"; -import { SqliteStorageAdapter } from "@/storage/sqlite/sqlite-storage-adapter/_module"; +import { storageTestSuite } from "@/storage/implementations/_shared/test-utilities/_module"; +import { SqliteStorageAdapter } from "@/storage/implementations/sqlite/sqlite-storage-adapter/_module"; import Sqlite, { type Database } from "better-sqlite3"; describe("class: SqliteStorageAdapter", () => { diff --git a/src/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts b/src/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts similarity index 87% rename from src/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts rename to src/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts index f96661d2..75a96140 100644 --- a/src/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts +++ b/src/storage/implementations/sqlite/sqlite-storage-adapter/sqlite-storage-adapter.ts @@ -2,11 +2,12 @@ * @module Storage */ -import { SuperJsonSerializer, type ISerializer } from "@/_module"; -import { type IStorageAdapter } from "@/contracts/storage/_module"; -import { SqlSerializer } from "@/serializer/sql-serializer/sql-serializer"; +import { SuperJsonSerializer } from "@/serializer/implementations/_module"; +import type { ISerializer } from "@/serializer/contracts/_module"; +import { type IStorageAdapter } from "@/storage/contracts/_module"; +import { SqlSerializer } from "@/serializer/implementations/sql-serializer/sql-serializer"; import { type Database } from "better-sqlite3"; -import { BaseSqliteStorageAdapter } from "@/storage/sqlite/_shared/_module"; +import { BaseSqliteStorageAdapter } from "@/storage/implementations/sqlite/_shared/_module"; import { type IInitizable } from "@/_shared/types"; import { Kysely, SqliteDialect } from "kysely"; import { KyselyTableNameTransformerPlugin } from "@/_shared/kysely/_module"; diff --git a/src/storage/storage.ts b/src/storage/implementations/storage.ts similarity index 97% rename from src/storage/storage.ts rename to src/storage/implementations/storage.ts index f3313c73..b2026f9b 100644 --- a/src/storage/storage.ts +++ b/src/storage/implementations/storage.ts @@ -6,12 +6,12 @@ import { KeyNotFoundStorageError, UnexpectedStorageError, type IStorageAdapter, -} from "@/contracts/storage/_module"; -import { type StorageValue, type IStorage } from "@/contracts/storage/_module"; -import { NamespaceStorageAdapter } from "@/storage/namespace-storage-adapter"; +} from "@/storage/contracts/_module"; +import { type StorageValue, type IStorage } from "@/storage/contracts/_module"; +import { NamespaceStorageAdapter } from "@/storage/implementations/namespace-storage-adapter"; import { simplifyAsyncLazyable } from "@/_shared/utilities"; import { type AsyncLazyable, type GetOrAddValue } from "@/_shared/types"; -import { LazyPromise } from "@/async/_module"; +import { LazyPromise } from "@/utilities/async/_module"; export type StorageSettings = { namespace?: string; diff --git a/src/storage/memory-storage-adapter/_module.ts b/src/storage/memory-storage-adapter/_module.ts deleted file mode 100644 index 28c8f586..00000000 --- a/src/storage/memory-storage-adapter/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/storage/memory-storage-adapter/memory-storage-adapter"; diff --git a/src/storage/mongodb-storage-adapter/_module.ts b/src/storage/mongodb-storage-adapter/_module.ts deleted file mode 100644 index 5a3f455c..00000000 --- a/src/storage/mongodb-storage-adapter/_module.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { - MongodbStorageAdapter, - type MongodbStorageAdapterSettings, -} from "@/storage/mongodb-storage-adapter/mongodb-storage-adapter"; diff --git a/src/storage/redis-storage-adapter/_module.ts b/src/storage/redis-storage-adapter/_module.ts deleted file mode 100644 index 316f1823..00000000 --- a/src/storage/redis-storage-adapter/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/storage/redis-storage-adapter/redis-storage-adapter"; diff --git a/src/storage/sqlite/_module.ts b/src/storage/sqlite/_module.ts deleted file mode 100644 index e2956a36..00000000 --- a/src/storage/sqlite/_module.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "@/storage/sqlite/sqlite-storage-adapter/_module"; -export * from "@/storage/sqlite/libsql-storage-adapter/_module"; diff --git a/src/storage/sqlite/_shared/_module.ts b/src/storage/sqlite/_shared/_module.ts deleted file mode 100644 index 72e4e9bb..00000000 --- a/src/storage/sqlite/_shared/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/storage/sqlite/_shared/base-sqlite-storage-adapter"; diff --git a/src/storage/sqlite/libsql-storage-adapter/_module.ts b/src/storage/sqlite/libsql-storage-adapter/_module.ts deleted file mode 100644 index 89de6b16..00000000 --- a/src/storage/sqlite/libsql-storage-adapter/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/storage/sqlite/libsql-storage-adapter/libsql-storage-adapter"; diff --git a/src/storage/sqlite/sqlite-storage-adapter/_module.ts b/src/storage/sqlite/sqlite-storage-adapter/_module.ts deleted file mode 100644 index 1264aed6..00000000 --- a/src/storage/sqlite/sqlite-storage-adapter/_module.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@/storage/sqlite/sqlite-storage-adapter/sqlite-storage-adapter"; diff --git a/src/utilities/_module.ts b/src/utilities/_module.ts index f376a1de..d1e8d624 100644 --- a/src/utilities/_module.ts +++ b/src/utilities/_module.ts @@ -1 +1,2 @@ +export * from "@/utilities/async/_module"; export * from "@/utilities/time-span/_module"; diff --git a/src/utilities/async/_module.ts b/src/utilities/async/_module.ts new file mode 100644 index 00000000..c04d9e6c --- /dev/null +++ b/src/utilities/async/_module.ts @@ -0,0 +1,11 @@ +export * from "@/utilities/async/_shared"; +export * from "@/utilities/async/abortable/_module"; +export * from "@/utilities/async/abortable-iterable/_module"; +export * from "@/utilities/async/backof-policies/_module"; +export * from "@/utilities/async/delay/_module"; +export * from "@/utilities/async/delay-iterable/_module"; +export * from "@/utilities/async/lazy-promise/_module"; +export * from "@/utilities/async/retry/_module"; +export { retryIterable as unstable_retryIterable } from "@/utilities/async/retry-iterable/_module"; +export * from "@/utilities/async/timeout/_module"; +export * from "@/utilities/async/timeout-iterable/_module"; diff --git a/src/async/_shared.ts b/src/utilities/async/_shared.ts similarity index 100% rename from src/async/_shared.ts rename to src/utilities/async/_shared.ts diff --git a/src/utilities/async/abortable-iterable/_module.ts b/src/utilities/async/abortable-iterable/_module.ts new file mode 100644 index 00000000..8b2379ff --- /dev/null +++ b/src/utilities/async/abortable-iterable/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/abortable-iterable/abortable-iterable"; diff --git a/src/async/abortable-iterable/abortable-iterable.test.ts b/src/utilities/async/abortable-iterable/abortable-iterable.test.ts similarity index 96% rename from src/async/abortable-iterable/abortable-iterable.test.ts rename to src/utilities/async/abortable-iterable/abortable-iterable.test.ts index b050a0f3..3f931c16 100644 --- a/src/async/abortable-iterable/abortable-iterable.test.ts +++ b/src/utilities/async/abortable-iterable/abortable-iterable.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "vitest"; -import { AsyncError, AbortAsyncError } from "@/async/_shared"; -import { abortableIterable } from "@/async/abortable-iterable/_module"; +import { AsyncError, AbortAsyncError } from "@/utilities/async/_shared"; +import { abortableIterable } from "@/utilities/async/abortable-iterable/_module"; describe("function: abortableIterable", () => { test("should throw AsyncError when aborted", async () => { diff --git a/src/async/abortable-iterable/abortable-iterable.ts b/src/utilities/async/abortable-iterable/abortable-iterable.ts similarity index 95% rename from src/async/abortable-iterable/abortable-iterable.ts rename to src/utilities/async/abortable-iterable/abortable-iterable.ts index cf615bff..29295a19 100644 --- a/src/async/abortable-iterable/abortable-iterable.ts +++ b/src/utilities/async/abortable-iterable/abortable-iterable.ts @@ -6,8 +6,8 @@ import { AbortAsyncError, // eslint-disable-next-line @typescript-eslint/no-unused-vars AsyncError, -} from "@/async/_shared"; -import { abortable } from "@/async/abortable/_module"; +} from "@/utilities/async/_shared"; +import { abortable } from "@/utilities/async/abortable/_module"; /** * @internal diff --git a/src/utilities/async/abortable/_module.ts b/src/utilities/async/abortable/_module.ts new file mode 100644 index 00000000..60ae0364 --- /dev/null +++ b/src/utilities/async/abortable/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/abortable/abortable"; diff --git a/src/async/abortable/abortable.test.ts b/src/utilities/async/abortable/abortable.test.ts similarity index 95% rename from src/async/abortable/abortable.test.ts rename to src/utilities/async/abortable/abortable.test.ts index d82a65a3..25df2a64 100644 --- a/src/async/abortable/abortable.test.ts +++ b/src/utilities/async/abortable/abortable.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "vitest"; -import { abortable } from "@/async/abortable/_module"; -import { AbortAsyncError, AsyncError } from "@/async/_shared"; +import { abortable } from "@/utilities/async/abortable/_module"; +import { AbortAsyncError, AsyncError } from "@/utilities/async/_shared"; describe("function: abortable", () => { test("should throw AsyncError when aborted", async () => { diff --git a/src/async/abortable/abortable.ts b/src/utilities/async/abortable/abortable.ts similarity index 96% rename from src/async/abortable/abortable.ts rename to src/utilities/async/abortable/abortable.ts index 7c359e74..77ac026b 100644 --- a/src/async/abortable/abortable.ts +++ b/src/utilities/async/abortable/abortable.ts @@ -6,8 +6,8 @@ import { AbortAsyncError, // eslint-disable-next-line @typescript-eslint/no-unused-vars AsyncError, -} from "@/async/_shared"; -import { LazyPromise } from "@/async/lazy-promise/_module"; +} from "@/utilities/async/_shared"; +import { LazyPromise } from "@/utilities/async/lazy-promise/_module"; /** * @internal diff --git a/src/utilities/async/backof-policies/_module.ts b/src/utilities/async/backof-policies/_module.ts new file mode 100644 index 00000000..76df860d --- /dev/null +++ b/src/utilities/async/backof-policies/_module.ts @@ -0,0 +1,5 @@ +export { type BackoffPolicy } from "@/utilities/async/backof-policies/_shared"; +export * from "@/utilities/async/backof-policies/constant-backoff-policy/_module"; +export * from "@/utilities/async/backof-policies/exponential-backoff-policy/_module"; +export * from "@/utilities/async/backof-policies/linear-backoff-policy/_module"; +export * from "@/utilities/async/backof-policies/polynomial-backoff-policy/_module"; diff --git a/src/async/backof-policies/_shared.ts b/src/utilities/async/backof-policies/_shared.ts similarity index 100% rename from src/async/backof-policies/_shared.ts rename to src/utilities/async/backof-policies/_shared.ts diff --git a/src/utilities/async/backof-policies/constant-backoff-policy/_module.ts b/src/utilities/async/backof-policies/constant-backoff-policy/_module.ts new file mode 100644 index 00000000..128ffe62 --- /dev/null +++ b/src/utilities/async/backof-policies/constant-backoff-policy/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy"; diff --git a/src/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts b/src/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts similarity index 95% rename from src/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts rename to src/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts index 9b07f151..dbe43966 100644 --- a/src/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts +++ b/src/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.ts @@ -6,7 +6,7 @@ import { TimeSpan } from "@/utilities/_module"; import { withJitter, type BackoffPolicy, -} from "@/async/backof-policies/_shared"; +} from "@/utilities/async/backof-policies/_shared"; /** * @group Backoff policies diff --git a/src/utilities/async/backof-policies/exponential-backoff-policy/_module.ts b/src/utilities/async/backof-policies/exponential-backoff-policy/_module.ts new file mode 100644 index 00000000..fba9416a --- /dev/null +++ b/src/utilities/async/backof-policies/exponential-backoff-policy/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy"; diff --git a/src/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts b/src/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts similarity index 90% rename from src/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts rename to src/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts index 5a67e379..90e48cf3 100644 --- a/src/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts +++ b/src/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.ts @@ -3,8 +3,8 @@ */ import { TimeSpan } from "@/utilities/_module"; -import type { BackoffPolicy } from "@/async/backof-policies/_shared"; -import { withJitter } from "@/async/backof-policies/_shared"; +import type { BackoffPolicy } from "@/utilities/async/backof-policies/_shared"; +import { withJitter } from "@/utilities/async/backof-policies/_shared"; /** * @group Backoff policies diff --git a/src/utilities/async/backof-policies/linear-backoff-policy/_module.ts b/src/utilities/async/backof-policies/linear-backoff-policy/_module.ts new file mode 100644 index 00000000..6e5466aa --- /dev/null +++ b/src/utilities/async/backof-policies/linear-backoff-policy/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy"; diff --git a/src/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts b/src/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts similarity index 89% rename from src/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts rename to src/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts index dc688cec..da217af5 100644 --- a/src/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts +++ b/src/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.ts @@ -3,8 +3,8 @@ */ import { TimeSpan } from "@/utilities/_module"; -import type { BackoffPolicy } from "@/async/backof-policies/_shared"; -import { withJitter } from "@/async/backof-policies/_shared"; +import type { BackoffPolicy } from "@/utilities/async/backof-policies/_shared"; +import { withJitter } from "@/utilities/async/backof-policies/_shared"; /** * @group Backoff policies diff --git a/src/utilities/async/backof-policies/polynomial-backoff-policy/_module.ts b/src/utilities/async/backof-policies/polynomial-backoff-policy/_module.ts new file mode 100644 index 00000000..56af051a --- /dev/null +++ b/src/utilities/async/backof-policies/polynomial-backoff-policy/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy"; diff --git a/src/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts b/src/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts similarity index 90% rename from src/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts rename to src/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts index 4f773e8f..9000dc3c 100644 --- a/src/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts +++ b/src/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts @@ -3,8 +3,8 @@ */ import { TimeSpan } from "@/utilities/_module"; -import type { BackoffPolicy } from "@/async/backof-policies/_shared"; -import { withJitter } from "@/async/backof-policies/_shared"; +import type { BackoffPolicy } from "@/utilities/async/backof-policies/_shared"; +import { withJitter } from "@/utilities/async/backof-policies/_shared"; /** * @group Backoff policies diff --git a/src/utilities/async/delay-iterable/_module.ts b/src/utilities/async/delay-iterable/_module.ts new file mode 100644 index 00000000..e5eaecad --- /dev/null +++ b/src/utilities/async/delay-iterable/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/delay-iterable/delay-iterable"; diff --git a/src/async/delay-iterable/delay-iterable.test.ts b/src/utilities/async/delay-iterable/delay-iterable.test.ts similarity index 93% rename from src/async/delay-iterable/delay-iterable.test.ts rename to src/utilities/async/delay-iterable/delay-iterable.test.ts index 89e4be83..effcd2d8 100644 --- a/src/async/delay-iterable/delay-iterable.test.ts +++ b/src/utilities/async/delay-iterable/delay-iterable.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vitest"; -import { delayIterable } from "@/async/delay-iterable/_module"; -import { AbortAsyncError, AsyncError } from "@/async/_shared"; -import { TimeSpan } from "@/_module"; +import { delayIterable } from "@/utilities/async/delay-iterable/_module"; +import { AbortAsyncError, AsyncError } from "@/utilities/async/_shared"; +import { TimeSpan } from "@/utilities/time-span/_module"; describe("function: delayIterable", () => { test("should throw AsyncError when aborted", async () => { diff --git a/src/async/delay-iterable/delay-iterable.ts b/src/utilities/async/delay-iterable/delay-iterable.ts similarity index 92% rename from src/async/delay-iterable/delay-iterable.ts rename to src/utilities/async/delay-iterable/delay-iterable.ts index 363fbec8..8380f858 100644 --- a/src/async/delay-iterable/delay-iterable.ts +++ b/src/utilities/async/delay-iterable/delay-iterable.ts @@ -4,10 +4,10 @@ import type { TimeSpan } from "@/utilities/_module"; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import type { AsyncError } from "@/async/_shared"; -import { AbortAsyncError } from "@/async/_shared"; -import { abortable } from "@/async/abortable/_module"; -import { delay } from "@/async/delay/delay"; +import type { AsyncError } from "@/utilities/async/_shared"; +import { AbortAsyncError } from "@/utilities/async/_shared"; +import { abortable } from "@/utilities/async/abortable/_module"; +import { delay } from "@/utilities/async/delay/delay"; /** * @internal diff --git a/src/utilities/async/delay/_module.ts b/src/utilities/async/delay/_module.ts new file mode 100644 index 00000000..8abffad5 --- /dev/null +++ b/src/utilities/async/delay/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/delay/delay"; diff --git a/src/async/delay/delay.test.ts b/src/utilities/async/delay/delay.test.ts similarity index 86% rename from src/async/delay/delay.test.ts rename to src/utilities/async/delay/delay.test.ts index c4206dfd..ab9ed45f 100644 --- a/src/async/delay/delay.test.ts +++ b/src/utilities/async/delay/delay.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vitest"; -import { delay } from "@/async/delay/_module"; -import { AbortAsyncError, AsyncError } from "@/async/_shared"; -import { TimeSpan } from "@/_module"; +import { delay } from "@/utilities/async/delay/_module"; +import { AbortAsyncError, AsyncError } from "@/utilities/async/_shared"; +import { TimeSpan } from "@/utilities/time-span/_module"; describe("function: delay", () => { test("should throw AsyncError when aborted", async () => { diff --git a/src/async/delay/delay.ts b/src/utilities/async/delay/delay.ts similarity index 91% rename from src/async/delay/delay.ts rename to src/utilities/async/delay/delay.ts index e1da413c..3433d15d 100644 --- a/src/async/delay/delay.ts +++ b/src/utilities/async/delay/delay.ts @@ -8,9 +8,9 @@ import { AsyncError, // eslint-disable-next-line @typescript-eslint/no-unused-vars AbortAsyncError, -} from "@/async/_shared"; -import { abortable } from "@/async/abortable/_module"; -import { LazyPromise } from "@/async/lazy-promise/_module"; +} from "@/utilities/async/_shared"; +import { abortable } from "@/utilities/async/abortable/_module"; +import { LazyPromise } from "@/utilities/async/lazy-promise/_module"; /** * The delay function creates a promise that will be fulfilled after given time and can be aborted by providing abortSignal. diff --git a/src/utilities/async/lazy-promise/_module.ts b/src/utilities/async/lazy-promise/_module.ts new file mode 100644 index 00000000..81195024 --- /dev/null +++ b/src/utilities/async/lazy-promise/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/lazy-promise/lazy-promise"; diff --git a/src/async/lazy-promise/lazy-promise.test.ts b/src/utilities/async/lazy-promise/lazy-promise.test.ts similarity index 94% rename from src/async/lazy-promise/lazy-promise.test.ts rename to src/utilities/async/lazy-promise/lazy-promise.test.ts index 3f9bb91f..e74adc9b 100644 --- a/src/async/lazy-promise/lazy-promise.test.ts +++ b/src/utilities/async/lazy-promise/lazy-promise.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "vitest"; -import { LazyPromise } from "@/async/lazy-promise/_module"; +import { LazyPromise } from "@/utilities/async/lazy-promise/_module"; describe("function: lazyPromise", () => { test("Should not execute callback function when not awaited", async () => { diff --git a/src/async/lazy-promise/lazy-promise.ts b/src/utilities/async/lazy-promise/lazy-promise.ts similarity index 100% rename from src/async/lazy-promise/lazy-promise.ts rename to src/utilities/async/lazy-promise/lazy-promise.ts diff --git a/src/utilities/async/retry-iterable/_module.ts b/src/utilities/async/retry-iterable/_module.ts new file mode 100644 index 00000000..a8f79dfc --- /dev/null +++ b/src/utilities/async/retry-iterable/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/retry-iterable/retry-iterable"; diff --git a/src/async/retry-iterable/retry-iterable.ts b/src/utilities/async/retry-iterable/retry-iterable.ts similarity index 96% rename from src/async/retry-iterable/retry-iterable.ts rename to src/utilities/async/retry-iterable/retry-iterable.ts index d1e22372..0728f982 100644 --- a/src/async/retry-iterable/retry-iterable.ts +++ b/src/utilities/async/retry-iterable/retry-iterable.ts @@ -10,9 +10,9 @@ import { TimeoutAsyncError, // eslint-disable-next-line @typescript-eslint/no-unused-vars RetryAsyncError, -} from "@/async/_shared"; -import { retry } from "@/async/retry/retry"; -import type { RetrySettings } from "@/async/retry/_module"; +} from "@/utilities/async/_shared"; +import { retry } from "@/utilities/async/retry/retry"; +import type { RetrySettings } from "@/utilities/async/retry/_module"; /** * @internal diff --git a/src/utilities/async/retry/_module.ts b/src/utilities/async/retry/_module.ts new file mode 100644 index 00000000..2fe02085 --- /dev/null +++ b/src/utilities/async/retry/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/retry/retry"; diff --git a/src/async/retry/retry.test.ts b/src/utilities/async/retry/retry.test.ts similarity index 95% rename from src/async/retry/retry.test.ts rename to src/utilities/async/retry/retry.test.ts index d0458b26..7e72c03b 100644 --- a/src/async/retry/retry.test.ts +++ b/src/utilities/async/retry/retry.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vitest"; -import { retry } from "@/async/retry/_module"; -import { AbortAsyncError, RetryAsyncError } from "@/async/_shared"; -import { TimeSpan } from "@/_module"; +import { retry } from "@/utilities/async/retry/_module"; +import { AbortAsyncError, RetryAsyncError } from "@/utilities/async/_shared"; +import { TimeSpan } from "@/utilities/time-span/_module"; describe("function: retry", () => { test("Should throw RetryAsyncError when all atempts fail", async () => { diff --git a/src/async/retry/retry.ts b/src/utilities/async/retry/retry.ts similarity index 92% rename from src/async/retry/retry.ts rename to src/utilities/async/retry/retry.ts index 1d913e3c..dd46e678 100644 --- a/src/async/retry/retry.ts +++ b/src/utilities/async/retry/retry.ts @@ -2,7 +2,7 @@ * @module Async */ -import { delay } from "@/async/delay/_module"; +import { delay } from "@/utilities/async/delay/_module"; import { // eslint-disable-next-line @typescript-eslint/no-unused-vars type AsyncError, @@ -11,11 +11,11 @@ import { // eslint-disable-next-line @typescript-eslint/no-unused-vars TimeoutAsyncError, RetryAsyncError, -} from "@/async/_shared"; -import type { BackoffPolicy } from "@/async/backof-policies/_module"; -import { exponentialBackoffPolicy } from "@/async/backof-policies/_module"; -import { LazyPromise } from "@/async/lazy-promise/_module"; -import { timeout } from "@/async/timeout/_module"; +} from "@/utilities/async/_shared"; +import type { BackoffPolicy } from "@/utilities/async/backof-policies/_module"; +import { exponentialBackoffPolicy } from "@/utilities/async/backof-policies/_module"; +import { LazyPromise } from "@/utilities/async/lazy-promise/_module"; +import { timeout } from "@/utilities/async/timeout/_module"; import { TimeSpan } from "@/utilities/_module"; export type RetryPolicy = (error: unknown) => boolean; diff --git a/src/utilities/async/timeout-iterable/_module.ts b/src/utilities/async/timeout-iterable/_module.ts new file mode 100644 index 00000000..01351de2 --- /dev/null +++ b/src/utilities/async/timeout-iterable/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/timeout-iterable/timeout-iterable"; diff --git a/src/async/timeout-iterable/timeout-iterable.test.ts b/src/utilities/async/timeout-iterable/timeout-iterable.test.ts similarity index 97% rename from src/async/timeout-iterable/timeout-iterable.test.ts rename to src/utilities/async/timeout-iterable/timeout-iterable.test.ts index ede2dfe7..63e9c827 100644 --- a/src/async/timeout-iterable/timeout-iterable.test.ts +++ b/src/utilities/async/timeout-iterable/timeout-iterable.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vitest"; -import { timeoutIterable } from "@/async/timeout-iterable/_module"; -import { AsyncError, AbortAsyncError } from "@/async/_shared"; -import { TimeSpan } from "@/_module"; +import { timeoutIterable } from "@/utilities/async/timeout-iterable/_module"; +import { AsyncError, AbortAsyncError } from "@/utilities/async/_shared"; +import { TimeSpan } from "@/utilities/time-span/_module"; describe("function: timeoutIterable", () => { test("should throw AsyncError when aborted", async () => { diff --git a/src/async/timeout-iterable/timeout-iterable.ts b/src/utilities/async/timeout-iterable/timeout-iterable.ts similarity index 93% rename from src/async/timeout-iterable/timeout-iterable.ts rename to src/utilities/async/timeout-iterable/timeout-iterable.ts index f69b98a8..ffb2d9fe 100644 --- a/src/async/timeout-iterable/timeout-iterable.ts +++ b/src/utilities/async/timeout-iterable/timeout-iterable.ts @@ -3,8 +3,8 @@ */ // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { AsyncError, AbortAsyncError } from "@/async/_shared"; -import { abortableIterable } from "@/async/abortable-iterable/_module"; +import { AsyncError, AbortAsyncError } from "@/utilities/async/_shared"; +import { abortableIterable } from "@/utilities/async/abortable-iterable/_module"; import type { TimeSpan } from "@/utilities/_module"; /** diff --git a/src/utilities/async/timeout/_module.ts b/src/utilities/async/timeout/_module.ts new file mode 100644 index 00000000..685de6bd --- /dev/null +++ b/src/utilities/async/timeout/_module.ts @@ -0,0 +1 @@ +export * from "@/utilities/async/timeout/timeout"; diff --git a/src/async/timeout/timeout.test.ts b/src/utilities/async/timeout/timeout.test.ts similarity index 96% rename from src/async/timeout/timeout.test.ts rename to src/utilities/async/timeout/timeout.test.ts index 97758f25..27bac8e4 100644 --- a/src/async/timeout/timeout.test.ts +++ b/src/utilities/async/timeout/timeout.test.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from "vitest"; -import { timeout } from "@/async/timeout/_module"; +import { timeout } from "@/utilities/async/timeout/_module"; import { AbortAsyncError, AsyncError, TimeoutAsyncError, -} from "@/async/_shared"; -import { TimeSpan } from "@/_module"; +} from "@/utilities/async/_shared"; +import { TimeSpan } from "@/utilities/time-span/_module"; describe("function: timeout", () => { test("should throw AsyncError when aborted", async () => { diff --git a/src/async/timeout/timeout.ts b/src/utilities/async/timeout/timeout.ts similarity index 93% rename from src/async/timeout/timeout.ts rename to src/utilities/async/timeout/timeout.ts index 6b9b0e9a..ce323f99 100644 --- a/src/async/timeout/timeout.ts +++ b/src/utilities/async/timeout/timeout.ts @@ -2,7 +2,7 @@ * @module Async */ -import { LazyPromise } from "@/async/lazy-promise/_module"; +import { LazyPromise } from "@/utilities/async/lazy-promise/_module"; import { // eslint-disable-next-line @typescript-eslint/no-unused-vars AsyncError, @@ -10,8 +10,8 @@ import { AbortAsyncError, // eslint-disable-next-line @typescript-eslint/no-unused-vars TimeoutAsyncError, -} from "@/async/_shared"; -import { abortable } from "@/async/abortable/_module"; +} from "@/utilities/async/_shared"; +import { abortable } from "@/utilities/async/abortable/_module"; import type { TimeSpan } from "@/utilities/_module"; /** diff --git a/src/utilities/time-span/time-span.ts b/src/utilities/time-span/time-span.ts index cf7bf7c8..b4cd9bd4 100644 --- a/src/utilities/time-span/time-span.ts +++ b/src/utilities/time-span/time-span.ts @@ -131,14 +131,14 @@ export class TimeSpan { /** * Will return endDate relative to a given startDate argument. */ - toEndDate(startDate: Date): Date { + toEndDate(startDate = new Date()): Date { return new Date(startDate.getTime() + this.toMilliseconds()); } /** * Will return startDate relative to a given endDate argument. */ - toStartDate(endDate: Date): Date { + toStartDate(endDate = new Date()): Date { return new Date(endDate.getTime() - this.toMilliseconds()); } }