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