@byloth/core 1.5.0-rc.5 → 1.5.0-rc.7

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.
@@ -0,0 +1,294 @@
1
+ import { SmartAsyncIterator } from "../iterators/index.js";
2
+ import type { AsyncGeneratorFunction } from "../iterators/types.js";
3
+
4
+ import ReducedIterator from "./reduced-iterator.js";
5
+ import type { MaybeAsyncKeyIteratee, MaybeAsyncKeyTypeGuardIteratee, MaybeAsyncKeyReducer } from "./types.js";
6
+
7
+ export default class AggregatedAsyncIterator<K extends PropertyKey, T>
8
+ {
9
+ protected _elements: SmartAsyncIterator<[K, T]>;
10
+
11
+ public constructor(iterable: AsyncIterable<[K, T]>);
12
+ public constructor(iterator: AsyncIterator<[K, T]>);
13
+ public constructor(generatorFn: AsyncGeneratorFunction<[K, T]>);
14
+ public constructor(argument: AsyncIterable<[K, T]> | AsyncIterator<[K, T]> | AsyncGeneratorFunction<[K, T]>);
15
+ public constructor(argument: AsyncIterable<[K, T]> | AsyncIterator<[K, T]> | AsyncGeneratorFunction<[K, T]>)
16
+ {
17
+ this._elements = new SmartAsyncIterator(argument);
18
+ }
19
+
20
+ public async every(predicate: MaybeAsyncKeyIteratee<K, T, boolean>): Promise<ReducedIterator<K, boolean>>
21
+ {
22
+ const indexes = new Map<K, [number, boolean]>();
23
+
24
+ for await (const [key, element] of this._elements)
25
+ {
26
+ const [index, result] = indexes.get(key) ?? [0, true];
27
+
28
+ if (!(result)) { continue; }
29
+
30
+ indexes.set(key, [index + 1, await predicate(key, element, index)]);
31
+ }
32
+
33
+ return new ReducedIterator(function* ()
34
+ {
35
+ for (const [key, [_, result]] of indexes)
36
+ {
37
+ yield [key, result];
38
+ }
39
+ });
40
+ }
41
+ public async some(predicate: MaybeAsyncKeyIteratee<K, T, boolean>): Promise<ReducedIterator<K, boolean>>
42
+ {
43
+ const indexes = new Map<K, [number, boolean]>();
44
+
45
+ for await (const [key, element] of this._elements)
46
+ {
47
+ const [index, result] = indexes.get(key) ?? [0, false];
48
+
49
+ if (result) { continue; }
50
+
51
+ indexes.set(key, [index + 1, await predicate(key, element, index)]);
52
+ }
53
+
54
+ return new ReducedIterator(function* ()
55
+ {
56
+ for (const [key, [_, result]] of indexes)
57
+ {
58
+ yield [key, result];
59
+ }
60
+ });
61
+ }
62
+
63
+ public filter(predicate: MaybeAsyncKeyIteratee<K, T, boolean>): AggregatedAsyncIterator<K, T>;
64
+ public filter<S extends T>(predicate: MaybeAsyncKeyTypeGuardIteratee<K, T, S>): AggregatedAsyncIterator<K, S>;
65
+ public filter(predicate: MaybeAsyncKeyIteratee<K, T, boolean>): AggregatedAsyncIterator<K, T>
66
+ {
67
+ const elements = this._elements;
68
+
69
+ return new AggregatedAsyncIterator(async function* ()
70
+ {
71
+ const indexes = new Map<K, number>();
72
+
73
+ for await (const [key, element] of elements)
74
+ {
75
+ const index = indexes.get(key) ?? 0;
76
+
77
+ indexes.set(key, index + 1);
78
+
79
+ if (predicate(key, element, index)) { yield [key, element]; }
80
+ }
81
+ });
82
+ }
83
+ public map<V>(iteratee: MaybeAsyncKeyIteratee<K, T, V>): AggregatedAsyncIterator<K, V>
84
+ {
85
+ const elements = this._elements;
86
+
87
+ return new AggregatedAsyncIterator(async function* ()
88
+ {
89
+ const indexes = new Map<K, number>();
90
+
91
+ for await (const [key, element] of elements)
92
+ {
93
+ const index = indexes.get(key) ?? 0;
94
+
95
+ indexes.set(key, index + 1);
96
+
97
+ yield [key, await iteratee(key, element, index)];
98
+ }
99
+ });
100
+ }
101
+ public async reduce(reducer: MaybeAsyncKeyReducer<K, T, T>): Promise<ReducedIterator<K, T>>;
102
+ public async reduce<A>(reducer: MaybeAsyncKeyReducer<K, T, A>, initialValue: (key: K) => A)
103
+ : Promise<ReducedIterator<K, A>>;
104
+ public async reduce<A>(reducer: MaybeAsyncKeyReducer<K, T, A>, initialValue?: (key: K) => A)
105
+ : Promise<ReducedIterator<K, A>>
106
+ {
107
+ const accumulators = new Map<K, [number, A]>();
108
+
109
+ for await (const [key, element] of this._elements)
110
+ {
111
+ let index: number;
112
+ let accumulator: A;
113
+
114
+ if (accumulators.has(key))
115
+ {
116
+ [index, accumulator] = accumulators.get(key)!;
117
+
118
+ index += 1;
119
+ }
120
+ else if (initialValue !== undefined)
121
+ {
122
+ index = 0;
123
+ accumulator = initialValue(key);
124
+ }
125
+ else
126
+ {
127
+ accumulators.set(key, [0, (element as unknown) as A]);
128
+
129
+ continue;
130
+ }
131
+
132
+ accumulator = await reducer(key, accumulator, element, index);
133
+
134
+ accumulators.set(key, [index, accumulator]);
135
+ }
136
+
137
+ return new ReducedIterator(function* ()
138
+ {
139
+ for (const [key, [_, accumulator]] of accumulators)
140
+ {
141
+ yield [key, accumulator];
142
+ }
143
+ });
144
+ }
145
+
146
+ public unique(): AggregatedAsyncIterator<K, T>
147
+ {
148
+ const elements = this._elements;
149
+
150
+ return new AggregatedAsyncIterator(async function* ()
151
+ {
152
+ const keys = new Map<K, Set<T>>();
153
+
154
+ for await (const [key, element] of elements)
155
+ {
156
+ const values = keys.get(key) ?? new Set<T>();
157
+
158
+ if (values.has(element)) { continue; }
159
+
160
+ values.add(element);
161
+ keys.set(key, values);
162
+
163
+ yield [key, element];
164
+ }
165
+ });
166
+ }
167
+
168
+ public async count(): Promise<ReducedIterator<K, number>>
169
+ {
170
+ const counters = new Map<K, number>();
171
+
172
+ for await (const [key] of this._elements)
173
+ {
174
+ const count = counters.get(key) ?? 0;
175
+
176
+ counters.set(key, count + 1);
177
+ }
178
+
179
+ return new ReducedIterator(function* ()
180
+ {
181
+ for (const [key, count] of counters)
182
+ {
183
+ yield [key, count];
184
+ }
185
+ });
186
+ }
187
+ public async first(): Promise<ReducedIterator<K, T>>
188
+ {
189
+ const firsts = new Map<K, T>();
190
+
191
+ for await (const [key, element] of this._elements)
192
+ {
193
+ if (firsts.has(key)) { continue; }
194
+
195
+ firsts.set(key, element);
196
+ }
197
+
198
+ return new ReducedIterator(function* ()
199
+ {
200
+ for (const [key, element] of firsts)
201
+ {
202
+ yield [key, element];
203
+ }
204
+ });
205
+ }
206
+ public async last(): Promise<ReducedIterator<K, T>>
207
+ {
208
+ const lasts = new Map<K, T>();
209
+
210
+ for await (const [key, element] of this._elements)
211
+ {
212
+ lasts.set(key, element);
213
+ }
214
+
215
+ return new ReducedIterator(function* ()
216
+ {
217
+ for (const [key, element] of lasts)
218
+ {
219
+ yield [key, element];
220
+ }
221
+ });
222
+ }
223
+
224
+ public keys(): SmartAsyncIterator<K>
225
+ {
226
+ const elements = this._elements;
227
+
228
+ return new SmartAsyncIterator<K>(async function* ()
229
+ {
230
+ const keys = new Set<K>();
231
+
232
+ for await (const [key] of elements)
233
+ {
234
+ if (keys.has(key)) { continue; }
235
+ keys.add(key);
236
+
237
+ yield key;
238
+ }
239
+ });
240
+ }
241
+ public items(): SmartAsyncIterator<[K, T]>
242
+ {
243
+ return this._elements;
244
+ }
245
+ public values(): SmartAsyncIterator<T>
246
+ {
247
+ const elements = this._elements;
248
+
249
+ return new SmartAsyncIterator<T>(async function* ()
250
+ {
251
+ for await (const [_, element] of elements)
252
+ {
253
+ yield element;
254
+ }
255
+ });
256
+ }
257
+
258
+ public async toArray(): Promise<T[][]>
259
+ {
260
+ const map = await this.toMap();
261
+
262
+ return Array.from(map.values());
263
+ }
264
+ public async toMap(): Promise<Map<K, T[]>>
265
+ {
266
+ const groups = new Map<K, T[]>();
267
+
268
+ for await (const [key, element] of this._elements)
269
+ {
270
+ const value = groups.get(key) ?? [];
271
+
272
+ value.push(element);
273
+ groups.set(key, value);
274
+ }
275
+
276
+ return groups;
277
+ }
278
+ public async toObject(): Promise<Record<K, T[]>>
279
+ {
280
+ const groups = { } as Record<K, T[]>;
281
+
282
+ for await (const [key, element] of this._elements)
283
+ {
284
+ const value = groups[key] ?? [];
285
+
286
+ value.push(element);
287
+ groups[key] = value;
288
+ }
289
+
290
+ return groups;
291
+ }
292
+
293
+ public get [Symbol.toStringTag]() { return "AggregatedAsyncIterator"; }
294
+ }
@@ -1,8 +1,8 @@
1
- import ReducedIterator from "./reduced-iterator.js";
2
- import SmartIterator from "../smart-iterator.js";
1
+ import { SmartIterator } from "../iterators/index.js";
2
+ import type { GeneratorFunction } from "../iterators/types.js";
3
3
 
