@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
@@ -29,7 +29,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
29
29
  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");
30
30
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
31
31
  };
32
- var _Client_instances, _Client_clients, _Client_downloadPools, _Client_uploadPools, _Client_guaranteeUpdateDelivery, _Client_accountManager, _Client_botInfoManager, _Client_businessConnectionManager, _Client_fileManager, _Client_networkStatisticsManager, _Client_paymentManager, _Client_reactionManager, _Client_translationsManager, _Client_updateManager, _Client_messageManager, _Client_videoChatManager, _Client_callbackQueryManager, _Client_chatListManager, _Client_chatManager, _Client_forumManager, _Client_giftManager, _Client_inlineQueryManager, _Client_pollManager, _Client_storyManager, _Client_managers, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_transportProvider, _Client_publicKeys, _Client_outgoingMessages, _Client_persistCache, _Client_disableUpdates, _Client_authString, _Client_L, _Client_LsignIn, _Client_LupdateGapRecoveryLoop, _Client_LhandleMigrationError, _Client_Lmin, _Client_setMainClient, _Client_newClient, _Client_disconnectAllClients, _Client_client_get, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectMutex, _Client_lastConnect, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_lastUpdates, _Client_updateGapRecoveryLoopAbortController, _Client_startUpdateGapRecoveryLoop, _Client_updateGapRecoveryLoop, _Client_clientDisconnectionLoopAbortController, _Client_startClientDisconnectionLoop, _Client_clientDisconnectionLoop, _Client_getClient, _Client_getMainClientMutex, _Client_getMainClient, _Client_getDownloadClient, _Client_getUploadClient, _Client_setupClient, _Client_importAuthorization, _Client_invoke, _Client_handleInvokeError, _Client_authStringImported, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerChatId, _Client_getInputPeerInner, _Client_getMinInputPeer, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe, _Client_previouslyConnected, _Client_lastConnectionState, _Client_onConnectionStateChange;
32
+ var _Client_instances, _Client_clients, _Client_downloadPools, _Client_uploadPools, _Client_guaranteeUpdateDelivery, _Client_accountManager, _Client_botInfoManager, _Client_businessConnectionManager, _Client_fileManager, _Client_networkStatisticsManager, _Client_paymentManager, _Client_reactionManager, _Client_translationsManager, _Client_updateManager, _Client_messageManager, _Client_videoChatManager, _Client_callbackQueryManager, _Client_chatListManager, _Client_chatManager, _Client_forumManager, _Client_giftManager, _Client_inlineQueryManager, _Client_pollManager, _Client_storyManager, _Client_managers, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_transportProvider, _Client_publicKeys, _Client_outgoingMessages, _Client_persistCache, _Client_disableUpdates, _Client_authString, _Client_L, _Client_LsignIn, _Client_LupdateGapRecoveryLoop, _Client_LhandleMigrationError, _Client_Lmin, _Client_setMainClient, _Client_newClient, _Client_disconnectAllClients, _Client_client_get, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectMutex, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_lastUpdates, _Client_updateGapRecoveryLoopAbortController, _Client_startUpdateGapRecoveryLoop, _Client_updateGapRecoveryLoop, _Client_clientDisconnectionLoopAbortController, _Client_startClientDisconnectionLoop, _Client_clientDisconnectionLoop, _Client_getClient, _Client_getMainClientMutex, _Client_getMainClient, _Client_getDownloadClient, _Client_getUploadClient, _Client_setupClient, _Client_importAuthorization, _Client_invoke, _Client_handleInvokeError, _Client_authStringImported, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerChatId, _Client_getInputPeerInner, _Client_getMinInputPeer, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe, _Client_previouslyConnected, _Client_lastConnectionState, _Client_onConnectionStateChange;
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
34
  exports.Client = exports.handleMigrationError = exports.restartAuth = exports.Composer = void 0;
35
35
  const _0_deps_js_1 = require("../0_deps.js");
@@ -618,7 +618,6 @@ class Client extends Composer {
618
618
  }).bind(this));
619
619
  _Client_storageInited.set(this, false);
620
620
  _Client_connectMutex.set(this, new _1_utilities_js_1.Mutex());
