@daiso-tech/core 0.28.1 → 0.30.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.
Files changed (247) hide show
  1. package/README.md +8 -2
  2. package/dist/async/utilities/abort/abort.d.ts +1 -1
  3. package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +3 -4
  4. package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  5. package/dist/async/utilities/retry/retry.d.ts +1 -1
  6. package/dist/async/utilities/timeout/timeout.d.ts +1 -1
  7. package/dist/cache/contracts/cache-factory.contract.js +1 -1
  8. package/dist/cache/contracts/cache-factory.contract.js.map +1 -1
  9. package/dist/cache/contracts/cache.contract.d.ts +3 -3
  10. package/dist/cache/implementations/derivables/cache/cache.d.ts +18 -13
  11. package/dist/cache/implementations/derivables/cache/cache.js +10 -3
  12. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  13. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js.map +1 -1
  14. package/dist/collection/contracts/_module-exports.d.ts +1 -1
  15. package/dist/collection/contracts/_module-exports.js +1 -1
  16. package/dist/collection/contracts/_module-exports.js.map +1 -1
  17. package/dist/collection/contracts/_shared/_module.d.ts +11 -0
  18. package/dist/collection/contracts/_shared/_module.js +12 -0
  19. package/dist/collection/contracts/_shared/_module.js.map +1 -0
  20. package/dist/collection/contracts/_shared/compartor.type.d.ts +9 -0
  21. package/dist/collection/contracts/_shared/compartor.type.js +5 -0
  22. package/dist/collection/contracts/_shared/compartor.type.js.map +1 -0
  23. package/dist/collection/contracts/_shared/cross-join-result.type.d.ts +11 -0
  24. package/dist/collection/contracts/_shared/cross-join-result.type.js +5 -0
  25. package/dist/collection/contracts/_shared/cross-join-result.type.js.map +1 -0
  26. package/dist/collection/contracts/_shared/ensure-map.type.d.ts +8 -0
  27. package/dist/collection/contracts/_shared/ensure-map.type.js +5 -0
  28. package/dist/collection/contracts/_shared/ensure-map.type.js.map +1 -0
  29. package/dist/collection/contracts/_shared/ensure-record.type.d.ts +8 -0
  30. package/dist/collection/contracts/_shared/ensure-record.type.js +5 -0
  31. package/dist/collection/contracts/_shared/ensure-record.type.js.map +1 -0
  32. package/dist/collection/contracts/_shared/foreach.type.d.ts +22 -0
  33. package/dist/collection/contracts/_shared/foreach.type.js +5 -0
  34. package/dist/collection/contracts/_shared/foreach.type.js.map +1 -0
  35. package/dist/collection/contracts/_shared/map.type.d.ts +22 -0
  36. package/dist/collection/contracts/{_shared.js → _shared/map.type.js} +1 -1
  37. package/dist/collection/contracts/_shared/map.type.js.map +1 -0
  38. package/dist/collection/contracts/_shared/modifier.type.d.ts +18 -0
  39. package/dist/collection/contracts/_shared/modifier.type.js +5 -0
  40. package/dist/collection/contracts/_shared/modifier.type.js.map +1 -0
  41. package/dist/collection/contracts/_shared/predicate.type.d.ts +49 -0
  42. package/dist/collection/contracts/_shared/predicate.type.js +5 -0
  43. package/dist/collection/contracts/_shared/predicate.type.js.map +1 -0
  44. package/dist/collection/contracts/_shared/reduce.type.d.ts +24 -0
  45. package/dist/collection/contracts/_shared/reduce.type.js +5 -0
  46. package/dist/collection/contracts/_shared/reduce.type.js.map +1 -0
  47. package/dist/collection/contracts/_shared/tap.type.d.ts +16 -0
  48. package/dist/collection/contracts/_shared/tap.type.js +5 -0
  49. package/dist/collection/contracts/_shared/tap.type.js.map +1 -0
  50. package/dist/collection/contracts/_shared/transform.type.d.ts +16 -0
  51. package/dist/collection/contracts/_shared/transform.type.js +5 -0
  52. package/dist/collection/contracts/_shared/transform.type.js.map +1 -0
  53. package/dist/collection/contracts/async-collection.contract.d.ts +3 -3
  54. package/dist/collection/contracts/collection.contract.d.ts +31 -31
  55. package/dist/collection/contracts/collection.errors.d.ts +1 -1
  56. package/dist/collection/contracts/collection.errors.js +1 -1
  57. package/dist/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.js +2 -2
  58. package/dist/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
  59. package/dist/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js +2 -1
  60. package/dist/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  61. package/dist/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.js +2 -1
  62. package/dist/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  63. package/dist/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.js +2 -1
  64. package/dist/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  65. package/dist/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.js +2 -2
  66. package/dist/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
  67. package/dist/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.js +2 -2
  68. package/dist/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  69. package/dist/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.js +2 -2
  70. package/dist/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  71. package/dist/collection/implementations/async-iterable-collection/_shared/async-map-iterable.js +2 -1
  72. package/dist/collection/implementations/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  73. package/dist/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.js +2 -2
  74. package/dist/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  75. package/dist/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.js +2 -1
  76. package/dist/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  77. package/dist/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.js +6 -1
  78. package/dist/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -1
  79. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.js +2 -1
  80. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  81. package/dist/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.js +2 -1
  82. package/dist/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  83. package/dist/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.js +2 -1
  84. package/dist/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  85. package/dist/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js +3 -2
  86. package/dist/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  87. package/dist/collection/implementations/async-iterable-collection/_shared/async-when-iterable.js +2 -1
  88. package/dist/collection/implementations/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  89. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +3 -3
  90. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +25 -24
  91. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  92. package/dist/collection/implementations/iterable-collection/_shared/chunk-while-iterable.d.ts +2 -2
  93. package/dist/collection/implementations/iterable-collection/_shared/chunk-while-iterable.js +2 -1
  94. package/dist/collection/implementations/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
  95. package/dist/collection/implementations/iterable-collection/_shared/count-by-iterable.js +2 -1
  96. package/dist/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  97. package/dist/collection/implementations/iterable-collection/_shared/filter-iterable.d.ts +2 -2
  98. package/dist/collection/implementations/iterable-collection/_shared/filter-iterable.js +2 -1
  99. package/dist/collection/implementations/iterable-collection/_shared/filter-iterable.js.map +1 -1
  100. package/dist/collection/implementations/iterable-collection/_shared/flat-map-iterable.js +2 -1
  101. package/dist/collection/implementations/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  102. package/dist/collection/implementations/iterable-collection/_shared/group-by-iterable.js +2 -1
  103. package/dist/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  104. package/dist/collection/implementations/iterable-collection/_shared/insert-after-iterable.d.ts +2 -2
  105. package/dist/collection/implementations/iterable-collection/_shared/insert-after-iterable.js +3 -1
  106. package/dist/collection/implementations/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  107. package/dist/collection/implementations/iterable-collection/_shared/insert-before-iterable.d.ts +2 -2
  108. package/dist/collection/implementations/iterable-collection/_shared/insert-before-iterable.js +3 -1
  109. package/dist/collection/implementations/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  110. package/dist/collection/implementations/iterable-collection/_shared/map-iterable.js +2 -1
  111. package/dist/collection/implementations/iterable-collection/_shared/map-iterable.js.map +1 -1
  112. package/dist/collection/implementations/iterable-collection/_shared/partion-iterable.d.ts +2 -2
  113. package/dist/collection/implementations/iterable-collection/_shared/partion-iterable.js +2 -1
  114. package/dist/collection/implementations/iterable-collection/_shared/partion-iterable.js.map +1 -1
  115. package/dist/collection/implementations/iterable-collection/_shared/skip-until-iterable.d.ts +2 -2
  116. package/dist/collection/implementations/iterable-collection/_shared/skip-until-iterable.js +2 -1
  117. package/dist/collection/implementations/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  118. package/dist/collection/implementations/iterable-collection/_shared/sort-iterable.js +6 -1
  119. package/dist/collection/implementations/iterable-collection/_shared/sort-iterable.js.map +1 -1
  120. package/dist/collection/implementations/iterable-collection/_shared/take-until-iterable.d.ts +2 -2
  121. package/dist/collection/implementations/iterable-collection/_shared/take-until-iterable.js +2 -1
  122. package/dist/collection/implementations/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  123. package/dist/collection/implementations/iterable-collection/_shared/tap-iterable.js +2 -1
  124. package/dist/collection/implementations/iterable-collection/_shared/tap-iterable.js.map +1 -1
  125. package/dist/collection/implementations/iterable-collection/_shared/unique-iterable.js +2 -1
  126. package/dist/collection/implementations/iterable-collection/_shared/unique-iterable.js.map +1 -1
  127. package/dist/collection/implementations/iterable-collection/_shared/update-iterable.d.ts +2 -2
  128. package/dist/collection/implementations/iterable-collection/_shared/update-iterable.js +3 -2
  129. package/dist/collection/implementations/iterable-collection/_shared/update-iterable.js.map +1 -1
  130. package/dist/collection/implementations/iterable-collection/_shared/when-iterable.js +2 -1
  131. package/dist/collection/implementations/iterable-collection/_shared/when-iterable.js.map +1 -1
  132. package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +31 -31
  133. package/dist/collection/implementations/iterable-collection/iterable-collection.js +23 -22
  134. package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  135. package/dist/collection/implementations/list-collection/list-collection.d.ts +31 -31
  136. package/dist/collection/implementations/list-collection/list-collection.js +44 -38
  137. package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
  138. package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +10 -4
  139. package/dist/event-bus/contracts/event-bus.contract.d.ts +26 -8
  140. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +3 -4
  141. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +0 -1
  142. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
  143. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +3 -4
  144. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
  145. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +3 -4
  146. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +0 -1
  147. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
  148. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +11 -10
  149. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +30 -6
  150. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
  151. package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +4 -4
  152. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +10 -8
  153. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -1
  154. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +453 -4
  155. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
  156. package/dist/lock/contracts/lock-provider-factory.contract.js +1 -1
  157. package/dist/lock/contracts/lock-provider-factory.contract.js.map +1 -1
  158. package/dist/lock/contracts/lock.contract.d.ts +5 -5
  159. package/dist/lock/contracts/lock.events.d.ts +1 -1
  160. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +16 -11
  161. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +10 -3
  162. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  163. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +1 -1
  164. package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +18 -13
  165. package/dist/lock/implementations/derivables/lock-provider/lock.js +12 -17
  166. package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
  167. package/dist/utilities/_module-exports.d.ts +2 -2
  168. package/dist/utilities/_module-exports.js +2 -2
  169. package/dist/utilities/_module-exports.js.map +1 -1
  170. package/dist/utilities/classes/_module.d.ts +0 -1
  171. package/dist/utilities/classes/_module.js +0 -1
  172. package/dist/utilities/classes/_module.js.map +1 -1
  173. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.d.ts +1 -1
  174. package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +1 -1
  175. package/dist/utilities/classes/key-prefixer/key-prefixer.js +1 -1
  176. package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -1
  177. package/dist/utilities/functions/_module-exports.d.ts +7 -0
  178. package/dist/utilities/functions/_module-exports.js +8 -0
  179. package/dist/utilities/functions/_module-exports.js.map +1 -0
  180. package/dist/utilities/functions/factory.d.ts +44 -0
  181. package/dist/utilities/functions/factory.js +80 -0
  182. package/dist/utilities/functions/factory.js.map +1 -0
  183. package/dist/utilities/functions/get-constructor-name.d.ts +7 -0
  184. package/dist/utilities/functions/get-constructor-name.js +10 -0
  185. package/dist/utilities/functions/get-constructor-name.js.map +1 -0
  186. package/dist/utilities/functions/invokable.d.ts +20 -0
  187. package/dist/utilities/functions/invokable.js +33 -0
  188. package/dist/utilities/functions/invokable.js.map +1 -0
  189. package/dist/utilities/functions/is-nullable.d.ts +7 -0
  190. package/dist/utilities/functions/is-nullable.js +10 -0
  191. package/dist/utilities/functions/is-nullable.js.map +1 -0
  192. package/dist/utilities/functions/lazy.d.ts +20 -0
  193. package/dist/utilities/functions/lazy.js +39 -0
  194. package/dist/utilities/functions/lazy.js.map +1 -0
  195. package/dist/utilities/functions/object.d.ts +15 -0
  196. package/dist/utilities/functions/object.js +33 -0
  197. package/dist/utilities/functions/object.js.map +1 -0
  198. package/dist/utilities/functions/resolve-one-or-more.d.ts +12 -0
  199. package/dist/utilities/functions/resolve-one-or-more.js +25 -0
  200. package/dist/utilities/functions/resolve-one-or-more.js.map +1 -0
  201. package/dist/utilities/types/_module.d.ts +10 -0
  202. package/dist/utilities/types/_module.js +11 -0
  203. package/dist/utilities/types/_module.js.map +1 -0
  204. package/dist/utilities/types/async-iterable-value.type.d.ts +8 -0
  205. package/dist/utilities/types/async-iterable-value.type.js +5 -0
  206. package/dist/utilities/types/async-iterable-value.type.js.map +1 -0
  207. package/dist/utilities/types/at-least-one.type.d.ts +8 -0
  208. package/dist/utilities/types/at-least-one.type.js +5 -0
  209. package/dist/utilities/types/at-least-one.type.js.map +1 -0
  210. package/dist/utilities/types/factory.type.d.ts +49 -0
  211. package/dist/utilities/types/factory.type.js +5 -0
  212. package/dist/utilities/types/factory.type.js.map +1 -0
  213. package/dist/utilities/types/invokable.type.d.ts +20 -0
  214. package/dist/utilities/types/invokable.type.js +5 -0
  215. package/dist/utilities/types/invokable.type.js.map +1 -0
  216. package/dist/utilities/types/items.type.d.ts +8 -0
  217. package/dist/utilities/types/items.type.js +5 -0
  218. package/dist/utilities/types/items.type.js.map +1 -0
  219. package/dist/utilities/types/lazy.type.d.ts +31 -0
  220. package/dist/utilities/{types.js → types/lazy.type.js} +1 -1
  221. package/dist/utilities/types/lazy.type.js.map +1 -0
  222. package/dist/utilities/types/none-func.type.d.ts +8 -0
  223. package/dist/utilities/types/none-func.type.js +5 -0
  224. package/dist/utilities/types/none-func.type.js.map +1 -0
  225. package/dist/utilities/types/one-or-more.type.d.ts +8 -0
  226. package/dist/utilities/types/one-or-more.type.js +5 -0
  227. package/dist/utilities/types/one-or-more.type.js.map +1 -0
  228. package/dist/utilities/types/promiseable.type.d.ts +8 -0
  229. package/dist/utilities/types/promiseable.type.js +5 -0
  230. package/dist/utilities/types/promiseable.type.js.map +1 -0
  231. package/dist/utilities/types/result.type.d.ts +8 -0
  232. package/dist/utilities/types/result.type.js +5 -0
  233. package/dist/utilities/types/result.type.js.map +1 -0
  234. package/package.json +85 -25
  235. package/dist/collection/contracts/_shared.d.ts +0 -141
  236. package/dist/collection/contracts/_shared.js.map +0 -1
  237. package/dist/utilities/classes/pipeline/_module.d.ts +0 -1
  238. package/dist/utilities/classes/pipeline/_module.js +0 -2
  239. package/dist/utilities/classes/pipeline/_module.js.map +0 -1
  240. package/dist/utilities/classes/pipeline/pipeline.d.ts +0 -46
  241. package/dist/utilities/classes/pipeline/pipeline.js +0 -76
  242. package/dist/utilities/classes/pipeline/pipeline.js.map +0 -1
  243. package/dist/utilities/functions.d.ts +0 -57
  244. package/dist/utilities/functions.js +0 -123
  245. package/dist/utilities/functions.js.map +0 -1
  246. package/dist/utilities/types.d.ts +0 -104
  247. package/dist/utilities/types.js.map +0 -1
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ import type { Invokable, Promisable } from "../../../utilities/_module-exports.js";
5
+ /**
6
+ *
7
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
8
+ */
9
+ export type Modifier<TInput, TOutput> = Invokable<[
10
+ collection: TInput
11
+ ], TOutput>;
12
+ /**
13
+ *
14
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
15
+ */
16
+ export type AsyncModifier<TInput, TOutput> = Invokable<[
17
+ collection: TInput
18
+ ], Promisable<TOutput>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=modifier.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modifier.type.js","sourceRoot":"","sources":["../../../../src/collection/contracts/_shared/modifier.type.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ import type { Invokable, Promisable } from "../../../utilities/_module-exports.js";
5
+ /**
6
+ *
7
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
8
+ */
9
+ export type PredicateFn<TInput, TCollection> = Invokable<[
10
+ item: TInput,
11
+ index: number,
12
+ collection: TCollection
13
+ ], boolean>;
14
+ /**
15
+ *
16
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
17
+ */
18
+ export type PredicateGuardFn<TInput, TCollection, TOutput extends TInput = TInput> = (item: TInput, index: number, collection: TCollection) => item is TOutput;
19
+ /**
20
+ *
21
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
22
+ */
23
+ export type PredicateGuardInvokableObject<TInput, TCollection, TOutput extends TInput = TInput> = {
24
+ invoke(item: TInput, index: number, collection: TCollection): item is TOutput;
25
+ };
26
+ /**
27
+ *
28
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
29
+ */
30
+ export type PredicateGuardInvokable<TInput, TCollection, TOutput extends TInput = TInput> = PredicateGuardFn<TInput, TCollection, TOutput> | PredicateGuardInvokableObject<TInput, TCollection, TOutput>;
31
+ /**
32
+ *
33
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
34
+ */
35
+ export type PredicateInvokable<TInput, TCollection, TOutput extends TInput = TInput> = PredicateFn<TInput, TCollection> | PredicateGuardInvokable<TInput, TCollection, TOutput>;
36
+ /**
37
+ *
38
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
39
+ */
40
+ export type AsyncPredicateInvokable<TInput, TCollection> = Invokable<[
41
+ item: TInput,
42
+ index: number,
43
+ collection: TCollection
44
+ ], Promisable<boolean>>;
45
+ /**
46
+ *
47
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
48
+ */
49
+ export type AsyncPredicate<TInput, TCollection, TOutput extends TInput = TInput> = AsyncPredicateInvokable<TInput, TCollection> | PredicateGuardInvokable<TInput, TCollection, TOutput>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=predicate.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate.type.js","sourceRoot":"","sources":["../../../../src/collection/contracts/_shared/predicate.type.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ import type { Invokable, Promisable } from "../../../utilities/_module-exports.js";
5
+ /**
6
+ *
7
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
8
+ */
9
+ export type Reduce<TInput, TCollection, TOutput> = Invokable<[
10
+ output: TOutput,
11
+ item: TInput,
12
+ index: number,
13
+ collection: TCollection
14
+ ], TOutput>;
15
+ /**
16
+ *
17
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
18
+ */
19
+ export type AsyncReduce<TInput, TCollection, TOutput> = Invokable<[
20
+ output: TOutput,
21
+ item: TInput,
22
+ index: number,
23
+ collection: TCollection
24
+ ], Promisable<TOutput>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=reduce.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reduce.type.js","sourceRoot":"","sources":["../../../../src/collection/contracts/_shared/reduce.type.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ import type { Invokable, Promisable } from "../../../utilities/_module-exports.js";
5
+ /**
6
+ *
7
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
8
+ */
9
+ export type Tap<TCollection> = Invokable<[collection: TCollection], void>;
10
+ /**
11
+ *
12
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
13
+ */
14
+ export type AsyncTap<TCollection> = Invokable<[
15
+ collection: TCollection
16
+ ], Promisable<void>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=tap.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tap.type.js","sourceRoot":"","sources":["../../../../src/collection/contracts/_shared/tap.type.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ import type { Invokable, Promisable } from "../../../utilities/_module-exports.js";
5
+ /**
6
+ *
7
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
8
+ */
9
+ export type Transform<TInput, TOutput> = Invokable<[value: TInput], TOutput>;
10
+ /**
11
+ *
12
+ * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
13
+ */
14
+ export type AsyncTransform<TInput, TOutput> = Invokable<[
15
+ value: TInput
16
+ ], Promisable<TOutput>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Collection
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=transform.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.type.js","sourceRoot":"","sources":["../../../../src/collection/contracts/_shared/transform.type.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @module Collection
3
3
  */
