@mtkruto/node 0.63.2 → 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.
- package/esm/0_deps.d.ts +10 -5
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +10 -5
- package/esm/0_test_deps.d.ts.map +1 -0
- package/esm/_dnt.polyfills.d.ts +13 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +11 -0
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +2 -0
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +8 -5
- package/esm/client/2_update_manager.js +11 -11
- package/esm/client/5_client.d.ts +0 -9
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +12 -59
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +4 -4
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/_util.js +6 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/abortable.js +46 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/deadline.js +38 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/debounce.js +57 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/delay.js +65 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/mod.js +23 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +170 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/pool.js +99 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/retry.js +107 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.0.12/tee.js +102 -0
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/build_message.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/build_message.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff_str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff_str.js +4 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/format.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/format.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/styles.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/styles.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/1.0.6/types.js +3 -0
- package/esm/session/1_session.js +4 -4
- package/esm/session/2_session_encrypted.d.ts.map +1 -1
- package/esm/session/2_session_encrypted.js +5 -8
- package/package.json +1 -1
- package/script/0_deps.d.ts +10 -5
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +25 -28
- package/script/0_test_deps.d.ts.map +1 -0
- package/script/_dnt.polyfills.d.ts +13 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +11 -0
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +2 -0
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +7 -4
- package/script/client/2_update_manager.js +10 -10
- package/script/client/5_client.d.ts +0 -9
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +11 -58
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +4 -4
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
- package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/_util.js +9 -0
- package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
- package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/abortable.js +49 -0
- package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
- package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/deadline.js +41 -0
- package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
- package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/debounce.js +60 -0
- package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
- package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/delay.js +91 -0
- package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
- package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/mod.js +39 -0
- package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
- package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +174 -0
- package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
- package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/pool.js +102 -0
- package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
- package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/retry.js +112 -0
- package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
- package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.0.12/tee.js +105 -0
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/build_message.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/build_message.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff_str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff_str.js +4 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/format.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/format.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/styles.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/styles.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/1.0.6/types.js +4 -0
- package/script/session/1_session.js +3 -3
- package/script/session/2_session_encrypted.d.ts.map +1 -1
- package/script/session/2_session_encrypted.js +4 -7
- package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -52
- package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
- package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/less.js +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -33
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -167
- package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
- package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -20
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -2
- package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -49
- package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -49
- package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -30
- package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -55
- package/script/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
- package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/less.js +0 -31
- package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
- package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -61
- package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
- package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -36
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -170
- package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
- package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
- package/script/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -47
- package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -23
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/format.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/format.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.6}/types.d.ts +0 -0
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown in {@linkcode retry} once the maximum number of failed attempts
|
|
3
|
+
* has been reached.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts no-assert ignore
|
|
7
|
+
* import { RetryError } from "@std/async/retry";
|
|
8
|
+
*
|
|
9
|
+
* throw new RetryError({ foo: "bar" }, 3);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare class RetryError extends Error {
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new {@linkcode RetryError} instance.
|
|
15
|
+
*
|
|
16
|
+
* @param cause the cause for this error.
|
|
17
|
+
* @param attempts the number of retry attempts made.
|
|
18
|
+
*/
|
|
19
|
+
constructor(cause: unknown, attempts: number);
|
|
20
|
+
}
|
|
21
|
+
/** Options for {@linkcode retry}. */
|
|
22
|
+
export interface RetryOptions {
|
|
23
|
+
/**
|
|
24
|
+
* How much to backoff after each retry.
|
|
25
|
+
*
|
|
26
|
+
* @default {2}
|
|
27
|
+
*/
|
|
28
|
+
multiplier?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum milliseconds between attempts.
|
|
31
|
+
*
|
|
32
|
+
* @default {60000}
|
|
33
|
+
*/
|
|
34
|
+
maxTimeout?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum amount of attempts until failure.
|
|
37
|
+
*
|
|
38
|
+
* @default {5}
|
|
39
|
+
*/
|
|
40
|
+
maxAttempts?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The initial and minimum amount of milliseconds between attempts.
|
|
43
|
+
*
|
|
44
|
+
* @default {1000}
|
|
45
|
+
*/
|
|
46
|
+
minTimeout?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Amount of jitter to introduce to the time between attempts. This is `1`
|
|
49
|
+
* for full jitter by default.
|
|
50
|
+
*
|
|
51
|
+
* @default {1}
|
|
52
|
+
*/
|
|
53
|
+
jitter?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Calls the given (possibly asynchronous) function up to `maxAttempts` times.
|
|
57
|
+
* Retries as long as the given function throws. If the attempts are exhausted,
|
|
58
|
+
* throws a {@linkcode RetryError} with `cause` set to the inner exception.
|
|
59
|
+
*
|
|
60
|
+
* The backoff is calculated by multiplying `minTimeout` with `multiplier` to the power of the current attempt counter (starting at 0 up to `maxAttempts - 1`). It is capped at `maxTimeout` however.
|
|
61
|
+
* How long the actual delay is, depends on `jitter`.
|
|
62
|
+
*
|
|
63
|
+
* When `jitter` is the default value of `1`, waits between two attempts for a
|
|
64
|
+
* randomized amount between 0 and the backoff time. With the default options
|
|
65
|
+
* the maximal delay will be `15s = 1s + 2s + 4s + 8s`. If all five attempts
|
|
66
|
+
* are exhausted the mean delay will be `9.5s = ½(4s + 15s)`.
|
|
67
|
+
*
|
|
68
|
+
* When `jitter` is `0`, waits the full backoff time.
|
|
69
|
+
*
|
|
70
|
+
* @example Example configuration 1
|
|
71
|
+
* ```ts no-assert
|
|
72
|
+
* import { retry } from "@std/async/retry";
|
|
73
|
+
* const req = async () => {
|
|
74
|
+
* // some function that throws sometimes
|
|
75
|
+
* };
|
|
76
|
+
*
|
|
77
|
+
* // Below resolves to the first non-error result of `req`
|
|
78
|
+
* const retryPromise = await retry(req, {
|
|
79
|
+
* multiplier: 2,
|
|
80
|
+
* maxTimeout: 60000,
|
|
81
|
+
* maxAttempts: 5,
|
|
82
|
+
* minTimeout: 100,
|
|
83
|
+
* jitter: 1,
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @example Example configuration 2
|
|
88
|
+
* ```ts no-assert
|
|
89
|
+
* import { retry } from "@std/async/retry";
|
|
90
|
+
* const req = async () => {
|
|
91
|
+
* // some function that throws sometimes
|
|
92
|
+
* };
|
|
93
|
+
*
|
|
94
|
+
* // Make sure we wait at least 1 minute, but at most 2 minutes
|
|
95
|
+
* const retryPromise = await retry(req, {
|
|
96
|
+
* multiplier: 2.34,
|
|
97
|
+
* maxTimeout: 80000,
|
|
98
|
+
* maxAttempts: 7,
|
|
99
|
+
* minTimeout: 1000,
|
|
100
|
+
* jitter: 0.5,
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @typeParam T The return type of the function to retry and returned promise.
|
|
105
|
+
* @param fn The function to retry.
|
|
106
|
+
* @param options Additional options.
|
|
107
|
+
* @returns The promise that resolves with the value returned by the function to retry.
|
|
108
|
+
*/
|
|
109
|
+
export declare function retry<T>(fn: (() => Promise<T>) | (() => T), options?: RetryOptions): Promise<T>;
|
|
110
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/retry.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC;;;;;OAKG;gBACS,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;CAK7C;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,EAAE,EAAE,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAClC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,CAAC,CA6CZ"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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.RetryError = void 0;
|
|
6
|
+
exports.retry = retry;
|
|
7
|
+
const _util_js_1 = require("./_util.js");
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown in {@linkcode retry} once the maximum number of failed attempts
|
|
10
|
+
* has been reached.
|
|
11
|
+
*
|
|
12
|
+
* @example Usage
|
|
13
|
+
* ```ts no-assert ignore
|
|
14
|
+
* import { RetryError } from "@std/async/retry";
|
|
15
|
+
*
|
|
16
|
+
* throw new RetryError({ foo: "bar" }, 3);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
class RetryError extends Error {
|
|
20
|
+
/**
|
|
21
|
+
* Constructs a new {@linkcode RetryError} instance.
|
|
22
|
+
*
|
|
23
|
+
* @param cause the cause for this error.
|
|
24
|
+
* @param attempts the number of retry attempts made.
|
|
25
|
+
*/
|
|
26
|
+
constructor(cause, attempts) {
|
|
27
|
+
super(`Retrying exceeded the maxAttempts (${attempts}).`);
|
|
28
|
+
this.name = "RetryError";
|
|
29
|
+
this.cause = cause;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.RetryError = RetryError;
|
|
33
|
+
/**
|
|
34
|
+
* Calls the given (possibly asynchronous) function up to `maxAttempts` times.
|
|
35
|
+
* Retries as long as the given function throws. If the attempts are exhausted,
|
|
36
|
+
* throws a {@linkcode RetryError} with `cause` set to the inner exception.
|
|
37
|
+
*
|
|
38
|
+
* The backoff is calculated by multiplying `minTimeout` with `multiplier` to the power of the current attempt counter (starting at 0 up to `maxAttempts - 1`). It is capped at `maxTimeout` however.
|
|
39
|
+
* How long the actual delay is, depends on `jitter`.
|
|
40
|
+
*
|
|
41
|
+
* When `jitter` is the default value of `1`, waits between two attempts for a
|
|
42
|
+
* randomized amount between 0 and the backoff time. With the default options
|
|
43
|
+
* the maximal delay will be `15s = 1s + 2s + 4s + 8s`. If all five attempts
|
|
44
|
+
* are exhausted the mean delay will be `9.5s = ½(4s + 15s)`.
|
|
45
|
+
*
|
|
46
|
+
* When `jitter` is `0`, waits the full backoff time.
|
|
47
|
+
*
|
|
48
|
+
* @example Example configuration 1
|
|
49
|
+
* ```ts no-assert
|
|
50
|
+
* import { retry } from "@std/async/retry";
|
|
51
|
+
* const req = async () => {
|
|
52
|
+
* // some function that throws sometimes
|
|
53
|
+
* };
|
|
54
|
+
*
|
|
55
|
+
* // Below resolves to the first non-error result of `req`
|
|
56
|
+
* const retryPromise = await retry(req, {
|
|
57
|
+
* multiplier: 2,
|
|
58
|
+
* maxTimeout: 60000,
|
|
59
|
+
* maxAttempts: 5,
|
|
60
|
+
* minTimeout: 100,
|
|
61
|
+
* jitter: 1,
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Example configuration 2
|
|
66
|
+
* ```ts no-assert
|
|
67
|
+
* import { retry } from "@std/async/retry";
|
|
68
|
+
* const req = async () => {
|
|
69
|
+
* // some function that throws sometimes
|
|
70
|
+
* };
|
|
71
|
+
*
|
|
72
|
+
* // Make sure we wait at least 1 minute, but at most 2 minutes
|
|
73
|
+
* const retryPromise = await retry(req, {
|
|
74
|
+
* multiplier: 2.34,
|
|
75
|
+
* maxTimeout: 80000,
|
|
76
|
+
* maxAttempts: 7,
|
|
77
|
+
* minTimeout: 1000,
|
|
78
|
+
* jitter: 0.5,
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @typeParam T The return type of the function to retry and returned promise.
|
|
83
|
+
* @param fn The function to retry.
|
|
84
|
+
* @param options Additional options.
|
|
85
|
+
* @returns The promise that resolves with the value returned by the function to retry.
|
|
86
|
+
*/
|
|
87
|
+
async function retry(fn, options) {
|
|
88
|
+
const { multiplier = 2, maxTimeout = 60000, maxAttempts = 5, minTimeout = 1000, jitter = 1, } = options ?? {};
|
|
89
|
+
if (maxTimeout <= 0) {
|
|
90
|
+
throw new TypeError(`Cannot retry as 'maxTimeout' must be positive: current value is ${maxTimeout}`);
|
|
91
|
+
}
|
|
92
|
+
if (minTimeout > maxTimeout) {
|
|
93
|
+
throw new TypeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${minTimeout}', 'maxTimeout=${maxTimeout}'`);
|
|
94
|
+
}
|
|
95
|
+
if (jitter > 1) {
|
|
96
|
+
throw new TypeError(`Cannot retry as 'jitter' must be <= 1: current value is ${jitter}`);
|
|
97
|
+
}
|
|
98
|
+
let attempt = 0;
|
|
99
|
+
while (true) {
|
|
100
|
+
try {
|
|
101
|
+
return await fn();
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (attempt + 1 >= maxAttempts) {
|
|
105
|
+
throw new RetryError(error, maxAttempts);
|
|
106
|
+
}
|
|
107
|
+
const timeout = (0, _util_js_1.exponentialBackoffWithJitter)(maxTimeout, minTimeout, attempt, multiplier, jitter);
|
|
108
|
+
await new Promise((r) => setTimeout(r, timeout));
|
|
109
|
+
}
|
|
110
|
+
attempt++;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for representing n-tuple. Used in {@linkcode tee}.
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type Tuple<T, N extends number> = N extends N ? number extends N ? T[] : TupleOf<T, N, []> : never;
|
|
7
|
+
/**
|
|
8
|
+
* Utility for representing n-tuple of. Used in {@linkcode Tuple}.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export type TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N ? R : TupleOf<T, N, [T, ...R]>;
|
|
13
|
+
/**
|
|
14
|
+
* Branches the given async iterable into the `n` branches.
|
|
15
|
+
*
|
|
16
|
+
* @example Usage
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { tee } from "@std/async/tee";
|
|
19
|
+
* import { assertEquals } from "@std/assert";
|
|
20
|
+
*
|
|
21
|
+
* const gen = async function* gen() {
|
|
22
|
+
* yield 1;
|
|
23
|
+
* yield 2;
|
|
24
|
+
* yield 3;
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* const [branch1, branch2] = tee(gen());
|
|
28
|
+
*
|
|
29
|
+
* const result1 = await Array.fromAsync(branch1);
|
|
30
|
+
* assertEquals(result1, [1, 2, 3]);
|
|
31
|
+
*
|
|
32
|
+
* const result2 = await Array.fromAsync(branch2);
|
|
33
|
+
* assertEquals(result2, [1, 2, 3]);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @typeParam T The type of the provided async iterable and the returned async iterables.
|
|
37
|
+
* @typeParam N The amount of branches to tee into.
|
|
38
|
+
* @param iterable The iterable to tee.
|
|
39
|
+
* @param n The amount of branches to tee into.
|
|
40
|
+
* @returns The tuple where each element is an async iterable.
|
|
41
|
+
*/
|
|
42
|
+
export declare function tee<T, N extends number = 2>(iterable: AsyncIterable<T>, n?: N): Tuple<AsyncIterable<T>, N>;
|
|
43
|
+
//# sourceMappingURL=tee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tee.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/tee.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,GAChD,MAAM,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,KAAK,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,IAC1D,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,GACrB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAuC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,CAAC,EACzC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,CAAC,GAAE,CAAU,GACZ,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAuB5B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
5
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
6
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7
|
+
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");
|
|
8
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
9
|
+
};
|
|
10
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12
|
+
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");
|
|
13
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var _Queue_source, _Queue_queue;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.tee = tee;
|
|
18
|
+
class Queue {
|
|
19
|
+
constructor(iterable) {
|
|
20
|
+
_Queue_source.set(this, void 0);
|
|
21
|
+
_Queue_queue.set(this, void 0);
|
|
22
|
+
Object.defineProperty(this, "head", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: void 0
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(this, "done", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
configurable: true,
|
|
31
|
+
writable: true,
|
|
32
|
+
value: void 0
|
|
33
|
+
});
|
|
34
|
+
__classPrivateFieldSet(this, _Queue_source, iterable[Symbol.asyncIterator](), "f");
|
|
35
|
+
__classPrivateFieldSet(this, _Queue_queue, {
|
|
36
|
+
value: undefined,
|
|
37
|
+
next: undefined,
|
|
38
|
+
}, "f");
|
|
39
|
+
this.head = __classPrivateFieldGet(this, _Queue_queue, "f");
|
|
40
|
+
this.done = false;
|
|
41
|
+
}
|
|
42
|
+
async next() {
|
|
43
|
+
const result = await __classPrivateFieldGet(this, _Queue_source, "f").next();
|
|
44
|
+
if (!result.done) {
|
|
45
|
+
const nextNode = {
|
|
46
|
+
value: result.value,
|
|
47
|
+
next: undefined,
|
|
48
|
+
};
|
|
49
|
+
__classPrivateFieldGet(this, _Queue_queue, "f").next = nextNode;
|
|
50
|
+
__classPrivateFieldSet(this, _Queue_queue, nextNode, "f");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.done = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
_Queue_source = new WeakMap(), _Queue_queue = new WeakMap();
|
|
58
|
+
/**
|
|
59
|
+
* Branches the given async iterable into the `n` branches.
|
|
60
|
+
*
|
|
61
|
+
* @example Usage
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { tee } from "@std/async/tee";
|
|
64
|
+
* import { assertEquals } from "@std/assert";
|
|
65
|
+
*
|
|
66
|
+
* const gen = async function* gen() {
|
|
67
|
+
* yield 1;
|
|
68
|
+
* yield 2;
|
|
69
|
+
* yield 3;
|
|
70
|
+
* };
|
|
71
|
+
*
|
|
72
|
+
* const [branch1, branch2] = tee(gen());
|
|
73
|
+
*
|
|
74
|
+
* const result1 = await Array.fromAsync(branch1);
|
|
75
|
+
* assertEquals(result1, [1, 2, 3]);
|
|
76
|
+
*
|
|
77
|
+
* const result2 = await Array.fromAsync(branch2);
|
|
78
|
+
* assertEquals(result2, [1, 2, 3]);
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @typeParam T The type of the provided async iterable and the returned async iterables.
|
|
82
|
+
* @typeParam N The amount of branches to tee into.
|
|
83
|
+
* @param iterable The iterable to tee.
|
|
84
|
+
* @param n The amount of branches to tee into.
|
|
85
|
+
* @returns The tuple where each element is an async iterable.
|
|
86
|
+
*/
|
|
87
|
+
function tee(iterable, n = 2) {
|
|
88
|
+
const queue = new Queue(iterable);
|
|
89
|
+
async function* generator() {
|
|
90
|
+
let buffer = queue.head;
|
|
91
|
+
while (true) {
|
|
92
|
+
if (buffer.next) {
|
|
93
|
+
buffer = buffer.next;
|
|
94
|
+
yield buffer.value;
|
|
95
|
+
}
|
|
96
|
+
else if (queue.done) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
await queue.next();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return Array.from({ length: n }).map(() => generator());
|
|
105
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_message.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.
|
|
1
|
+
{"version":3,"file":"build_message.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/build_message.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,QAAQ;AAClB;;;GAGG;AACH,UAAU,UAAQ,GACjB,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CASvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CASrD;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAC7C,OAAO,GAAE,mBAAwB,GAChC,MAAM,EAAE,CAsBV"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2018-
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.createColor = createColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/diff.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAanD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAWvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,CAAC,EAAE,CAAC,EAAE,EACN,CAAC,EAAE,CAAC,EAAE,EACN,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,WAAW,EACnB,kBAAkB,EAAE,MAAM,GACzB,KAAK,CAAC;IACP,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAgCD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,WAAW,EACnB,kBAAkB,EAAE,MAAM,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,aAAa,EACrB,IAAI,CAAC,EAAE,aAAa,GACnB,aAAa,CAsBf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAwEvD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2018-
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.createCommon = createCommon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff_str.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.
|
|
1
|
+
{"version":3,"file":"diff_str.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/diff_str.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAY/C;AAKD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,MAAM,EAAE,CAiBnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EACxB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,GAC3B,UAAU,CAAC,MAAM,CAAC,EAAE,CAetB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,CAkDlE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
5
|
exports.unescape = unescape;
|
|
4
6
|
exports.tokenize = tokenize;
|
|
@@ -24,6 +26,7 @@ const diff_js_1 = require("./diff.js");
|
|
|
24
26
|
*/
|
|
25
27
|
function unescape(string) {
|
|
26
28
|
return string
|
|
29
|
+
.replaceAll("\\", "\\\\")
|
|
27
30
|
.replaceAll("\b", "\\b")
|
|
28
31
|
.replaceAll("\f", "\\f")
|
|
29
32
|
.replaceAll("\t", "\\t")
|
|
@@ -31,7 +34,7 @@ function unescape(string) {
|
|
|
31
34
|
// This does not remove line breaks
|
|
32
35
|
.replaceAll(/\r\n|\r|\n/g, (str) => str === "\r" ? "\\r" : str === "\n" ? "\\n\n" : "\\r\\n\r\n");
|
|
33
36
|
}
|
|
34
|
-
const WHITESPACE_SYMBOLS = /([^\S\r\n]
|
|
37
|
+
const WHITESPACE_SYMBOLS = /((?:\\[bftv]|[^\S\r\n])+|\\[rn\\]|[()[\]{}'"\r\n]|\b)/;
|
|
35
38
|
/**
|
|
36
39
|
* Tokenizes a string into an array of tokens.
|
|
37
40
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/format.ts"],"names":[],"mappings":"AAuBA,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAezC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2018-
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
5
|
if (k2 === undefined) k2 = k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/styles.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2018-
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
// A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors
|
|
5
5
|
// on npm.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.6/types.ts"],"names":[],"mappings":"AAGA,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,6BAA6B;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,+BAA+B;IAC/B,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B"}
|
|
@@ -117,7 +117,7 @@ class Session {
|
|
|
117
117
|
return this.transport.connection.connected;
|
|
118
118
|
}
|
|
119
119
|
async connect() {
|
|
120
|
-
const
|
|
120
|
+
const unlock = await __classPrivateFieldGet(this, _Session_connectMutex, "f").lock();
|
|
121
121
|
try {
|
|
122
122
|
if (this.connected) {
|
|
123
123
|
return;
|
|
@@ -128,7 +128,7 @@ class Session {
|
|
|
128
128
|
__classPrivateFieldSet(this, _Session_disconnected, false, "f");
|
|
129
129
|
}
|
|
130
130
|
finally {
|
|
131
|
-
|
|
131
|
+
unlock();
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
async waitUntilConnected() {
|
|
@@ -167,7 +167,7 @@ _Session_dc = new WeakMap(), _Session_cdn = new WeakMap(), _Session_lastConnect
|
|
|
167
167
|
}
|
|
168
168
|
if (__classPrivateFieldGet(this, _Session_lastConnect, "f") && Date.now() - __classPrivateFieldGet(this, _Session_lastConnect, "f").getTime() <= 10 * _0_deps_js_1.SECOND) {
|
|
169
169
|
__classPrivateFieldGet(this, _Session_L, "f").debug("reconnecting after a delay");
|
|
170
|
-
await
|
|
170
|
+
await (0, _0_deps_js_1.delay)(3 * _0_deps_js_1.SECOND);
|
|
171
171
|
}
|
|
172
172
|
else {
|
|
173
173
|
__classPrivateFieldGet(this, _Session_L, "f").debug("reconnecting");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_session_encrypted.d.ts","sourceRoot":"","sources":["../../src/session/2_session_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAA8C,OAAO,EAAuC,MAAM,YAAY,CAAC;AACtH,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASxD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxD;AAQD,qBAAa,gBAAiB,SAAQ,OAAQ,YAAW,OAAO;;IAI9D,QAAQ,EAAE,QAAQ,CAAM;gBAQZ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,aAAa;IAMpC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAM7C,IAAI,OAAO,IAAI,UAAU,CAExB;IAEc,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"2_session_encrypted.d.ts","sourceRoot":"","sources":["../../src/session/2_session_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAA8C,OAAO,EAAuC,MAAM,YAAY,CAAC;AACtH,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASxD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxD;AAQD,qBAAa,gBAAiB,SAAQ,OAAQ,YAAW,OAAO;;IAI9D,QAAQ,EAAE,QAAQ,CAAM;gBAQZ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,aAAa;IAMpC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAM7C,IAAI,OAAO,IAAI,UAAU,CAExB;IAEc,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,UAAU,IAAI,IAAI;IAuDrB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;CAsU9C"}
|
|
@@ -78,6 +78,9 @@ class SessionEncrypted extends _1_session_js_1.Session {
|
|
|
78
78
|
return __classPrivateFieldGet(this, _SessionEncrypted_authKey, "f");
|
|
79
79
|
}
|
|
80
80
|
async connect() {
|
|
81
|
+
if (!this.connected) {
|
|
82
|
+
__classPrivateFieldGet(this, _SessionEncrypted_instances, "m", _SessionEncrypted_rejectAllPending).call(this, new _0_errors_js_1.ConnectionError("Not connected."));
|
|
83
|
+
}
|
|
81
84
|
await super.connect();
|
|
82
85
|
if (!__classPrivateFieldGet(_a, _a, "f", _SessionEncrypted_TGCRYPTO_INITED)) {
|
|
83
86
|
await (0, _0_deps_js_1.initTgCrypto)();
|
|
@@ -387,13 +390,7 @@ async function _SessionEncrypted_onMessage(msgId, body) {
|
|
|
387
390
|
while (this.connected) {
|
|
388
391
|
const then = Date.now();
|
|
389
392
|
try {
|
|
390
|
-
await
|
|
391
|
-
const timeout = setTimeout(resolve, __classPrivateFieldGet(this, _SessionEncrypted_pingInterval, "f") - timeElapsed);
|
|
392
|
-
__classPrivateFieldGet(this, _SessionEncrypted_pingLoopAbortController, "f").signal.onabort = () => {
|
|
393
|
-
reject(__classPrivateFieldGet(this, _SessionEncrypted_pingLoopAbortController, "f")?.signal.reason);
|
|
394
|
-
clearTimeout(timeout);
|
|
395
|
-
};
|
|
396
|
-
});
|
|
393
|
+
await (0, _0_deps_js_1.delay)(__classPrivateFieldGet(this, _SessionEncrypted_pingInterval, "f") - timeElapsed, { signal: __classPrivateFieldGet(this, _SessionEncrypted_pingLoopAbortController, "f").signal });
|
|
397
394
|
if (!this.connected) {
|
|
398
395
|
continue;
|
|
399
396
|
}
|