@daiso-tech/core 0.1.1 → 0.1.2

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 (196) hide show
  1. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js +3 -12
  2. package/dist/cjs/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  3. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js +7 -1
  4. package/dist/cjs/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +1 -1
  5. package/dist/cjs/collection/iterable-collection/iterable-collection.js +3 -12
  6. package/dist/cjs/collection/iterable-collection/iterable-collection.js.map +1 -1
  7. package/dist/cjs/collection/list-collection/list-collection.js +3 -3
  8. package/dist/cjs/collection/list-collection/list-collection.js.map +1 -1
  9. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js +3 -12
  10. package/dist/esm/collection/async-iterable-collection/async-iterable-collection.js.map +1 -1
  11. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js +7 -1
  12. package/dist/esm/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.js.map +1 -1
  13. package/dist/esm/collection/iterable-collection/iterable-collection.js +3 -12
  14. package/dist/esm/collection/iterable-collection/iterable-collection.js.map +1 -1
  15. package/dist/esm/collection/list-collection/list-collection.js +3 -3
  16. package/dist/esm/collection/list-collection/list-collection.js.map +1 -1
  17. package/dist/types/collection/async-iterable-collection/async-iterable-collection.d.ts +3 -3
  18. package/dist/types/collection/iterable-collection/iterable-collection.d.ts +2 -2
  19. package/dist/types/collection/list-collection/list-collection.d.ts +3 -3
  20. package/dist/types/contracts/collection/async-collection.contract.d.ts +29 -4
  21. package/dist/types/contracts/collection/collection.contract.d.ts +2 -4
  22. package/package.json +4 -1
  23. package/.changeset/README.md +0 -8
  24. package/.changeset/config.json +0 -11
  25. package/.eslintignore +0 -3
  26. package/.eslintrc.json +0 -50
  27. package/.gitattributes +0 -6
  28. package/.github/workflows/main.yaml +0 -54
  29. package/.github/workflows/release.yaml +0 -31
  30. package/.prettierignore +0 -4
  31. package/.prettierrc.json +0 -4
  32. package/.vscode/settings.json +0 -46
  33. package/CHANGELOG.md +0 -13
  34. package/docs-api/.nojekyll +0 -1
  35. package/docs-api/assets/highlight.css +0 -92
  36. package/docs-api/assets/icons.js +0 -18
  37. package/docs-api/assets/icons.svg +0 -1
  38. package/docs-api/assets/main.js +0 -60
  39. package/docs-api/assets/navigation.js +0 -1
  40. package/docs-api/assets/search.js +0 -1
  41. package/docs-api/assets/style.css +0 -1448
  42. package/docs-api/classes/AsyncIterableCollection.html +0 -437
  43. package/docs-api/classes/CollectionError.html +0 -12
  44. package/docs-api/classes/IndexOverflowError.html +0 -12
  45. package/docs-api/classes/ItemNotFoundError.html +0 -12
  46. package/docs-api/classes/IterableCollection.html +0 -434
  47. package/docs-api/classes/ListCollection.html +0 -434
  48. package/docs-api/classes/MultipleItemsFoundError.html +0 -12
  49. package/docs-api/classes/UnexpectedCollectionError.html +0 -12
  50. package/docs-api/functions/isAsyncIterable.html +0 -1
  51. package/docs-api/functions/isIterable.html +0 -1
  52. package/docs-api/functions/range.html +0 -4
  53. package/docs-api/hierarchy.html +0 -1
  54. package/docs-api/index.html +0 -1
  55. package/docs-api/modules.html +0 -60
  56. package/docs-api/types/AsyncCollapse.html +0 -1
  57. package/docs-api/types/AsyncFilter.html +0 -1
  58. package/docs-api/types/AsyncFilter_.html +0 -1
  59. package/docs-api/types/AsyncFindOrSettings.html +0 -1
  60. package/docs-api/types/AsyncFindSettings.html +0 -1
  61. package/docs-api/types/AsyncForEach.html +0 -1
  62. package/docs-api/types/AsyncForEach_.html +0 -1
  63. package/docs-api/types/AsyncGroupBySettings.html +0 -1
  64. package/docs-api/types/AsyncIterableValue.html +0 -1
  65. package/docs-api/types/AsyncLazyable.html +0 -1
  66. package/docs-api/types/AsyncLazyable_.html +0 -1
  67. package/docs-api/types/AsyncMap.html +0 -1
  68. package/docs-api/types/AsyncMap_.html +0 -1
  69. package/docs-api/types/AsyncModifier.html +0 -1
  70. package/docs-api/types/AsyncModifier_.html +0 -1
  71. package/docs-api/types/AsyncReduce.html +0 -1
  72. package/docs-api/types/AsyncReduceSettings.html +0 -1
  73. package/docs-api/types/AsyncReduce_.html +0 -1
  74. package/docs-api/types/AsyncTap.html +0 -1
  75. package/docs-api/types/AsyncTap_.html +0 -1
  76. package/docs-api/types/AsyncTransform.html +0 -1
  77. package/docs-api/types/AsyncTransform_.html +0 -1
  78. package/docs-api/types/Collapse.html +0 -1
  79. package/docs-api/types/Comparator.html +0 -1
  80. package/docs-api/types/EnsureType.html +0 -1
  81. package/docs-api/types/Filter.html +0 -1
  82. package/docs-api/types/FilterGuard.html +0 -1
  83. package/docs-api/types/Filter_.html +0 -1
  84. package/docs-api/types/FindOrSettings.html +0 -1
  85. package/docs-api/types/FindSettings.html +0 -1
  86. package/docs-api/types/ForEach.html +0 -1
  87. package/docs-api/types/GroupBySettings.html +0 -1
  88. package/docs-api/types/IAsyncCollection.html +0 -357
  89. package/docs-api/types/ICollection.html +0 -357
  90. package/docs-api/types/JoinSettings.html +0 -1
  91. package/docs-api/types/Lazyable.html +0 -1
  92. package/docs-api/types/Map.html +0 -1
  93. package/docs-api/types/Modifier.html +0 -1
  94. package/docs-api/types/PageSettings.html +0 -1
  95. package/docs-api/types/RecordItem.html +0 -1
  96. package/docs-api/types/Reduce.html +0 -1
  97. package/docs-api/types/ReduceSettings.html +0 -1
  98. package/docs-api/types/ReverseSettings.html +0 -1
  99. package/docs-api/types/SliceSettings.html +0 -1
  100. package/docs-api/types/SlidingSettings.html +0 -1
  101. package/docs-api/types/Tap.html +0 -1
  102. package/docs-api/types/Transform.html +0 -1
  103. package/docs-api/types/UpdatedItem.html +0 -1
  104. package/src/_module.ts +0 -2
  105. package/src/collection/_module.ts +0 -4
  106. package/src/collection/_shared.ts +0 -45
  107. package/src/collection/async-iterable-collection/_module.ts +0 -1
  108. package/src/collection/async-iterable-collection/async-iterable-collection.test.ts +0 -3195
  109. package/src/collection/async-iterable-collection/async-iterable-collection.ts +0 -1276
  110. package/src/collection/async-iterable-collection/async-iterable-helpers/_module.ts +0 -35
  111. package/src/collection/async-iterable-collection/async-iterable-helpers/async-abort-iterable.ts +0 -25
  112. package/src/collection/async-iterable-collection/async-iterable-helpers/async-chunk-iterable.ts +0 -57
  113. package/src/collection/async-iterable-collection/async-iterable-helpers/async-chunk-whilte-iterable.ts +0 -54
  114. package/src/collection/async-iterable-collection/async-iterable-helpers/async-collapse-iterable.ts +0 -40
  115. package/src/collection/async-iterable-collection/async-iterable-helpers/async-count-by-iterable.ts +0 -58
  116. package/src/collection/async-iterable-collection/async-iterable-helpers/async-cross-join-iterable.ts +0 -69
  117. package/src/collection/async-iterable-collection/async-iterable-helpers/async-delay-iterable.ts +0 -19
  118. package/src/collection/async-iterable-collection/async-iterable-helpers/async-entries-iterable.ts +0 -28
  119. package/src/collection/async-iterable-collection/async-iterable-helpers/async-filter-iterable.ts +0 -42
  120. package/src/collection/async-iterable-collection/async-iterable-helpers/async-flat-map-iterable.ts +0 -44
  121. package/src/collection/async-iterable-collection/async-iterable-helpers/async-group-by-iterable.ts +0 -48
  122. package/src/collection/async-iterable-collection/async-iterable-helpers/async-insert-after-iterable.ts +0 -57
  123. package/src/collection/async-iterable-collection/async-iterable-helpers/async-insert-before-iterable.ts +0 -57
  124. package/src/collection/async-iterable-collection/async-iterable-helpers/async-map-iterable.ts +0 -40
  125. package/src/collection/async-iterable-collection/async-iterable-helpers/async-merge-iterable.ts +0 -35
  126. package/src/collection/async-iterable-collection/async-iterable-helpers/async-pad-end-iterable.ts +0 -41
  127. package/src/collection/async-iterable-collection/async-iterable-helpers/async-pad-start-iterable.ts +0 -41
  128. package/src/collection/async-iterable-collection/async-iterable-helpers/async-partion-iterable.ts +0 -63
  129. package/src/collection/async-iterable-collection/async-iterable-helpers/async-repeat-iterable.ts +0 -40
  130. package/src/collection/async-iterable-collection/async-iterable-helpers/async-reverse-iterable.ts +0 -35
  131. package/src/collection/async-iterable-collection/async-iterable-helpers/async-shuffle-iterable.ts +0 -23
  132. package/src/collection/async-iterable-collection/async-iterable-helpers/async-skip-iterable.ts +0 -41
  133. package/src/collection/async-iterable-collection/async-iterable-helpers/async-skip-until-iterable.ts +0 -55
  134. package/src/collection/async-iterable-collection/async-iterable-helpers/async-slice-iterable.ts +0 -33
  135. package/src/collection/async-iterable-collection/async-iterable-helpers/async-sliding-iterable.ts +0 -54
  136. package/src/collection/async-iterable-collection/async-iterable-helpers/async-sort-iterable.ts +0 -18
  137. package/src/collection/async-iterable-collection/async-iterable-helpers/async-split-iterable.ts +0 -64
  138. package/src/collection/async-iterable-collection/async-iterable-helpers/async-take-iterable.ts +0 -41
  139. package/src/collection/async-iterable-collection/async-iterable-helpers/async-take-until-iterable.ts +0 -41
  140. package/src/collection/async-iterable-collection/async-iterable-helpers/async-tap-iterable.ts +0 -34
  141. package/src/collection/async-iterable-collection/async-iterable-helpers/async-timeout-iterable.ts +0 -20
  142. package/src/collection/async-iterable-collection/async-iterable-helpers/async-unique-iterable.ts +0 -49
  143. package/src/collection/async-iterable-collection/async-iterable-helpers/async-update-iterable.ts +0 -64
  144. package/src/collection/async-iterable-collection/async-iterable-helpers/async-when-iterable.ts +0 -43
  145. package/src/collection/async-iterable-collection/async-iterable-helpers/async-zip-iterable.ts +0 -45
  146. package/src/collection/iterable-collection/_module.ts +0 -1
  147. package/src/collection/iterable-collection/iterable-collection.test.ts +0 -2379
  148. package/src/collection/iterable-collection/iterable-collection.ts +0 -1317
  149. package/src/collection/iterable-collection/iterable-helpers/_module.ts +0 -32
  150. package/src/collection/iterable-collection/iterable-helpers/chunk-iterable.ts +0 -49
  151. package/src/collection/iterable-collection/iterable-helpers/chunk-whilte-iterable.ts +0 -51
  152. package/src/collection/iterable-collection/iterable-helpers/collapse-iterable.ts +0 -35
  153. package/src/collection/iterable-collection/iterable-helpers/count-by-iterable.ts +0 -49
  154. package/src/collection/iterable-collection/iterable-helpers/cross-join-iterable.ts +0 -57
  155. package/src/collection/iterable-collection/iterable-helpers/entries-iterable.ts +0 -42
  156. package/src/collection/iterable-collection/iterable-helpers/filter-iterable.ts +0 -39
  157. package/src/collection/iterable-collection/iterable-helpers/flat-map-iterable.ts +0 -35
  158. package/src/collection/iterable-collection/iterable-helpers/group-by-iterable.ts +0 -52
  159. package/src/collection/iterable-collection/iterable-helpers/insert-after-iterable.ts +0 -43
  160. package/src/collection/iterable-collection/iterable-helpers/insert-before-iterable.ts +0 -43
  161. package/src/collection/iterable-collection/iterable-helpers/map-iterable.ts +0 -35
  162. package/src/collection/iterable-collection/iterable-helpers/merge-iterable.ts +0 -31
  163. package/src/collection/iterable-collection/iterable-helpers/pad-end-iterable.ts +0 -52
  164. package/src/collection/iterable-collection/iterable-helpers/pad-start-iterable.ts +0 -52
  165. package/src/collection/iterable-collection/iterable-helpers/partion-iterable.ts +0 -46
  166. package/src/collection/iterable-collection/iterable-helpers/repeat-iterable.ts +0 -36
  167. package/src/collection/iterable-collection/iterable-helpers/reverse-iterable.ts +0 -46
  168. package/src/collection/iterable-collection/iterable-helpers/shuffle-iterable.ts +0 -36
  169. package/src/collection/iterable-collection/iterable-helpers/skip-iterable.ts +0 -37
  170. package/src/collection/iterable-collection/iterable-helpers/skip-until-iterable.ts +0 -41
  171. package/src/collection/iterable-collection/iterable-helpers/slice-iterable.ts +0 -47
  172. package/src/collection/iterable-collection/iterable-helpers/sliding-iterable.ts +0 -49
  173. package/src/collection/iterable-collection/iterable-helpers/sort-iterable.ts +0 -29
  174. package/src/collection/iterable-collection/iterable-helpers/split-iterable.ts +0 -58
  175. package/src/collection/iterable-collection/iterable-helpers/take-iterable.ts +0 -37
  176. package/src/collection/iterable-collection/iterable-helpers/take-until-iterable.ts +0 -38
  177. package/src/collection/iterable-collection/iterable-helpers/tap-iterable.ts +0 -31
  178. package/src/collection/iterable-collection/iterable-helpers/unique-iterable.ts +0 -43
  179. package/src/collection/iterable-collection/iterable-helpers/update-iterable.ts +0 -50
  180. package/src/collection/iterable-collection/iterable-helpers/when-iterable.ts +0 -37
  181. package/src/collection/iterable-collection/iterable-helpers/zip-iterable.ts +0 -41
  182. package/src/collection/list-collection/_module.ts +0 -1
  183. package/src/collection/list-collection/list-collection.test.ts +0 -2280
  184. package/src/collection/list-collection/list-collection.ts +0 -1883
  185. package/src/contracts/_module.ts +0 -1
  186. package/src/contracts/collection/_module.ts +0 -3
  187. package/src/contracts/collection/_shared.ts +0 -346
  188. package/src/contracts/collection/async-collection.contract.ts +0 -1028
  189. package/src/contracts/collection/collection.contract.ts +0 -978
  190. package/src/types.ts +0 -2
  191. package/tsconfig.base.json +0 -31
  192. package/tsconfig.cjs.json +0 -12
  193. package/tsconfig.esm.json +0 -12
  194. package/tsconfig.json +0 -10
  195. package/tsconfig.types.json +0 -12
  196. package/vite.config.ts +0 -6