4
+ import ReducedIterator from "./reduced-iterator.js";
4
5
  import type { KeyIteratee, KeyTypeGuardIteratee, KeyReducer } from "./types.js";
5
- import type { GeneratorFunction } from "../../types.js";
6
6
 
7
7
  export default class AggregatedIterator<K extends PropertyKey, T>
8
8
  {
@@ -225,8 +225,13 @@ export default class AggregatedIterator<K extends PropertyKey, T>
225
225
 
226
226
  return new SmartIterator<K>(function* ()
227
227
  {
228
+ const keys = new Set<K>();
229
+
228
230
  for (const [key] of elements)
229
231
  {
232
+ if (keys.has(key)) { continue; }
233
+ keys.add(key);
234
+
230
235
  yield key;
231
236
  }
232
237
  });
@@ -0,0 +1,46 @@
1
+ import AggregatedIterator from "./aggregated-iterator.js";
2
+
3
+ import { SmartIterator } from "../iterators/index.js";
4
+ import type { GeneratorFunction, Iteratee, TypeGuardIteratee } from "../iterators/types.js";
5
+
6
+ export default class Aggregator<T>
7
+ {
8
+ protected _elements: SmartIterator<T>;
9
+
10
+ public constructor(iterable: Iterable<T>);
11
+ public constructor(iterator: Iterator<T>);
12
+ public constructor(generatorFn: GeneratorFunction<T>);
13
+ public constructor(argument: Iterable<T> | Iterator<T> | GeneratorFunction<T>);
14
+ public constructor(argument: Iterable<T> | Iterator<T> | GeneratorFunction<T>)
15
+ {
16
+ this._elements = new SmartIterator(argument);
17
+ }
18
+
19
+ public filter(predicate: Iteratee<T, boolean>): Aggregator<T>;
20
+ public filter<S extends T>(predicate: TypeGuardIteratee<T, S>): Aggregator<S>;
21
+ public filter(predicate: Iteratee<T, boolean>): Aggregator<T>
22
+ {
23
+ return new Aggregator(this._elements.filter(predicate));
24
+ }
25
+ public map<V>(iteratee: Iteratee<T, V>): Aggregator<V>
26
+ {
27
+ return new Aggregator(this._elements.map(iteratee));
28
+ }
29
+
30
+ public unique(): Aggregator<T>
31
+ {
32
+ return new Aggregator(this._elements.unique());
33
+ }
34
+
35
+ public groupBy<K extends PropertyKey>(iteratee: Iteratee<T, K>): AggregatedIterator<K, T>
36
+ {
37
+ return new AggregatedIterator(this._elements.map((element, index) =>
38
+ {
39
+ const key = iteratee(element, index);
40
+
41
+ return [key, element] as [K, T];
42
+ }));
43
+ }
44
+
45
+ public get [Symbol.toStringTag]() { return "Aggregator"; }
46
+ }
@@ -0,0 +1,46 @@
1
+ import AggregatedAsyncIterator from "./aggregated-async-iterator.js";
2
+
3
+ import { SmartAsyncIterator } from "../iterators/index.js";
4
+ import type { AsyncGeneratorFunction, MaybeAsyncIteratee, MaybeAsyncTypeGuardIteratee } from "../iterators/types.js";
5
+
6
+ export default class AsyncAggregator<T>
7
+ {
8
+ protected _elements: SmartAsyncIterator<T>;
9
+
10
+ public constructor(iterable: AsyncIterable<T>);
11
+ public constructor(iterator: AsyncIterator<T>);
12
+ public constructor(generatorFn: AsyncGeneratorFunction<T>);
13
+ public constructor(argument: AsyncIterable<T> | AsyncIterator<T> | AsyncGeneratorFunction<T>);
14
+ public constructor(argument: AsyncIterable<T> | AsyncIterator<T> | AsyncGeneratorFunction<T>)
15
+ {
16
+ this._elements = new SmartAsyncIterator(argument);
17
+ }
18
+
19
+ public filter(predicate: MaybeAsyncIteratee<T, boolean>): AsyncAggregator<T>;
20
+ public filter<S extends T>(predicate: MaybeAsyncTypeGuardIteratee<T, S>): AsyncAggregator<S>;
21
+ public filter(predicate: MaybeAsyncIteratee<T, boolean>): AsyncAggregator<T>
22
+ {
23
+ return new AsyncAggregator(this._elements.filter(predicate));
24
+ }
25
+ public map<V>(iteratee: MaybeAsyncIteratee<T, V>): AsyncAggregator<V>
26
+ {
27
+ return new AsyncAggregator(this._elements.map(iteratee));
28
+ }
29
+
30
+ public unique(): AsyncAggregator<T>
31
+ {
32
+ return new AsyncAggregator(this._elements.unique());
33
+ }
34
+
35
+ public groupBy<K extends PropertyKey>(iteratee: MaybeAsyncIteratee<T, K>): AggregatedAsyncIterator<K, T>
36
+ {
37
+ return new AggregatedAsyncIterator(this._elements.map(async (element, index) =>
38
+ {
39
+ const key = await iteratee(element, index);
40
+
41
+ return [key, element] as [K, T];
42
+ }));
43
+ }
44
+
45
+ public get [Symbol.toStringTag]() { return "AsyncAggregator"; }
46
+ }
@@ -1,50 +1,7 @@
1
+ import Aggregator from "./aggregator.js";
2
+ import AsyncAggregator from "./async-aggregator.js";
1
3
  import AggregatedIterator from "./aggregated-iterator.js";
4
+ import AggregatedAsyncIterator from "./aggregated-async-iterator.js";
2
5
  import ReducedIterator from "./reduced-iterator.js";
3
- import SmartIterator from "../smart-iterator.js";
4
6
 
5
- import type { GeneratorFunction, Iteratee, TypeGuardIteratee } from "../../types.js";
6
-
7
- export default class Aggregator<T>
8
- {
9
- protected _elements: SmartIterator<T>;
10
-
11
- public constructor(iterable: Iterable<T>);
12
- public constructor(iterator: Iterator<T>);
13
- public constructor(generatorFn: GeneratorFunction<T>);
14
- public constructor(argument: Iterable<T> | Iterator<T> | GeneratorFunction<T>);
15
- public constructor(argument: Iterable<T> | Iterator<T> | GeneratorFunction<T>)
16
- {
17
- this._elements = new SmartIterator(argument);
18
- }
19
-
20
- public filter(predicate: Iteratee<T, boolean>): Aggregator<T>;
21
- public filter<S extends T>(predicate: TypeGuardIteratee<T, S>): Aggregator<S>;
22
- public filter(predicate: Iteratee<T, boolean>): Aggregator<T>
23
- {
24
- return new Aggregator(this._elements.filter(predicate));
25
- }
26
- public map<V>(iteratee: Iteratee<T, V>): Aggregator<V>
27
- {
28
- return new Aggregator(this._elements.map(iteratee));
29
- }
30
-
31
- public unique(): Aggregator<T>
32
- {
33
- return new Aggregator(this._elements.unique());
34
- }
35
-
36
- public groupBy<K extends PropertyKey>(iteratee: Iteratee<T, K>): AggregatedIterator<K, T>
37
- {
38
- return new AggregatedIterator(this._elements.map((element, index) =>
39
- {
40
- const key = iteratee(element, index);
41
-
42
- return [key, element] as [K, T];
43
- }));
44
- }
45
-
46
- public get [Symbol.toStringTag]() { return "Aggregator"; }
47
- }
48
-
49
- export { AggregatedIterator, ReducedIterator };
50
- export type { KeyIteratee, KeyReducer, KeyTypeGuardIteratee } from "./types.js";
7
+ export { Aggregator, AsyncAggregator, AggregatedIterator, AggregatedAsyncIterator, ReducedIterator };
@@ -1,7 +1,7 @@
1
- import SmartIterator from "../smart-iterator.js";
1
+ import { SmartIterator } from "../iterators/index.js";
2
+ import type { GeneratorFunction } from "../iterators/types.js";
2
3
 
3
- import type { KeyIteratee, KeyTypeGuardIteratee } from "./types.js";
4
- import type { GeneratorFunction } from "../../types.js";
4
+ import type { KeyIteratee, KeyReducer, KeyTypeGuardIteratee } from "./types.js";
5
5
 
6
6
  export default class ReducedIterator<K extends PropertyKey, T>
7
7
  {
@@ -45,6 +45,38 @@ export default class ReducedIterator<K extends PropertyKey, T>
45
45
  }
46
46
  });
