@daiso-tech/core 0.35.4 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -54
- package/dist/async/backof-policies/_shared.d.ts +8 -2
- package/dist/async/backof-policies/_shared.js +0 -1
- package/dist/async/backof-policies/_shared.js.map +1 -1
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js +10 -4
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -1
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +10 -4
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -1
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js +10 -4
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +10 -4
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -1
- package/dist/async/middlewares/_shared.d.ts +6 -1
- package/dist/async/middlewares/_shared.js +11 -1
- package/dist/async/middlewares/_shared.js.map +1 -1
- package/dist/async/middlewares/fallback/fallback.middleware.d.ts +3 -3
- package/dist/async/middlewares/fallback/fallback.middleware.js +3 -2
- package/dist/async/middlewares/fallback/fallback.middleware.js.map +1 -1
- package/dist/async/middlewares/hedging/_shared.d.ts +7 -7
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js +7 -7
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js.map +1 -1
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js +6 -6
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js.map +1 -1
- package/dist/async/middlewares/observe/observe.middleware.d.ts +4 -4
- package/dist/async/middlewares/retry/retry.middleware.d.ts +5 -4
- package/dist/async/middlewares/retry/retry.middleware.js +10 -10
- package/dist/async/middlewares/retry/retry.middleware.js.map +1 -1
- package/dist/async/middlewares/timeout/timeout.middleware.d.ts +4 -2
- package/dist/async/middlewares/timeout/timeout.middleware.js +3 -1
- package/dist/async/middlewares/timeout/timeout.middleware.js.map +1 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +1 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.js +1 -1
- package/dist/async/utilities/promise-queue/promise-queue.js.map +1 -1
- package/dist/cache/contracts/cache-factory.contract.d.ts +2 -2
- package/dist/cache/contracts/cache.errors.d.ts +3 -3
- package/dist/cache/contracts/cache.errors.js +1 -1
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/implementations/adapters/_module-exports.d.ts +1 -2
- package/dist/cache/implementations/adapters/_module-exports.js +1 -2
- package/dist/cache/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +41 -16
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +102 -57
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +4 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +27 -11
- package/dist/cache/implementations/derivables/cache/cache.js +38 -34
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +15 -47
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +19 -45
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +4 -5
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +4 -5
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/collection/contracts/async-collection.contract.d.ts +127 -121
- package/dist/collection/contracts/collection.contract.d.ts +126 -120
- package/dist/collection/contracts/collection.errors.d.ts +3 -3
- package/dist/collection/contracts/collection.errors.js +1 -1
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/_shared.d.ts +4 -4
- package/dist/collection/implementations/_shared.js +2 -2
- package/dist/collection/implementations/_shared.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.d.ts +1 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.js +1 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.d.ts +7 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js +17 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js.map +1 -0
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +15 -13
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +19 -16
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/_module.d.ts +1 -0
- package/dist/collection/implementations/iterable-collection/_shared/_module.js +1 -0
- package/dist/collection/implementations/iterable-collection/_shared/_module.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.d.ts +7 -0
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js +21 -0
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js.map +1 -0
- package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +14 -12
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +16 -13
- package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/collection/implementations/list-collection/list-collection.d.ts +14 -12
- package/dist/collection/implementations/list-collection/list-collection.js +26 -13
- package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/event-bus/contracts/event-bus-factory.contract.d.ts +2 -2
- package/dist/event-bus/contracts/event-bus.contract.d.ts +2 -2
- package/dist/event-bus/contracts/event-bus.errors.d.ts +3 -3
- package/dist/event-bus/contracts/event-bus.errors.js +1 -1
- package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +46 -9
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +64 -22
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +12 -41
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +15 -35
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
- package/dist/lock/contracts/lock.errors.d.ts +2 -2
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/implementations/adapters/_module-exports.d.ts +1 -2
- package/dist/lock/implementations/adapters/_module-exports.js +1 -2
- package/dist/lock/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +40 -15
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +75 -34
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +6 -3
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +22 -18
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +20 -22
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +12 -6
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +4 -2
- package/dist/lock/implementations/derivables/lock-provider/lock.js +16 -18
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +6 -50
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +10 -54
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +1 -9
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +1 -9
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/contracts/flexible-serde.contract.d.ts +9 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
- package/dist/utilities/classes/_module.d.ts +1 -1
- package/dist/utilities/classes/_module.js +1 -1
- package/dist/utilities/classes/_module.js.map +1 -1
- package/dist/utilities/classes/hooks/hooks.d.ts +2 -2
- package/dist/utilities/classes/hooks/hooks.js +2 -2
- package/dist/utilities/classes/namespace/_module.d.ts +1 -0
- package/dist/utilities/classes/namespace/_module.js +2 -0
- package/dist/utilities/classes/namespace/_module.js.map +1 -0
- package/dist/utilities/classes/{key-prefixer/key-prefixer.d.ts → namespace/namespace.d.ts} +38 -17
- package/dist/utilities/classes/{key-prefixer/key-prefixer.js → namespace/namespace.js} +51 -19
- package/dist/utilities/classes/namespace/namespace.js.map +1 -0
- package/dist/utilities/classes/time-span/time-span.d.ts +1 -2
- package/dist/utilities/classes/time-span/time-span.js +1 -4
- package/dist/utilities/classes/time-span/time-span.js.map +1 -1
- package/dist/utilities/functions/_module-exports.d.ts +2 -1
- package/dist/utilities/functions/_module-exports.js +2 -1
- package/dist/utilities/functions/_module-exports.js.map +1 -1
- package/dist/utilities/functions/lazy.d.ts +4 -0
- package/dist/utilities/functions/lazy.js +9 -3
- package/dist/utilities/functions/lazy.js.map +1 -1
- package/dist/utilities/functions/result.d.ts +11 -0
- package/dist/utilities/functions/result.js +15 -0
- package/dist/utilities/functions/result.js.map +1 -0
- package/dist/utilities/functions/validate.d.ts +8 -0
- package/dist/utilities/functions/validate.js +17 -0
- package/dist/utilities/functions/validate.js.map +1 -0
- package/dist/utilities/types/factory.type.d.ts +13 -18
- package/dist/utilities/types/result.type.d.ts +11 -1
- package/package.json +15 -11
- package/dist/cache/implementations/adapters/libsql-cache-adapter/_module.d.ts +0 -1
- package/dist/cache/implementations/adapters/libsql-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/libsql-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +0 -61
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +0 -95
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +0 -1
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/_module.d.ts +0 -1
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +0 -59
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +0 -94
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +0 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/_module.d.ts +0 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/_module.js +0 -2
- package/dist/lock/implementations/adapters/libsql-lock-adapter/_module.js.map +0 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +0 -60
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +0 -84
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +0 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/_module.d.ts +0 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/_module.js +0 -2
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/_module.js.map +0 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +0 -59
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +0 -83
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +0 -1
- package/dist/utilities/classes/key-prefixer/_module.d.ts +0 -1
- package/dist/utilities/classes/key-prefixer/_module.js +0 -2
- package/dist/utilities/classes/key-prefixer/_module.js.map +0 -1
- package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +0 -1
- package/dist/utilities/functions/factory.d.ts +0 -44
- package/dist/utilities/functions/factory.js +0 -80
- package/dist/utilities/functions/factory.js.map +0 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type { AsyncReduce, CrossJoinResult, AsyncPredicate, AsyncForEach, AsyncMap, AsyncModifier, Tap, AsyncTransform, Comparator, EnsureRecord, EnsureMap } from "../../collection/contracts/_shared/_module.js";
|
|
5
5
|
import type { AsyncLazyable, AsyncIterableValue } from "../../utilities/_module-exports.js";
|
|
6
6
|
import type { LazyPromise } from "../../async/_module-exports.js";
|
|
7
|
+
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
8
|
/**
|
|
8
9
|
*
|
|
9
10
|
* IMPORT_PATH: `"@daiso-tech/core/collection/contracts"`
|
|
@@ -31,14 +32,14 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
31
32
|
*/
|
|
32
33
|
keys(): IAsyncCollection<number>;
|
|
33
34
|
/**
|
|
34
|
-
* The `
|
|
35
|
+
* The `copy` method returns a copy of the collection.
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
copy(): IAsyncCollection<TInput>;
|
|
37
38
|
/**
|
|
38
39
|
* The `filter` method filters the collection using `predicateFn`, keeping only those items that pass `predicateFn`.
|
|
39
40
|
* @example
|
|
40
41
|
* ```ts
|
|
41
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
42
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
42
43
|
*
|
|
43
44
|
* // Asume the inputed collection is empty.
|
|
44
45
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -51,11 +52,16 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
51
52
|
* ```
|
|
52
53
|
*/
|
|
53
54
|
filter<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TOutput>;
|
|
55
|
+
/**
|
|
56
|
+
* The `validate` method filters all items that matches the `schema` and transforms them afterwards.
|
|
57
|
+
* The `schema` can be any [standard schema](https://standardschema.dev/) compliant object.
|
|
58
|
+
*/
|
|
59
|
+
validate<TOutput>(schema: StandardSchemaV1<TInput, TOutput>): IAsyncCollection<TOutput>;
|
|
54
60
|
/**
|
|
55
61
|
* The `reject` method filters the collection using `predicateFn`, keeping only those items that not pass `predicateFn`.
|
|
56
62
|
* @example
|
|
57
63
|
* ```ts
|
|
58
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
64
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
59
65
|
*
|
|
60
66
|
* // Asume the inputed collection is empty.
|
|
61
67
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -73,7 +79,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
73
79
|
* The `mapFn` is free to modify the item and return it, thus forming a new collection of modified items.
|
|
74
80
|
* @example
|
|
75
81
|
* ```ts
|
|
76
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
82
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
77
83
|
*
|
|
78
84
|
* // Asume the inputed collection is empty.
|
|
79
85
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -91,7 +97,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
91
97
|
* The final result of running the reducer across all items of the array is a single value.
|
|
92
98
|
* @example
|
|
93
99
|
* ```ts
|
|
94
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
100
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
95
101
|
*
|
|
96
102
|
* // Asume the inputed collection is empty.
|
|
97
103
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -103,7 +109,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
103
109
|
* ```
|
|
104
110
|
* @example
|
|
105
111
|
* ```ts
|
|
106
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
112
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
107
113
|
*
|
|
108
114
|
* // Asume the inputed collection is empty.
|
|
109
115
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -129,7 +135,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
129
135
|
* @throws {TypeCollectionError}
|
|
130
136
|
* @example
|
|
131
137
|
* ```ts
|
|
132
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
138
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
133
139
|
*
|
|
134
140
|
* // Asume the inputed collection is empty.
|
|
135
141
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -142,7 +148,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
142
148
|
* ```
|
|
143
149
|
* @example
|
|
144
150
|
* ```ts
|
|
145
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
151
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
146
152
|
*
|
|
147
153
|
* // Asume the inputed collection is empty.
|
|
148
154
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -159,7 +165,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
159
165
|
* The `collapse` method collapses a collection of iterables into a single, flat collection.
|
|
160
166
|
* @example
|
|
161
167
|
* ```ts
|
|
162
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
168
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
163
169
|
*
|
|
164
170
|
* // Asume the inputed collection is empty.
|
|
165
171
|
* async function main(collection: IAsyncCollection<number[]>): Promise<void> {
|
|
@@ -177,7 +183,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
177
183
|
* It is identical to a `map` method followed by a `collapse` method.
|
|
178
184
|
* @example
|
|
179
185
|
* ```ts
|
|
180
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
186
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
181
187
|
*
|
|
182
188
|
* // Asume the inputed collection is empty.
|
|
183
189
|
* async function main(collection: IAsyncCollection<string[]>): Promise<void> {
|
|
@@ -194,7 +200,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
194
200
|
* The `change` method changes only the items that passes `predicateFn` using `mapFn`.
|
|
195
201
|
* @example
|
|
196
202
|
* ```ts
|
|
197
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
203
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
198
204
|
*
|
|
199
205
|
* // Asume the inputed collection is empty.
|
|
200
206
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -211,7 +217,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
211
217
|
* The `set` method changes a item by i>index` using `value`.
|
|
212
218
|
* @example
|
|
213
219
|
* ```ts
|
|
214
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
220
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
215
221
|
*
|
|
216
222
|
* // Asume the inputed collection is empty.
|
|
217
223
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -224,7 +230,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
224
230
|
* ```
|
|
225
231
|
* @example
|
|
226
232
|
* ```ts
|
|
227
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
233
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
228
234
|
*
|
|
229
235
|
* // Asume the inputed collection is empty.
|
|
230
236
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -241,7 +247,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
241
247
|
* The `get` method returns the item by index. If the item is not found null will returned.
|
|
242
248
|
* @example
|
|
243
249
|
* ```ts
|
|
244
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
250
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
245
251
|
*
|
|
246
252
|
* // Asume the inputed collection is empty.
|
|
247
253
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -261,7 +267,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
261
267
|
* @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
|
|
262
268
|
* @example
|
|
263
269
|
* ```ts
|
|
264
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
270
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
265
271
|
*
|
|
266
272
|
* // Asume the inputed collection is empty.
|
|
267
273
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -280,7 +286,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
280
286
|
* The `page` method returns a new collection containing the items that would be present on ` page ` with custom ` pageSize `.
|
|
281
287
|
* @example
|
|
282
288
|
* ```ts
|
|
283
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
289
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
284
290
|
*
|
|
285
291
|
* // Asume the inputed collection is empty.
|
|
286
292
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -299,7 +305,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
299
305
|
* @throws {EmptyCollectionError} {@link EmptyCollectionError}
|
|
300
306
|
* @example
|
|
301
307
|
* ```ts
|
|
302
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
308
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
303
309
|
*
|
|
304
310
|
* // Asume the inputed collection is empty.
|
|
305
311
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -317,7 +323,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
317
323
|
* @throws {EmptyCollectionError} {@link EmptyCollectionError}
|
|
318
324
|
* @example
|
|
319
325
|
* ```ts
|
|
320
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
326
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
321
327
|
*
|
|
322
328
|
* // Asume the inputed collection is empty.
|
|
323
329
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -335,7 +341,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
335
341
|
* @throws {EmptyCollectionError} {@link EmptyCollectionError}
|
|
336
342
|
* @example
|
|
337
343
|
* ```ts
|
|
338
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
344
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
339
345
|
*
|
|
340
346
|
* // Asume the inputed collection is empty.
|
|
341
347
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -353,7 +359,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
353
359
|
* @throws {EmptyCollectionError} {@link EmptyCollectionError}
|
|
354
360
|
* @example
|
|
355
361
|
* ```ts
|
|
356
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
362
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
357
363
|
*
|
|
358
364
|
* // Asume the inputed collection is empty.
|
|
359
365
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -371,7 +377,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
371
377
|
* @throws {EmptyCollectionError} {@link EmptyCollectionError}
|
|
372
378
|
* @example
|
|
373
379
|
* ```ts
|
|
374
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
380
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
375
381
|
*
|
|
376
382
|
* // Asume the inputed collection is empty.
|
|
377
383
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -388,7 +394,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
388
394
|
* @throws {EmptyCollectionError} {@link EmptyCollectionError}
|
|
389
395
|
* @example
|
|
390
396
|
* ```ts
|
|
391
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
397
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
392
398
|
*
|
|
393
399
|
* // Asume the inputed collection is empty.
|
|
394
400
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -404,7 +410,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
404
410
|
* The `some` method determines whether at least one item in the collection matches `predicateFn`.
|
|
405
411
|
* @example
|
|
406
412
|
* ```ts
|
|
407
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
413
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
408
414
|
*
|
|
409
415
|
* // Asume the inputed collection is empty.
|
|
410
416
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -420,7 +426,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
420
426
|
* The `every` method determines whether all items in the collection matches `predicateFn`.
|
|
421
427
|
* @example
|
|
422
428
|
* ```ts
|
|
423
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
429
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
424
430
|
*
|
|
425
431
|
* // Asume the inputed collection is empty.
|
|
426
432
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -436,7 +442,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
436
442
|
* The `take` method takes the first `limit` items.
|
|
437
443
|
* @example
|
|
438
444
|
* ```ts
|
|
439
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
445
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
440
446
|
*
|
|
441
447
|
* // Asume the inputed collection is empty.
|
|
442
448
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -449,7 +455,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
449
455
|
* ```
|
|
450
456
|
* @example
|
|
451
457
|
* ```ts
|
|
452
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
458
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
453
459
|
*
|
|
454
460
|
* // Asume the inputed collection is empty.
|
|
455
461
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -466,7 +472,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
466
472
|
* The `takeUntil` method takes items until `predicateFn` returns true.
|
|
467
473
|
* @example
|
|
468
474
|
* ```ts
|
|
469
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
475
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
470
476
|
*
|
|
471
477
|
* // Asume the inputed collection is empty.
|
|
472
478
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -483,7 +489,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
483
489
|
* The `takeWhile` method takes items until `predicateFn` returns false.
|
|
484
490
|
* @example
|
|
485
491
|
* ```ts
|
|
486
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
492
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
487
493
|
*
|
|
488
494
|
* // Asume the inputed collection is empty.
|
|
489
495
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -500,7 +506,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
500
506
|
* The `skip` method skips the first `offset` items.
|
|
501
507
|
* @example
|
|
502
508
|
* ```ts
|
|
503
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
509
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
504
510
|
*
|
|
505
511
|
* // Asume the inputed collection is empty.
|
|
506
512
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -517,7 +523,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
517
523
|
* The `skipUntil` method skips items until `predicateFn` returns true.
|
|
518
524
|
* @example
|
|
519
525
|
* ```ts
|
|
520
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
526
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
521
527
|
*
|
|
522
528
|
* // Asume the inputed collection is empty.
|
|
523
529
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -534,7 +540,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
534
540
|
* The `skipWhile` method skips items until `predicateFn` returns false.
|
|
535
541
|
* @example
|
|
536
542
|
* ```ts
|
|
537
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
543
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
538
544
|
*
|
|
539
545
|
* // Asume the inputed collection is empty.
|
|
540
546
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -551,7 +557,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
551
557
|
* The `when` method will execute `callback` when `condition` evaluates to true.
|
|
552
558
|
* @example
|
|
553
559
|
* ```ts
|
|
554
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
560
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
555
561
|
*
|
|
556
562
|
* // Asume the inputed collection is empty.
|
|
557
563
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -569,7 +575,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
569
575
|
* The `whenEmpty` method will execute `callback` when the collection is empty.
|
|
570
576
|
* @example
|
|
571
577
|
* ```ts
|
|
572
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
578
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
573
579
|
*
|
|
574
580
|
* // Asume the inputed collection is empty.
|
|
575
581
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -582,7 +588,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
582
588
|
* ```
|
|
583
589
|
* @example
|
|
584
590
|
* ```ts
|
|
585
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
591
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
586
592
|
*
|
|
587
593
|
* // Asume the inputed collection is empty.
|
|
588
594
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -599,7 +605,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
599
605
|
* The `whenNot` method will execute `callback` when `condition` evaluates to false.
|
|
600
606
|
* @example
|
|
601
607
|
* ```ts
|
|
602
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
608
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
603
609
|
*
|
|
604
610
|
* // Asume the inputed collection is empty.
|
|
605
611
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -617,7 +623,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
617
623
|
* The `whenNotEmpty` method will execute `callback` when the collection is not empty.
|
|
618
624
|
* @example
|
|
619
625
|
* ```ts
|
|
620
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
626
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
621
627
|
*
|
|
622
628
|
* // Asume the inputed collection is empty.
|
|
623
629
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -629,7 +635,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
629
635
|
* ```
|
|
630
636
|
* @example
|
|
631
637
|
* ```ts
|
|
632
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
638
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
633
639
|
*
|
|
634
640
|
* // Asume the inputed collection is empty.
|
|
635
641
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -647,7 +653,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
647
653
|
* This method is useful when you want compose multiple smaller functions.
|
|
648
654
|
* @example
|
|
649
655
|
* ```ts
|
|
650
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
656
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
651
657
|
*
|
|
652
658
|
* // Asume the inputed collection is empty.
|
|
653
659
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -674,7 +680,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
674
680
|
* The `tap` method passes a copy of the original collection to `callback`, allowing you to do something with the items while not affecting the original collection.
|
|
675
681
|
* @example
|
|
676
682
|
* ```ts
|
|
677
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
683
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
678
684
|
*
|
|
679
685
|
* // Asume the inputed collection is empty.
|
|
680
686
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -696,7 +702,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
696
702
|
* If `chunkSize` is not divisible with total number of items then the last chunk will contain the remaining items.
|
|
697
703
|
* @example
|
|
698
704
|
* ```ts
|
|
699
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
705
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
700
706
|
*
|
|
701
707
|
* // Asume the inputed collection is empty.
|
|
702
708
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -715,7 +721,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
715
721
|
* The chunk variable passed to the `predicateFn` may be used to inspect the previous item.
|
|
716
722
|
* @example
|
|
717
723
|
* ```ts
|
|
718
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
724
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
719
725
|
*
|
|
720
726
|
* // Asume the inputed collection is empty.
|
|
721
727
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -735,7 +741,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
735
741
|
* The `split` method breaks a collection evenly into `chunkAmount` of chunks.
|
|
736
742
|
* @example
|
|
737
743
|
* ```ts
|
|
738
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
744
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
739
745
|
*
|
|
740
746
|
* // Asume the inputed collection is empty.
|
|
741
747
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -749,7 +755,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
749
755
|
* ```
|
|
750
756
|
* @example
|
|
751
757
|
* ```ts
|
|
752
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
758
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
753
759
|
*
|
|
754
760
|
* // Asume the inputed collection is empty.
|
|
755
761
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -763,7 +769,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
763
769
|
* ```
|
|
764
770
|
* @example
|
|
765
771
|
* ```ts
|
|
766
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
772
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
767
773
|
*
|
|
768
774
|
* // Asume the inputed collection is empty.
|
|
769
775
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -780,7 +786,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
780
786
|
* The `partition` method is used to separate items that pass `predicateFn` from those that do not.
|
|
781
787
|
* @example
|
|
782
788
|
* ```ts
|
|
783
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
789
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
784
790
|
*
|
|
785
791
|
* // Asume the inputed collection is empty.
|
|
786
792
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -798,7 +804,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
798
804
|
* The `sliding` method returns a new collection of chunks representing a "sliding window" view of the items in the collection.
|
|
799
805
|
* @example
|
|
800
806
|
* ```ts
|
|
801
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
807
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
802
808
|
*
|
|
803
809
|
* // Asume the inputed collection is empty.
|
|
804
810
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -817,7 +823,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
817
823
|
* By default the equality check occurs on the item.
|
|
818
824
|
* @example
|
|
819
825
|
* ```ts
|
|
820
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
826
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
821
827
|
*
|
|
822
828
|
* // Asume the inputed collection is empty.
|
|
823
829
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -844,7 +850,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
844
850
|
* ```
|
|
845
851
|
* @example
|
|
846
852
|
* ```ts
|
|
847
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
853
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
848
854
|
*
|
|
849
855
|
* // Asume the inputed collection is empty.
|
|
850
856
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -872,7 +878,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
872
878
|
* By default the equality check occurs on the item.
|
|
873
879
|
* @example
|
|
874
880
|
* ```ts
|
|
875
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
881
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
876
882
|
*
|
|
877
883
|
* // Asume the inputed collection is empty.
|
|
878
884
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -890,7 +896,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
890
896
|
* ```
|
|
891
897
|
* @example
|
|
892
898
|
* ```ts
|
|
893
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
899
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
894
900
|
*
|
|
895
901
|
* // Asume the inputed collection is empty.
|
|
896
902
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -911,7 +917,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
911
917
|
* By default the equality check occurs on the item.
|
|
912
918
|
* @example
|
|
913
919
|
* ```ts
|
|
914
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
920
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
915
921
|
*
|
|
916
922
|
* type Phone = {
|
|
917
923
|
* name: string;
|
|
@@ -930,7 +936,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
930
936
|
* ```
|
|
931
937
|
* @example
|
|
932
938
|
* ```ts
|
|
933
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
939
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
934
940
|
*
|
|
935
941
|
* // Asume the inputed collection is empty.
|
|
936
942
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -957,7 +963,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
957
963
|
* By default the equality check occurs on the item.
|
|
958
964
|
* @example
|
|
959
965
|
* ```ts
|
|
960
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
966
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
961
967
|
*
|
|
962
968
|
* // Asume the inputed collection is empty.
|
|
963
969
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -970,7 +976,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
970
976
|
* ```
|
|
971
977
|
* @example
|
|
972
978
|
* ```ts
|
|
973
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
979
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
974
980
|
*
|
|
975
981
|
* type Phone = {
|
|
976
982
|
* name: string;
|
|
@@ -1008,7 +1014,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1008
1014
|
* The `repeat` method will repeat the original collection `amount` times.
|
|
1009
1015
|
* @example
|
|
1010
1016
|
* ```ts
|
|
1011
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1017
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1012
1018
|
*
|
|
1013
1019
|
* // Asume the inputed collection is empty.
|
|
1014
1020
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1026,7 +1032,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1026
1032
|
* The padding is applied from the start of this collection.
|
|
1027
1033
|
* @example
|
|
1028
1034
|
* ```ts
|
|
1029
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1035
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1030
1036
|
*
|
|
1031
1037
|
* // Asume the inputed collection is empty.
|
|
1032
1038
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1074,7 +1080,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1074
1080
|
* The padding is applied from the end of this collection.
|
|
1075
1081
|
* @example
|
|
1076
1082
|
* ```ts
|
|
1077
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1083
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1078
1084
|
*
|
|
1079
1085
|
* // Asume the inputed collection is empty.
|
|
1080
1086
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1122,7 +1128,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1122
1128
|
* where `start` and `end` (end not included) represent the index of items in the collection.
|
|
1123
1129
|
* @example
|
|
1124
1130
|
* ```ts
|
|
1125
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1131
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1126
1132
|
*
|
|
1127
1133
|
* // Asume the inputed collection is empty.
|
|
1128
1134
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1135,7 +1141,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1135
1141
|
* ```
|
|
1136
1142
|
* @example
|
|
1137
1143
|
* ```ts
|
|
1138
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1144
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1139
1145
|
*
|
|
1140
1146
|
* // Asume the inputed collection is empty.
|
|
1141
1147
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1148,7 +1154,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1148
1154
|
* ```
|
|
1149
1155
|
* @example
|
|
1150
1156
|
* ```ts
|
|
1151
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1157
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1152
1158
|
*
|
|
1153
1159
|
* // Asume the inputed collection is empty.
|
|
1154
1160
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1161,7 +1167,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1161
1167
|
* ```
|
|
1162
1168
|
* @example
|
|
1163
1169
|
* ```ts
|
|
1164
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1170
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1165
1171
|
*
|
|
1166
1172
|
* // Asume the inputed collection is empty.
|
|
1167
1173
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1174,7 +1180,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1174
1180
|
* ```
|
|
1175
1181
|
* @example
|
|
1176
1182
|
* ```ts
|
|
1177
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1183
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1178
1184
|
*
|
|
1179
1185
|
* // Asume the inputed collection is empty.
|
|
1180
1186
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1187,7 +1193,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1187
1193
|
* ```
|
|
1188
1194
|
* @example
|
|
1189
1195
|
* ```ts
|
|
1190
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1196
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1191
1197
|
*
|
|
1192
1198
|
* // Asume the inputed collection is empty.
|
|
1193
1199
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1204,7 +1210,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1204
1210
|
* The `prepend` method adds `iterable` to the beginning of the collection.
|
|
1205
1211
|
* @example
|
|
1206
1212
|
* ```ts
|
|
1207
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1213
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1208
1214
|
*
|
|
1209
1215
|
* // Asume the inputed collection is empty.
|
|
1210
1216
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1221,7 +1227,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1221
1227
|
* The `append` method adds `iterable` to the end of the collection.
|
|
1222
1228
|
* @example
|
|
1223
1229
|
* ```ts
|
|
1224
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1230
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1225
1231
|
*
|
|
1226
1232
|
* // Asume the inputed collection is empty.
|
|
1227
1233
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1238,7 +1244,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1238
1244
|
* The `insertBefore` method adds `iterable` before the first item that matches `predicateFn`.
|
|
1239
1245
|
* @example
|
|
1240
1246
|
* ```ts
|
|
1241
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1247
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1242
1248
|
*
|
|
1243
1249
|
* // Asume the inputed collection is empty.
|
|
1244
1250
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1255,7 +1261,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1255
1261
|
* The `insertAfter` method adds `iterable` after the first item that matches `predicateFn`.
|
|
1256
1262
|
* @example
|
|
1257
1263
|
* ```ts
|
|
1258
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1264
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1259
1265
|
*
|
|
1260
1266
|
* // Asume the inputed collection is empty.
|
|
1261
1267
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1272,7 +1278,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1272
1278
|
* The `crossJoin` method cross joins the collection's values among `iterables`, returning a Cartesian product with all possible permutations.
|
|
1273
1279
|
* @example
|
|
1274
1280
|
* ```ts
|
|
1275
|
-
* import { ICollection } from "@daiso-tech/core"
|
|
1281
|
+
* import { ICollection } from "@daiso-tech/core/collection/contracts";
|
|
1276
1282
|
*
|
|
1277
1283
|
* async function(): Promise<void> {
|
|
1278
1284
|
* await collection
|
|
@@ -1289,7 +1295,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1289
1295
|
* ```
|
|
1290
1296
|
* @example
|
|
1291
1297
|
* ```ts
|
|
1292
|
-
* import { ICollection } from "@daiso-tech/core"
|
|
1298
|
+
* import { ICollection } from "@daiso-tech/core/collection/contracts";
|
|
1293
1299
|
*
|
|
1294
1300
|
* async function(): Promise<void> {
|
|
1295
1301
|
* await collection
|
|
@@ -1316,7 +1322,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1316
1322
|
* The returned collection has size of the shortest collection.
|
|
1317
1323
|
* @example
|
|
1318
1324
|
* ```ts
|
|
1319
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1325
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1320
1326
|
*
|
|
1321
1327
|
* // Asume the inputed collection is empty.
|
|
1322
1328
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1329,7 +1335,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1329
1335
|
* ```
|
|
1330
1336
|
* @example
|
|
1331
1337
|
* ```ts
|
|
1332
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1338
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1333
1339
|
*
|
|
1334
1340
|
* // Asume the inputed collection is empty.
|
|
1335
1341
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1342,7 +1348,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1342
1348
|
* ```
|
|
1343
1349
|
* @example
|
|
1344
1350
|
* ```ts
|
|
1345
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1351
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1346
1352
|
*
|
|
1347
1353
|
* // Asume the inputed collection is empty.
|
|
1348
1354
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -1359,7 +1365,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1359
1365
|
* The `sort` method sorts the collection. You can provide a `comparator` function.
|
|
1360
1366
|
* @example
|
|
1361
1367
|
* ```ts
|
|
1362
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1368
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1363
1369
|
*
|
|
1364
1370
|
* type Person = {
|
|
1365
1371
|
* name: string;
|
|
@@ -1377,7 +1383,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1377
1383
|
* ```
|
|
1378
1384
|
* @example
|
|
1379
1385
|
* ```ts
|
|
1380
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1386
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1381
1387
|
*
|
|
1382
1388
|
* // Asume the inputed collection is empty.
|
|
1383
1389
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1405,7 +1411,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1405
1411
|
* The reversing of the collection will be applied in chunks that are the size of ` chunkSize `.
|
|
1406
1412
|
* @example
|
|
1407
1413
|
* ```ts
|
|
1408
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1414
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1409
1415
|
*
|
|
1410
1416
|
* // Asume the inputed collection is empty.
|
|
1411
1417
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1427,7 +1433,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1427
1433
|
* By default it will get the first item. If the collection is empty or no items passes ` predicateFn ` than null i returned.
|
|
1428
1434
|
* @example
|
|
1429
1435
|
* ```ts
|
|
1430
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1436
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1431
1437
|
*
|
|
1432
1438
|
* // Asume the inputed collection is empty.
|
|
1433
1439
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1439,7 +1445,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1439
1445
|
* ```
|
|
1440
1446
|
* @example
|
|
1441
1447
|
* ```ts
|
|
1442
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1448
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1443
1449
|
*
|
|
1444
1450
|
* // Asume the inputed collection is empty.
|
|
1445
1451
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1451,7 +1457,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1451
1457
|
* ```
|
|
1452
1458
|
* @example
|
|
1453
1459
|
* ```ts
|
|
1454
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1460
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1455
1461
|
*
|
|
1456
1462
|
* // Asume the inputed collection is empty.
|
|
1457
1463
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1468,7 +1474,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1468
1474
|
* By default it will get the first item. If the collection is empty or no items passes ` predicateFn ` than ` defaultValue `.
|
|
1469
1475
|
* @example
|
|
1470
1476
|
* ```ts
|
|
1471
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1477
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1472
1478
|
*
|
|
1473
1479
|
* // Asume the inputed collection is empty.
|
|
1474
1480
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1480,7 +1486,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1480
1486
|
* ```
|
|
1481
1487
|
* @example
|
|
1482
1488
|
* ```ts
|
|
1483
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1489
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1484
1490
|
*
|
|
1485
1491
|
* // Asume the inputed collection is empty.
|
|
1486
1492
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1493,7 +1499,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1493
1499
|
* You can pass a function as default value.
|
|
1494
1500
|
* @example
|
|
1495
1501
|
* ```ts
|
|
1496
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1502
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1497
1503
|
*
|
|
1498
1504
|
* // Asume the inputed collection is empty.
|
|
1499
1505
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1506,7 +1512,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1506
1512
|
* You can pass an async function as default value.
|
|
1507
1513
|
* @example
|
|
1508
1514
|
* ```ts
|
|
1509
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1515
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1510
1516
|
*
|
|
1511
1517
|
* // Asume the inputed collection is empty.
|
|
1512
1518
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1519,7 +1525,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1519
1525
|
* You can pass a {@link LazyPromise| `LazyPromise`} as default value.
|
|
1520
1526
|
* @example
|
|
1521
1527
|
* ```ts
|
|
1522
|
-
* import type { IAsyncCollection, ICache } from "@daiso-tech/core";
|
|
1528
|
+
* import type { IAsyncCollection, ICache } from "@daiso-tech/core/collection/contracts";
|
|
1523
1529
|
*
|
|
1524
1530
|
* // Asume the inputed collection is empty.
|
|
1525
1531
|
* async function main(collection: IAsyncCollection<number>, cache: ICache<number>): Promise<void> {
|
|
@@ -1537,7 +1543,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1537
1543
|
* @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
|
|
1538
1544
|
* @example
|
|
1539
1545
|
* ```ts
|
|
1540
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1546
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1541
1547
|
*
|
|
1542
1548
|
* // Asume the inputed collection is empty.
|
|
1543
1549
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1549,7 +1555,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1549
1555
|
* ```
|
|
1550
1556
|
* @example
|
|
1551
1557
|
* ```ts
|
|
1552
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1558
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1553
1559
|
*
|
|
1554
1560
|
* // Asume the inputed collection is empty.
|
|
1555
1561
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1561,7 +1567,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1561
1567
|
* ```
|
|
1562
1568
|
* @example
|
|
1563
1569
|
* ```ts
|
|
1564
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1570
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1565
1571
|
*
|
|
1566
1572
|
* // Asume the inputed collection is empty.
|
|
1567
1573
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1578,7 +1584,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1578
1584
|
* By default it will get the last item. If the collection is empty or no items passes ` predicateFn ` than null i returned.
|
|
1579
1585
|
* @example
|
|
1580
1586
|
* ```ts
|
|
1581
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1587
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1582
1588
|
*
|
|
1583
1589
|
* // Asume the inputed collection is empty.
|
|
1584
1590
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1590,7 +1596,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1590
1596
|
* ```
|
|
1591
1597
|
* @example
|
|
1592
1598
|
* ```ts
|
|
1593
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1599
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1594
1600
|
*
|
|
1595
1601
|
* // Asume the inputed collection is empty.
|
|
1596
1602
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1602,7 +1608,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1602
1608
|
* ```
|
|
1603
1609
|
* @example
|
|
1604
1610
|
* ```ts
|
|
1605
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1611
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1606
1612
|
*
|
|
1607
1613
|
* // Asume the inputed collection is empty.
|
|
1608
1614
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1619,7 +1625,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1619
1625
|
* By default it will get the last item. If the collection is empty or no items passes ` predicateFn ` than ` defaultValue `.
|
|
1620
1626
|
* @example
|
|
1621
1627
|
* ```ts
|
|
1622
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1628
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1623
1629
|
*
|
|
1624
1630
|
* // Asume the inputed collection is empty.
|
|
1625
1631
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1631,7 +1637,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1631
1637
|
* ```
|
|
1632
1638
|
* @example
|
|
1633
1639
|
* ```ts
|
|
1634
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1640
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1635
1641
|
*
|
|
1636
1642
|
* // Asume the inputed collection is empty.
|
|
1637
1643
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1644,7 +1650,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1644
1650
|
* You can pass a function as default value.
|
|
1645
1651
|
* @example
|
|
1646
1652
|
* ```ts
|
|
1647
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1653
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1648
1654
|
*
|
|
1649
1655
|
* // Asume the inputed collection is empty.
|
|
1650
1656
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1657,7 +1663,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1657
1663
|
* You can pass an async function as default value.
|
|
1658
1664
|
* @example
|
|
1659
1665
|
* ```ts
|
|
1660
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1666
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1661
1667
|
*
|
|
1662
1668
|
* // Asume the inputed collection is empty.
|
|
1663
1669
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1670,7 +1676,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1670
1676
|
* You can pass a {@link LazyPromise| `LazyPromise`} as default value.
|
|
1671
1677
|
* @example
|
|
1672
1678
|
* ```ts
|
|
1673
|
-
* import type { IAsyncCollection, ICache } from "@daiso-tech/core";
|
|
1679
|
+
* import type { IAsyncCollection, ICache } from "@daiso-tech/core/collection/contracts";
|
|
1674
1680
|
*
|
|
1675
1681
|
* // Asume the inputed collection is empty.
|
|
1676
1682
|
* async function main(collection: IAsyncCollection<number>, cache: ICache<number>): Promise<void> {
|
|
@@ -1688,7 +1694,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1688
1694
|
* @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
|
|
1689
1695
|
* @example
|
|
1690
1696
|
* ```ts
|
|
1691
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1697
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1692
1698
|
*
|
|
1693
1699
|
* // Asume the inputed collection is empty.
|
|
1694
1700
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1700,7 +1706,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1700
1706
|
* ```
|
|
1701
1707
|
* @example
|
|
1702
1708
|
* ```ts
|
|
1703
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1709
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1704
1710
|
*
|
|
1705
1711
|
* // Asume the inputed collection is empty.
|
|
1706
1712
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1712,7 +1718,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1712
1718
|
* ```
|
|
1713
1719
|
* @example
|
|
1714
1720
|
* ```ts
|
|
1715
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1721
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1716
1722
|
*
|
|
1717
1723
|
* // Asume the inputed collection is empty.
|
|
1718
1724
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1729,7 +1735,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1729
1735
|
* If the `predicateFn` does not match or matches the first item then null is returned.
|
|
1730
1736
|
* @example
|
|
1731
1737
|
* ```ts
|
|
1732
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1738
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1733
1739
|
*
|
|
1734
1740
|
* // Asume the inputed collection is empty.
|
|
1735
1741
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1741,7 +1747,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1741
1747
|
* ```
|
|
1742
1748
|
* @example
|
|
1743
1749
|
* ```ts
|
|
1744
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1750
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1745
1751
|
*
|
|
1746
1752
|
* // Asume the inputed collection is empty.
|
|
1747
1753
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1758,7 +1764,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1758
1764
|
* If the collection is empty or the `predicateFn` does not match or matches the first item then `defaultValue` is returned.
|
|
1759
1765
|
* @example
|
|
1760
1766
|
* ```ts
|
|
1761
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1767
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1762
1768
|
*
|
|
1763
1769
|
* // Asume the inputed collection is empty.
|
|
1764
1770
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1771,7 +1777,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1771
1777
|
* You can pass a function as default value.
|
|
1772
1778
|
* @example
|
|
1773
1779
|
* ```ts
|
|
1774
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1780
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1775
1781
|
*
|
|
1776
1782
|
* // Asume the inputed collection is empty.
|
|
1777
1783
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1784,7 +1790,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1784
1790
|
* You can pass an async function as default value.
|
|
1785
1791
|
* @example
|
|
1786
1792
|
* ```ts
|
|
1787
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1793
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1788
1794
|
*
|
|
1789
1795
|
* // Asume the inputed collection is empty.
|
|
1790
1796
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1797,7 +1803,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1797
1803
|
* You can pass a {@link LazyPromise| `LazyPromise`} as default value.
|
|
1798
1804
|
* @example
|
|
1799
1805
|
* ```ts
|
|
1800
|
-
* import type { IAsyncCollection, ICache } from "@daiso-tech/core";
|
|
1806
|
+
* import type { IAsyncCollection, ICache } from "@daiso-tech/core/collection/contracts";
|
|
1801
1807
|
*
|
|
1802
1808
|
* // Asume the inputed collection is empty.
|
|
1803
1809
|
* async function main(collection: IAsyncCollection<number>, cache: ICache<number>): Promise<void> {
|
|
@@ -1815,7 +1821,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1815
1821
|
* @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
|
|
1816
1822
|
* @example
|
|
1817
1823
|
* ```ts
|
|
1818
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1824
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1819
1825
|
*
|
|
1820
1826
|
* // Asume the inputed collection is empty.
|
|
1821
1827
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1827,7 +1833,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1827
1833
|
* ```
|
|
1828
1834
|
* @example
|
|
1829
1835
|
* ```ts
|
|
1830
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1836
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1831
1837
|
*
|
|
1832
1838
|
* // Asume the inputed collection is empty.
|
|
1833
1839
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1844,7 +1850,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1844
1850
|
* If the collection is empty or the `predicateFn` does not match or matches the last item then null is returned.
|
|
1845
1851
|
* @example
|
|
1846
1852
|
* ```ts
|
|
1847
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1853
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1848
1854
|
*
|
|
1849
1855
|
* // Asume the inputed collection is empty.
|
|
1850
1856
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1856,7 +1862,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1856
1862
|
* ```
|
|
1857
1863
|
* @example
|
|
1858
1864
|
* ```ts
|
|
1859
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1865
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1860
1866
|
*
|
|
1861
1867
|
* // Asume the inputed collection is empty.
|
|
1862
1868
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1873,7 +1879,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1873
1879
|
* If the collection is empty or the `predicateFn` does not match or matches the last item then `defaultValue` is returned.
|
|
1874
1880
|
* @example
|
|
1875
1881
|
* ```ts
|
|
1876
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1882
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1877
1883
|
*
|
|
1878
1884
|
* // Asume the inputed collection is empty.
|
|
1879
1885
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1886,7 +1892,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1886
1892
|
* You can pass a function as default value.
|
|
1887
1893
|
* @example
|
|
1888
1894
|
* ```ts
|
|
1889
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1895
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1890
1896
|
*
|
|
1891
1897
|
* // Asume the inputed collection is empty.
|
|
1892
1898
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1899,7 +1905,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1899
1905
|
* You can pass an async function as default value.
|
|
1900
1906
|
* @example
|
|
1901
1907
|
* ```ts
|
|
1902
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1908
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1903
1909
|
*
|
|
1904
1910
|
* // Asume the inputed collection is empty.
|
|
1905
1911
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1912,7 +1918,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1912
1918
|
* You can pass a {@link LazyPromise| `LazyPromise`} as default value.
|
|
1913
1919
|
* @example
|
|
1914
1920
|
* ```ts
|
|
1915
|
-
* import type { IAsyncCollection, ICache } from "@daiso-tech/core";
|
|
1921
|
+
* import type { IAsyncCollection, ICache } from "@daiso-tech/core/collection/contracts";
|
|
1916
1922
|
*
|
|
1917
1923
|
* // Asume the inputed collection is empty.
|
|
1918
1924
|
* async function main(collection: IAsyncCollection<number>, cache: ICache<number>): Promise<void> {
|
|
@@ -1930,7 +1936,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1930
1936
|
* @throws {ItemNotFoundCollectionError} {@link ItemNotFoundCollectionError}
|
|
1931
1937
|
* @example
|
|
1932
1938
|
* ```ts
|
|
1933
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1939
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1934
1940
|
*
|
|
1935
1941
|
* // Asume the inputed collection is empty.
|
|
1936
1942
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1942,7 +1948,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1942
1948
|
* ```
|
|
1943
1949
|
* @example
|
|
1944
1950
|
* ```ts
|
|
1945
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1951
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1946
1952
|
*
|
|
1947
1953
|
* // Asume the inputed collection is empty.
|
|
1948
1954
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1961,7 +1967,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1961
1967
|
* @throws {MultipleItemsFoundCollectionError} {@link MultipleItemsFoundCollectionError}
|
|
1962
1968
|
* @example
|
|
1963
1969
|
* ```ts
|
|
1964
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1970
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1965
1971
|
*
|
|
1966
1972
|
* // Asume the inputed collection is empty.
|
|
1967
1973
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1973,7 +1979,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1973
1979
|
* ```
|
|
1974
1980
|
* @example
|
|
1975
1981
|
* ```ts
|
|
1976
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1982
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1977
1983
|
*
|
|
1978
1984
|
* // Asume the inputed collection is empty.
|
|
1979
1985
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -1985,7 +1991,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
1985
1991
|
* ```
|
|
1986
1992
|
* @example
|
|
1987
1993
|
* ```ts
|
|
1988
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
1994
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
1989
1995
|
*
|
|
1990
1996
|
* // Asume the inputed collection is empty.
|
|
1991
1997
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -2001,7 +2007,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
2001
2007
|
* The `nth` method creates a new collection consisting of every n-th item.
|
|
2002
2008
|
* @example
|
|
2003
2009
|
* ```ts
|
|
2004
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
2010
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
2005
2011
|
*
|
|
2006
2012
|
* // Asume the inputed collection is empty.
|
|
2007
2013
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -2017,7 +2023,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
2017
2023
|
* The `count` method returns the total number of items in the collection that passes `predicateFn`.
|
|
2018
2024
|
* @example
|
|
2019
2025
|
* ```ts
|
|
2020
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
2026
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
2021
2027
|
*
|
|
2022
2028
|
* // Asume the inputed collection is empty.
|
|
2023
2029
|
* async function main(collection: IAsyncCollection<number>): Promise<void> {
|
|
@@ -2045,7 +2051,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
2045
2051
|
* The `searchFirst` return the index of the first item that matches `predicateFn`.
|
|
2046
2052
|
* @example
|
|
2047
2053
|
* ```ts
|
|
2048
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
2054
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
2049
2055
|
*
|
|
2050
2056
|
* // Asume the inputed collection is empty.
|
|
2051
2057
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|
|
@@ -2061,7 +2067,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
|
|
|
2061
2067
|
* The `searchLast` return the index of the last item that matches `predicateFn`.
|
|
2062
2068
|
* @example
|
|
2063
2069
|
* ```ts
|
|
2064
|
-
* import type { IAsyncCollection } from "@daiso-tech/core";
|
|
2070
|
+
* import type { IAsyncCollection } from "@daiso-tech/core/collection/contracts";
|
|
2065
2071
|
*
|
|
2066
2072
|
* // Asume the inputed collection is empty.
|
|
2067
2073
|
* async function main(collection: IAsyncCollection<string>): Promise<void> {
|