@mtkruto/node 0.63.3 → 0.63.4

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 (261) 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 +8 -5
  10. package/esm/client/2_update_manager.js +11 -11
  11. package/esm/client/5_client.d.ts +0 -9
  12. package/esm/client/5_client.d.ts.map +1 -1
  13. package/esm/client/5_client.js +12 -37
  14. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
  15. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
  16. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
  17. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
  18. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
  19. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
  20. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
  21. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
  22. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
  23. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
  24. package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
  25. package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
  26. package/esm/deps/jsr.io/@std/async/1.0.12/_util.js +6 -0
  27. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
  28. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
  29. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.js +46 -0
  30. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
  31. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.js +38 -0
  33. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
  34. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.js +57 -0
  36. package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
  37. package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
  38. package/esm/deps/jsr.io/@std/async/1.0.12/delay.js +65 -0
  39. package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
  40. package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
  41. package/esm/deps/jsr.io/@std/async/1.0.12/mod.js +23 -0
  42. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
  43. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
  44. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +170 -0
  45. package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
  46. package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
  47. package/esm/deps/jsr.io/@std/async/1.0.12/pool.js +99 -0
  48. package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
  49. package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
  50. package/esm/deps/jsr.io/@std/async/1.0.12/retry.js +107 -0
  51. package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
  52. package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
  53. package/esm/deps/jsr.io/@std/async/1.0.12/tee.js +102 -0
  54. package/esm/session/1_session.js +4 -4
  55. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  56. package/esm/session/2_session_encrypted.js +2 -8
  57. package/package.json +1 -1
  58. package/script/0_deps.d.ts +10 -5
  59. package/script/0_deps.d.ts.map +1 -1
  60. package/script/0_deps.js +25 -28
  61. package/script/0_test_deps.d.ts.map +1 -0
  62. package/script/_dnt.polyfills.d.ts +13 -0
  63. package/script/_dnt.polyfills.d.ts.map +1 -1
  64. package/script/_dnt.polyfills.js +11 -0
  65. package/script/client/2_file_manager.d.ts.map +1 -1
  66. package/script/client/2_file_manager.js +7 -4
  67. package/script/client/2_update_manager.js +10 -10
  68. package/script/client/5_client.d.ts +0 -9
  69. package/script/client/5_client.d.ts.map +1 -1
  70. package/script/client/5_client.js +11 -36
  71. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
  72. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
  73. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
  74. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
  75. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
  76. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
  77. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
  78. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
  79. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
  80. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
  81. package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
  82. package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
  83. package/script/deps/jsr.io/@std/async/1.0.12/_util.js +9 -0
  84. package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
  85. package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
  86. package/script/deps/jsr.io/@std/async/1.0.12/abortable.js +49 -0
  87. package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
  88. package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
  89. package/script/deps/jsr.io/@std/async/1.0.12/deadline.js +41 -0
  90. package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
  91. package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
  92. package/script/deps/jsr.io/@std/async/1.0.12/debounce.js +60 -0
  93. package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
  94. package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
  95. package/script/deps/jsr.io/@std/async/1.0.12/delay.js +91 -0
  96. package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
  97. package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
  98. package/script/deps/jsr.io/@std/async/1.0.12/mod.js +39 -0
  99. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
  100. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
  101. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +174 -0
  102. package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
  103. package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
  104. package/script/deps/jsr.io/@std/async/1.0.12/pool.js +102 -0
  105. package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
  106. package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
  107. package/script/deps/jsr.io/@std/async/1.0.12/retry.js +112 -0
  108. package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
  109. package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
  110. package/script/deps/jsr.io/@std/async/1.0.12/tee.js +105 -0
  111. package/script/session/1_session.js +3 -3
  112. package/script/session/2_session_encrypted.d.ts.map +1 -1
  113. package/script/session/2_session_encrypted.js +1 -7
  114. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
  115. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
  116. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -46
  117. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
  118. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
  119. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -46
  120. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
  121. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
  122. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -27
  123. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
  124. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
  125. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -20
  126. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
  127. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
  128. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -29
  129. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
  130. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
  131. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -29
  132. package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
  133. package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -52
  134. package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
  135. package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -53
  136. package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
  137. package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
  138. package/esm/deps/jsr.io/@std/assert/1.0.11/less.js +0 -28
  139. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
  140. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
  141. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -29
  142. package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
  143. package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
  144. package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
  145. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
  146. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
  147. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -45
  148. package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
  149. package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -33
  150. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
  151. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
  152. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
  153. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
  154. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
  155. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
  156. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
  157. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
  158. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
  159. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
  160. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
  161. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -167
  162. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
  163. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
  164. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -53
  165. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
  166. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
  167. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
  168. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
  169. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
  170. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -26
  171. package/esm/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
  172. package/esm/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -44
  173. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
  174. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
  175. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -20
  176. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
  177. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
  178. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -49
  179. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
  180. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
  181. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -49
  182. package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
  183. package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
  184. package/script/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -30
  185. package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
  186. package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
  187. package/script/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -23
  188. package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
  189. package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
  190. package/script/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -32
  191. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
  192. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
  193. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -32
  194. package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
  195. package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -55
  196. package/script/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
  197. package/script/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -56
  198. package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
  199. package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
  200. package/script/deps/jsr.io/@std/assert/1.0.11/less.js +0 -31
  201. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
  202. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
  203. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -32
  204. package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
  205. package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
  206. package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
  207. package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
  208. package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
  209. package/script/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -61
  210. package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
  211. package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -36
  212. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
  213. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
  214. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
  215. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
  216. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
  217. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
  218. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
  219. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
  220. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
  221. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
  222. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
  223. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -170
  224. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
  225. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
  226. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -56
  227. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
  228. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
  229. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
  230. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
  231. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
  232. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -29
  233. package/script/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
  234. package/script/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -47
  235. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
  236. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
  237. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -23
  238. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
  239. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
  240. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
  241. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
  242. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
  243. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
  244. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
  245. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +0 -0
  246. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
  247. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
  248. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
  249. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
  250. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
  251. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
  252. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
  253. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
  254. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
  255. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
  256. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
  257. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +0 -0
  258. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
  259. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
  260. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
  261. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.delay = delay;
