@daiso-tech/core 0.7.0 → 0.8.1

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 (559) hide show
  1. package/dist/cjs/_module.js +2 -0
  2. package/dist/cjs/_module.js.map +1 -1
  3. package/dist/cjs/_shared/utilities.js +9 -0
  4. package/dist/cjs/_shared/utilities.js.map +1 -1
  5. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
  6. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
  7. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
  8. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  9. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  10. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
  11. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -1
  12. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  13. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  14. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
  15. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  16. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  17. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  18. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  19. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
  20. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
  21. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  22. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
  23. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
  24. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
  25. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
  26. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  27. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
  28. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
  29. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -1
  30. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
  31. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
  32. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  33. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  34. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  35. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  36. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  37. package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
  38. package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  39. package/dist/cjs/collection/implementations/iterable-collection/_shared/chunk-iterable.js.map +1 -1
  40. package/dist/cjs/collection/implementations/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
  41. package/dist/cjs/collection/implementations/iterable-collection/_shared/collapse-iterable.js.map +1 -1
  42. package/dist/cjs/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  43. package/dist/cjs/collection/implementations/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  44. package/dist/cjs/collection/implementations/iterable-collection/_shared/entries-iterable.js.map +1 -1
  45. package/dist/cjs/collection/implementations/iterable-collection/_shared/filter-iterable.js.map +1 -1
  46. package/dist/cjs/collection/implementations/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  47. package/dist/cjs/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  48. package/dist/cjs/collection/implementations/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  49. package/dist/cjs/collection/implementations/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  50. package/dist/cjs/collection/implementations/iterable-collection/_shared/map-iterable.js.map +1 -1
  51. package/dist/cjs/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
  52. package/dist/cjs/collection/implementations/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
  53. package/dist/cjs/collection/implementations/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
  54. package/dist/cjs/collection/implementations/iterable-collection/_shared/partion-iterable.js.map +1 -1
  55. package/dist/cjs/collection/implementations/iterable-collection/_shared/repeat-iterable.js.map +1 -1
  56. package/dist/cjs/collection/implementations/iterable-collection/_shared/reverse-iterable.js.map +1 -1
  57. package/dist/cjs/collection/implementations/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
  58. package/dist/cjs/collection/implementations/iterable-collection/_shared/skip-iterable.js.map +1 -1
  59. package/dist/cjs/collection/implementations/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  60. package/dist/cjs/collection/implementations/iterable-collection/_shared/slice-iterable.js.map +1 -1
  61. package/dist/cjs/collection/implementations/iterable-collection/_shared/sliding-iterable.js.map +1 -1
  62. package/dist/cjs/collection/implementations/iterable-collection/_shared/sort-iterable.js.map +1 -1
  63. package/dist/cjs/collection/implementations/iterable-collection/_shared/split-iterable.js.map +1 -1
  64. package/dist/cjs/collection/implementations/iterable-collection/_shared/take-iterable.js.map +1 -1
  65. package/dist/cjs/collection/implementations/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  66. package/dist/cjs/collection/implementations/iterable-collection/_shared/tap-iterable.js.map +1 -1
  67. package/dist/cjs/collection/implementations/iterable-collection/_shared/unique-iterable.js.map +1 -1
  68. package/dist/cjs/collection/implementations/iterable-collection/_shared/update-iterable.js.map +1 -1
  69. package/dist/cjs/collection/implementations/iterable-collection/_shared/when-iterable.js.map +1 -1
  70. package/dist/cjs/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
  71. package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  72. package/dist/cjs/collection/implementations/list-collection/list-collection.js +2 -1
  73. package/dist/cjs/collection/implementations/list-collection/list-collection.js.map +1 -1
  74. package/dist/cjs/{utilities/async/backof-policies/exponential-backoff-policy → event-bus/contracts}/_module.js +4 -1
  75. package/dist/cjs/event-bus/contracts/_module.js.map +1 -0
  76. package/dist/cjs/event-bus/contracts/_shared.js +39 -0
  77. package/dist/cjs/event-bus/contracts/_shared.js.map +1 -0
  78. package/dist/cjs/event-bus/contracts/event-bus-adapter.contract.js +3 -0
  79. package/dist/cjs/event-bus/contracts/event-bus-adapter.contract.js.map +1 -0
  80. package/dist/cjs/event-bus/contracts/event-bus-manager.contract.js +3 -0
  81. package/dist/cjs/event-bus/contracts/event-bus-manager.contract.js.map +1 -0
  82. package/dist/cjs/event-bus/contracts/event-bus.contract.js +3 -0
  83. package/dist/cjs/event-bus/contracts/event-bus.contract.js.map +1 -0
  84. package/dist/cjs/{serializer → event-bus/implementations}/_module.js +5 -5
  85. package/dist/cjs/event-bus/implementations/_module.js.map +1 -0
  86. package/dist/cjs/event-bus/implementations/_shared/test-utilities/_module.js +18 -0
  87. package/dist/cjs/event-bus/implementations/_shared/test-utilities/_module.js.map +1 -0
  88. package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js +51 -0
  89. package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +1 -0
  90. package/dist/cjs/event-bus/implementations/event-bus/_module.js +19 -0
  91. package/dist/cjs/event-bus/implementations/event-bus/_module.js.map +1 -0
  92. package/dist/cjs/event-bus/implementations/event-bus/event-bus-manager.js +31 -0
  93. package/dist/cjs/event-bus/implementations/event-bus/event-bus-manager.js.map +1 -0
  94. package/dist/cjs/event-bus/implementations/event-bus/event-bus.js +104 -0
  95. package/dist/cjs/event-bus/implementations/event-bus/event-bus.js.map +1 -0
  96. package/dist/cjs/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js +41 -0
  97. package/dist/cjs/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js.map +1 -0
  98. package/dist/cjs/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js +35 -0
  99. package/dist/cjs/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js.map +1 -0
  100. package/dist/cjs/{utilities/async-iterable/timeout-iterable → event-bus/implementations/memory-event-bus-adapter}/_module.js +1 -1
  101. package/dist/cjs/event-bus/implementations/memory-event-bus-adapter/_module.js.map +1 -0
  102. package/dist/cjs/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js +23 -0
  103. package/dist/cjs/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -0
  104. package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/_module.js +18 -0
  105. package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/_module.js.map +1 -0
  106. package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js +16 -0
  107. package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -0
  108. package/dist/cjs/{utilities/async-iterable/abortable-iterable → event-bus/implementations/redis-event-bus-adapter}/_module.js +1 -1
  109. package/dist/cjs/event-bus/implementations/redis-event-bus-adapter/_module.js.map +1 -0
  110. package/dist/cjs/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js +45 -0
  111. package/dist/cjs/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js.map +1 -0
  112. package/dist/cjs/storage/contracts/_module.js +2 -0
  113. package/dist/cjs/storage/contracts/_module.js.map +1 -1
  114. package/dist/cjs/storage/contracts/storage-events.contract.js +14 -0
  115. package/dist/cjs/storage/contracts/storage-events.contract.js.map +1 -0
  116. package/dist/cjs/storage/contracts/storage-manager.contract.js +3 -0
  117. package/dist/cjs/storage/contracts/storage-manager.contract.js.map +1 -0
  118. package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js +294 -6
  119. package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js.map +1 -1
  120. package/dist/cjs/storage/implementations/storage/_module.js +1 -0
  121. package/dist/cjs/storage/implementations/storage/_module.js.map +1 -1
  122. package/dist/cjs/storage/implementations/storage/storage-manager.js +34 -0
  123. package/dist/cjs/storage/implementations/storage/storage-manager.js.map +1 -0
  124. package/dist/cjs/storage/implementations/storage/storage.js +67 -21
  125. package/dist/cjs/storage/implementations/storage/storage.js.map +1 -1
  126. package/dist/cjs/storage/implementations/storage/with-event-storage-adapter.js +255 -0
  127. package/dist/cjs/storage/implementations/storage/with-event-storage-adapter.js.map +1 -0
  128. package/dist/cjs/storage/implementations/storage/with-namespace-storage-adapter.js +0 -3
  129. package/dist/cjs/storage/implementations/storage/with-namespace-storage-adapter.js.map +1 -1
  130. package/dist/cjs/storage/implementations/storage/with-validation-storage-adapter.js.map +1 -1
  131. package/dist/cjs/utilities/_module.js +1 -2
  132. package/dist/cjs/utilities/_module.js.map +1 -1
  133. package/dist/cjs/utilities/async/_module.js +6 -1
  134. package/dist/cjs/utilities/async/_module.js.map +1 -1
  135. package/dist/cjs/utilities/{async-iterable/retry-iterable → async/abortable-iterable}/_module.js +1 -1
  136. package/dist/cjs/utilities/async/abortable-iterable/_module.js.map +1 -0
  137. package/dist/cjs/utilities/async/abortable-iterable/abortable-iterable.js.map +1 -0
  138. package/dist/cjs/utilities/{async-iterable → async}/delay-iterable/_module.js +1 -1
  139. package/dist/cjs/utilities/async/delay-iterable/_module.js.map +1 -0
  140. package/dist/cjs/utilities/async/delay-iterable/delay-iterable.js.map +1 -0
  141. package/dist/cjs/utilities/async/retry/retry.js +1 -1
  142. package/dist/cjs/utilities/async/retry/retry.js.map +1 -1
  143. package/dist/cjs/utilities/async/retry-iterable/_module.js +18 -0
  144. package/dist/cjs/utilities/async/retry-iterable/_module.js.map +1 -0
  145. package/dist/cjs/utilities/async/retry-iterable/retry-iterable.js.map +1 -0
  146. package/dist/cjs/utilities/async/timeout-iterable/_module.js +18 -0
  147. package/dist/cjs/utilities/async/timeout-iterable/_module.js.map +1 -0
  148. package/dist/cjs/utilities/{async-iterable → async}/timeout-iterable/timeout-iterable.js +1 -1
  149. package/dist/cjs/utilities/async/timeout-iterable/timeout-iterable.js.map +1 -0
  150. package/dist/cjs/utilities/backof-policies/_module.js +21 -0
  151. package/dist/cjs/utilities/backof-policies/_module.js.map +1 -0
  152. package/dist/cjs/utilities/backof-policies/_shared.js.map +1 -0
  153. package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js +18 -0
  154. package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js.map +1 -0
  155. package/dist/cjs/utilities/{async/backof-policies → backof-policies}/constant-backoff-policy/constant-backoff-policy.js +2 -2
  156. package/dist/cjs/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
  157. package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js +18 -0
  158. package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
  159. package/dist/cjs/utilities/{async/backof-policies → backof-policies}/exponential-backoff-policy/exponential-backoff-policy.js +2 -2
  160. package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
  161. package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js +18 -0
  162. package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js.map +1 -0
  163. package/dist/cjs/utilities/{async/backof-policies → backof-policies}/linear-backoff-policy/linear-backoff-policy.js +2 -2
  164. package/dist/cjs/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
  165. package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js +18 -0
  166. package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
  167. package/dist/cjs/utilities/{async/backof-policies → backof-policies}/polynomial-backoff-policy/polynomial-backoff-policy.js +2 -2
  168. package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
  169. package/dist/cjs/utilities/time-span/time-span.js.map +1 -1
  170. package/dist/cjs/utilities/validation/_module.js.map +1 -1
  171. package/dist/esm/_module.js +2 -0
  172. package/dist/esm/_module.js.map +1 -1
  173. package/dist/esm/_shared/utilities.js +7 -0
  174. package/dist/esm/_shared/utilities.js.map +1 -1
  175. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
  176. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
  177. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
  178. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
  179. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  180. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
  181. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -1
  182. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
  183. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
  184. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
  185. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
  186. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
  187. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
  188. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
  189. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
  190. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
  191. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
  192. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
  193. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
  194. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
  195. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
  196. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
  197. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
  198. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
  199. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -1
  200. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
  201. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
  202. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
  203. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
  204. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
  205. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
  206. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
  207. package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
  208. package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  209. package/dist/esm/collection/implementations/iterable-collection/_shared/chunk-iterable.js.map +1 -1
  210. package/dist/esm/collection/implementations/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
  211. package/dist/esm/collection/implementations/iterable-collection/_shared/collapse-iterable.js.map +1 -1
  212. package/dist/esm/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
  213. package/dist/esm/collection/implementations/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  214. package/dist/esm/collection/implementations/iterable-collection/_shared/entries-iterable.js.map +1 -1
  215. package/dist/esm/collection/implementations/iterable-collection/_shared/filter-iterable.js.map +1 -1
  216. package/dist/esm/collection/implementations/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
  217. package/dist/esm/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
  218. package/dist/esm/collection/implementations/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
  219. package/dist/esm/collection/implementations/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
  220. package/dist/esm/collection/implementations/iterable-collection/_shared/map-iterable.js.map +1 -1
  221. package/dist/esm/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
  222. package/dist/esm/collection/implementations/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
  223. package/dist/esm/collection/implementations/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
  224. package/dist/esm/collection/implementations/iterable-collection/_shared/partion-iterable.js.map +1 -1
  225. package/dist/esm/collection/implementations/iterable-collection/_shared/repeat-iterable.js.map +1 -1
  226. package/dist/esm/collection/implementations/iterable-collection/_shared/reverse-iterable.js.map +1 -1
  227. package/dist/esm/collection/implementations/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
  228. package/dist/esm/collection/implementations/iterable-collection/_shared/skip-iterable.js.map +1 -1
  229. package/dist/esm/collection/implementations/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
  230. package/dist/esm/collection/implementations/iterable-collection/_shared/slice-iterable.js.map +1 -1
  231. package/dist/esm/collection/implementations/iterable-collection/_shared/sliding-iterable.js.map +1 -1
  232. package/dist/esm/collection/implementations/iterable-collection/_shared/sort-iterable.js.map +1 -1
  233. package/dist/esm/collection/implementations/iterable-collection/_shared/split-iterable.js.map +1 -1
  234. package/dist/esm/collection/implementations/iterable-collection/_shared/take-iterable.js.map +1 -1
  235. package/dist/esm/collection/implementations/iterable-collection/_shared/take-until-iterable.js.map +1 -1
  236. package/dist/esm/collection/implementations/iterable-collection/_shared/tap-iterable.js.map +1 -1
  237. package/dist/esm/collection/implementations/iterable-collection/_shared/unique-iterable.js.map +1 -1
  238. package/dist/esm/collection/implementations/iterable-collection/_shared/update-iterable.js.map +1 -1
  239. package/dist/esm/collection/implementations/iterable-collection/_shared/when-iterable.js.map +1 -1
  240. package/dist/esm/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
  241. package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  242. package/dist/esm/collection/implementations/list-collection/list-collection.js +2 -1
  243. package/dist/esm/collection/implementations/list-collection/list-collection.js.map +1 -1
  244. package/dist/esm/event-bus/contracts/_module.js +5 -0
  245. package/dist/esm/event-bus/contracts/_module.js.map +1 -0
  246. package/dist/esm/event-bus/contracts/_shared.js +31 -0
  247. package/dist/esm/event-bus/contracts/_shared.js.map +1 -0
  248. package/dist/esm/event-bus/contracts/event-bus-adapter.contract.js +1 -0
  249. package/dist/esm/event-bus/contracts/event-bus-adapter.contract.js.map +1 -0
  250. package/dist/esm/event-bus/contracts/event-bus-manager.contract.js +1 -0
  251. package/dist/esm/event-bus/contracts/event-bus-manager.contract.js.map +1 -0
  252. package/dist/esm/event-bus/contracts/event-bus.contract.js +1 -0
  253. package/dist/esm/event-bus/contracts/event-bus.contract.js.map +1 -0
  254. package/dist/esm/event-bus/implementations/_module.js +6 -0
  255. package/dist/esm/event-bus/implementations/_module.js.map +1 -0
  256. package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js +2 -0
  257. package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js.map +1 -0
  258. package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js +48 -0
  259. package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +1 -0
  260. package/dist/esm/event-bus/implementations/event-bus/_module.js +3 -0
  261. package/dist/esm/event-bus/implementations/event-bus/_module.js.map +1 -0
  262. package/dist/esm/event-bus/implementations/event-bus/event-bus-manager.js +27 -0
  263. package/dist/esm/event-bus/implementations/event-bus/event-bus-manager.js.map +1 -0
  264. package/dist/esm/event-bus/implementations/event-bus/event-bus.js +100 -0
  265. package/dist/esm/event-bus/implementations/event-bus/event-bus.js.map +1 -0
  266. package/dist/esm/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js +37 -0
  267. package/dist/esm/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js.map +1 -0
  268. package/dist/esm/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js +31 -0
  269. package/dist/esm/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js.map +1 -0
  270. package/dist/esm/event-bus/implementations/memory-event-bus-adapter/_module.js +2 -0
  271. package/dist/esm/event-bus/implementations/memory-event-bus-adapter/_module.js.map +1 -0
  272. package/dist/esm/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js +19 -0
  273. package/dist/esm/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -0
  274. package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/_module.js +2 -0
  275. package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/_module.js.map +1 -0
  276. package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js +12 -0
  277. package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -0
  278. package/dist/esm/event-bus/implementations/redis-event-bus-adapter/_module.js +2 -0
  279. package/dist/esm/event-bus/implementations/redis-event-bus-adapter/_module.js.map +1 -0
  280. package/dist/esm/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js +41 -0
  281. package/dist/esm/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js.map +1 -0
  282. package/dist/esm/storage/contracts/_module.js +2 -0
  283. package/dist/esm/storage/contracts/_module.js.map +1 -1
  284. package/dist/esm/storage/contracts/storage-events.contract.js +11 -0
  285. package/dist/esm/storage/contracts/storage-events.contract.js.map +1 -0
  286. package/dist/esm/storage/contracts/storage-manager.contract.js +1 -0
  287. package/dist/esm/storage/contracts/storage-manager.contract.js.map +1 -0
  288. package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js +293 -5
  289. package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js.map +1 -1
  290. package/dist/esm/storage/implementations/storage/_module.js +1 -0
  291. package/dist/esm/storage/implementations/storage/_module.js.map +1 -1
  292. package/dist/esm/storage/implementations/storage/storage-manager.js +30 -0
  293. package/dist/esm/storage/implementations/storage/storage-manager.js.map +1 -0
  294. package/dist/esm/storage/implementations/storage/storage.js +69 -23
  295. package/dist/esm/storage/implementations/storage/storage.js.map +1 -1
  296. package/dist/esm/storage/implementations/storage/with-event-storage-adapter.js +251 -0
  297. package/dist/esm/storage/implementations/storage/with-event-storage-adapter.js.map +1 -0
  298. package/dist/esm/storage/implementations/storage/with-namespace-storage-adapter.js +0 -3
  299. package/dist/esm/storage/implementations/storage/with-namespace-storage-adapter.js.map +1 -1
  300. package/dist/esm/storage/implementations/storage/with-validation-storage-adapter.js.map +1 -1
  301. package/dist/esm/utilities/_module.js +1 -2
  302. package/dist/esm/utilities/_module.js.map +1 -1
  303. package/dist/esm/utilities/async/_module.js +4 -1
  304. package/dist/esm/utilities/async/_module.js.map +1 -1
  305. package/dist/esm/utilities/async/abortable-iterable/_module.js +2 -0
  306. package/dist/esm/utilities/async/abortable-iterable/_module.js.map +1 -0
  307. package/dist/esm/utilities/async/abortable-iterable/abortable-iterable.js.map +1 -0
  308. package/dist/esm/utilities/async/delay-iterable/_module.js +2 -0
  309. package/dist/esm/utilities/async/delay-iterable/_module.js.map +1 -0
  310. package/dist/esm/utilities/async/delay-iterable/delay-iterable.js.map +1 -0
  311. package/dist/esm/utilities/async/retry/retry.js +1 -1
  312. package/dist/esm/utilities/async/retry/retry.js.map +1 -1
  313. package/dist/esm/utilities/async/retry-iterable/_module.js +2 -0
  314. package/dist/esm/utilities/async/retry-iterable/_module.js.map +1 -0
  315. package/dist/esm/utilities/async/retry-iterable/retry-iterable.js.map +1 -0
  316. package/dist/esm/utilities/async/timeout-iterable/_module.js +2 -0
  317. package/dist/esm/utilities/async/timeout-iterable/_module.js.map +1 -0
  318. package/dist/esm/utilities/{async-iterable → async}/timeout-iterable/timeout-iterable.js +1 -1
  319. package/dist/esm/utilities/async/timeout-iterable/timeout-iterable.js.map +1 -0
  320. package/dist/esm/utilities/backof-policies/_module.js +5 -0
  321. package/dist/esm/utilities/backof-policies/_module.js.map +1 -0
  322. package/dist/esm/utilities/backof-policies/_shared.js.map +1 -0
  323. package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js +2 -0
  324. package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js.map +1 -0
  325. package/dist/esm/utilities/{async/backof-policies → backof-policies}/constant-backoff-policy/constant-backoff-policy.js +2 -2
  326. package/dist/esm/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
  327. package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js +2 -0
  328. package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
  329. package/dist/esm/utilities/{async/backof-policies → backof-policies}/exponential-backoff-policy/exponential-backoff-policy.js +2 -2
  330. package/dist/esm/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
  331. package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js +2 -0
  332. package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js.map +1 -0
  333. package/dist/esm/utilities/{async/backof-policies → backof-policies}/linear-backoff-policy/linear-backoff-policy.js +2 -2
  334. package/dist/esm/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
  335. package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js +2 -0
  336. package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
  337. package/dist/esm/utilities/{async/backof-policies → backof-policies}/polynomial-backoff-policy/polynomial-backoff-policy.js +2 -2
  338. package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
  339. package/dist/esm/utilities/time-span/time-span.js.map +1 -1
  340. package/dist/esm/utilities/validation/_module.js.map +1 -1
  341. package/dist/types/_module.d.ts +2 -0
  342. package/dist/types/_shared/types.d.ts +1 -1
  343. package/dist/types/_shared/utilities.d.ts +8 -0
  344. package/dist/types/collection/contracts/async-collection.contract.d.ts +236 -43
  345. package/dist/types/collection/contracts/collection.contract.d.ts +229 -42
  346. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.d.ts +3 -0
  347. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.d.ts +3 -0
  348. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.d.ts +3 -0
  349. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.d.ts +3 -0
  350. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.d.ts +3 -0
  351. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.d.ts +3 -0
  352. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.d.ts +3 -0
  353. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.d.ts +3 -0
  354. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.d.ts +3 -0
  355. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.d.ts +3 -0
  356. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.d.ts +3 -0
  357. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.d.ts +3 -0
  358. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-map-iterable.d.ts +3 -0
  359. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.d.ts +3 -0
  360. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.d.ts +3 -0
  361. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.d.ts +3 -0
  362. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.d.ts +3 -0
  363. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.d.ts +3 -0
  364. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.d.ts +3 -0
  365. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.d.ts +3 -0
  366. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.d.ts +3 -0
  367. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.d.ts +3 -0
  368. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.d.ts +3 -0
  369. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.d.ts +3 -0
  370. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.d.ts +3 -0
  371. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-split-iterable.d.ts +3 -0
  372. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-iterable.d.ts +3 -0
  373. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.d.ts +3 -0
  374. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.d.ts +3 -0
  375. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.d.ts +3 -0
  376. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-update-iterable.d.ts +3 -0
  377. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-when-iterable.d.ts +3 -0
  378. package/dist/types/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.d.ts +3 -0
  379. package/dist/types/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +10 -9
  380. package/dist/types/collection/implementations/iterable-collection/_shared/chunk-iterable.d.ts +3 -0
  381. package/dist/types/collection/implementations/iterable-collection/_shared/chunk-while-iterable.d.ts +3 -0
  382. package/dist/types/collection/implementations/iterable-collection/_shared/collapse-iterable.d.ts +3 -0
  383. package/dist/types/collection/implementations/iterable-collection/_shared/count-by-iterable.d.ts +3 -0
  384. package/dist/types/collection/implementations/iterable-collection/_shared/cross-join-iterable.d.ts +3 -0
  385. package/dist/types/collection/implementations/iterable-collection/_shared/entries-iterable.d.ts +3 -0
  386. package/dist/types/collection/implementations/iterable-collection/_shared/filter-iterable.d.ts +3 -0
  387. package/dist/types/collection/implementations/iterable-collection/_shared/flat-map-iterable.d.ts +3 -0
  388. package/dist/types/collection/implementations/iterable-collection/_shared/group-by-iterable.d.ts +3 -0
  389. package/dist/types/collection/implementations/iterable-collection/_shared/insert-after-iterable.d.ts +3 -0
  390. package/dist/types/collection/implementations/iterable-collection/_shared/insert-before-iterable.d.ts +3 -0
  391. package/dist/types/collection/implementations/iterable-collection/_shared/map-iterable.d.ts +3 -0
  392. package/dist/types/collection/implementations/iterable-collection/_shared/merge-iterable.d.ts +3 -0
  393. package/dist/types/collection/implementations/iterable-collection/_shared/pad-end-iterable.d.ts +3 -0
  394. package/dist/types/collection/implementations/iterable-collection/_shared/pad-start-iterable.d.ts +3 -0
  395. package/dist/types/collection/implementations/iterable-collection/_shared/partion-iterable.d.ts +3 -0
  396. package/dist/types/collection/implementations/iterable-collection/_shared/repeat-iterable.d.ts +3 -0
  397. package/dist/types/collection/implementations/iterable-collection/_shared/reverse-iterable.d.ts +3 -0
  398. package/dist/types/collection/implementations/iterable-collection/_shared/shuffle-iterable.d.ts +3 -0
  399. package/dist/types/collection/implementations/iterable-collection/_shared/skip-iterable.d.ts +3 -0
  400. package/dist/types/collection/implementations/iterable-collection/_shared/skip-until-iterable.d.ts +3 -0
  401. package/dist/types/collection/implementations/iterable-collection/_shared/slice-iterable.d.ts +3 -0
  402. package/dist/types/collection/implementations/iterable-collection/_shared/sliding-iterable.d.ts +3 -0
  403. package/dist/types/collection/implementations/iterable-collection/_shared/sort-iterable.d.ts +3 -0
  404. package/dist/types/collection/implementations/iterable-collection/_shared/split-iterable.d.ts +3 -0
  405. package/dist/types/collection/implementations/iterable-collection/_shared/take-iterable.d.ts +3 -0
  406. package/dist/types/collection/implementations/iterable-collection/_shared/take-until-iterable.d.ts +3 -0
  407. package/dist/types/collection/implementations/iterable-collection/_shared/tap-iterable.d.ts +3 -0
  408. package/dist/types/collection/implementations/iterable-collection/_shared/unique-iterable.d.ts +3 -0
  409. package/dist/types/collection/implementations/iterable-collection/_shared/update-iterable.d.ts +3 -0
  410. package/dist/types/collection/implementations/iterable-collection/_shared/when-iterable.d.ts +3 -0
  411. package/dist/types/collection/implementations/iterable-collection/_shared/zip-iterable.d.ts +3 -0
  412. package/dist/types/collection/implementations/iterable-collection/iterable-collection.d.ts +7 -7
  413. package/dist/types/collection/implementations/list-collection/list-collection.d.ts +7 -7
  414. package/dist/types/event-bus/contracts/_module.d.ts +4 -0
  415. package/dist/types/event-bus/contracts/_shared.d.ts +38 -0
  416. package/dist/types/event-bus/contracts/event-bus-adapter.contract.d.ts +23 -0
  417. package/dist/types/event-bus/contracts/event-bus-manager.contract.d.ts +120 -0
  418. package/dist/types/event-bus/contracts/event-bus.contract.d.ts +119 -0
  419. package/dist/types/event-bus/implementations/_module.d.ts +5 -0
  420. package/dist/types/event-bus/implementations/_shared/test-utilities/_module.d.ts +1 -0
  421. package/dist/types/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.d.ts +36 -0
  422. package/dist/types/event-bus/implementations/event-bus/_module.d.ts +2 -0
  423. package/dist/types/event-bus/implementations/event-bus/event-bus-manager.d.ts +26 -0
  424. package/dist/types/event-bus/implementations/event-bus/event-bus.d.ts +102 -0
  425. package/dist/types/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.d.ts +16 -0
  426. package/dist/types/event-bus/implementations/event-bus/with-validation-event-bus-adapter.d.ts +17 -0
  427. package/dist/types/event-bus/implementations/memory-event-bus-adapter/_module.d.ts +1 -0
  428. package/dist/types/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +15 -0
  429. package/dist/types/event-bus/implementations/no-op-event-bus-adapter/_module.d.ts +1 -0
  430. package/dist/types/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +14 -0
  431. package/dist/types/event-bus/implementations/redis-event-bus-adapter/_module.d.ts +1 -0
  432. package/dist/types/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.d.ts +28 -0
  433. package/dist/types/serializer/contracts/serializer.contract.d.ts +0 -3
  434. package/dist/types/storage/contracts/_module.d.ts +2 -0
  435. package/dist/types/storage/contracts/storage-adapter.contract.d.ts +12 -24
  436. package/dist/types/storage/contracts/storage-events.contract.d.ts +91 -0
  437. package/dist/types/storage/contracts/storage-manager.contract.d.ts +100 -0
  438. package/dist/types/storage/contracts/storage.contract.d.ts +84 -51
  439. package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.d.ts +18 -2
  440. package/dist/types/storage/implementations/storage/_module.d.ts +1 -0
  441. package/dist/types/storage/implementations/storage/storage-manager.d.ts +29 -0
  442. package/dist/types/storage/implementations/storage/storage.d.ts +81 -8
  443. package/dist/types/storage/implementations/storage/with-event-storage-adapter.d.ts +31 -0
  444. package/dist/types/storage/implementations/storage/with-namespace-storage-adapter.d.ts +0 -1
  445. package/dist/types/storage/implementations/storage/with-validation-storage-adapter.d.ts +3 -0
  446. package/dist/types/utilities/_module.d.ts +1 -2
  447. package/dist/types/utilities/async/_module.d.ts +4 -1
  448. package/dist/types/utilities/async/_shared.d.ts +6 -6
  449. package/dist/types/utilities/async/abortable/abortable.d.ts +2 -2
  450. package/dist/types/utilities/async/abortable-iterable/_module.d.ts +1 -0
  451. package/dist/types/utilities/{async-iterable → async}/abortable-iterable/abortable-iterable.d.ts +2 -2
  452. package/dist/types/utilities/async/delay/delay.d.ts +2 -2
  453. package/dist/types/utilities/async/delay-iterable/_module.d.ts +1 -0
  454. package/dist/types/utilities/{async-iterable → async}/delay-iterable/delay-iterable.d.ts +2 -2
  455. package/dist/types/utilities/async/lazy-promise/lazy-promise.d.ts +3 -3
  456. package/dist/types/utilities/async/retry/retry.d.ts +7 -4
  457. package/dist/types/utilities/async/retry-iterable/_module.d.ts +1 -0
  458. package/dist/types/utilities/{async-iterable → async}/retry-iterable/retry-iterable.d.ts +1 -1
  459. package/dist/types/utilities/async/timeout/timeout.d.ts +2 -2
  460. package/dist/types/utilities/async/timeout-iterable/_module.d.ts +1 -0
  461. package/dist/types/utilities/{async-iterable → async}/timeout-iterable/timeout-iterable.d.ts +2 -2
  462. package/dist/types/utilities/backof-policies/_module.d.ts +5 -0
  463. package/dist/types/utilities/{async/backof-policies → backof-policies}/_shared.d.ts +2 -2
  464. package/dist/types/utilities/backof-policies/constant-backoff-policy/_module.d.ts +1 -0
  465. package/dist/types/utilities/{async/backof-policies → backof-policies}/constant-backoff-policy/constant-backoff-policy.d.ts +3 -3
  466. package/dist/types/utilities/backof-policies/exponential-backoff-policy/_module.d.ts +1 -0
  467. package/dist/types/utilities/{async/backof-policies → backof-policies}/exponential-backoff-policy/exponential-backoff-policy.d.ts +3 -3
  468. package/dist/types/utilities/backof-policies/linear-backoff-policy/_module.d.ts +1 -0
  469. package/dist/types/utilities/{async/backof-policies → backof-policies}/linear-backoff-policy/linear-backoff-policy.d.ts +3 -3
  470. package/dist/types/utilities/backof-policies/polynomial-backoff-policy/_module.d.ts +1 -0
  471. package/dist/types/utilities/{async/backof-policies → backof-policies}/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +3 -3
  472. package/dist/types/utilities/time-span/time-span.d.ts +2 -1
  473. package/dist/types/utilities/validation/_module.d.ts +21 -1
  474. package/package.json +1 -1
  475. package/dist/cjs/serializer/_module.js.map +0 -1
  476. package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js +0 -300
  477. package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js.map +0 -1
  478. package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js +0 -1208
  479. package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js.map +0 -1
  480. package/dist/cjs/utilities/async/backof-policies/_module.js +0 -21
  481. package/dist/cjs/utilities/async/backof-policies/_module.js.map +0 -1
  482. package/dist/cjs/utilities/async/backof-policies/_shared.js.map +0 -1
  483. package/dist/cjs/utilities/async/backof-policies/constant-backoff-policy/_module.js +0 -18
  484. package/dist/cjs/utilities/async/backof-policies/constant-backoff-policy/_module.js.map +0 -1
  485. package/dist/cjs/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
  486. package/dist/cjs/utilities/async/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
  487. package/dist/cjs/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
  488. package/dist/cjs/utilities/async/backof-policies/linear-backoff-policy/_module.js +0 -18
  489. package/dist/cjs/utilities/async/backof-policies/linear-backoff-policy/_module.js.map +0 -1
  490. package/dist/cjs/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
  491. package/dist/cjs/utilities/async/backof-policies/polynomial-backoff-policy/_module.js +0 -18
  492. package/dist/cjs/utilities/async/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
  493. package/dist/cjs/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
  494. package/dist/cjs/utilities/async-iterable/_module.js +0 -23
  495. package/dist/cjs/utilities/async-iterable/_module.js.map +0 -1
  496. package/dist/cjs/utilities/async-iterable/abortable-iterable/_module.js.map +0 -1
  497. package/dist/cjs/utilities/async-iterable/abortable-iterable/abortable-iterable.js.map +0 -1
  498. package/dist/cjs/utilities/async-iterable/delay-iterable/_module.js.map +0 -1
  499. package/dist/cjs/utilities/async-iterable/delay-iterable/delay-iterable.js.map +0 -1
  500. package/dist/cjs/utilities/async-iterable/retry-iterable/_module.js.map +0 -1
  501. package/dist/cjs/utilities/async-iterable/retry-iterable/retry-iterable.js.map +0 -1
  502. package/dist/cjs/utilities/async-iterable/timeout-iterable/_module.js.map +0 -1
  503. package/dist/cjs/utilities/async-iterable/timeout-iterable/timeout-iterable.js.map +0 -1
  504. package/dist/esm/serializer/_module.js +0 -6
  505. package/dist/esm/serializer/_module.js.map +0 -1
  506. package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js +0 -297
  507. package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js.map +0 -1
  508. package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js +0 -1205
  509. package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js.map +0 -1
  510. package/dist/esm/utilities/async/backof-policies/_module.js +0 -5
  511. package/dist/esm/utilities/async/backof-policies/_module.js.map +0 -1
  512. package/dist/esm/utilities/async/backof-policies/_shared.js.map +0 -1
  513. package/dist/esm/utilities/async/backof-policies/constant-backoff-policy/_module.js +0 -2
  514. package/dist/esm/utilities/async/backof-policies/constant-backoff-policy/_module.js.map +0 -1
  515. package/dist/esm/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
  516. package/dist/esm/utilities/async/backof-policies/exponential-backoff-policy/_module.js +0 -2
  517. package/dist/esm/utilities/async/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
  518. package/dist/esm/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
  519. package/dist/esm/utilities/async/backof-policies/linear-backoff-policy/_module.js +0 -2
  520. package/dist/esm/utilities/async/backof-policies/linear-backoff-policy/_module.js.map +0 -1
  521. package/dist/esm/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
  522. package/dist/esm/utilities/async/backof-policies/polynomial-backoff-policy/_module.js +0 -2
  523. package/dist/esm/utilities/async/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
  524. package/dist/esm/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
  525. package/dist/esm/utilities/async-iterable/_module.js +0 -5
  526. package/dist/esm/utilities/async-iterable/_module.js.map +0 -1
  527. package/dist/esm/utilities/async-iterable/abortable-iterable/_module.js +0 -2
  528. package/dist/esm/utilities/async-iterable/abortable-iterable/_module.js.map +0 -1
  529. package/dist/esm/utilities/async-iterable/abortable-iterable/abortable-iterable.js.map +0 -1
  530. package/dist/esm/utilities/async-iterable/delay-iterable/_module.js +0 -2
  531. package/dist/esm/utilities/async-iterable/delay-iterable/_module.js.map +0 -1
  532. package/dist/esm/utilities/async-iterable/delay-iterable/delay-iterable.js.map +0 -1
  533. package/dist/esm/utilities/async-iterable/retry-iterable/_module.js +0 -2
  534. package/dist/esm/utilities/async-iterable/retry-iterable/_module.js.map +0 -1
  535. package/dist/esm/utilities/async-iterable/retry-iterable/retry-iterable.js.map +0 -1
  536. package/dist/esm/utilities/async-iterable/timeout-iterable/_module.js +0 -2
  537. package/dist/esm/utilities/async-iterable/timeout-iterable/_module.js.map +0 -1
  538. package/dist/esm/utilities/async-iterable/timeout-iterable/timeout-iterable.js.map +0 -1
  539. package/dist/types/serializer/_module.d.ts +0 -5
  540. package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.d.ts +0 -20
  541. package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.d.ts +0 -20
  542. package/dist/types/utilities/async/backof-policies/_module.d.ts +0 -5
  543. package/dist/types/utilities/async/backof-policies/constant-backoff-policy/_module.d.ts +0 -1
  544. package/dist/types/utilities/async/backof-policies/exponential-backoff-policy/_module.d.ts +0 -1
  545. package/dist/types/utilities/async/backof-policies/linear-backoff-policy/_module.d.ts +0 -1
  546. package/dist/types/utilities/async/backof-policies/polynomial-backoff-policy/_module.d.ts +0 -1
  547. package/dist/types/utilities/async-iterable/_module.d.ts +0 -4
  548. package/dist/types/utilities/async-iterable/abortable-iterable/_module.d.ts +0 -1
  549. package/dist/types/utilities/async-iterable/delay-iterable/_module.d.ts +0 -1
  550. package/dist/types/utilities/async-iterable/retry-iterable/_module.d.ts +0 -1
  551. package/dist/types/utilities/async-iterable/timeout-iterable/_module.d.ts +0 -1
  552. /package/dist/cjs/utilities/{async-iterable → async}/abortable-iterable/abortable-iterable.js +0 -0
  553. /package/dist/cjs/utilities/{async-iterable → async}/delay-iterable/delay-iterable.js +0 -0
  554. /package/dist/cjs/utilities/{async-iterable → async}/retry-iterable/retry-iterable.js +0 -0
  555. /package/dist/cjs/utilities/{async/backof-policies → backof-policies}/_shared.js +0 -0
  556. /package/dist/esm/utilities/{async-iterable → async}/abortable-iterable/abortable-iterable.js +0 -0
  557. /package/dist/esm/utilities/{async-iterable → async}/delay-iterable/delay-iterable.js +0 -0
  558. /package/dist/esm/utilities/{async-iterable → async}/retry-iterable/retry-iterable.js +0 -0
  559. /package/dist/esm/utilities/{async/backof-policies → backof-policies}/_shared.js +0 -0
