@daiso-tech/core 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +1 -1
- package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/base-cache.js +8 -8
- package/dist/cjs/cache/implementations/derivables/base-cache.js.map +1 -1
- package/dist/cjs/collection/contracts/_module.js +1 -0
- package/dist/cjs/collection/contracts/_module.js.map +1 -1
- package/dist/cjs/collection/contracts/_shared.js +0 -43
- package/dist/cjs/collection/contracts/_shared.js.map +1 -1
- package/dist/cjs/collection/contracts/collection.errors.js +46 -0
- package/dist/cjs/collection/contracts/collection.errors.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js +3 -3
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js +38 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/update-iterable.js +3 -3
- package/dist/cjs/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js +34 -1
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/list-collection/list-collection.js +34 -1
- package/dist/cjs/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/cjs/serializer/implementations/_shared/test-utilities/serializer.test-suite.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +1 -1
- package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/base-cache.js +8 -8
- package/dist/esm/cache/implementations/derivables/base-cache.js.map +1 -1
- package/dist/esm/collection/contracts/_module.js +1 -0
- package/dist/esm/collection/contracts/_module.js.map +1 -1
- package/dist/esm/collection/contracts/_shared.js +0 -36
- package/dist/esm/collection/contracts/_shared.js.map +1 -1
- package/dist/esm/collection/contracts/collection.errors.js +37 -0
- package/dist/esm/collection/contracts/collection.errors.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js +39 -2
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/update-iterable.js +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js +35 -2
- package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js +34 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/esm/serializer/implementations/_shared/test-utilities/serializer.test-suite.js.map +1 -1
- package/dist/types/_shared/types.d.ts +0 -1
- package/dist/types/collection/contracts/_module.d.ts +1 -0
- package/dist/types/collection/contracts/_shared.d.ts +2 -36
- package/dist/types/collection/contracts/async-collection.contract.d.ts +39 -60
- package/dist/types/collection/contracts/collection.contract.d.ts +36 -55
- package/dist/types/collection/contracts/collection.errors.d.ts +39 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.d.ts +6 -3
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-update-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +8 -6
- package/dist/types/collection/implementations/iterable-collection/_shared/count-by-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/iterable-collection/_shared/entries-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/iterable-collection/_shared/group-by-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/iterable-collection/_shared/update-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/iterable-collection/_shared/zip-iterable.d.ts +2 -3
- package/dist/types/collection/implementations/iterable-collection/iterable-collection.d.ts +8 -6
- package/dist/types/collection/implementations/list-collection/list-collection.d.ts +7 -5
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
|
+
import type { EnsureMap, EnsureRecord } from "../../../collection/contracts/_module";
|
|
4
5
|
import { type Collapse, type Comparator, type Predicate, type ForEach, type ICollection, type Map, type Modifier, type Tap, type Transform, type Reduce, type CrossJoinResult } from "../../../collection/contracts/_module";
|
|
5
6
|
import { type Lazyable } from "../../../_shared/types";
|
|
6
|
-
import { type RecordItem } from "../../../_shared/types";
|
|
7
7
|
/**
|
|
8
8
|
* All methods that return <i>{@link ICollection}</i> are executed lazly which means they will be executed when the <i>IterableCollection</i> is iterated with <i>forEach</i> method or "for of" loop.
|
|
9
9
|
* The rest of the methods are executed eagerly.
|
|
10
10
|
* @group Adapters
|
|
11
11
|
*/
|
|
12
12
|
export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
13
|
-
private iterable;
|
|
13
|
+
private readonly iterable;
|
|
14
14
|
private static DEFAULT_CHUNK_SIZE;
|
|
15
15
|
private static makeCollection;
|
|
16
16
|
/**
|
|
@@ -19,7 +19,7 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
|
19
19
|
constructor(iterable: Iterable<TInput>);
|
|
20
20
|
[Symbol.iterator](): Iterator<TInput>;
|
|
21
21
|
toIterator(): Iterator<TInput, void>;
|
|
22
|
-
entries(): ICollection<
|
|
22
|
+
entries(): ICollection<[number, TInput]>;
|
|
23
23
|
keys(): ICollection<number>;
|
|
24
24
|
values(): ICollection<TInput>;
|
|
25
25
|
filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
|
|
@@ -61,8 +61,8 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
|
61
61
|
split(chunkAmount: number): ICollection<ICollection<TInput>>;
|
|
62
62
|
partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
|
|
63
63
|
sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
|
|
64
|
-
groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<
|
|
65
|
-
countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<
|
|
64
|
+
groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<[TOutput, ICollection<TInput>]>;
|
|
65
|
+
countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<[TOutput, number]>;
|
|
66
66
|
unique<TOutput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
67
67
|
difference<TOutput = TInput>(iterable: Iterable<TInput>, mapFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
68
68
|
repeat(amount: number): ICollection<TInput>;
|
|
@@ -74,7 +74,7 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
|
74
74
|
insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
75
75
|
insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
76
76
|
crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
|
|
77
|
-
zip<TExtended>(iterable: Iterable<TExtended>): ICollection<
|
|
77
|
+
zip<TExtended>(iterable: Iterable<TExtended>): ICollection<[TInput, TExtended]>;
|
|
78
78
|
sort(comparator?: Comparator<TInput>): ICollection<TInput>;
|
|
79
79
|
reverse(chunkSize?: number): ICollection<TInput>;
|
|
80
80
|
shuffle(mathRandom?: () => number): ICollection<TInput>;
|
|
@@ -100,4 +100,6 @@ export declare class IterableCollection<TInput> implements ICollection<TInput> {
|
|
|
100
100
|
searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
101
101
|
forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
|
|
102
102
|
toArray(): TInput[];
|
|
103
|
+
toRecord(): EnsureRecord<TInput>;
|
|
104
|
+
toMap(): EnsureMap<TInput>;
|
|
103
105
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
|
+
import type { EnsureMap, EnsureRecord } from "../../../collection/contracts/_module";
|
|
4
5
|
import { type Collapse, type Comparator, type Predicate, type ICollection, type Map, type Modifier, type Tap, type Transform, type Reduce, type ForEach, type CrossJoinResult } from "../../../collection/contracts/_module";
|
|
5
6
|
import { type Lazyable } from "../../../_shared/types";
|
|
6
|
-
import { type RecordItem } from "../../../_shared/types";
|
|
7
7
|
/**
|
|
8
8
|
* All methods in <i>ListCollection</i> are executed eagerly.
|
|
9
9
|
* @group Adapters
|
|
@@ -16,7 +16,7 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
|
16
16
|
constructor(iterable?: Iterable<TInput>);
|
|
17
17
|
[Symbol.iterator](): Iterator<TInput>;
|
|
18
18
|
toIterator(): Iterator<TInput, void>;
|
|
19
|
-
entries(): ICollection<
|
|
19
|
+
entries(): ICollection<[number, TInput]>;
|
|
20
20
|
keys(): ICollection<number>;
|
|
21
21
|
values(): ICollection<TInput>;
|
|
22
22
|
filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
|
|
@@ -58,8 +58,8 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
|
58
58
|
split(chunkAmount: number): ICollection<ICollection<TInput>>;
|
|
59
59
|
partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
|
|
60
60
|
sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
|
|
61
|
-
groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<
|
|
62
|
-
countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<
|
|
61
|
+
groupBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<[TOutput, ICollection<TInput>]>;
|
|
62
|
+
countBy<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<[TOutput, number]>;
|
|
63
63
|
unique<TOutput = TInput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
64
64
|
difference<TOutput = TInput>(iterable: Iterable<TInput>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
|
|
65
65
|
repeat(amount: number): ICollection<TInput>;
|
|
@@ -71,7 +71,7 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
|
71
71
|
insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
72
72
|
insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
|
|
73
73
|
crossJoin<TExtended>(iterable: Iterable<TExtended>): ICollection<CrossJoinResult<TInput, TExtended>>;
|
|
74
|
-
zip<TExtended>(iterable: Iterable<TExtended>): ICollection<
|
|
74
|
+
zip<TExtended>(iterable: Iterable<TExtended>): ICollection<[TInput, TExtended]>;
|
|
75
75
|
sort(comparator?: Comparator<TInput>): ICollection<TInput>;
|
|
76
76
|
reverse(_chunkSize?: number): ICollection<TInput>;
|
|
77
77
|
shuffle(mathRandom?: () => number): ICollection<TInput>;
|
|
@@ -97,4 +97,6 @@ export declare class ListCollection<TInput> implements ICollection<TInput> {
|
|
|
97
97
|
searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
|
|
98
98
|
forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
|
|
99
99
|
toArray(): TInput[];
|
|
100
|
+
toRecord(): EnsureRecord<TInput>;
|
|
101
|
+
toMap(): EnsureMap<TInput>;
|
|
100
102
|
}
|