29
+ /** Options for {@linkcode delay}. */
30
+ const dntShim = __importStar(require("../../../../../_dnt.shims.js"));
31
+ /**
32
+ * Resolve a {@linkcode Promise} after a given amount of milliseconds.
33
+ *
34
+ * @throws {DOMException} If the optional signal is aborted before the delay
35
+ * duration, and `signal.reason` is undefined.
36
+ * @param ms Duration in milliseconds for how long the delay should last.
37
+ * @param options Additional options.
38
+ *
39
+ * @example Basic usage
40
+ * ```ts no-assert
41
+ * import { delay } from "@std/async/delay";
42
+ *
43
+ * // ...
44
+ * const delayedPromise = delay(100);
45
+ * const result = await delayedPromise;
46
+ * // ...
47
+ * ```
48
+ *
49
+ * @example Disable persistence
50
+ *
51
+ * Setting `persistent` to `false` will allow the process to continue to run as
52
+ * long as the timer exists.
53
+ *
54
+ * ```ts no-assert ignore
55
+ * import { delay } from "@std/async/delay";
56
+ *
57
+ * // ...
58
+ * await delay(100, { persistent: false });
59
+ * // ...
60
+ * ```
61
+ */
62
+ function delay(ms, options = {}) {
63
+ const { signal, persistent = true } = options;
64
+ if (signal?.aborted)
65
+ return Promise.reject(signal.reason);
66
+ return new Promise((resolve, reject) => {
67
+ const abort = () => {
68
+ clearTimeout(i);
69
+ reject(signal?.reason);
70
+ };
71
+ const done = () => {
72
+ signal?.removeEventListener("abort", abort);
73
+ resolve();
74
+ };
75
+ const i = setTimeout(done, ms);
76
+ signal?.addEventListener("abort", abort, { once: true });
77
+ if (persistent === false) {
78
+ try {
79
+ // @ts-ignore For browser compatibility
80
+ dntShim.Deno.unrefTimer(i);
81
+ }
82
+ catch (error) {
83
+ if (!(error instanceof ReferenceError)) {
84
+ throw error;
85
+ }
86
+ // deno-lint-ignore no-console
87
+ console.error("`persistent` option is only available in Deno");
88
+ }
89
+ }
90
+ });
91
+ }
@@ -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,39 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ /**
20
+ * Provide helpers with asynchronous tasks like {@linkcode delay | delays},
21
+ * {@linkcode debounce | debouncing}, {@linkcode retry | retrying}, or
22
+ * {@linkcode pooledMap | pooling}.
23
+ *
24
+ * ```ts no-assert
25
+ * import { delay } from "@std/async/delay";
26
+ *
27
+ * await delay(100); // waits for 100 milliseconds
28
+ * ```
29
+ *
30
+ * @module
31
+ */
32
+ __exportStar(require("./abortable.js"), exports);
33
+ __exportStar(require("./deadline.js"), exports);
34
+ __exportStar(require("./debounce.js"), exports);
35
+ __exportStar(require("./delay.js"), exports);
36
+ __exportStar(require("./mux_async_iterator.js"), exports);
37
+ __exportStar(require("./pool.js"), exports);
38
+ __exportStar(require("./tee.js"), exports);
39
+ __exportStar(require("./retry.js"), exports);
@@ -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,174 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
5
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
6
+ 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");
7
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8
+ };
9
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10
+ if (kind === "m") throw new TypeError("Private method is not writable");
11
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
12
+ 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");
13
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14
+ };
15
+ var _MuxAsyncIterator_instances, _MuxAsyncIterator_iteratorCount, _MuxAsyncIterator_yields, _MuxAsyncIterator_throws, _MuxAsyncIterator_signal, _MuxAsyncIterator_callIteratorNext;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.MuxAsyncIterator = void 0;
18
+ /**
19
+ * Multiplexes multiple async iterators into a single stream. It currently
20
+ * makes an assumption that the final result (the value returned and not
21
+ * yielded from the iterator) does not matter; if there is any result, it is
22
+ * discarded.
23
+ *
24
+ * @example Usage
25
+ * ```ts
26
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
27
+ * import { assertEquals } from "@std/assert";
28
+ *
29
+ * async function* gen123(): AsyncIterableIterator<number> {
30
+ * yield 1;
31
+ * yield 2;
32
+ * yield 3;
33
+ * }
34
+ *
35
+ * async function* gen456(): AsyncIterableIterator<number> {
36
+ * yield 4;
37
+ * yield 5;
38
+ * yield 6;
39
+ * }
40
+ *
41
+ * const mux = new MuxAsyncIterator<number>();
42
+ * mux.add(gen123());
43
+ * mux.add(gen456());
44
+ *
45
+ * const result = await Array.fromAsync(mux);
46
+ *
47
+ * assertEquals(result, [1, 4, 2, 5, 3, 6]);
48
+ * ```
49
+ *
50
+ * @typeParam T The type of the provided async iterables and generated async iterable.
51
+ */
52
+ class MuxAsyncIterator {
53
+ constructor() {
54
+ _MuxAsyncIterator_instances.add(this);
55
+ _MuxAsyncIterator_iteratorCount.set(this, 0);
56
+ _MuxAsyncIterator_yields.set(this, []);
57
+ // deno-lint-ignore no-explicit-any
58
+ _MuxAsyncIterator_throws.set(this, []);
59
+ _MuxAsyncIterator_signal.set(this, Promise.withResolvers());
60
+ }
61
+ /**
62
+ * Add an async iterable to the stream.
63
+ *
64
+ * @param iterable The async iterable to add.
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
+ add(iterable) {
86
+ var _a;
87
+ __classPrivateFieldSet(this, _MuxAsyncIterator_iteratorCount, (_a = __classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f"), ++_a), "f");
88
+ __classPrivateFieldGet(this, _MuxAsyncIterator_instances, "m", _MuxAsyncIterator_callIteratorNext).call(this, iterable[Symbol.asyncIterator]());
89
+ }
90
+ /**
91
+ * Returns an async iterator of the stream.
92
+ * @returns the async iterator for all the added async iterables.
93
+ *
94
+ * @example Usage
95
+ * ```ts
96
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
97
+ * import { assertEquals } from "@std/assert";
98
+ *
99
+ * async function* gen123(): AsyncIterableIterator<number> {
100
+ * yield 1;
101
+ * yield 2;
102
+ * yield 3;
103
+ * }
104
+ *
105
+ * const mux = new MuxAsyncIterator<number>();
106
+ * mux.add(gen123());
107
+ *
108
+ * const result = await Array.fromAsync(mux.iterate());
109
+ *
110
+ * assertEquals(result, [1, 2, 3]);
111
+ * ```
112
+ */
113
+ async *iterate() {
114
+ while (__classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f") > 0) {
115
+ // Sleep until any of the wrapped iterators yields.
116
+ await __classPrivateFieldGet(this, _MuxAsyncIterator_signal, "f").promise;
117
+ // Note that while we're looping over `yields`, new items may be added.
118
+ for (const { iterator, value } of __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f")) {
119
+ yield value;
120
+ __classPrivateFieldGet(this, _MuxAsyncIterator_instances, "m", _MuxAsyncIterator_callIteratorNext).call(this, iterator);
121
+ }
122
+ if (__classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f").length) {
123
+ for (const e of __classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f")) {
124
+ throw e;
125
+ }
126
+ }
127
+ // Clear the `yields` list and reset the `signal` promise.
128
+ __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f").length = 0;
129
+ __classPrivateFieldSet(this, _MuxAsyncIterator_signal, Promise.withResolvers(), "f");
130
+ }
131
+ }
132
+ /**
133
+ * Implements an async iterator for the stream.
134
+ * @returns the async iterator for all the added async iterables.
135
+ *
136
+ * @example Usage
137
+ * ```ts
138
+ * import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
139
+ * import { assertEquals } from "@std/assert";
140
+ *
141
+ * async function* gen123(): AsyncIterableIterator<number> {
142
+ * yield 1;
143
+ * yield 2;
144
+ * yield 3;
145
+ * }
146
+ *
147
+ * const mux = new MuxAsyncIterator<number>();
148
+ * mux.add(gen123());
149
+ *
150
+ * const result = await Array.fromAsync(mux);
151
+ *
152
+ * assertEquals(result, [1, 2, 3]);
153
+ * ```
154
+ */
155
+ [(_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) {
156
+ var _a;
157
+ try {
158
+ const { value, done } = await iterator.next();
159
+ if (done) {
160
+ __classPrivateFieldSet(this, _MuxAsyncIterator_iteratorCount, (_a = __classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f"), --_a), "f");
161
+ }
162
+ else {
163
+ __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f").push({ iterator, value });
164
+ }
165
+ }
166
+ catch (e) {
167
+ __classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f").push(e);
168
+ }
169
+ __classPrivateFieldGet(this, _MuxAsyncIterator_signal, "f").resolve();
170
+ }, Symbol.asyncIterator)]() {
171
+ return this.iterate();
172
+ }
173
+ }
174
+ exports.MuxAsyncIterator = MuxAsyncIterator;
@@ -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"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ // Copyright 2018-2025 the Deno authors. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.pooledMap = pooledMap;
6
+ /** Error message emitted from the thrown error while mapping. */
7
+ const ERROR_WHILE_MAPPING_MESSAGE = "Cannot complete the mapping as an error was thrown from an item";
8
+ /**
9
+ * pooledMap transforms values from an (async) iterable into another async
10
+ * iterable. The transforms are done concurrently, with a max concurrency
11
+ * defined by the poolLimit.
12
+ *
13
+ * If an error is thrown from `iterableFn`, no new transformations will begin.
14
+ * All currently executing transformations are allowed to finish and still
15
+ * yielded on success. After that, the rejections among them are gathered and
16
+ * thrown by the iterator in an `AggregateError`.
17
+ *
18
+ * @example Usage
19
+ * ```ts
20
+ * import { pooledMap } from "@std/async/pool";
21
+ * import { assertEquals } from "@std/assert";
22
+ *
23
+ * const results = pooledMap(
24
+ * 2,
25
+ * [1, 2, 3],
26
+ * (i) => new Promise((r) => setTimeout(() => r(i), 1000)),
27
+ * );
28
+ *
29
+ * assertEquals(await Array.fromAsync(results), [1, 2, 3]);
30
+ * ```
31
+ *
32
+ * @typeParam T the input type.
33
+ * @typeParam R the output type.
34
+ * @param poolLimit The maximum count of items being processed concurrently.
35
+ * @param array The input array for mapping.
36
+ * @param iteratorFn The function to call for every item of the array.
37
+ * @returns The async iterator with the transformed values.
38
+ */
39
+ function pooledMap(poolLimit, array, iteratorFn) {
40
+ // Create the async iterable that is returned from this function.
41
+ const res = new TransformStream({
42
+ async transform(p, controller) {
43
+ try {
44
+ const s = await p;
45
+ controller.enqueue(s);
46
+ }
47
+ catch (e) {
48
+ if (e instanceof AggregateError &&
49
+ e.message === ERROR_WHILE_MAPPING_MESSAGE) {
50
+ controller.error(e);
51
+ }
52
+ }
53
+ },
54
+ });
55
+ // Start processing items from the iterator
56
+ (async () => {
57
+ const writer = res.writable.getWriter();
58
+ const executing = [];
59
+ try {
60
+ for await (const item of array) {
61
+ const p = Promise.resolve().then(() => iteratorFn(item));
62
+ // Only write on success. If we `writer.write()` a rejected promise,
63
+ // that will end the iteration. We don't want that yet. Instead let it
64
+ // fail the race, taking us to the catch block where all currently
65
+ // executing jobs are allowed to finish and all rejections among them
66
+ // can be reported together.
67
+ writer.write(p);
68
+ const e = p.then(() => executing.splice(executing.indexOf(e), 1));
69
+ executing.push(e);
70
+ if (executing.length >= poolLimit) {
71
+ await Promise.race(executing);
72
+ }
73
+ }
74
+ // Wait until all ongoing events have processed, then close the writer.
75
+ await Promise.all(executing);
76
+ writer.close();
77
+ }
78
+ catch {
79
+ const errors = [];
80
+ for (const result of await Promise.allSettled(executing)) {
81
+ if (result.status === "rejected") {
82
+ errors.push(result.reason);
83
+ }
84
+ }
85
+ writer.write(Promise.reject(new AggregateError(errors, ERROR_WHILE_MAPPING_MESSAGE))).catch(() => { });
86
+ }
87
+ })();
88
+ // Feature test until browser coverage is adequate
89
+ return Symbol.asyncIterator in res.readable &&
90
+ typeof res.readable[Symbol.asyncIterator] === "function"
91
+ ? res.readable[Symbol.asyncIterator]()
92
+ : (async function* () {
93
+ const reader = res.readable.getReader();
94
+ while (true) {
95
+ const { done, value } = await reader.read();
96
+ if (done)
97
+ break;
98
+ yield value;
99
+ }
100
+ reader.releaseLock();
101
+ })();
102
+ }