@@ -1,1205 +0,0 @@
1
- import { Storage } from "../../../../storage/implementations/_module";
2
- export function storageAdapterValueTestSuite(settings) {
3
- const { expect, test, createAdapter, describe, beforeEach } = settings;
4
- let storageAdapter;
5
- beforeEach(async () => {
6
- storageAdapter = new Storage(await createAdapter());
7
- });
8
- describe("Value tests:", () => {
9
- describe("method: getMany / addMany", () => {
10
- test("Should work with positive integer", async () => {
11
- const value = 1;
12
- await storageAdapter.addMany({ a: value });
13
- expect(await storageAdapter.getMany(["a"])).toEqual({
14
- a: value,
15
- });
16
- });
17
- test("Should work with negative integer", async () => {
18
- const value = -1;
19
- await storageAdapter.addMany({ a: value });
20
- expect(await storageAdapter.getMany(["a"])).toEqual({
21
- a: value,
22
- });
23
- });
24
- test("Should work with positive decimal", async () => {
25
- const value = 1.5;
26
- await storageAdapter.addMany({ a: value });
27
- expect(await storageAdapter.getMany(["a"])).toEqual({
28
- a: value,
29
- });
30
- });
31
- test("Should work with negative decimal", async () => {
32
- const value = -1.5;
33
- await storageAdapter.addMany({ a: value });
34
- expect(await storageAdapter.getMany(["a"])).toEqual({
35
- a: value,
36
- });
37
- });
38
- test("Should work with NaN", async () => {
39
- const value = NaN;
40
- await storageAdapter.addMany({ a: value });
41
- const { a: getResult } = await storageAdapter.getMany(["a"]);
42
- expect(getResult).toBeNaN();
43
- });
44
- test("Should work with Infinity", async () => {
45
- const value = Infinity;
46
- await storageAdapter.addMany({ a: value });
47
- const { a: getResult } = await storageAdapter.getMany(["a"]);
48
- expect(isFinite(getResult)).toBe(false);
49
- });
50
- test("Should work with Bigint", async () => {
51
- const value = 20n;
52
- await storageAdapter.addMany({ a: value });
53
- expect(await storageAdapter.getMany(["a"])).toEqual({
54
- a: value,
55
- });
56
- });
57
- test("Should work with true", async () => {
58
- const value = true;
59
- await storageAdapter.addMany({ a: value });
60
- expect(await storageAdapter.getMany(["a"])).toEqual({
61
- a: value,
62
- });
63
- });
64
- test("Should work with false", async () => {
65
- const value = false;
66
- await storageAdapter.addMany({ a: value });
67
- expect(await storageAdapter.getMany(["a"])).toEqual({
68
- a: value,
69
- });
70
- });
71
- test("Should work with string", async () => {
72
- const value = "str";
73
- await storageAdapter.addMany({ a: value });
74
- expect(await storageAdapter.getMany(["a"])).toEqual({
75
- a: value,
76
- });
77
- });
78
- test("Should work with Date", async () => {
79
- const value = new Date("2024-01-01");
80
- await storageAdapter.addMany({ a: value });
81
- const { a: getResult } = await storageAdapter.getMany(["a"]);
82
- expect(getResult).toBeInstanceOf(Date);
83
- expect(getResult).toEqual(value);
84
- });
85
- test("Should work with RegExp", async () => {
86
- const value = /test/;
87
- await storageAdapter.addMany({ a: value });
88
- const { a: getResult } = await storageAdapter.getMany(["a"]);
89
- expect(getResult).toBeInstanceOf(RegExp);
90
- expect(getResult).toEqual(value);
91
- });
92
- test("Should work with Buffer", async () => {
93
- const value = Buffer.from("asd");
94
- await storageAdapter.addMany({ a: value });
95
- const { a: getResult } = await storageAdapter.getMany(["a"]);
96
- expect(getResult).toBeInstanceOf(Buffer);
97
- expect(getResult?.toString("base64")).toEqual(value.toString("base64"));
98
- });
99
- test("Should work with Uint8Array", async () => {
100
- const value = new Uint8Array(Buffer.from("asd"));
101
- await storageAdapter.addMany({ a: value });
102
- const { a: getResult } = await storageAdapter.getMany(["a"]);
103
- expect(getResult).toBeInstanceOf(Uint8Array);
104
- expect(getResult
105
- ? Buffer.from(getResult).toString("base64")
106
- : undefined).toEqual(Buffer.from(value).toString("base64"));
107
- });
108
- test("Should work with Int8Array", async () => {
109
- const value = new Int8Array(Buffer.from("asd"));
110
- await storageAdapter.addMany({ a: value });
111
- const { a: getResult } = await storageAdapter.getMany(["a"]);
112
- expect(getResult).toBeInstanceOf(Int8Array);
113
- expect(getResult
114
- ? Buffer.from(getResult).toString("base64")
115
- : undefined).toEqual(Buffer.from(value).toString("base64"));
116
- });
117
- test("Should work with Uint16Array", async () => {
118
- const value = new Uint16Array(Buffer.from("asd"));
119
- await storageAdapter.addMany({ a: value });
120
- const { a: getResult } = await storageAdapter.getMany(["a"]);
121
- expect(getResult).toBeInstanceOf(Uint16Array);
122
- expect(getResult
123
- ? Buffer.from(getResult).toString("base64")
124
- : undefined).toEqual(Buffer.from(value).toString("base64"));
125
- });
126
- test("Should work with Int16Array", async () => {
127
- const value = new Int16Array(Buffer.from("asd"));
128
- await storageAdapter.addMany({ a: value });
129
- const { a: getResult } = await storageAdapter.getMany(["a"]);
130
- expect(getResult).toBeInstanceOf(Int16Array);
131
- expect(getResult
132
- ? Buffer.from(getResult).toString("base64")
133
- : undefined).toEqual(Buffer.from(value).toString("base64"));
134
- });
135
- test("Should work with Uint32Array", async () => {
136
- const value = new Uint32Array(Buffer.from("asd"));
137
- await storageAdapter.addMany({ a: value });
138
- const { a: getResult } = await storageAdapter.getMany(["a"]);
139
- expect(getResult).toBeInstanceOf(Uint32Array);
140
- expect(getResult
141
- ? Buffer.from(getResult).toString("base64")
142
- : undefined).toEqual(Buffer.from(value).toString("base64"));
143
- });
144
- test("Should work with Int32Array", async () => {
145
- const value = new Int32Array(Buffer.from("asd"));
146
- await storageAdapter.addMany({ a: value });
147
- const { a: getResult } = await storageAdapter.getMany(["a"]);
148
- expect(getResult).toBeInstanceOf(Int32Array);
149
- expect(getResult
150
- ? Buffer.from(getResult).toString("base64")
151
- : undefined).toEqual(Buffer.from(value).toString("base64"));
152
- });
153
- test("Should work with Float32Array", async () => {
154
- const value = new Float32Array(Buffer.from("asd"));
155
- await storageAdapter.addMany({ a: value });
156
- const { a: getResult } = await storageAdapter.getMany(["a"]);
157
- expect(getResult).toBeInstanceOf(Float32Array);
158
- expect(getResult
159
- ? Buffer.from(getResult).toString("base64")
160
- : undefined).toEqual(Buffer.from(value).toString("base64"));
161
- });
162
- test("Should work with Float64Array", async () => {
163
- const value = new Float64Array(Buffer.from("asd"));
164
- await storageAdapter.addMany({ a: value });
165
- const { a: getResult } = await storageAdapter.getMany(["a"]);
166
- expect(getResult).toBeInstanceOf(Float64Array);
167
- expect(getResult
168
- ? Buffer.from(getResult).toString("base64")
169
- : undefined).toEqual(Buffer.from(value).toString("base64"));
170
- });
171
- test("Should work with Set", async () => {
172
- const value = new Set(["a", "b", "c"]);
173
- await storageAdapter.addMany({ a: value });
174
- const { a: getResult } = await storageAdapter.getMany(["a"]);
175
- expect(getResult).toBeInstanceOf(Set);
176
- expect(getResult).toEqual(value);
177
- });
178
- test("Should work with Set of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays", async () => {
179
- const value = new Set([
180
- 0,
181
- -1,
182
- 1,
183
- -1.5,
184
- 1.5,
185
- NaN,
186
- Infinity,
187
- 2n,
188
- true,
189
- false,
190
- "str",
191
- new Date("2024-01-01"),
192
- new Set(["a", "b", "c"]),
193
- new Map([
194
- ["a", 1],
195
- ["b", 2],
196
- ["c", 3],
197
- ]),
198
- { a: 1, b: 2 },
199
- [1, 2, 3],
200
- /test/,
201
- ]);
202
- await storageAdapter.addMany({ a: value });
203
- const { a: getResult } = await storageAdapter.getMany(["a"]);
204
- expect(getResult).toBeInstanceOf(Set);
205
- expect(getResult).toEqual(value);
206
- });
207
- test("Should work with Map", async () => {
208
- const value = new Map([
209
- ["a", 1],
210
- ["b", 2],
211
- ["c", 3],
212
- ]);
213
- await storageAdapter.addMany({ a: value });
214
- const { a: getResult } = await storageAdapter.getMany(["a"]);
215
- expect(getResult).toBeInstanceOf(Map);
216
- expect(getResult).toEqual(value);
217
- });
218
- test("Should work with Map of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays values", async () => {
219
- const value = new Map([
220
- ["a", 0],
221
- ["b", -1],
222
- ["c", 1],
223
- ["d", -1.5],
224
- ["e", 1.5],
225
- ["f", NaN],
226
- ["g", Infinity],
227
- ["h", 2n],
228
- ["j", true],
229
- ["l", false],
230
- ["i", "str"],
231
- ["r", new Date("2024-01-01")],
232
- ["k", new Set(["a", "b", "c"])],
233
- [
234
- "p",
235
- new Map([
236
- ["a", 1],
237
- ["b", 2],
238
- ["c", 3],
239
- ]),
240
- ],
241
- ["a", /test/],
242
- [1, { a: 2, b: -1 }],
243
- [2, [1, 2, 3]],
244
- ]);
245
- await storageAdapter.addMany({ a: value });
246
- const { a: getResult } = await storageAdapter.getMany(["a"]);
247
- expect(getResult).toBeInstanceOf(Map);
248
- expect(getResult).toEqual(value);
249
- });
250
- test("Should work with Map of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays keys", async () => {
251
- const value = new Map([
252
- [0, "a"],
253
- [-1, "a"],
254
- [1, "a"],
255
- [-1.5, "a"],
256
- [1.5, "a"],
257
- [NaN, "a"],
258
- [Infinity, "a"],
259
- [2n, "a"],
260
- [true, "a"],
261
- [false, "a"],
262
- ["str", "a"],
263
- [new Date("2024-01-01"), "a"],
264
- [new Set(["a", "b", "c"]), "a"],
265
- [
266
- new Map([
267
- ["a", 1],
268
- ["b", 2],
269
- ["c", 3],
270
- ]),
271
- "a",
272
- ],
273
- [/test/, "a"],
274
- [{ a: 2, b: -1 }, 1],
275
- [[1, 2, 3], 2],
276
- ]);
277
- await storageAdapter.addMany({ a: value });
278
- const { a: getResult } = await storageAdapter.getMany(["a"]);
279
- expect(getResult).toBeInstanceOf(Map);
280
- expect(getResult).toEqual(value);
281
- });
282
- test("Should work with array of number, boolean, string, Date, Set, Map, RegExp", async () => {
283
- const value = [
284
- 0,
285
- -1,
286
- 1,
287
- -1.5,
288
- 1.5,
289
- NaN,
290
- Infinity,
291
- 2n,
292
- true,
293
- false,
294
- "str",
295
- new Date("2024-01-01"),
296
- new Set(["a", "b", "c"]),
297
- new Map([
298
- ["a", 1],
299
- ["b", 2],
300
- ["c", 3],
301
- ]),
302
- /test/,
303
- ];
304
- await storageAdapter.addMany({ a: value });
305
- const getResult = await storageAdapter.getMany(["a"]);
306
- expect(getResult).toEqual({ a: value });
307
- });
308
- test("Should work with array of objects", async () => {
309
- const value = [
310
- Object.fromEntries([
311
- ["a", 0],
312
- ["b", -1],
313
- ["c", 1],
314
- ["d", -1.5],
315
- ["e", 1.5],
316
- ["f", NaN],
317
- ["g", Infinity],
318
- ["h", 2n],
319
- ["j", true],
320
- ["l", false],
321
- ["i", "str"],
322
- ["r", new Date("2024-01-01")],
323
- ["k", new Set(["a", "b", "c"])],
324
- [
325
- "p",
326
- new Map([
327
- ["a", 1],
328
- ["b", 2],
329
- ["c", 3],
330
- ]),
331
- ],
332
- ["a", /test/],
333
- ]),
334
- ];
335
- await storageAdapter.addMany({ a: value });
336
- const { a: getResult } = await storageAdapter.getMany(["a"]);
337
- expect(getResult).toEqual(value);
338
- });
339
- test("Should work with object of number, boolean, string, Date, Set, Map, RegExp", async () => {
340
- const value = Object.fromEntries([
341
- ["a", 0],
342
- ["b", -1],
343
- ["c", 1],
344
- ["d", -1.5],
345
- ["e", 1.5],
346
- ["f", NaN],
347
- ["g", Infinity],
348
- ["h", 2n],
349
- ["j", true],
350
- ["l", false],
351
- ["i", "str"],
352
- ["r", new Date("2024-01-01")],
353
- ["k", new Set(["a", "b", "c"])],
354
- [
355
- "p",
356
- new Map([
357
- ["a", 1],
358
- ["b", 2],
359
- ["c", 3],
360
- ]),
361
- ],
362
- ["a", /test/],
363
- ]);
364
- await storageAdapter.addMany({ a: value });
365
- const { a: getResult } = await storageAdapter.getMany(["a"]);
366
- expect(getResult).toEqual(value);
367
- });
368
- test("Should work with object of arrays", async () => {
369
- const value = {
370
- a: [
371
- 0,
372
- -1,
373
- 1,
374
- -1.5,
375
- 1.5,
376
- NaN,
377
- Infinity,
378
- 2n,
379
- true,
380
- false,
381
- "str",
382
- new Date("2024-01-01"),
383
- new Set(["a", "b", "c"]),
384
- new Map([
385
- ["a", 1],
386
- ["b", 2],
387
- ["c", 3],
388
- ]),
389
- /test/,
390
- ],
391
- };
392
- await storageAdapter.addMany({ a: value });
393
- const { a: getResult } = await storageAdapter.getMany(["a"]);
394
- expect(getResult).toEqual(value);
395
- });
396
- });
397
- describe("method: updateMany", () => {
398
- test("Should work with positive integer", async () => {
399
- const value = 1;
400
- await storageAdapter.addMany({ a: -1 });
401
- await storageAdapter.updateMany({ a: value });
402
- expect(await storageAdapter.getMany(["a"])).toEqual({
403
- a: value,
404
- });
405
- });
406
- test("Should work with negative integer", async () => {
407
- const value = -1;
408
- await storageAdapter.addMany({ a: -1 });
409
- await storageAdapter.updateMany({ a: value });
410
- expect(await storageAdapter.getMany(["a"])).toEqual({
411
- a: value,
412
- });
413
- });
414
- test("Should work with positive decimal", async () => {
415
- const value = 1.5;
416
- await storageAdapter.addMany({ a: -1 });
417
- await storageAdapter.updateMany({ a: value });
418
- expect(await storageAdapter.getMany(["a"])).toEqual({
419
- a: value,
420
- });
421
- });
422
- test("Should work with negative decimal", async () => {
423
- const value = -1.5;
424
- await storageAdapter.addMany({ a: -1 });
425
- await storageAdapter.updateMany({ a: value });
426
- expect(await storageAdapter.getMany(["a"])).toEqual({
427
- a: value,
428
- });
429
- });
430
- test("Should work with NaN", async () => {
431
- const value = NaN;
432
- await storageAdapter.addMany({ a: -1 });
433
- await storageAdapter.updateMany({ a: value });
434
- const { a: getResult } = await storageAdapter.getMany(["a"]);
435
- expect(getResult).toBeNaN();
436
- });
437
- test("Should work with Infinity", async () => {
438
- const value = Infinity;
439
- await storageAdapter.addMany({ a: -1 });
440
- await storageAdapter.updateMany({ a: value });
441
- const { a: getResult } = await storageAdapter.getMany(["a"]);
442
- expect(isFinite(getResult)).toBe(false);
443
- });
444
- test("Should work with Bigint", async () => {
445
- const value = 20n;
446
- await storageAdapter.addMany({ a: -1 });
447
- await storageAdapter.updateMany({ a: value });
448
- expect(await storageAdapter.getMany(["a"])).toEqual({
449
- a: value,
450
- });
451
- });
452
- test("Should work with true", async () => {
453
- const value = true;
454
- await storageAdapter.addMany({ a: -1 });
455
- await storageAdapter.updateMany({ a: value });
456
- expect(await storageAdapter.getMany(["a"])).toEqual({
457
- a: value,
458
- });
459
- });
460
- test("Should work with false", async () => {
461
- const value = false;
462
- await storageAdapter.addMany({ a: -1 });
463
- await storageAdapter.updateMany({ a: value });
464
- expect(await storageAdapter.getMany(["a"])).toEqual({
465
- a: value,
466
- });
467
- });
468
- test("Should work with string", async () => {
469
- const value = "str";
470
- await storageAdapter.addMany({ a: -1 });
471
- await storageAdapter.updateMany({ a: value });
472
- expect(await storageAdapter.getMany(["a"])).toEqual({
473
- a: value,
474
- });
475
- });
476
- test("Should work with Date", async () => {
477
- const value = new Date("2024-01-01");
478
- await storageAdapter.addMany({ a: -1 });
479
- await storageAdapter.updateMany({ a: value });
480
- const { a: getResult } = await storageAdapter.getMany(["a"]);
481
- expect(getResult).toBeInstanceOf(Date);
482
- expect(getResult).toEqual(value);
483
- });
484
- test("Should work with RegExp", async () => {
485
- const value = /test/;
486
- await storageAdapter.addMany({ a: -1 });
487
- await storageAdapter.updateMany({ a: value });
488
- const { a: getResult } = await storageAdapter.getMany(["a"]);
489
- expect(getResult).toBeInstanceOf(RegExp);
490
- expect(getResult).toEqual(value);
491
- });
492
- test("Should work with Buffer", async () => {
493
- const value = Buffer.from("asd");
494
- await storageAdapter.addMany({ a: -1 });
495
- await storageAdapter.updateMany({ a: value });
496
- const { a: getResult } = await storageAdapter.getMany(["a"]);
497
- expect(getResult).toBeInstanceOf(Buffer);
498
- expect(getResult?.toString("base64")).toEqual(value.toString("base64"));
499
- });
500
- test("Should work with Uint8Array", async () => {
501
- const value = new Uint8Array(Buffer.from("asd"));
502
- await storageAdapter.addMany({ a: -1 });
503
- await storageAdapter.updateMany({ a: value });
504
- const { a: getResult } = await storageAdapter.getMany(["a"]);
505
- expect(getResult).toBeInstanceOf(Uint8Array);
506
- expect(getResult
507
- ? Buffer.from(getResult).toString("base64")
508
- : undefined).toEqual(Buffer.from(value).toString("base64"));
509
- });
510
- test("Should work with Int8Array", async () => {
511
- const value = new Int8Array(Buffer.from("asd"));
512
- await storageAdapter.addMany({ a: -1 });
513
- await storageAdapter.updateMany({ a: value });
514
- const { a: getResult } = await storageAdapter.getMany(["a"]);
515
- expect(getResult).toBeInstanceOf(Int8Array);
516
- expect(getResult
517
- ? Buffer.from(getResult).toString("base64")
518
- : undefined).toEqual(Buffer.from(value).toString("base64"));
519
- });
520
- test("Should work with Uint16Array", async () => {
521
- const value = new Uint16Array(Buffer.from("asd"));
522
- await storageAdapter.addMany({ a: -1 });
523
- await storageAdapter.updateMany({ a: value });
524
- const { a: getResult } = await storageAdapter.getMany(["a"]);
525
- expect(getResult).toBeInstanceOf(Uint16Array);
526
- expect(getResult
527
- ? Buffer.from(getResult).toString("base64")
528
- : undefined).toEqual(Buffer.from(value).toString("base64"));
529
- });
530
- test("Should work with Int16Array", async () => {
531
- const value = new Int16Array(Buffer.from("asd"));
532
- await storageAdapter.addMany({ a: -1 });
533
- await storageAdapter.updateMany({ a: value });
534
- const { a: getResult } = await storageAdapter.getMany(["a"]);
535
- expect(getResult).toBeInstanceOf(Int16Array);
536
- expect(getResult
537
- ? Buffer.from(getResult).toString("base64")
538
- : undefined).toEqual(Buffer.from(value).toString("base64"));
539
- });
540
- test("Should work with Uint32Array", async () => {
541
- const value = new Uint32Array(Buffer.from("asd"));
542
- await storageAdapter.addMany({ a: -1 });
543
- await storageAdapter.updateMany({ a: value });
544
- const { a: getResult } = await storageAdapter.getMany(["a"]);
545
- expect(getResult).toBeInstanceOf(Uint32Array);
546
- expect(getResult
547
- ? Buffer.from(getResult).toString("base64")
548
- : undefined).toEqual(Buffer.from(value).toString("base64"));
549
- });
550
- test("Should work with Int32Array", async () => {
551
- const value = new Int32Array(Buffer.from("asd"));
552
- await storageAdapter.addMany({ a: -1 });
553
- await storageAdapter.updateMany({ a: value });
554
- const { a: getResult } = await storageAdapter.getMany(["a"]);
555
- expect(getResult).toBeInstanceOf(Int32Array);
556
- expect(getResult
557
- ? Buffer.from(getResult).toString("base64")
558
- : undefined).toEqual(Buffer.from(value).toString("base64"));
559
- });
560
- test("Should work with Float32Array", async () => {
561
- const value = new Float32Array(Buffer.from("asd"));
562
- await storageAdapter.addMany({ a: -1 });
563
- await storageAdapter.updateMany({ a: value });
564
- const { a: getResult } = await storageAdapter.getMany(["a"]);
565
- expect(getResult).toBeInstanceOf(Float32Array);
566
- expect(getResult
567
- ? Buffer.from(getResult).toString("base64")
568
- : undefined).toEqual(Buffer.from(value).toString("base64"));
569
- });
570
- test("Should work with Float64Array", async () => {
571
- const value = new Float64Array(Buffer.from("asd"));
572
- await storageAdapter.addMany({ a: -1 });
573
- await storageAdapter.updateMany({ a: value });
574
- const { a: getResult } = await storageAdapter.getMany(["a"]);
575
- expect(getResult).toBeInstanceOf(Float64Array);
576
- expect(getResult
577
- ? Buffer.from(getResult).toString("base64")
578
- : undefined).toEqual(Buffer.from(value).toString("base64"));
579
- });
580
- test("Should work with Set", async () => {
581
- const value = new Set(["a", "b", "c"]);
582
- await storageAdapter.addMany({ a: -1 });
583
- await storageAdapter.updateMany({ a: value });
584
- const { a: getResult } = await storageAdapter.getMany(["a"]);
585
- expect(getResult).toBeInstanceOf(Set);
586
- expect(getResult).toEqual(value);
587
- });
588
- test("Should work with Set of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays", async () => {
589
- const value = new Set([
590
- 0,
591
- -1,
592
- 1,
593
- -1.5,
594
- 1.5,
595
- NaN,
596
- Infinity,
597
- 2n,
598
- true,
599
- false,
600
- "str",
601
- new Date("2024-01-01"),
602
- new Set(["a", "b", "c"]),
603
- new Map([
604
- ["a", 1],
605
- ["b", 2],
606
- ["c", 3],
607
- ]),
608
- { a: 1, b: 2 },
609
- [1, 2, 3],
610
- /test/,
611
- ]);
612
- await storageAdapter.addMany({ a: -1 });
613
- await storageAdapter.updateMany({ a: value });
614
- const { a: getResult } = await storageAdapter.getMany(["a"]);
615
- expect(getResult).toBeInstanceOf(Set);
616
- expect(getResult).toEqual(value);
617
- });
618
- test("Should work with Map", async () => {
619
- const value = new Map([
620
- ["a", 1],
621
- ["b", 2],
622
- ["c", 3],
623
- ]);
624
- await storageAdapter.addMany({ a: -1 });
625
- await storageAdapter.updateMany({ a: value });
626
- const { a: getResult } = await storageAdapter.getMany(["a"]);
627
- expect(getResult).toBeInstanceOf(Map);
628
- expect(getResult).toEqual(value);
629
- });
630
- test("Should work with Map of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays values", async () => {
631
- const value = new Map([
632
- ["a", 0],
633
- ["b", -1],
634
- ["c", 1],
635
- ["d", -1.5],
636
- ["e", 1.5],
637
- ["f", NaN],
638
- ["g", Infinity],
639
- ["h", 2n],
640
- ["j", true],
641
- ["l", false],
642
- ["i", "str"],
643
- ["r", new Date("2024-01-01")],
644
- ["k", new Set(["a", "b", "c"])],
645
- [
646
- "p",
647
- new Map([
648
- ["a", 1],
649
- ["b", 2],
650
- ["c", 3],
651
- ]),
652
- ],
653
- ["a", /test/],
654
- [1, { a: 2, b: -1 }],
655
- [2, [1, 2, 3]],
656
- ]);
657
- await storageAdapter.addMany({ a: -1 });
658
- await storageAdapter.updateMany({ a: value });
659
- const { a: getResult } = await storageAdapter.getMany(["a"]);
660
- expect(getResult).toBeInstanceOf(Map);
661
- expect(getResult).toEqual(value);
662
- });
663
- test("Should work with Map of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays keys", async () => {
664
- const value = new Map([
665
- [0, "a"],
666
- [-1, "a"],
667
- [1, "a"],
668
- [-1.5, "a"],
669
- [1.5, "a"],
670
- [NaN, "a"],
671
- [Infinity, "a"],
672
- [2n, "a"],
673
- [true, "a"],
674
- [false, "a"],
675
- ["str", "a"],
676
- [new Date("2024-01-01"), "a"],
677
- [new Set(["a", "b", "c"]), "a"],
678
- [
679
- new Map([
680
- ["a", 1],
681
- ["b", 2],
682
- ["c", 3],
683
- ]),
684
- "a",
685
- ],
686
- [/test/, "a"],
687
- [{ a: 2, b: -1 }, 1],
688
- [[1, 2, 3], 2],
689
- ]);
690
- await storageAdapter.addMany({ a: -1 });
691
- await storageAdapter.updateMany({ a: value });
692
- const { a: getResult } = await storageAdapter.getMany(["a"]);
693
- expect(getResult).toBeInstanceOf(Map);
694
- expect(getResult).toEqual(value);
695
- });
696
- test("Should work with array of number, boolean, string, Date, Set, Map, RegExp", async () => {
697
- const value = [
698
- 0,
699
- -1,
700
- 1,
701
- -1.5,
702
- 1.5,
703
- NaN,
704
- Infinity,
705
- 2n,
706
- true,
707
- false,
708
- "str",
709
- new Date("2024-01-01"),
710
- new Set(["a", "b", "c"]),
711
- new Map([
712
- ["a", 1],
713
- ["b", 2],
714
- ["c", 3],
715
- ]),
716
- /test/,
717
- ];
718
- await storageAdapter.addMany({ a: -1 });
719
- await storageAdapter.updateMany({ a: value });
720
- const getResult = await storageAdapter.getMany(["a"]);
721
- expect(getResult).toEqual({ a: value });
722
- });
723
- test("Should work with array of objects", async () => {
724
- const value = [
725
- Object.fromEntries([
726
- ["a", 0],
727
- ["b", -1],
728
- ["c", 1],
729
- ["d", -1.5],
730
- ["e", 1.5],
731
- ["f", NaN],
732
- ["g", Infinity],
733
- ["h", 2n],
734
- ["j", true],
735
- ["l", false],
736
- ["i", "str"],
737
- ["r", new Date("2024-01-01")],
738
- ["k", new Set(["a", "b", "c"])],
739
- [
740
- "p",
741
- new Map([
742
- ["a", 1],
743
- ["b", 2],
744
- ["c", 3],
745
- ]),
746
- ],
747
- ["a", /test/],
748
- ]),
749
- ];
750
- await storageAdapter.addMany({ a: -1 });
751
- await storageAdapter.updateMany({ a: value });
752
- const { a: getResult } = await storageAdapter.getMany(["a"]);
753
- expect(getResult).toEqual(value);
754
- });
755
- test("Should work with object of number, boolean, string, Date, Set, Map, RegExp", async () => {
756
- const value = Object.fromEntries([
757
- ["a", 0],
758
- ["b", -1],
759
- ["c", 1],
760
- ["d", -1.5],
761
- ["e", 1.5],
762
- ["f", NaN],
763
- ["g", Infinity],
764
- ["h", 2n],
765
- ["j", true],
766
- ["l", false],
767
- ["i", "str"],
768
- ["r", new Date("2024-01-01")],
769
- ["k", new Set(["a", "b", "c"])],
770
- [
771
- "p",
772
- new Map([
773
- ["a", 1],
774
- ["b", 2],
775
- ["c", 3],
776
- ]),
777
- ],
778
- ["a", /test/],
779
- ]);
780
- await storageAdapter.addMany({ a: -1 });
781
- await storageAdapter.updateMany({ a: value });
782
- const { a: getResult } = await storageAdapter.getMany(["a"]);
783
- expect(getResult).toEqual(value);
784
- });
785
- test("Should work with object of arrays", async () => {
786
- const value = {
787
- a: [
788
- 0,
789
- -1,
790
- 1,
791
- -1.5,
792
- 1.5,
793
- NaN,
794
- Infinity,
795
- 2n,
796
- true,
797
- false,
798
- "str",
799
- new Date("2024-01-01"),
800
- new Set(["a", "b", "c"]),
801
- new Map([
802
- ["a", 1],
803
- ["b", 2],
804
- ["c", 3],
805
- ]),
806
- /test/,
807
- ],
808
- };
809
- await storageAdapter.addMany({ a: -1 });
810
- await storageAdapter.updateMany({ a: value });
811
- const { a: getResult } = await storageAdapter.getMany(["a"]);
812
- expect(getResult).toEqual(value);
813
- });
814
- });
815
- describe("method: putMany", () => {
816
- test("Should work with positive integer", async () => {
817
- const value = 1;
818
- await storageAdapter.putMany({ a: value });
819
- expect(await storageAdapter.getMany(["a"])).toEqual({
820
- a: value,
821
- });
822
- });
823
- test("Should work with negative integer", async () => {
824
- const value = -1;
825
- await storageAdapter.putMany({ a: value });
826
- expect(await storageAdapter.getMany(["a"])).toEqual({
827
- a: value,
828
- });
829
- });
830
- test("Should work with positive decimal", async () => {
831
- const value = 1.5;
832
- await storageAdapter.putMany({ a: value });
833
- expect(await storageAdapter.getMany(["a"])).toEqual({
834
- a: value,
835
- });
836
- });
837
- test("Should work with negative decimal", async () => {
838
- const value = -1.5;
839
- await storageAdapter.putMany({ a: value });
840
- expect(await storageAdapter.getMany(["a"])).toEqual({
841
- a: value,
842
- });
843
- });
844
- test("Should work with NaN", async () => {
845
- const value = NaN;
846
- await storageAdapter.putMany({ a: value });
847
- const { a: getResult } = await storageAdapter.getMany(["a"]);
848
- expect(getResult).toBeNaN();
849
- });
850
- test("Should work with Infinity", async () => {
851
- const value = Infinity;
852
- await storageAdapter.putMany({ a: value });
853
- const { a: getResult } = await storageAdapter.getMany(["a"]);
854
- expect(isFinite(getResult)).toBe(false);
855
- });
856
- test("Should work with Bigint", async () => {
857
- const value = 20n;
858
- await storageAdapter.putMany({ a: value });
859
- expect(await storageAdapter.getMany(["a"])).toEqual({
860
- a: value,
861
- });
862
- });
863
- test("Should work with true", async () => {
864
- const value = true;
865
- await storageAdapter.putMany({ a: value });
866
- expect(await storageAdapter.getMany(["a"])).toEqual({
867
- a: value,
868
- });
869
- });
870
- test("Should work with false", async () => {
871
- const value = false;
872
- await storageAdapter.putMany({ a: value });
873
- expect(await storageAdapter.getMany(["a"])).toEqual({
874
- a: value,
875
- });
876
- });
877
- test("Should work with string", async () => {
878
- const value = "str";
879
- await storageAdapter.putMany({ a: value });
880
- expect(await storageAdapter.getMany(["a"])).toEqual({
881
- a: value,
882
- });
883
- });
884
- test("Should work with Date", async () => {
885
- const value = new Date("2024-01-01");
886
- await storageAdapter.putMany({ a: value });
887
- const { a: getResult } = await storageAdapter.getMany(["a"]);
888
- expect(getResult).toBeInstanceOf(Date);
889
- expect(getResult).toEqual(value);
890
- });
891
- test("Should work with RegExp", async () => {
892
- const value = /test/;
893
- await storageAdapter.putMany({ a: value });
894
- const { a: getResult } = await storageAdapter.getMany(["a"]);
895
- expect(getResult).toBeInstanceOf(RegExp);
896
- expect(getResult).toEqual(value);
897
- });
898
- test("Should work with Buffer", async () => {
899
- const value = Buffer.from("asd");
900
- await storageAdapter.putMany({ a: value });
901
- const { a: getResult } = await storageAdapter.getMany(["a"]);
902
- expect(getResult).toBeInstanceOf(Buffer);
903
- expect(getResult?.toString("base64")).toEqual(value.toString("base64"));
904
- });
905
- test("Should work with Uint8Array", async () => {
906
- const value = new Uint8Array(Buffer.from("asd"));
907
- await storageAdapter.putMany({ a: value });
908
- const { a: getResult } = await storageAdapter.getMany(["a"]);
909
- expect(getResult).toBeInstanceOf(Uint8Array);
910
- expect(getResult
911
- ? Buffer.from(getResult).toString("base64")
912
- : undefined).toEqual(Buffer.from(value).toString("base64"));
913
- });
914
- test("Should work with Int8Array", async () => {
915
- const value = new Int8Array(Buffer.from("asd"));
916
- await storageAdapter.putMany({ a: value });
917
- const { a: getResult } = await storageAdapter.getMany(["a"]);
918
- expect(getResult).toBeInstanceOf(Int8Array);
919
- expect(getResult
920
- ? Buffer.from(getResult).toString("base64")
921
- : undefined).toEqual(Buffer.from(value).toString("base64"));
922
- });
923
- test("Should work with Uint16Array", async () => {
924
- const value = new Uint16Array(Buffer.from("asd"));
925
- await storageAdapter.putMany({ a: value });
926
- const { a: getResult } = await storageAdapter.getMany(["a"]);
927
- expect(getResult).toBeInstanceOf(Uint16Array);
928
- expect(getResult
929
- ? Buffer.from(getResult).toString("base64")
930
- : undefined).toEqual(Buffer.from(value).toString("base64"));
931
- });
932
- test("Should work with Int16Array", async () => {
933
- const value = new Int16Array(Buffer.from("asd"));
934
- await storageAdapter.putMany({ a: value });
935
- const { a: getResult } = await storageAdapter.getMany(["a"]);
936
- expect(getResult).toBeInstanceOf(Int16Array);
937
- expect(getResult
938
- ? Buffer.from(getResult).toString("base64")
939
- : undefined).toEqual(Buffer.from(value).toString("base64"));
940
- });
941
- test("Should work with Uint32Array", async () => {
942
- const value = new Uint32Array(Buffer.from("asd"));
943
- await storageAdapter.putMany({ a: value });
944
- const { a: getResult } = await storageAdapter.getMany(["a"]);
945
- expect(getResult).toBeInstanceOf(Uint32Array);
946
- expect(getResult
947
- ? Buffer.from(getResult).toString("base64")
948
- : undefined).toEqual(Buffer.from(value).toString("base64"));
949
- });
950
- test("Should work with Int32Array", async () => {
951
- const value = new Int32Array(Buffer.from("asd"));
952
- await storageAdapter.putMany({ a: value });
953
- const { a: getResult } = await storageAdapter.getMany(["a"]);
954
- expect(getResult).toBeInstanceOf(Int32Array);
955
- expect(getResult
956
- ? Buffer.from(getResult).toString("base64")
957
- : undefined).toEqual(Buffer.from(value).toString("base64"));
958
- });
959
- test("Should work with Float32Array", async () => {
960
- const value = new Float32Array(Buffer.from("asd"));
961
- await storageAdapter.putMany({ a: value });
962
- const { a: getResult } = await storageAdapter.getMany(["a"]);
963
- expect(getResult).toBeInstanceOf(Float32Array);
964
- expect(getResult
965
- ? Buffer.from(getResult).toString("base64")
966
- : undefined).toEqual(Buffer.from(value).toString("base64"));
967
- });
968
- test("Should work with Float64Array", async () => {
969
- const value = new Float64Array(Buffer.from("asd"));
970
- await storageAdapter.putMany({ a: value });
971
- const { a: getResult } = await storageAdapter.getMany(["a"]);
972
- expect(getResult).toBeInstanceOf(Float64Array);
973
- expect(getResult
974
- ? Buffer.from(getResult).toString("base64")
975
- : undefined).toEqual(Buffer.from(value).toString("base64"));
976
- });
977
- test("Should work with Set", async () => {
978
- const value = new Set(["a", "b", "c"]);
979
- await storageAdapter.putMany({ a: value });
980
- const { a: getResult } = await storageAdapter.getMany(["a"]);
981
- expect(getResult).toBeInstanceOf(Set);
982
- expect(getResult).toEqual(value);
983
- });
984
- test("Should work with Set of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays", async () => {
985
- const value = new Set([
986
- 0,
987
- -1,
988
- 1,
989
- -1.5,
990
- 1.5,
991
- NaN,
992
- Infinity,
993
- 2n,
994
- true,
995
- false,
996
- "str",
997
- new Date("2024-01-01"),
998
- new Set(["a", "b", "c"]),
999
- new Map([
1000
- ["a", 1],
1001
- ["b", 2],
1002
- ["c", 3],
1003
- ]),
1004
- { a: 1, b: 2 },
1005
- [1, 2, 3],
1006
- /test/,
1007
- ]);
1008
- await storageAdapter.putMany({ a: value });
1009
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1010
- expect(getResult).toBeInstanceOf(Set);
1011
- expect(getResult).toEqual(value);
1012
- });
1013
- test("Should work with Map", async () => {
1014
- const value = new Map([
1015
- ["a", 1],
1016
- ["b", 2],
1017
- ["c", 3],
1018
- ]);
1019
- await storageAdapter.putMany({ a: value });
1020
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1021
- expect(getResult).toBeInstanceOf(Map);
1022
- expect(getResult).toEqual(value);
1023
- });
1024
- test("Should work with Map of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays values", async () => {
1025
- const value = new Map([
1026
- ["a", 0],
1027
- ["b", -1],
1028
- ["c", 1],
1029
- ["d", -1.5],
1030
- ["e", 1.5],
1031
- ["f", NaN],
1032
- ["g", Infinity],
1033
- ["h", 2n],
1034
- ["j", true],
1035
- ["l", false],
1036
- ["i", "str"],
1037
- ["r", new Date("2024-01-01")],
1038
- ["k", new Set(["a", "b", "c"])],
1039
- [
1040
- "p",
1041
- new Map([
1042
- ["a", 1],
1043
- ["b", 2],
1044
- ["c", 3],
1045
- ]),
1046
- ],
1047
- ["a", /test/],
1048
- [1, { a: 2, b: -1 }],
1049
- [2, [1, 2, 3]],
1050
- ]);
1051
- await storageAdapter.putMany({ a: value });
1052
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1053
- expect(getResult).toBeInstanceOf(Map);
1054
- expect(getResult).toEqual(value);
1055
- });
1056
- test("Should work with Map of number, boolean, string, Date, Set, Map, RegExp, Objects, Arrays keys", async () => {
1057
- const value = new Map([
1058
- [0, "a"],
1059
- [-1, "a"],
1060
- [1, "a"],
1061
- [-1.5, "a"],
1062
- [1.5, "a"],
1063
- [NaN, "a"],
1064
- [Infinity, "a"],
1065
- [2n, "a"],
1066
- [true, "a"],
1067
- [false, "a"],
1068
- ["str", "a"],
1069
- [new Date("2024-01-01"), "a"],
1070
- [new Set(["a", "b", "c"]), "a"],
1071
- [
1072
- new Map([
1073
- ["a", 1],
1074
- ["b", 2],
1075
- ["c", 3],
1076
- ]),
1077
- "a",
1078
- ],
1079
- [/test/, "a"],
1080
- [{ a: 2, b: -1 }, 1],
1081
- [[1, 2, 3], 2],
1082
- ]);
1083
- await storageAdapter.putMany({ a: value });
1084
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1085
- expect(getResult).toBeInstanceOf(Map);
1086
- expect(getResult).toEqual(value);
1087
- });
1088
- test("Should work with array of number, boolean, string, Date, Set, Map, RegExp", async () => {
1089
- const value = [
1090
- 0,
1091
- -1,
1092
- 1,
1093
- -1.5,
1094
- 1.5,
1095
- NaN,
1096
- Infinity,
1097
- 2n,
1098
- true,
1099
- false,
1100
- "str",
1101
- new Date("2024-01-01"),
1102
- new Set(["a", "b", "c"]),
1103
- new Map([
1104
- ["a", 1],
1105
- ["b", 2],
1106
- ["c", 3],
1107
- ]),
1108
- /test/,
1109
- ];
1110
- await storageAdapter.putMany({ a: value });
1111
- const getResult = await storageAdapter.getMany(["a"]);
1112
- expect(getResult).toEqual({ a: value });
1113
- });
1114
- test("Should work with array of objects", async () => {
1115
- const value = [
1116
- Object.fromEntries([
1117
- ["a", 0],
1118
- ["b", -1],
1119
- ["c", 1],
1120
- ["d", -1.5],
1121
- ["e", 1.5],
1122
- ["f", NaN],
1123
- ["g", Infinity],
1124
- ["h", 2n],
1125
- ["j", true],
1126
- ["l", false],
1127
- ["i", "str"],
1128
- ["r", new Date("2024-01-01")],
1129
- ["k", new Set(["a", "b", "c"])],
1130
- [
1131
- "p",
1132
- new Map([
1133
- ["a", 1],
1134
- ["b", 2],
1135
- ["c", 3],
1136
- ]),
1137
- ],
1138
- ["a", /test/],
1139
- ]),
1140
- ];
1141
- await storageAdapter.putMany({ a: value });
1142
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1143
- expect(getResult).toEqual(value);
1144
- });
1145
- test("Should work with object of number, boolean, string, Date, Set, Map, RegExp", async () => {
1146
- const value = Object.fromEntries([
1147
- ["a", 0],
1148
- ["b", -1],
1149
- ["c", 1],
1150
- ["d", -1.5],
1151
- ["e", 1.5],
1152
- ["f", NaN],
1153
- ["g", Infinity],
1154
- ["h", 2n],
1155
- ["j", true],
1156
- ["l", false],
1157
- ["i", "str"],
1158
- ["r", new Date("2024-01-01")],
1159
- ["k", new Set(["a", "b", "c"])],
1160
- [
1161
- "p",
1162
- new Map([
1163
- ["a", 1],
1164
- ["b", 2],
1165
- ["c", 3],
1166
- ]),
1167
- ],
1168
- ["a", /test/],
1169
- ]);
1170
- await storageAdapter.putMany({ a: value });
1171
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1172
- expect(getResult).toEqual(value);
1173
- });
1174
- test("Should work with object of arrays", async () => {
1175
- const value = {
1176
- a: [
1177
- 0,
1178
- -1,
1179
- 1,
1180
- -1.5,
1181
- 1.5,
1182
- NaN,
1183
- Infinity,
1184
- 2n,
1185
- true,
1186
- false,
1187
- "str",
1188
- new Date("2024-01-01"),
1189
- new Set(["a", "b", "c"]),
1190
- new Map([
1191
- ["a", 1],
1192
- ["b", 2],
1193
- ["c", 3],
1194
- ]),
1195
- /test/,
1196
- ],
1197
- };
1198
- await storageAdapter.putMany({ a: value });
1199
- const { a: getResult } = await storageAdapter.getMany(["a"]);
1200
- expect(getResult).toEqual(value);
1201
- });
1202
- });
1203
- });
1204
- }
1205
- //# sourceMappingURL=storage-adapter-value.test-suite.js.map