4
- import type { AsyncReduce, CrossJoinResult, AsyncPredicate, AsyncForEach, AsyncMap, AsyncModifier, AsyncTap, AsyncTransform, Comparator, EnsureRecord, EnsureMap } from "../../collection/contracts/_shared.js";
4
+ import type { AsyncReduce, CrossJoinResult, AsyncPredicate, AsyncForEach, AsyncMap, AsyncModifier, Tap, AsyncTransform, Comparator, EnsureRecord, EnsureMap } from "../../collection/contracts/_shared/_module.js";
5
5
  import type { TimeSpan, AsyncLazyable, AsyncIterableValue } from "../../utilities/_module-exports.js";
6
6
  import type { LazyPromise } from "../../async/_module-exports.js";
7
7
  /**
@@ -690,7 +690,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
690
690
  * }
691
691
  * ```
692
692
  */
693
- tap(callback: AsyncTap<IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
693
+ tap(callback: Tap<IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
694
694
  /**
695
695
  * The <i>chunk</i> method breaks the collection into multiple, smaller collections of size <i>chunkSize</i>.
696
696
  * If <i>chunkSize</i> is not divisible with total number of items then the last chunk will contain the remaining items.
@@ -2177,7 +2177,7 @@ export type IAsyncCollection<TInput = unknown> = AsyncIterable<TInput> & {
2177
2177
  */
2178
2178
  toRecord(): LazyPromise<EnsureRecord<TInput>>;
2179
2179
  /**
2180
- * The <i>toMap</i> method converts the collection to a new <i>{@link Map}</i>.
2180
+ * The <i>toMap</i> method converts the collection to a new <i>{@link AsyncMap}</i>.
2181
2181
  * An error will be thrown if item is not a tuple of size 2.
2182
2182
  * @throws {TypeCollectionError} {@link TypeCollectionError}
2183
2183
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @module Collection
3
3
  */
4
- import type { Comparator, Predicate, ForEach, Map, Modifier, Tap, Transform, Reduce, CrossJoinResult, EnsureMap, EnsureRecord } from "../../collection/contracts/_shared.js";
4
+ import type { Comparator, PredicateInvokable, ForEach, Map, Modifier, Tap, Transform, Reduce, CrossJoinResult, EnsureMap, EnsureRecord } from "../../collection/contracts/_shared/_module.js";
5
5
  import type { ISerializable } from "../../serde/contracts/_module-exports.js";
6
6
  import type { Lazyable } from "../../utilities/_module-exports.js";
7
7
  export type Collapse<TValue> = TValue extends Array<infer TItem> | Iterable<infer TItem> | ICollection<infer TItem> ? TItem : TValue;
@@ -46,7 +46,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
46
46
  * }
47
47
  * ```
48
48
  */
49
- filter<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
49
+ filter<TOutput extends TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
50
50
  /**
51
51
  * The <i>reject</i> method filters the collection using <i>predicateFn</i>, keeping only those items that not pass <i>predicateFn</i>.
52
52
  * @example
@@ -63,7 +63,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
63
63
  * }
64
64
  * ```
65
65
  */
66
- reject<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
66
+ reject<TOutput extends TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
67
67
  /**
68
68
  * The <i>map</i> method iterates through the collection and passes each item to <i>mapFn</i>.
69
69
  * The <i>mapFn</i> is free to modify the item and return it, thus forming a new collection of modified items.
@@ -201,7 +201,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
201
201
  * }
202
202
  * ```
203
203
  */
204
- change<TFilterOutput extends TInput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<TInput | TFilterOutput | TMapOutput>;
204
+ change<TFilterOutput extends TInput, TMapOutput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<TInput | TFilterOutput | TMapOutput>;
205
205
  /**
206
206
  * The <i>set</i> method changes a item by i>index</i> using <i>value</i>.
207
207
  * @example
@@ -400,7 +400,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
400
400
  * }
401
401
  * ```
402
402
  */
403
- percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
403
+ percentage(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): number;
404
404
  /**
405
405
  * The <i>some</i> method determines whether at least one item in the collection matches <i>predicateFn</i>.
406
406
  * @example
@@ -416,7 +416,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
416
416
  * }
417
417
  * ```
418
418
  */
419
- some<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
419
+ some<TOutput extends TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): boolean;
420
420
  /**
421
421
  * The <i>every</i> method determines whether all items in the collection matches <i>predicateFn</i>.
422
422
  * @example
@@ -432,7 +432,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
432
432
  * }
433
433
  * ```
434
434
  */