@@ -1,37 +0,0 @@
1
- import {
2
- CollectionError,
3
- type ICollection,
4
- type Modifier,
5
- UnexpectedCollectionError,
6
- } from "@/contracts/collection/_module";
7
-
8
- export class WhenIterable<TInput, TExtended>
9
- implements Iterable<TInput | TExtended>
10
- {
11
- constructor(
12
- private collection: ICollection<TInput>,
13
- private condition: () => boolean,
14
- private callback: Modifier<ICollection<TInput>, ICollection<TExtended>>,
15
- ) {}
16
-
17
- *[Symbol.iterator](): Iterator<TInput | TExtended> {
18
- try {
19
- if (this.condition()) {
20
- yield* this.callback(this.collection);
21
- return;
22
- }
23
- yield* this.collection as ICollection<TInput | TExtended>;
24
- } catch (error: unknown) {
25
- if (
26
- error instanceof CollectionError ||
27
- error instanceof TypeError
28
- ) {
29
- throw error;
30
- }
31
- throw new UnexpectedCollectionError(
32
- `Unexpected error "${String(error)}" occured`,
33
- error,
34
- );
35
- }
36
- }
37
- }
@@ -1,41 +0,0 @@
1
- import {
2
- CollectionError,
3
- UnexpectedCollectionError,
4
- type RecordItem,
5
- } from "@/contracts/collection/_module";
6
-
7
- export class ZipIterable<TInput, TExtended>
8
- implements Iterable<RecordItem<TInput, TExtended>>
9
- {
10
- constructor(
11
- private iterableA: Iterable<TInput>,
12
- private iterableB: Iterable<TExtended>,
13
- ) {}
14
-
15
- *[Symbol.iterator](): Iterator<RecordItem<TInput, TExtended>> {
16
- try {
17
- const iteratorA = this.iterableA[Symbol.iterator](),
18
- iteratorB = this.iterableB[Symbol.iterator]();
19
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
20
- while (true) {
21
- const itemA = iteratorA.next(),
22
- itemB = iteratorB.next();
23
- if (itemA.done || itemB.done) {
24
- break;
25
- }
26
- yield [itemA.value, itemB.value];
27
- }
28
- } catch (error: unknown) {
29
- if (
30
- error instanceof CollectionError ||
31
- error instanceof TypeError
32
- ) {
33
- throw error;
34
- }
35
- throw new UnexpectedCollectionError(
36
- `Unexpected error "${String(error)}" occured`,
37
- error,
38
- );
39
- }
40
- }
41
- }
@@ -1 +0,0 @@
1
- export * from "@/collection/list-collection/list-collection";