@mtkruto/node 0.63.3 → 0.63.6

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 (269) hide show
  1. package/esm/0_deps.d.ts +10 -5
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +10 -5
  4. package/esm/0_test_deps.d.ts.map +1 -0
  5. package/esm/_dnt.polyfills.d.ts +13 -0
  6. package/esm/_dnt.polyfills.d.ts.map +1 -1
  7. package/esm/_dnt.polyfills.js +11 -0
  8. package/esm/client/2_file_manager.d.ts.map +1 -1
  9. package/esm/client/2_file_manager.js +52 -72
  10. package/esm/client/2_update_manager.js +11 -11
  11. package/esm/client/3_client_encrypted_pool.d.ts +0 -1
  12. package/esm/client/3_client_encrypted_pool.d.ts.map +1 -1
  13. package/esm/client/3_client_encrypted_pool.js +15 -22
  14. package/esm/client/3_client_encrypted_pool_test.d.ts.map +1 -0
  15. package/esm/client/5_client.d.ts +0 -9
  16. package/esm/client/5_client.d.ts.map +1 -1
  17. package/esm/client/5_client.js +25 -44
  18. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
  19. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
  20. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
  21. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
  22. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
  23. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
  24. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
  25. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
  26. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
  27. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
  28. package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
  29. package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/async/1.0.12/_util.js +6 -0
  31. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
  32. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.js +46 -0
  34. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
  35. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.js +38 -0
  37. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
  38. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.js +57 -0
  40. package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
  41. package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/async/1.0.12/delay.js +65 -0
  43. package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
  44. package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/async/1.0.12/mod.js +23 -0
  46. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
  47. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +170 -0
  49. package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
  50. package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/async/1.0.12/pool.js +99 -0
  52. package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
  53. package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/async/1.0.12/retry.js +107 -0
  55. package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
  56. package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/async/1.0.12/tee.js +102 -0
  58. package/esm/session/1_session.js +4 -4
  59. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  60. package/esm/session/2_session_encrypted.js +2 -8
  61. package/package.json +1 -1
  62. package/script/0_deps.d.ts +10 -5
  63. package/script/0_deps.d.ts.map +1 -1
  64. package/script/0_deps.js +25 -28
  65. package/script/0_test_deps.d.ts.map +1 -0
  66. package/script/_dnt.polyfills.d.ts +13 -0
  67. package/script/_dnt.polyfills.d.ts.map +1 -1
  68. package/script/_dnt.polyfills.js +11 -0
  69. package/script/client/2_file_manager.d.ts.map +1 -1
  70. package/script/client/2_file_manager.js +51 -71
  71. package/script/client/2_update_manager.js +10 -10
  72. package/script/client/3_client_encrypted_pool.d.ts +0 -1
  73. package/script/client/3_client_encrypted_pool.d.ts.map +1 -1
  74. package/script/client/3_client_encrypted_pool.js +15 -22
  75. package/script/client/3_client_encrypted_pool_test.d.ts.map +1 -0
  76. package/script/client/5_client.d.ts +0 -9
  77. package/script/client/5_client.d.ts.map +1 -1
  78. package/script/client/5_client.js +23 -42
  79. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
  80. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
  81. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
  82. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
  83. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
  84. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
  85. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
  86. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
  87. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
  88. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
  89. package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
  90. package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
  91. package/script/deps/jsr.io/@std/async/1.0.12/_util.js +9 -0
  92. package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
  93. package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
  94. package/script/deps/jsr.io/@std/async/1.0.12/abortable.js +49 -0
  95. package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
  96. package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
  97. package/script/deps/jsr.io/@std/async/1.0.12/deadline.js +41 -0
  98. package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
  99. package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
  100. package/script/deps/jsr.io/@std/async/1.0.12/debounce.js +60 -0
  101. package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
  102. package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
  103. package/script/deps/jsr.io/@std/async/1.0.12/delay.js +91 -0
  104. package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
  105. package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
  106. package/script/deps/jsr.io/@std/async/1.0.12/mod.js +39 -0
  107. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
  108. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
  109. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +174 -0
  110. package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
  111. package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
  112. package/script/deps/jsr.io/@std/async/1.0.12/pool.js +102 -0
  113. package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
  114. package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
  115. package/script/deps/jsr.io/@std/async/1.0.12/retry.js +112 -0
  116. package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
  117. package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
  118. package/script/deps/jsr.io/@std/async/1.0.12/tee.js +105 -0
  119. package/script/session/1_session.js +3 -3
  120. package/script/session/2_session_encrypted.d.ts.map +1 -1
  121. package/script/session/2_session_encrypted.js +1 -7
  122. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
  123. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
  124. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -46
  125. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
  126. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
  127. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -46
  128. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
  129. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
  130. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -27
  131. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
  132. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
  133. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -20
  134. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
  135. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
  136. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -29
  137. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
  138. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
  139. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -29
  140. package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
  141. package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -52
  142. package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
  143. package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -53
  144. package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
  145. package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
  146. package/esm/deps/jsr.io/@std/assert/1.0.11/less.js +0 -28
  147. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
  148. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
  149. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -29
  150. package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
  151. package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
  152. package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
  153. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
  154. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
  155. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -45
  156. package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
  157. package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -33
  158. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
  159. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
  160. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
  161. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
  162. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
  163. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
  164. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
  165. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
  166. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
  167. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
  168. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
  169. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -167
  170. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
  171. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
  172. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -53
  173. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
  174. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
  175. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
  176. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
  177. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
  178. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -26
  179. package/esm/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
  180. package/esm/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -44
  181. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
  182. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
  183. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -20
  184. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
  185. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
  186. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -49
  187. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
  188. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
  189. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -49
  190. package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
  191. package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
  192. package/script/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -30
  193. package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
  194. package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
  195. package/script/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -23
  196. package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
  197. package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
  198. package/script/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -32
  199. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
  200. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
  201. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -32
  202. package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
  203. package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -55
  204. package/script/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
  205. package/script/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -56
  206. package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
  207. package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
  208. package/script/deps/jsr.io/@std/assert/1.0.11/less.js +0 -31
  209. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
  210. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
  211. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -32
  212. package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
  213. package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
  214. package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
  215. package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
  216. package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
  217. package/script/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -61
  218. package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
  219. package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -36
  220. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
  221. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
  222. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
  223. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
  224. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
  225. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
  226. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
  227. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
  228. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
  229. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
  230. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
  231. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -170
  232. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
  233. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
  234. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -56
  235. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
  236. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
  237. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
  238. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
  239. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
  240. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -29
  241. package/script/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
  242. package/script/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -47
  243. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
  244. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
  245. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -23
  246. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
  247. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
  248. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
  249. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
  250. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
  251. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
  252. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
  253. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +0 -0
  254. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
  255. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
  256. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
  257. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
  258. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
  259. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
  260. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
  261. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
  262. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
  263. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
  264. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
  265. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +0 -0
  266. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
  267. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
  268. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
  269. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