47
47
  }
48
+ public reduce(reducer: KeyReducer<K, T, T>): T;
49
+ public reduce<A>(reducer: KeyReducer<K, T, A>, initialValue: A): A;
50
+ public reduce<A>(reducer: KeyReducer<K, T, A>, initialValue?: A): A
51
+ {
52
+ let index = 0;
53
+ let accumulator: A;
54
+
55
+ if (initialValue !== undefined)
56
+ {
57
+ accumulator = initialValue;
58
+ }
59
+ else
60
+ {
61
+ const firstElement = this._elements.next();
62
+ if (firstElement.done)
63
+ {
64
+ throw new TypeError("Reduce of empty iterator with no initial value");
65
+ }
66
+
67
+ index += 1;
68
+ accumulator = (firstElement.value[1] as unknown) as A;
69
+ }
70
+
71
+ for (const [key, element] of this._elements)
72
+ {
73
+ accumulator = reducer(key, accumulator, element, index);
74
+
75
+ index += 1;
76
+ }
77
+
78
+ return accumulator;
79
+ }
48
80
 
49
81
  public keys(): SmartIterator<K>
50
82
  {
@@ -1,5 +1,14 @@
1
+ import type { MaybePromise } from "../promises/types.js";
2
+
1
3
  export type KeyIteratee<K extends PropertyKey, T, R = void> = (key: K, value: T, index: number) => R;
4
+ export type MaybeAsyncKeyIteratee<K extends PropertyKey, T, R = void> = (key: K, value: T, index: number) =>
5
+ MaybePromise<R>;
6
+
2
7
  export type KeyTypeGuardIteratee<K extends PropertyKey, T, R extends T> =
3
8
  (key: K, value: T, index: number) => value is R;
9
+ export type MaybeAsyncKeyTypeGuardIteratee<K extends PropertyKey, T, R extends T> =
10
+ (key: K, value: MaybePromise<T>, index: number) => value is MaybePromise<R>;
4
11
 
5
12
  export type KeyReducer<K extends PropertyKey, T, A> = (key: K, accumulator: A, value: T, index: number) => A;
13
+ export type MaybeAsyncKeyReducer<K extends PropertyKey, T, A> =
14
+ (key: K, accumulator: A, value: T, index: number) => MaybePromise<A>;
@@ -41,3 +41,34 @@ export default class Exception extends Error
41
41
 
42
42
  public get [Symbol.toStringTag]() { return "Exception"; }
43
43
  }
