Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored all code be grouped based on features #56

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/_module.ts
Original file line number Diff line number Diff line change
@@ -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";
11 changes: 0 additions & 11 deletions src/async/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/abortable-iterable/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/abortable/_module.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/async/backof-policies/_module.ts

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/async/backof-policies/linear-backoff-policy/_module.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/async/delay-iterable/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/delay/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/lazy-promise/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/retry-iterable/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/retry/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/timeout-iterable/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/async/timeout/_module.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/collection/_module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/collection/async-iterable-collection/_module.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/collection/async-iterable-collection/_shared/_module.ts

This file was deleted.

3 changes: 3 additions & 0 deletions src/collection/contracts/_module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "@/collection/contracts/_shared";
export * from "@/collection/contracts/collection.contract";
export * from "@/collection/contracts/async-collection.contract";
Original file line number Diff line number Diff line change
Expand Up @@ -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> = TValue extends
| Array<infer TItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> = TValue extends
Expand Down
4 changes: 4 additions & 0 deletions src/collection/implementations/_module.ts
Original file line number Diff line number Diff line change
@@ -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";
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "@/collection/implementations/async-iterable-collection/async-iterable-collection";
Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncMap,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";
import { type RecordItem } from "@/_shared/types";
/**
* @internal
Expand All @@ -15,9 +15,7 @@ export class AsyncCountByIterable<TInput, TOutput = TInput>
TInput,
IAsyncCollection<TInput>,
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<
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncMap,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -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";

/**
Expand All @@ -16,9 +16,7 @@ export class AsyncGroupByIterable<TInput, TOutput = TInput>
TInput,
IAsyncCollection<TInput>,
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: <TInput>(
iterable: AsyncIterableValue<TInput>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncMap,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {} from "@/contracts/collection/_module";
import {} from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type Comparator,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";
import { type AsyncIterableValue } from "@/_shared/types";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IAsyncCollection } from "@/contracts/collection/_module";
import { type IAsyncCollection } from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AsyncPredicate,
type IAsyncCollection,
} from "@/contracts/collection/_module";
} from "@/collection/contracts/_module";

/**
* @internal
Expand Down
Loading
Loading