435
- every<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
435
+ every<TOutput extends TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): boolean;
436
436
  /**
437
437
  * The <i>take</i> method takes the first <i>limit</i> items.
438
438
  * @example
@@ -480,7 +480,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
480
480
  * }
481
481
  * ```
482
482
  */
483
- takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
483
+ takeUntil(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): ICollection<TInput>;
484
484
  /**
485
485
  * The <i>takeWhile</i> method takes items until <i>predicateFn</i> returns false.
486
486
  * @example
@@ -497,7 +497,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
497
497
  * }
498
498
  * ```
499
499
  */
500
- takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
500
+ takeWhile(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): ICollection<TInput>;
501
501
  /**
502
502
  * The <i>skip</i> method skips the first <i>offset</i> items.
503
503
  * @example
@@ -531,7 +531,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
531
531
  * }
532
532
  * ```
533
533
  */
534
- skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
534
+ skipUntil(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): ICollection<TInput>;
535
535
  /**
536
536
  * The <i>skipWhile</i> method skips items until <i>predicateFn</i> returns false.
537
537
  * @example
@@ -548,7 +548,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
548
548
  * }
549
549
  * ```
550
550
  */
551
- skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
551
+ skipWhile(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): ICollection<TInput>;
552
552
  /**
553
553
  * The <i>when</i> method will execute <i>callback</i> when <i>condition</i> evaluates to true.
554
554
  * @example
@@ -730,7 +730,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
730
730
  * }
731
731
  * ```
732
732
  */