44
+
45
+ export class FatalErrorException extends Exception
46
+ {
47
+ public constructor(message?: string, cause?: unknown, name = "FatalErrorException")
48
+ {
49
+ if (message === undefined)
50
+ {
51
+ message = "The routine has encountered an unrecoverable error and cannot continue as expected. " +
52
+ "Please, refresh the page and try again. If the problem persists, contact the support team.";
53
+ }
54
+
55
+ super(message, cause, name);
56
+ }
57
+
58
+ public get [Symbol.toStringTag]() { return "FatalErrorException"; }
59
+ }
60
+
61
+ export class NotImplementedException extends Exception
62
+ {
63
+ public constructor(message?: string, cause?: unknown, name = "NotImplementedException")
64
+ {
65
+ if (message === undefined)
66
+ {
67
+ message = "This feature is not implemented yet. Please, try again later.";
68
+ }
69
+
70
+ super(message, cause, name);
71
+ }
72
+
73
+ public get [Symbol.toStringTag]() { return "NotImplementedException"; }
74
+ }
@@ -1,5 +1,32 @@
1
1
  import Exception from "./core.js";
2
2
 
3
+ export class FileNotFoundException extends Exception
4
+ {
5
+ public constructor(message: string, cause?: unknown, name = "FileNotFoundException")
6
+ {
7
+ super(message, cause, name);
8
+ }
9
+
10
+ public get [Symbol.toStringTag]() { return "FileNotFoundException"; }
11
+ }
12
+ export class NetworkException extends Exception
13
+ {
14
+ public constructor(message: string, cause?: unknown, name = "NetworkException")
15
+ {
16
+ super(message, cause, name);
17
+ }
18
+
19
+ public get [Symbol.toStringTag]() { return "NetworkException"; }
20
+ }
21
+ export class PermissionException extends Exception
22
+ {
23
+ public constructor(message: string, cause?: unknown, name = "PermissionException")
24
+ {
25
+ super(message, cause, name);
26
+ }
27
+
28
+ public get [Symbol.toStringTag]() { return "PermissionException"; }
29
+ }
3
30
  export class ReferenceException extends Exception