@@ -0,0 +1,38 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { abortable } from "./abortable.js";
4
+ /**
5
+ * Create a promise which will be rejected with {@linkcode DOMException} when
6
+ * a given delay is exceeded.
7
+ *
8
+ * Note: Prefer to use {@linkcode AbortSignal.timeout} instead for the APIs
9
+ * that accept {@linkcode AbortSignal}.
10
+ *
11
+ * @throws {DOMException & { name: "TimeoutError" }} If the provided duration
12
+ * runs out before resolving.
13
+ * @throws {DOMException & { name: "AbortError" }} If the optional signal is
14
+ * aborted with the default `reason` before resolving or timing out.
15
+ * @throws {AbortSignal["reason"]} If the optional signal is aborted with a
16
+ * custom `reason` before resolving or timing out.
17
+ * @typeParam T The type of the provided and returned promise.
18
+ * @param p The promise to make rejectable.
19
+ * @param ms Duration in milliseconds for when the promise should time out.
20
+ * @param options Additional options.
21
+ * @returns A promise that will reject if the provided duration runs out before resolving.
22
+ *
23
+ * @example Usage
24
+ * ```ts ignore
25
+ * import { deadline } from "@std/async/deadline";
26
+ * import { delay } from "@std/async/delay";
27
+ *
28
+ * const delayedPromise = delay(1_000);
29
+ * // Below throws `DOMException` after 10 ms
30
+ * const result = await deadline(delayedPromise, 10);
31
+ * ```
32
+ */
33
+ export async function deadline(p, ms, options = {}) {
34
+ const signals = [AbortSignal.timeout(ms)];
35
+ if (options.signal)
36
+ signals.push(options.signal);
37
+ return await abortable(p, AbortSignal.any(signals));
38
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * A debounced function that will be delayed by a given `wait`
3
+ * time in milliseconds. If the method is called again before
4
+ * the timeout expires, the previous call will be aborted.
5
+ */
6
+ export interface DebouncedFunction<T extends Array<unknown>> {
7
+ (...args: T): void;
8
+ /** Clears the debounce timeout and omits calling the debounced function. */
9
+ clear(): void;
10
+ /** Clears the debounce timeout and calls the debounced function immediately. */
11
+ flush(): void;
12
+ /** Returns a boolean whether a debounce call is pending or not. */
13
+ readonly pending: boolean;
14
+ }
15
+ /**
16
+ * Creates a debounced function that delays the given `func`
17
+ * by a given `wait` time in milliseconds. If the method is called
18
+ * again before the timeout expires, the previous call will be
19
+ * aborted.
20
+ *
21
+ * @example Usage
22
+ * ```ts ignore
23
+ * import { debounce } from "@std/async/debounce";
24
+ *
25
+ * const log = debounce(
26
+ * (event: Deno.FsEvent) =>
27
+ * console.log("[%s] %s", event.kind, event.paths[0]),
28
+ * 200,
29
+ * );
30
+ *
31
+ * for await (const event of Deno.watchFs("./")) {
32
+ * log(event);
33
+ * }
34
+ * // wait 200ms ...
35
+ * // output: Function debounced after 200ms with baz
36
+ * ```
37
+ *
38
+ * @typeParam T The arguments of the provided function.
39
+ * @param fn The function to debounce.
40
+ * @param wait The time in milliseconds to delay the function.
41
+ * @returns The debounced function.
42
+ */
43
+ export declare function debounce<T extends Array<any>>(fn: (this: DebouncedFunction<T>, ...args: T) => void, wait: number): DebouncedFunction<T>;
44
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/debounce.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC;IACzD,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACnB,4EAA4E;IAC5E,KAAK,IAAI,IAAI,CAAC;IACd,gFAAgF;IAChF,KAAK,IAAI,IAAI,CAAC;IACd,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,EAC3C,EAAE,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,EACpD,IAAI,EAAE,MAAM,GACX,iBAAiB,CAAC,CAAC,CAAC,CA8BtB"}
@@ -0,0 +1,57 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Creates a debounced function that delays the given `func`
5
+ * by a given `wait` time in milliseconds. If the method is called
6
+ * again before the timeout expires, the previous call will be
7
+ * aborted.
8
+ *
9
+ * @example Usage
10
+ * ```ts ignore
11
+ * import { debounce } from "@std/async/debounce";
12
+ *
13
+ * const log = debounce(
14
+ * (event: Deno.FsEvent) =>
15
+ * console.log("[%s] %s", event.kind, event.paths[0]),
16
+ * 200,
17
+ * );
18
+ *
19
+ * for await (const event of Deno.watchFs("./")) {
20
+ * log(event);
21
+ * }
22
+ * // wait 200ms ...
23
+ * // output: Function debounced after 200ms with baz
24
+ * ```
25
+ *
26
+ * @typeParam T The arguments of the provided function.
27
+ * @param fn The function to debounce.
28
+ * @param wait The time in milliseconds to delay the function.
29
+ * @returns The debounced function.
30
+ */
31
+ // deno-lint-ignore no-explicit-any
32
+ export function debounce(fn, wait) {
33
+ let timeout = null;
34
+ let flush = null;
35
+ const debounced = ((...args) => {
36
+ debounced.clear();
37
+ flush = () => {
38
+ debounced.clear();
39
+ fn.call(debounced, ...args);
40
+ };
41
+ timeout = Number(setTimeout(flush, wait));
42
+ });
43
+ debounced.clear = () => {
44
+ if (typeof timeout === "number") {
45
+ clearTimeout(timeout);
46
+ timeout = null;
47
+ flush = null;
48
+ }
49
+ };
50
+ debounced.flush = () => {
51
+ flush?.();
52
+ };
53
+ Object.defineProperty(debounced, "pending", {
54
+ get: () => typeof timeout === "number",
55
+ });
56
+ return debounced;
57
+ }
@@ -0,0 +1,42 @@
1
+ export interface DelayOptions {
2
+ /** Signal used to abort the delay. */
3
+ signal?: AbortSignal;
4
+ /** Indicates whether the process should continue to run as long as the timer exists.
5
+ *
6
+ * @default {true}
7
+ */
8
+ persistent?: boolean;
9
+ }
10
+ /**
11
+ * Resolve a {@linkcode Promise} after a given amount of milliseconds.
12
+ *
13
+ * @throws {DOMException} If the optional signal is aborted before the delay
14
+ * duration, and `signal.reason` is undefined.
15
+ * @param ms Duration in milliseconds for how long the delay should last.
16
+ * @param options Additional options.
17
+ *
18
+ * @example Basic usage
19
+ * ```ts no-assert
20
+ * import { delay } from "@std/async/delay";
21
+ *
22
+ * // ...
23
+ * const delayedPromise = delay(100);
24
+ * const result = await delayedPromise;
25
+ * // ...
26
+ * ```
27
+ *
28
+ * @example Disable persistence
29
+ *
30
+ * Setting `persistent` to `false` will allow the process to continue to run as
31
+ * long as the timer exists.
32
+ *
33
+ * ```ts no-assert ignore
34
+ * import { delay } from "@std/async/delay";
35
+ *
36
+ * // ...
37
+ * await delay(100, { persistent: false });
38
+ * // ...
39
+ * ```
40
+ */
41
+ export declare function delay(ms: number, options?: DelayOptions): Promise<void>;
42
+ //# sourceMappingURL=delay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/delay.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B3E"}
@@ -0,0 +1,65 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ /** Options for {@linkcode delay}. */
4
+ import * as dntShim from "../../../../../_dnt.shims.js";
5
+ /**
6
+ * Resolve a {@linkcode Promise} after a given amount of milliseconds.
7
+ *
8
+ * @throws {DOMException} If the optional signal is aborted before the delay
9
+ * duration, and `signal.reason` is undefined.
10
+ * @param ms Duration in milliseconds for how long the delay should last.
11
+ * @param options Additional options.
12
+ *
13
+ * @example Basic usage
14
+ * ```ts no-assert
15
+ * import { delay } from "@std/async/delay";
16
+ *
17
+ * // ...
18
+ * const delayedPromise = delay(100);
19
+ * const result = await delayedPromise;
20
+ * // ...
21
+ * ```
22
+ *
23
+ * @example Disable persistence
24
+ *
25
+ * Setting `persistent` to `false` will allow the process to continue to run as
26
+ * long as the timer exists.
27
+ *
28
+ * ```ts no-assert ignore
29
+ * import { delay } from "@std/async/delay";
30
+ *
31
+ * // ...
32
+ * await delay(100, { persistent: false });
33
+ * // ...
34
+ * ```
35
+ */
36
+ export function delay(ms, options = {}) {
37
+ const { signal, persistent = true } = options;
38
+ if (signal?.aborted)
39
+ return Promise.reject(signal.reason);
40
+ return new Promise((resolve, reject) => {
41
+ const abort = () => {
42
+ clearTimeout(i);
43
+ reject(signal?.reason);
44
+ };
45
+ const done = () => {
46
+ signal?.removeEventListener("abort", abort);
47
+ resolve();
48
+ };
49
+ const i = setTimeout(done, ms);
50
+ signal?.addEventListener("abort", abort, { once: true });
51
+ if (persistent === false) {
52
+ try {
53
+ // @ts-ignore For browser compatibility
54
+ dntShim.Deno.unrefTimer(i);
55
+ }
56
+ catch (error) {
57
+ if (!(error instanceof ReferenceError)) {
58
+ throw error;
59
+ }
60
+ // deno-lint-ignore no-console
61
+ console.error("`persistent` option is only available in Deno");
62
+ }
63
+ }
64
+ });
65
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Provide helpers with asynchronous tasks like {@linkcode delay | delays},
3
+ * {@linkcode debounce | debouncing}, {@linkcode retry | retrying}, or
4
+ * {@linkcode pooledMap | pooling}.
5
+ *
6
+ * ```ts no-assert
7
+ * import { delay } from "@std/async/delay";
8
+ *
9
+ * await delay(100); // waits for 100 milliseconds
10
+ * ```
11
+ *
12
+ * @module
13
+ */
14
+ export * from "./abortable.js";
15
+ export * from "./deadline.js";
16
+ export * from "./debounce.js";
17
+ export * from "./delay.js";
18
+ export * from "./mux_async_iterator.js";
19
+ export * from "./pool.js";
20
+ export * from "./tee.js";
21
+ export * from "./retry.js";
22
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,23 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Provide helpers with asynchronous tasks like {@linkcode delay | delays},
5
+ * {@linkcode debounce | debouncing}, {@linkcode retry | retrying}, or
6
+ * {@linkcode pooledMap | pooling}.
7
+ *
8
+ * ```ts no-assert
9
+ * import { delay } from "@std/async/delay";
10
+ *
11
+ * await delay(100); // waits for 100 milliseconds
12
+ * ```
13
+ *
14
+ * @module
15
+ */
16
+ export * from "./abortable.js";
17
+ export * from "./deadline.js";
18
+ export * from "./debounce.js";
19
+ export * from "./delay.js";
20
+ export * from "./mux_async_iterator.js";
21
+ export * from "./pool.js";
22
+ export * from "./tee.js";
23
+ export * from "./retry.js";
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Multiplexes multiple async iterators into a single stream. It currently
3
+ * makes an assumption that the final result (the value returned and not
4
+ * yielded from the iterator) does not matter; if there is any result, it is
5
+ * discarded.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
10
+ * import { assertEquals } from "@std/assert";
11
+ *
12
+ * async function* gen123(): AsyncIterableIterator<number> {
13
+ * yield 1;
14
+ * yield 2;
15
+ * yield 3;
16
+ * }
17
+ *
18
+ * async function* gen456(): AsyncIterableIterator<number> {
19
+ * yield 4;
20
+ * yield 5;
21
+ * yield 6;
22
+ * }
23
+ *
24
+ * const mux = new MuxAsyncIterator<number>();
25
+ * mux.add(gen123());
26
+ * mux.add(gen456());
27
+ *
28
+ * const result = await Array.fromAsync(mux);
29
+ *
30
+ * assertEquals(result, [1, 4, 2, 5, 3, 6]);
31
+ * ```
32
+ *
33
+ * @typeParam T The type of the provided async iterables and generated async iterable.
34
+ */
35
+ export declare class MuxAsyncIterator<T> implements AsyncIterable<T> {
36
+ #private;
37
+ /**
38
+ * Add an async iterable to the stream.
39
+ *
40
+ * @param iterable The async iterable to add.
41
+ *
42
+ * @example Usage
43
+ * ```ts
44
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
45
+ * import { assertEquals } from "@std/assert";
46
+ *
47
+ * async function* gen123(): AsyncIterableIterator<number> {
48
+ * yield 1;
49
+ * yield 2;
50
+ * yield 3;
51
+ * }
52
+ *
53
+ * const mux = new MuxAsyncIterator<number>();
54
+ * mux.add(gen123());
55
+ *
56
+ * const result = await Array.fromAsync(mux.iterate());
57
+ *
58
+ * assertEquals(result, [1, 2, 3]);
59
+ * ```
60
+ */
61
+ add(iterable: AsyncIterable<T>): void;
62
+ /**
63
+ * Returns an async iterator of the stream.
64
+ * @returns the async iterator for all the added async iterables.
65
+ *
66
+ * @example Usage
67
+ * ```ts
68
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
69
+ * import { assertEquals } from "@std/assert";
70
+ *
71
+ * async function* gen123(): AsyncIterableIterator<number> {
72
+ * yield 1;
73
+ * yield 2;
74
+ * yield 3;
75
+ * }
76
+ *
77
+ * const mux = new MuxAsyncIterator<number>();
78
+ * mux.add(gen123());
79
+ *
80
+ * const result = await Array.fromAsync(mux.iterate());
81
+ *
82
+ * assertEquals(result, [1, 2, 3]);
83
+ * ```
84
+ */
85
+ iterate(): AsyncIterableIterator<T>;
86
+ /**
87
+ * Implements an async iterator for the stream.
88
+ * @returns the async iterator for all the added async iterables.
89
+ *
90
+ * @example Usage
91
+ * ```ts
92
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
93
+ * import { assertEquals } from "@std/assert";
94
+ *
95
+ * async function* gen123(): AsyncIterableIterator<number> {
96
+ * yield 1;
97
+ * yield 2;
98
+ * yield 3;
99
+ * }
100
+ *
101
+ * const mux = new MuxAsyncIterator<number>();
102
+ * mux.add(gen123());
103
+ *
104
+ * const result = await Array.fromAsync(mux);
105
+ *
106
+ * assertEquals(result, [1, 2, 3]);
107
+ * ```
108
+ */
109
+ [Symbol.asyncIterator](): AsyncIterator<T>;
110
+ }
111
+ //# sourceMappingURL=mux_async_iterator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mux_async_iterator.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,gBAAgB,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;;IAO1D;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAqB9B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,OAAO,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAsB1C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;CAG3C"}
@@ -0,0 +1,170 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
6
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
+ };
8
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9
+ if (kind === "m") throw new TypeError("Private method is not writable");
10
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
11
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
12
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
13
+ };
14
+ var _MuxAsyncIterator_instances, _MuxAsyncIterator_iteratorCount, _MuxAsyncIterator_yields, _MuxAsyncIterator_throws, _MuxAsyncIterator_signal, _MuxAsyncIterator_callIteratorNext;
15
+ /**
16
+ * Multiplexes multiple async iterators into a single stream. It currently
17
+ * makes an assumption that the final result (the value returned and not
18
+ * yielded from the iterator) does not matter; if there is any result, it is
19
+ * discarded.
20
+ *
21
+ * @example Usage
22
+ * ```ts
23
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
24
+ * import { assertEquals } from "@std/assert";
25
+ *
26
+ * async function* gen123(): AsyncIterableIterator<number> {
27
+ * yield 1;
28
+ * yield 2;
29
+ * yield 3;
30
+ * }
31
+ *
32
+ * async function* gen456(): AsyncIterableIterator<number> {
33
+ * yield 4;
34
+ * yield 5;
35
+ * yield 6;
36
+ * }
37
+ *
38
+ * const mux = new MuxAsyncIterator<number>();
39
+ * mux.add(gen123());
40
+ * mux.add(gen456());
41
+ *
42
+ * const result = await Array.fromAsync(mux);
43
+ *
44
+ * assertEquals(result, [1, 4, 2, 5, 3, 6]);
45
+ * ```
46
+ *
47
+ * @typeParam T The type of the provided async iterables and generated async iterable.
48
+ */
49
+ export class MuxAsyncIterator {
50
+ constructor() {
51
+ _MuxAsyncIterator_instances.add(this);
52
+ _MuxAsyncIterator_iteratorCount.set(this, 0);
53
+ _MuxAsyncIterator_yields.set(this, []);
54
+ // deno-lint-ignore no-explicit-any
55
+ _MuxAsyncIterator_throws.set(this, []);
56
+ _MuxAsyncIterator_signal.set(this, Promise.withResolvers());
57
+ }
58
+ /**
59
+ * Add an async iterable to the stream.
60
+ *
61
+ * @param iterable The async iterable to add.
62
+ *
63
+ * @example Usage
64
+ * ```ts
65
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
66
+ * import { assertEquals } from "@std/assert";
67
+ *
68
+ * async function* gen123(): AsyncIterableIterator<number> {
69
+ * yield 1;
70
+ * yield 2;
71
+ * yield 3;
72
+ * }
73
+ *
74
+ * const mux = new MuxAsyncIterator<number>();
75
+ * mux.add(gen123());
76
+ *
77
+ * const result = await Array.fromAsync(mux.iterate());
78
+ *
79
+ * assertEquals(result, [1, 2, 3]);
80
+ * ```
81
+ */
82
+ add(iterable) {
83
+ var _a;
84
+ __classPrivateFieldSet(this, _MuxAsyncIterator_iteratorCount, (_a = __classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f"), ++_a), "f");
85
+ __classPrivateFieldGet(this, _MuxAsyncIterator_instances, "m", _MuxAsyncIterator_callIteratorNext).call(this, iterable[Symbol.asyncIterator]());
86
+ }
87
+ /**
88
+ * Returns an async iterator of the stream.
89
+ * @returns the async iterator for all the added async iterables.
90
+ *
91
+ * @example Usage
92
+ * ```ts
93
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
94
+ * import { assertEquals } from "@std/assert";
95
+ *
96
+ * async function* gen123(): AsyncIterableIterator<number> {
97
+ * yield 1;
98
+ * yield 2;
99
+ * yield 3;
100
+ * }
101
+ *
102
+ * const mux = new MuxAsyncIterator<number>();
103
+ * mux.add(gen123());
104
+ *
105
+ * const result = await Array.fromAsync(mux.iterate());
106
+ *
107
+ * assertEquals(result, [1, 2, 3]);
108
+ * ```
109
+ */
110
+ async *iterate() {
111
+ while (__classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f") > 0) {
112
+ // Sleep until any of the wrapped iterators yields.
113
+ await __classPrivateFieldGet(this, _MuxAsyncIterator_signal, "f").promise;
114
+ // Note that while we're looping over `yields`, new items may be added.
115
+ for (const { iterator, value } of __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f")) {
116
+ yield value;
117
+ __classPrivateFieldGet(this, _MuxAsyncIterator_instances, "m", _MuxAsyncIterator_callIteratorNext).call(this, iterator);
118
+ }
119
+ if (__classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f").length) {
120
+ for (const e of __classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f")) {
121
+ throw e;
122
+ }
123
+ }
124
+ // Clear the `yields` list and reset the `signal` promise.
125
+ __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f").length = 0;
126
+ __classPrivateFieldSet(this, _MuxAsyncIterator_signal, Promise.withResolvers(), "f");
127
+ }
128
+ }
129
+ /**
130
+ * Implements an async iterator for the stream.
131
+ * @returns the async iterator for all the added async iterables.
132
+ *
133
+ * @example Usage
134
+ * ```ts
135
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
136
+ * import { assertEquals } from "@std/assert";
137
+ *
138
+ * async function* gen123(): AsyncIterableIterator<number> {
139
+ * yield 1;
140
+ * yield 2;
141
+ * yield 3;
142
+ * }
143
+ *
144
+ * const mux = new MuxAsyncIterator<number>();
145
+ * mux.add(gen123());
146
+ *
147
+ * const result = await Array.fromAsync(mux);
148
+ *
149
+ * assertEquals(result, [1, 2, 3]);
150
+ * ```
151
+ */
152
+ [(_MuxAsyncIterator_iteratorCount = new WeakMap(), _MuxAsyncIterator_yields = new WeakMap(), _MuxAsyncIterator_throws = new WeakMap(), _MuxAsyncIterator_signal = new WeakMap(), _MuxAsyncIterator_instances = new WeakSet(), _MuxAsyncIterator_callIteratorNext = async function _MuxAsyncIterator_callIteratorNext(iterator) {
153
+ var _a;
154
+ try {
155
+ const { value, done } = await iterator.next();
156
+ if (done) {
157
+ __classPrivateFieldSet(this, _MuxAsyncIterator_iteratorCount, (_a = __classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f"), --_a), "f");
158
+ }
159
+ else {
160
+ __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f").push({ iterator, value });
161
+ }
162
+ }
163
+ catch (e) {
164
+ __classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f").push(e);
165
+ }
166
+ __classPrivateFieldGet(this, _MuxAsyncIterator_signal, "f").resolve();
167
+ }, Symbol.asyncIterator)]() {
168
+ return this.iterate();
169
+ }
170
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * pooledMap transforms values from an (async) iterable into another async
3
+ * iterable. The transforms are done concurrently, with a max concurrency
4
+ * defined by the poolLimit.
5
+ *
6
+ * If an error is thrown from `iterableFn`, no new transformations will begin.
7
+ * All currently executing transformations are allowed to finish and still
8
+ * yielded on success. After that, the rejections among them are gathered and
9
+ * thrown by the iterator in an `AggregateError`.
10
+ *
11
+ * @example Usage
12
+ * ```ts
13
+ * import { pooledMap } from "@std/async/pool";
14
+ * import { assertEquals } from "@std/assert";
15
+ *
16
+ * const results = pooledMap(
17
+ * 2,
18
+ * [1, 2, 3],
19
+ * (i) => new Promise((r) => setTimeout(() => r(i), 1000)),
20
+ * );
21
+ *
22
+ * assertEquals(await Array.fromAsync(results), [1, 2, 3]);
23
+ * ```
24
+ *
25
+ * @typeParam T the input type.
26
+ * @typeParam R the output type.
27
+ * @param poolLimit The maximum count of items being processed concurrently.
28
+ * @param array The input array for mapping.
29
+ * @param iteratorFn The function to call for every item of the array.
30
+ * @returns The async iterator with the transformed values.
31
+ */
32
+ export declare function pooledMap<T, R>(poolLimit: number, array: Iterable<T> | AsyncIterable<T>, iteratorFn: (data: T) => Promise<R>): AsyncIterableIterator<R>;
33
+ //# sourceMappingURL=pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/pool.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EACrC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAClC,qBAAqB,CAAC,CAAC,CAAC,CAqE1B"}