733
- chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
733
+ chunkWhile(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
734
734
  /**
735
735
  * The <i>split</i> method breaks a collection evenly into <i>chunkAmount</i> of chunks.
736
736
  * @example
@@ -794,7 +794,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
794
794
  * }
795
795
  * ```
796
796
  */
797
- partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
797
+ partition(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
798
798
  /**
799
799
  * The <i>sliding</i> method returns a new collection of chunks representing a "sliding window" view of the items in the collection.
800
800
  * @example
@@ -1261,7 +1261,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1261
1261
  * }
1262
1262
  * ```
1263
1263
  */
1264
- insertBefore<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
1264
+ insertBefore<TExtended = TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
1265
1265
  /**
1266
1266
  * The <i>insertAfter</i> method adds <i>iterable</i> after the first item that matches <i>predicateFn</i>.
1267
1267
  * @example
@@ -1278,7 +1278,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1278
1278
  * }
1279
1279
  * ```
1280
1280
  */
1281
- insertAfter<TExtended = TInput>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
1281
+ insertAfter<TExtended = TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended>): ICollection<TInput | TExtended>;
1282
1282
  /**
1283
1283
  * The <i>crossJoin</i> method cross joins the collection's values among <i>iterables</i>, returning a Cartesian product with all possible permutations.
1284
1284
  * @example
@@ -1476,7 +1476,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1476
1476
  * ```
1477
1477
  * // 3
1478
1478
  */
1479
- first<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
1479
+ first<TOutput extends TInput>(predicateFn?: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput | null;
1480
1480
  /**
1481
1481
  * The <i>firstOr</i> method returns the first item in the collection that passes <i> predicateFn </i>
1482
1482
  * By default it will get the first item. If the collection is empty or no items passes <i> predicateFn </i> than <i> defaultValue </i>.
@@ -1529,7 +1529,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1529
1529
  * }
1530
1530
  * ```
1531
1531
  */
1532
- firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
1532
+ firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
1533
1533
  /**
1534
1534
  * The <i>firstOrFail</i> method returns the first item in the collection that passes <i> predicateFn </i>.
1535
1535
  * By default it will get the first item. If the collection is empty or no items passes <i> predicateFn </i> than error is thrown.
@@ -1571,7 +1571,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1571
1571
  * }
1572
1572
  * ```
1573
1573
  */
1574
- firstOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
1574
+ firstOrFail<TOutput extends TInput>(predicateFn?: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput;
1575
1575
  /**
1576
1576
  * The <i>last</i> method returns the last item in the collection that passes <i> predicateFn </i>.
1577
1577
  * By default it will get the last item. If the collection is empty or no items passes <i> predicateFn </i> than null i returned.
@@ -1612,7 +1612,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1612
1612
  * }
1613
1613
  * ```
1614
1614
  */
1615
- last<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | null;
1615
+ last<TOutput extends TInput>(predicateFn?: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput | null;
1616
1616
  /**
1617
1617
  * The <i>lastOr</i> method returns the last item in the collection that passes <i> predicateFn </i>.
1618
1618
  * By default it will get the last item. If the collection is empty or no items passes <i> predicateFn </i> than <i> defaultValue </i>.
@@ -1665,7 +1665,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1665
1665
  * }
1666
1666
  * ```
1667
1667
  */
1668
- lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
1668
+ lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn?: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
1669
1669
  /**
1670
1670
  * The <i>lastOrFail</i> method returns the last item in the collection that passes <i> predicateFn </i>.
1671
1671
  * By default it will get the last item. If the collection is empty or no items passes <i> predicateFn </i> than error is thrown.
@@ -1707,7 +1707,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1707
1707
  * }
1708
1708
  * ```
1709
1709
  */
1710
- lastOrFail<TOutput extends TInput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
1710
+ lastOrFail<TOutput extends TInput>(predicateFn?: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput;
1711
1711
  /**
1712
1712
  * The <i>before</i> method returns the item that comes before the first item that matches <i>predicateFn</i>.
1713
1713
  * If the <i>predicateFn</i> does not match or matches the first item then null is returned.
@@ -1736,7 +1736,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1736
1736
  * }
1737
1737
  * ```
1738
1738
  */
1739
- before(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
1739
+ before(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): TInput | null;
1740
1740
  /**
1741
1741
  * The <i>beforeOr</i> method returns the item that comes before the first item that matches <i>predicateFn</i>.
1742
1742
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the first item then <i>defaultValue</i> is returned.
@@ -1777,7 +1777,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1777
1777
  * }
1778
1778
  * ```
1779
1779
  */
1780
- beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
1780
+ beforeOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): TInput | TExtended;
1781
1781
  /**
1782
1782
  * The <i>beforeOrFail</i> method returns the item that comes before the first item that matches <i>predicateFn</i>.
1783
1783
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the first item then an error is thrown.
@@ -1807,7 +1807,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1807
1807
  * }
1808
1808
  * ```
1809
1809
  */
1810
- beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
1810
+ beforeOrFail(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): TInput;
1811
1811
  /**
1812
1812
  * The <i>after</i> method returns the item that comes after the first item that matches <i>predicateFn</i>.
1813
1813
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then null is returned.
@@ -1836,7 +1836,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1836
1836
  * }
1837
1837
  * ```
1838
1838
  */
1839
- after(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | null;
1839
+ after(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): TInput | null;
1840
1840
  /**
1841
1841
  * The <i>afterOr</i> method returns the item that comes after the first item that matches <i>predicateFn</i>.
1842
1842
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then <i>defaultValue</i> is returned.
@@ -1877,7 +1877,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1877
1877
  * }
1878
1878
  * ```
1879
1879
  */
1880
- afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
1880
+ afterOr<TExtended = TInput>(defaultValue: Lazyable<TExtended>, predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): TInput | TExtended;
1881
1881
  /**
1882
1882
  * The <i>afterOrFail</i> method returns the item that comes after the first item that matches <i>predicateFn</i>.
1883
1883
  * If the collection is empty or the <i>predicateFn</i> does not match or matches the last item then an error is thrown.
@@ -1907,7 +1907,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1907
1907
  * }
1908
1908
  * ```
1909
1909
  */
1910
- afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
1910
+ afterOrFail(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): TInput;
1911
1911
  /**
1912
1912
  * The <i>sole</i> method returns the first item in the collection that passes <i>predicateFn</i>, but only if <i>predicateFn</i> matches exactly one item.
1913
1913
  * If no items matches or multiple items are found an error will be thrown.
@@ -1950,7 +1950,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1950
1950
  * }
1951
1951
  * ```
1952
1952
  */
1953
- sole<TOutput extends TInput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
1953
+ sole<TOutput extends TInput>(predicateFn: PredicateInvokable<TInput, ICollection<TInput>, TOutput>): TOutput;
1954
1954
  /**
1955
1955
  * The <i>nth</i> method creates a new collection consisting of every n-th item.
1956
1956
  * @example
@@ -1983,7 +1983,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
1983
1983
  * }
1984
1984
  * ```
1985
1985
  */
1986
- count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
1986
+ count(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): number;
1987
1987
  /**
1988
1988
  * The <i>size</i> returns the size of the collection.
1989
1989
  */
@@ -2011,7 +2011,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
2011
2011
  * }
2012
2012
  * ```
2013
2013
  */
2014
- searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
2014
+ searchFirst(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): number;
2015
2015
  /**
2016
2016
  * The <i>searchLast</i> return the index of the last item that matches <i>predicateFn</i>.
2017
2017
  * @example
@@ -2027,7 +2027,7 @@ export type ICollection<TInput = unknown> = Iterable<TInput> & ISerializable<TIn
2027
2027
  * }
2028
2028
  * ```
2029
2029
  */
2030
- searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
2030
+ searchLast(predicateFn: PredicateInvokable<TInput, ICollection<TInput>>): number;
2031
2031
  /**
2032
2032
  * The <i>forEach</i> method iterates through all items in the collection.
2033
2033
  */
@@ -59,7 +59,7 @@ export declare class EmptyCollectionError extends CollectionError {
59
59
  constructor(message: string, cause?: unknown);
60
60
  }
61
61
  /**
62
- * The <i>registerCollectionErrorsToSerde</i> function registers all <i>ICollection</i> and <i>IAsyncCollection</i> related errors with <i>IFlexibleSerde</i>, ensuring they will properly be serialized and deserialized.
62
+ * The <i>registerCollectionErrorsToSerde</i> function registers all <i>ICollection</i> related errors with <i>IFlexibleSerde</i>, ensuring they will properly be serialized and deserialized.
63
63
  *
64
64
  * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
65
65
  * @group Errors
@@ -94,7 +94,7 @@ export class EmptyCollectionError extends CollectionError {
94
94
  }
95
95
  }
96
96
  /**
97
- * The <i>registerCollectionErrorsToSerde</i> function registers all <i>ICollection</i> and <i>IAsyncCollection</i> related errors with <i>IFlexibleSerde</i>, ensuring they will properly be serialized and deserialized.
97
+ * The <i>registerCollectionErrorsToSerde</i> function registers all <i>ICollection</i> related errors with <i>IFlexibleSerde</i>, ensuring they will properly be serialized and deserialized.
98
98
  *
99
99
  * IMPORT_PATH: ```"@daiso-tech/core/collection/contracts"```
100
100
  * @group Errors
@@ -2,7 +2,7 @@
2
2
  * @module Collection
3
3
  */
4
4
  import {} from "../../../../collection/contracts/_module-exports.js";
5
- import {} from "../../../../utilities/_module-exports.js";
5
+ import { resolveInvokable, } from "../../../../utilities/_module-exports.js";
6
6
  /**
7
7
  * @internal
8
8
  */
@@ -21,7 +21,7 @@ export class AsyncChunkWhileIterable {
21
21
  if (index === 0) {
22
22
  array.push(item);
23
23
  }
24
- else if (await this.predicateFn(item, index, this.makeCollection(array))) {
24
+ else if (await resolveInvokable(this.predicateFn)(item, index, this.makeCollection(array))) {
25
25
  array.push(item);
26
26
  }
27
27
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"async-chunk-while-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAA2B,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAIpB;IACA;IAEA;IAJZ,YACY,UAAoC,EACpC,WAA6D,EAE7D,cAEqB;QALrB,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAAkD;QAE7D,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACd,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;iBAAM,IACH,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EACjE,CAAC;gBACC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACJ,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACjC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBACjB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;QACL,CAAC;QACD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACJ"}
1
+ {"version":3,"file":"async-chunk-while-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACH,gBAAgB,GAEnB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAIpB;IACA;IAEA;IAJZ,YACY,UAAoC,EACpC,WAA6D,EAE7D,cAEqB;QALrB,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAAkD;QAE7D,mBAAc,GAAd,cAAc,CAEO;IAC9B,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACd,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;iBAAM,IACH,MAAM,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CACpC,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAC7B,EACH,CAAC;gBACC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACJ,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACjC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBACjB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;QACL,CAAC;QACD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACJ"}
@@ -2,6 +2,7 @@
2
2
  * @module Collection
3
3
  */
4
4
  import {} from "../../../../collection/contracts/_module-exports.js";
5
+ import { resolveInvokable } from "../../../../utilities/_module-exports.js";
5
6
  /**
6
7
  * @internal
7
8
  */
@@ -15,7 +16,7 @@ export class AsyncCountByIterable {
15
16
  async *[Symbol.asyncIterator]() {
16
17
  const map = new Map();
17
18
  for await (const [index, item] of this.collection.entries()) {
18
- const key = await this.callback(item, index, this.collection);
19
+ const key = await resolveInvokable(this.callback)(item, index, this.collection);
19
20
  if (!map.has(key)) {
20
21
  map.set(key, 0);
21
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"async-count-by-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AAEnD;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAIjB;IACA;IAFZ,YACY,UAAoC,EACpC,WAIJ,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B;QALhC,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAIwB;IACzC,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;QACvC,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACpB,CAAC;YACD,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACxB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;QACD,KAAK,CAAC,CAAC,GAAG,CAAC;IACf,CAAC;CACJ"}
1
+ {"version":3,"file":"async-count-by-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAIjB;IACA;IAFZ,YACY,UAAoC,EACpC,WAIJ,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B;QALhC,eAAU,GAAV,UAAU,CAA0B;QACpC,aAAQ,GAAR,QAAQ,CAIwB;IACzC,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;QACvC,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAC7C,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,UAAU,CAClB,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACpB,CAAC;YACD,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACxB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;QACD,KAAK,CAAC,CAAC,GAAG,CAAC;IACf,CAAC;CACJ"}
@@ -2,6 +2,7 @@
2
2
  * @module Collection
3
3
  */
4
4
  import {} from "../../../../collection/contracts/_module-exports.js";
5
+ import { resolveInvokable } from "../../../../utilities/_module-exports.js";
5
6
  /**
6
7
  * @internal
7
8
  */
@@ -14,7 +15,7 @@ export class AsyncFilterIterable {
14
15
  }
15
16
  async *[Symbol.asyncIterator]() {
16
17
  for await (const [index, item] of this.collection.entries()) {
17
- if (await this.predicateFn(item, index, this.collection)) {
18
+ if (await resolveInvokable(this.predicateFn)(item, index, this.collection)) {
18
19
  yield item;
19
20
  }
20
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"async-filter-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AAEnD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAIhB;IACA;IAFZ,YACY,UAAoC,EACpC,WAIP;QALO,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAIlB;IACF,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvD,MAAM,IAAe,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
1
+ {"version":3,"file":"async-filter-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAIhB;IACA;IAFZ,YACY,UAAoC,EACpC,WAIP;QALO,eAAU,GAAV,UAAU,CAA0B;QACpC,gBAAW,GAAX,WAAW,CAIlB;IACF,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,IACI,MAAM,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CACpC,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,UAAU,CAClB,EACH,CAAC;gBACC,MAAM,IAAe,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -2,6 +2,7 @@
2
2
  * @module Collection
3
3
  */
4
4
  import {} from "../../../../collection/contracts/_module-exports.js";
5
+ import { resolveInvokable } from "../../../../utilities/_module-exports.js";
5
6
  /**
6
7
  * @internal
7
8
  */
@@ -14,7 +15,7 @@ export class AsyncFlatMapIterable {
14
15
  }
15
16
  async *[Symbol.asyncIterator]() {
16
17
  for await (const [index, item] of this.collection.entries()) {
17
- yield* await this.mapFn(item, index, this.collection);
18
+ yield* await resolveInvokable(this.mapFn)(item, index, this.collection);
18
19
  }
19
20
  }
20
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"async-flat-map-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AAEnD;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAIjB;IACA;IAFZ,YACY,UAAoC,EACpC,KAIP;QALO,eAAU,GAAV,UAAU,CAA0B;QACpC,UAAK,GAAL,KAAK,CAIZ;IACF,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC;CACJ"}
1
+ {"version":3,"file":"async-flat-map-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGN,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAIjB;IACA;IAFZ,YACY,UAAoC,EACpC,KAIP;QALO,eAAU,GAAV,UAAU,CAA0B;QACpC,UAAK,GAAL,KAAK,CAIZ;IACF,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,IAAI,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,KAAK,CAAC,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CACrC,IAAI,EACJ,KAAK,EACL,IAAI,CAAC,UAAU,CAClB,CAAC;QACN,CAAC;IACL,CAAC;CACJ"}
@@ -2,7 +2,7 @@
2
2
  * @module Collection
3
3
  */
4
4
  import {} from "../../../../collection/contracts/_module-exports.js";
5
- import {} from "../../../../utilities/_module-exports.js";
5
+ import { resolveInvokable, } from "../../../../utilities/_module-exports.js";
6
6
  /**
7
7
  * @internal
8
8
  */
@@ -18,7 +18,7 @@ export class AsyncGroupByIterable {
18
18
  async *[Symbol.asyncIterator]() {
19
19
  const map = new Map();
20
20
  for await (const [index, item] of this.collection.entries()) {
21
- const key = await this.selectFn(item, index, this.collection);
21
+ const key = await resolveInvokable(this.selectFn)(item, index, this.collection);
22
22
  let array = map.get(key);
23
23
  if (array === undefined) {
24
24
  array = [];