4
31
  {
5
32
  public constructor(message: string, cause?: unknown, name = "ReferenceException")
@@ -9,6 +36,15 @@ export class ReferenceException extends Exception
9
36
 
10
37
  public get [Symbol.toStringTag]() { return "ReferenceException"; }
11
38
  }
39
+ export class RuntimeException extends Exception
40
+ {
41
+ public constructor(message: string, cause?: unknown, name = "RuntimeException")
42
+ {
43
+ super(message, cause, name);
44
+ }
45
+
46
+ public get [Symbol.toStringTag]() { return "RuntimeException"; }
47
+ }
12
48
  export class TimeoutException extends Exception
13
49
  {
14
50
  public constructor(message: string, cause?: unknown, name = "TimeoutException")
@@ -18,6 +54,15 @@ export class TimeoutException extends Exception
18
54
 
19
55
  public get [Symbol.toStringTag]() { return "TimeoutException"; }
20
56
  }
57
+ export class TypeException extends Exception
58
+ {
59
+ public constructor(message: string, cause?: unknown, name = "TypeException")
60
+ {
61
+ super(message, cause, name);
62
+ }
63
+
64
+ public get [Symbol.toStringTag]() { return "TypeException"; }
65
+ }
21
66
  export class ValueException extends Exception
22
67
  {
23
68
  public constructor(message: string, cause?: unknown, name = "ValueException")
@@ -29,3 +74,4 @@ export class ValueException extends Exception
29
74
  }