621
- _Client_lastConnect.set(this, null);
622
621
  _Client_lastPropagatedAuthorizationState.set(this, null);
623
622
  _Client_lastUpdates.set(this, new Date());
624
623
  _Client_updateGapRecoveryLoopAbortController.set(this, null);
@@ -762,20 +761,6 @@ class Client extends Composer {
762
761
  get disconnected() {
763
762
  return __classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get)?.disconnected ?? true;
764
763
  }
765
- /**
766
- * Sets the DC and resets the auth key stored in the session provider
767
- * if the stored DC was not the same as the `dc` parameter.
768
- *
769
- * @param dc The DC to change to.
770
- */
771
- async setDc(dc) {
772
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_initStorage).call(this);
773
- if (await this.storage.getDc() != dc) {
774
- await this.storage.setDc(dc);
775
- await this.storage.setAuthKey(null);
776
- await this.storage.getAuthKey();
777
- }
778
- }
779
764
  /**
780
765
  * Loads the session if `setDc` was not called, initializes and connnects
781
766
  * a `ClientPlain` to generate auth key if there was none, and connects the client.
@@ -810,7 +795,6 @@ class Client extends Composer {
810
795
  }
811
796
  }
812
797
  await __classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).connect();
813
- __classPrivateFieldSet(this, _Client_lastConnect, new Date(), "f");
814
798
  await Promise.all([this.storage.setAuthKey(__classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).authKey), this.storage.setDc(__classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).dc), this.storage.setServerSalt(__classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).serverSalt)]);
815
799
  __classPrivateFieldGet(this, _Client_instances, "m", _Client_startUpdateGapRecoveryLoop).call(this);
816
800
  __classPrivateFieldGet(this, _Client_instances, "m", _Client_startClientDisconnectionLoop).call(this);
@@ -819,14 +803,7 @@ class Client extends Composer {
819
803
  unlock();
820
804
  }
821
805
  }
822
- async reconnect(dc) {
823
- if (dc) {
824
- await this.setDc(dc);
825
- }
826
- this.disconnect();
827
- await this.connect();
828
- }
829
- async [(_Client_clients = new WeakMap(), _Client_downloadPools = new WeakMap(), _Client_uploadPools = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_paymentManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_translationsManager = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_chatManager = new WeakMap(), _Client_forumManager = new WeakMap(), _Client_giftManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_pollManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_managers = new WeakMap(), _Client_storage_ = new WeakMap(), _Client_messageStorage_ = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_apiId = new WeakMap(), _Client_apiHash = new WeakMap(), _Client_transportProvider = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_outgoingMessages = new WeakMap(), _Client_persistCache = new WeakMap(), _Client_disableUpdates = new WeakMap(), _Client_authString = new WeakMap(), _Client_L = new WeakMap(), _Client_LsignIn = new WeakMap(), _Client_LupdateGapRecoveryLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_Lmin = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_lastConnect = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_updateGapRecoveryLoopAbortController = new WeakMap(), _Client_clientDisconnectionLoopAbortController = new WeakMap(), _Client_getMainClientMutex = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_authStringImported = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_previouslyConnected = new WeakMap(), _Client_lastConnectionState = new WeakMap(), _Client_instances = new WeakSet(), _Client_setMainClient = function _Client_setMainClient(client) {
806
+ async [(_Client_clients = new WeakMap(), _Client_downloadPools = new WeakMap(), _Client_uploadPools = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_paymentManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_translationsManager = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_chatManager = new WeakMap(), _Client_forumManager = new WeakMap(), _Client_giftManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_pollManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_managers = new WeakMap(), _Client_storage_ = new WeakMap(), _Client_messageStorage_ = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_apiId = new WeakMap(), _Client_apiHash = new WeakMap(), _Client_transportProvider = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_outgoingMessages = new WeakMap(), _Client_persistCache = new WeakMap(), _Client_disableUpdates = new WeakMap(), _Client_authString = new WeakMap(), _Client_L = new WeakMap(), _Client_LsignIn = new WeakMap(), _Client_LupdateGapRecoveryLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_Lmin = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_updateGapRecoveryLoopAbortController = new WeakMap(), _Client_clientDisconnectionLoopAbortController = new WeakMap(), _Client_getMainClientMutex = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_authStringImported = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_previouslyConnected = new WeakMap(), _Client_lastConnectionState = new WeakMap(), _Client_instances = new WeakSet(), _Client_setMainClient = function _Client_setMainClient(client) {
830
807
  __classPrivateFieldGet(this, _Client_instances, "m", _Client_disconnectAllClients).call(this);
831
808
  __classPrivateFieldSet(this, _Client_clients, [client], "f");
832
809
  client.handlers.onUpdate = (updates) => {
@@ -884,7 +861,10 @@ class Client extends Composer {
884
861
  if (Math.abs((0, _3_transport_js_1.getDcId)(__classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).dc, __classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).cdn)) >= 10_000) {
885
862
  newDc += "-test";
886
863
  }
887
- await this.reconnect(newDc);
864
+ this.disconnect();
865
+ await this.storage.setDc(newDc);
866
+ await this.storage.setAuthKey(null);
867
+ await this.connect();
888
868
  __classPrivateFieldGet(this, _Client_LhandleMigrationError, "f").debug(`migrated to DC${newDc}`);
889
869
  }
890
870
  disconnect() {
@@ -1064,7 +1044,8 @@ class Client extends Composer {
1064
1044
  }
1065
1045
  finally {
1066
1046
  __classPrivateFieldSet(this, _Client_lastGetMe, null, "f");
1067
- await this.reconnect();
1047
+ this.disconnect();
1048
+ await this.connect();
1068
1049
  }
1069
1050
  }
1070
1051
  /**
@@ -1149,13 +1130,7 @@ class Client extends Composer {
1149
1130
  __classPrivateFieldSet(this, _Client_updateGapRecoveryLoopAbortController, new AbortController(), "f");
1150
1131
  while (this.connected) {
1151
1132
  try {
1152
- await new Promise((resolve, reject) => {
1153
- const timeout = setTimeout(resolve, 60 * _0_deps_js_1.SECOND);
1154
- __classPrivateFieldGet(this, _Client_updateGapRecoveryLoopAbortController, "f").signal.onabort = () => {
1155
- reject(__classPrivateFieldGet(this, _Client_updateGapRecoveryLoopAbortController, "f")?.signal.reason);
1156
- clearTimeout(timeout);
1157
- };
1158
- });
1133
+ await (0, _0_deps_js_1.delay)(60 * _0_deps_js_1.SECOND, { signal: __classPrivateFieldGet(this, _Client_updateGapRecoveryLoopAbortController, "f").signal });
1159
1134
  if (!this.connected) {
1160
1135
  continue;
1161
1136
  }
@@ -1235,7 +1210,7 @@ class Client extends Composer {
1235
1210
  if (client) {
1236
1211
  return client;
1237
1212
  }
1238
- const release = await __classPrivateFieldGet(this, _Client_getMainClientMutex, "f").lock();
1213
+ const unlock = await __classPrivateFieldGet(this, _Client_getMainClientMutex, "f").lock();
1239
1214
  client = __classPrivateFieldGet(this, _Client_clients, "f").find((v) => v.dc == dc);
1240
1215
  if (client) {
1241
1216
  return client;
@@ -1247,7 +1222,7 @@ class Client extends Composer {
1247
1222
  return client;
1248
1223
  }
1249
1224
  finally {
1250
- release();
1225
+ unlock();
1251
1226
  }
1252
1227
  }, _Client_getDownloadClient = async function _Client_getDownloadClient(dc) {
1253
1228
  dc ??= __classPrivateFieldGet(this, _Client_instances, "a", _Client_client_get).dc;
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
1
+ {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/equal.ts"],"names":[],"mappings":"AA2FA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAuGrD"}
1
+ {"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/equal.ts"],"names":[],"mappings":"AA2FA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAuGrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/equals.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAkBb"}
1
+ {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/equals.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAkBb"}
@@ -1 +1 @@
1
- {"version":3,"file":"false.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/false.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAI1E"}
1
+ {"version":3,"file":"false.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/false.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAI1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAE9B,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAE9C,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CA6BnC"}
1
+ {"version":3,"file":"instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAE9B,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAE9C,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CA6BnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
1
+ {"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
1
+ {"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
1
+ {"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.11/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
1
+ {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
@@ -0,0 +1,2 @@
1
+ export declare function exponentialBackoffWithJitter(cap: number, base: number, attempt: number, multiplier: number, jitter: number): number;
2
+ //# sourceMappingURL=_util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_util.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/_util.ts"],"names":[],"mappings":"AAGA,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,UAIf"}
@@ -0,0 +1,9 @@
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.exponentialBackoffWithJitter = exponentialBackoffWithJitter;
6
+ function exponentialBackoffWithJitter(cap, base, attempt, multiplier, jitter) {
7
+ const exp = Math.min(cap, base * multiplier ** attempt);
8
+ return (1 - jitter * Math.random()) * exp;
9
+ }
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Make a {@linkcode Promise} abortable with the given signal.
3
+ *
4
+ * @throws {DOMException} If the signal is already aborted and `signal.reason`
5
+ * is undefined. Otherwise, throws `signal.reason`.
6
+ * @typeParam T The type of the provided and returned promise.
7
+ * @param p The promise to make abortable.
8
+ * @param signal The signal to abort the promise with.
9
+ * @returns A promise that can be aborted.
10
+ *
11
+ * @example Error-handling a timeout
12
+ * ```ts ignore
13
+ * import { abortable, delay } from "@std/async";
14
+ * import { assertRejects, assertEquals } from "@std/assert";
15
+ *
16
+ * const promise = delay(1_000);
17
+ *
18
+ * // Rejects with `DOMException` after 100 ms
19
+ * await assertRejects(
20
+ * () => abortable(promise, AbortSignal.timeout(100)),
21
+ * DOMException,
22
+ * "Signal timed out."
23
+ * );
24
+ * ```
25
+ *
26
+ * @example Error-handling an abort
27
+ * ```ts ignore
28
+ * import { abortable, delay } from "@std/async";
29
+ * import { assertRejects, assertEquals } from "@std/assert";
30
+ *
31
+ * const promise = delay(1_000);
32
+ * const controller = new AbortController();
33
+ * controller.abort(new Error("This is my reason"));
34
+ *
35
+ * // Rejects with `DOMException` immediately
36
+ * await assertRejects(
37
+ * () => abortable(promise, controller.signal),
38
+ * Error,
39
+ * "This is my reason"
40
+ * );
41
+ * ```
42
+ */
43
+ export declare function abortable<T>(p: Promise<T>, signal: AbortSignal): Promise<T>;
44
+ /**
45
+ * Make an {@linkcode AsyncIterable} abortable with the given signal.
46
+ *
47
+ * @throws {DOMException} If the signal is already aborted and `signal.reason`
48
+ * is undefined. Otherwise, throws `signal.reason`.
49
+ * @typeParam T The type of the provided and returned async iterable.
50
+ * @param p The async iterable to make abortable.
51
+ * @param signal The signal to abort the promise with.
52
+ * @returns An async iterable that can be aborted.
53
+ *
54
+ * @example Error-handling a timeout
55
+ * ```ts
56
+ * import { abortable, delay } from "@std/async";
57
+ * import { assertRejects, assertEquals } from "@std/assert";
58
+ *
59
+ * const asyncIter = async function* () {
60
+ * yield "Hello";
61
+ * await delay(1_000);
62
+ * yield "World";
63
+ * };
64
+ *
65
+ * const items: string[] = [];
66
+ * // Below throws `DOMException` after 100 ms and items become `["Hello"]`
67
+ * await assertRejects(
68
+ * async () => {
69
+ * for await (const item of abortable(asyncIter(), AbortSignal.timeout(100))) {
70
+ * items.push(item);
71
+ * }
72
+ * },
73
+ * DOMException,
74
+ * "Signal timed out."
75
+ * );
76
+ * assertEquals(items, ["Hello"]);
77
+ * ```
78
+ *
79
+ * @example Error-handling an abort
80
+ * ```ts
81
+ * import { abortable, delay } from "@std/async";
82
+ * import { assertRejects, assertEquals } from "@std/assert";
83
+ *
84
+ * const asyncIter = async function* () {
85
+ * yield "Hello";
86
+ * await delay(1_000);
87
+ * yield "World";
88
+ * };
89
+ * const controller = new AbortController();
90
+ * controller.abort(new Error("This is my reason"));
91
+ *
92
+ * const items: string[] = [];
93
+ * // Below throws `DOMException` immediately
94
+ * await assertRejects(
95
+ * async () => {
96
+ * for await (const item of abortable(asyncIter(), controller.signal)) {
97
+ * items.push(item);
98
+ * }
99
+ * },
100
+ * Error,
101
+ * "This is my reason"
102
+ * );
103
+ * assertEquals(items, []);
104
+ * ```
105
+ */
106
+ export declare function abortable<T>(p: AsyncIterable<T>, signal: AbortSignal): AsyncGenerator<T>;
107
+ //# sourceMappingURL=abortable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abortable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/abortable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,wBAAgB,SAAS,CAAC,CAAC,EACzB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EACnB,MAAM,EAAE,WAAW,GAClB,cAAc,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,49 @@
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.abortable = abortable;
6
+ function abortable(p, signal) {
7
+ if (p instanceof Promise) {
8
+ return abortablePromise(p, signal);
9
+ }
10
+ else {
11
+ return abortableAsyncIterable(p, signal);
12
+ }
13
+ }
14
+ function abortablePromise(p, signal) {
15
+ if (signal.aborted)
16
+ return Promise.reject(signal.reason);
17
+ const { promise, reject } = Promise.withResolvers();
18
+ const abort = () => reject(signal.reason);
19
+ signal.addEventListener("abort", abort, { once: true });
20
+ return Promise.race([promise, p]).finally(() => {
21
+ signal.removeEventListener("abort", abort);
22
+ });
23
+ }
24
+ async function* abortableAsyncIterable(p, signal) {
25
+ signal.throwIfAborted();
26
+ const { promise, reject } = Promise.withResolvers();
27
+ const abort = () => reject(signal.reason);
28
+ signal.addEventListener("abort", abort, { once: true });
29
+ const it = p[Symbol.asyncIterator]();
30
+ try {
31
+ while (true) {
32
+ const race = Promise.race([promise, it.next()]);
33
+ race.catch(() => {
34
+ signal.removeEventListener("abort", abort);
35
+ });
36
+ const { done, value } = await race;
37
+ if (done) {
38
+ signal.removeEventListener("abort", abort);
39
+ const result = await it.return?.(value);
40
+ return result?.value;
41
+ }
42
+ yield value;
43
+ }
44
+ }
45
+ catch (e) {
46
+ await it.return?.();
47
+ throw e;
48
+ }
49
+ }
@@ -0,0 +1,36 @@
1
+ /** Options for {@linkcode deadline}. */
2
+ export interface DeadlineOptions {
3
+ /** Signal used to abort the deadline. */
4
+ signal?: AbortSignal;
5
+ }
6
+ /**
7
+ * Create a promise which will be rejected with {@linkcode DOMException} when
8
+ * a given delay is exceeded.
9
+ *
10
+ * Note: Prefer to use {@linkcode AbortSignal.timeout} instead for the APIs
11
+ * that accept {@linkcode AbortSignal}.
12
+ *
13
+ * @throws {DOMException & { name: "TimeoutError" }} If the provided duration
14
+ * runs out before resolving.
15
+ * @throws {DOMException & { name: "AbortError" }} If the optional signal is
16
+ * aborted with the default `reason` before resolving or timing out.
17
+ * @throws {AbortSignal["reason"]} If the optional signal is aborted with a
18
+ * custom `reason` before resolving or timing out.
19
+ * @typeParam T The type of the provided and returned promise.
20
+ * @param p The promise to make rejectable.
21
+ * @param ms Duration in milliseconds for when the promise should time out.
22
+ * @param options Additional options.
23
+ * @returns A promise that will reject if the provided duration runs out before resolving.
24
+ *
25
+ * @example Usage
26
+ * ```ts ignore
27
+ * import { deadline } from "@std/async/deadline";
28
+ * import { delay } from "@std/async/delay";
29
+ *
30
+ * const delayedPromise = delay(1_000);
31
+ * // Below throws `DOMException` after 10 ms
32
+ * const result = await deadline(delayedPromise, 10);
33
+ * ```
34
+ */
35
+ export declare function deadline<T>(p: Promise<T>, ms: number, options?: DeadlineOptions): Promise<T>;
36
+ //# sourceMappingURL=deadline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/deadline.ts"],"names":[],"mappings":"AAKA,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EACb,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,CAAC,CAAC,CAIZ"}
@@ -0,0 +1,41 @@
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.deadline = deadline;
6
+ const abortable_js_1 = require("./abortable.js");
7
+ /**
8
+ * Create a promise which will be rejected with {@linkcode DOMException} when
9
+ * a given delay is exceeded.
10
+ *
11
+ * Note: Prefer to use {@linkcode AbortSignal.timeout} instead for the APIs
12
+ * that accept {@linkcode AbortSignal}.
13
+ *
14
+ * @throws {DOMException & { name: "TimeoutError" }} If the provided duration
15
+ * runs out before resolving.
16
+ * @throws {DOMException & { name: "AbortError" }} If the optional signal is
17
+ * aborted with the default `reason` before resolving or timing out.
18
+ * @throws {AbortSignal["reason"]} If the optional signal is aborted with a
19
+ * custom `reason` before resolving or timing out.
20
+ * @typeParam T The type of the provided and returned promise.
21
+ * @param p The promise to make rejectable.
22
+ * @param ms Duration in milliseconds for when the promise should time out.
23
+ * @param options Additional options.
24
+ * @returns A promise that will reject if the provided duration runs out before resolving.
25
+ *
26
+ * @example Usage
27
+ * ```ts ignore
28
+ * import { deadline } from "@std/async/deadline";
29
+ * import { delay } from "@std/async/delay";
30
+ *
31
+ * const delayedPromise = delay(1_000);
32
+ * // Below throws `DOMException` after 10 ms
33
+ * const result = await deadline(delayedPromise, 10);
34
+ * ```
35
+ */
36
+ async function deadline(p, ms, options = {}) {
37
+ const signals = [AbortSignal.timeout(ms)];
38
+ if (options.signal)
39
+ signals.push(options.signal);
40
+ return await (0, abortable_js_1.abortable)(p, AbortSignal.any(signals));
41
+ }
@@ -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,60 @@
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.debounce = debounce;
6
+ /**
7
+ * Creates a debounced function that delays the given `func`
8
+ * by a given `wait` time in milliseconds. If the method is called
9
+ * again before the timeout expires, the previous call will be
10
+ * aborted.
11
+ *
12
+ * @example Usage
13
+ * ```ts ignore
14
+ * import { debounce } from "@std/async/debounce";
15
+ *
16
+ * const log = debounce(
17
+ * (event: Deno.FsEvent) =>
18
+ * console.log("[%s] %s", event.kind, event.paths[0]),
19
+ * 200,
20
+ * );
21
+ *
22
+ * for await (const event of Deno.watchFs("./")) {
23
+ * log(event);
24
+ * }
25
+ * // wait 200ms ...
26
+ * // output: Function debounced after 200ms with baz
27
+ * ```
28
+ *
29
+ * @typeParam T The arguments of the provided function.
30
+ * @param fn The function to debounce.
31
+ * @param wait The time in milliseconds to delay the function.
32
+ * @returns The debounced function.
33
+ */
34
+ // deno-lint-ignore no-explicit-any
35
+ function debounce(fn, wait) {
36
+ let timeout = null;
37
+ let flush = null;
38
+ const debounced = ((...args) => {
39
+ debounced.clear();
40
+ flush = () => {
41
+ debounced.clear();
42
+ fn.call(debounced, ...args);
43
+ };
44
+ timeout = Number(setTimeout(flush, wait));
45
+ });
46
+ debounced.clear = () => {
47
+ if (typeof timeout === "number") {
48
+ clearTimeout(timeout);
49
+ timeout = null;
50
+ flush = null;
51
+ }
52
+ };
53
+ debounced.flush = () => {
54
+ flush?.();
55
+ };
56
+ Object.defineProperty(debounced, "pending", {
57
+ get: () => typeof timeout === "number",
58
+ });
59
+ return debounced;
60
+ }
@@ -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"}