30
75
 
31
76
  export { Exception };
77
+ export { FatalErrorException, NotImplementedException } from "./core.js";
@@ -1,18 +1,32 @@
1
- import Aggregator, { AggregatedIterator, ReducedIterator } from "./aggregators/index.js";
2
- export type { KeyIteratee, KeyReducer, KeyTypeGuardIteratee } from "./aggregators/index.js";
1
+ export {
2
+ Aggregator,
3
+ AsyncAggregator,
4
+ AggregatedIterator,
5
+ AggregatedAsyncIterator,
6
+ ReducedIterator
7
+
8
+ } from "./aggregators/index.js";
9
+
10
+ export {
11
+ Exception,
12
+ FatalErrorException,
13
+ NotImplementedException,
14
+ FileNotFoundException,
15
+ NetworkException,
16
+ PermissionException,
17
+ ReferenceException,
18
+ RuntimeException,
19
+ TimeoutException,
20
+ TypeException,
21
+ ValueException
3
22
 
4
- export { Exception, ReferenceException, TimeoutException, ValueException } from "./exceptions/index.js";
23
+ } from "./exceptions/index.js";
24
+
25
+ export { SmartIterator, SmartAsyncIterator } from "./iterators/index.js";
5
26
 
6
27
  import JsonStorage from "./json-storage.js";
7
- import SmartIterator from "./smart-iterator.js";
8
28
  import Subscribers from "./subscribers.js";
9
29
 
10
30
  export { DeferredPromise, SmartPromise, TimedPromise } from "./promises/index.js";
11
- export {
12
- AggregatedIterator,
13
- Aggregator,
14
- JsonStorage,
15
- ReducedIterator,
16
- SmartIterator,
17
- Subscribers
18
- };
31
+
32
+ export { JsonStorage, Subscribers };
@@ -0,0 +1,4 @@
1
+ import SmartIterator from "./smart-iterator.js";
2
+ import SmartAsyncIterator from "./smart-async-iterator.js";
3
+
4
+ export { SmartIterator, SmartAsyncIterator };