@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,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplexes multiple async iterators into a single stream. It currently
|
|
3
|
+
* makes an assumption that the final result (the value returned and not
|
|
4
|
+
* yielded from the iterator) does not matter; if there is any result, it is
|
|
5
|
+
* discarded.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
10
|
+
* import { assertEquals } from "@std/assert";
|
|
11
|
+
*
|
|
12
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
13
|
+
* yield 1;
|
|
14
|
+
* yield 2;
|
|
15
|
+
* yield 3;
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* async function* gen456(): AsyncIterableIterator<number> {
|
|
19
|
+
* yield 4;
|
|
20
|
+
* yield 5;
|
|
21
|
+
* yield 6;
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
25
|
+
* mux.add(gen123());
|
|
26
|
+
* mux.add(gen456());
|
|
27
|
+
*
|
|
28
|
+
* const result = await Array.fromAsync(mux);
|
|
29
|
+
*
|
|
30
|
+
* assertEquals(result, [1, 4, 2, 5, 3, 6]);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @typeParam T The type of the provided async iterables and generated async iterable.
|
|
34
|
+
*/
|
|
35
|
+
export declare class MuxAsyncIterator<T> implements AsyncIterable<T> {
|
|
36
|
+
#private;
|
|
37
|
+
/**
|
|
38
|
+
* Add an async iterable to the stream.
|
|
39
|
+
*
|
|
40
|
+
* @param iterable The async iterable to add.
|
|
41
|
+
*
|
|
42
|
+
* @example Usage
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
45
|
+
* import { assertEquals } from "@std/assert";
|
|
46
|
+
*
|
|
47
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
48
|
+
* yield 1;
|
|
49
|
+
* yield 2;
|
|
50
|
+
* yield 3;
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
54
|
+
* mux.add(gen123());
|
|
55
|
+
*
|
|
56
|
+
* const result = await Array.fromAsync(mux.iterate());
|
|
57
|
+
*
|
|
58
|
+
* assertEquals(result, [1, 2, 3]);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
add(iterable: AsyncIterable<T>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Returns an async iterator of the stream.
|
|
64
|
+
* @returns the async iterator for all the added async iterables.
|
|
65
|
+
*
|
|
66
|
+
* @example Usage
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
69
|
+
* import { assertEquals } from "@std/assert";
|
|
70
|
+
*
|
|
71
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
72
|
+
* yield 1;
|
|
73
|
+
* yield 2;
|
|
74
|
+
* yield 3;
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
78
|
+
* mux.add(gen123());
|
|
79
|
+
*
|
|
80
|
+
* const result = await Array.fromAsync(mux.iterate());
|
|
81
|
+
*
|
|
82
|
+
* assertEquals(result, [1, 2, 3]);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
iterate(): AsyncIterableIterator<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Implements an async iterator for the stream.
|
|
88
|
+
* @returns the async iterator for all the added async iterables.
|
|
89
|
+
*
|
|
90
|
+
* @example Usage
|
|
91
|
+
* ```ts
|
|
92
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
93
|
+
* import { assertEquals } from "@std/assert";
|
|
94
|
+
*
|
|
95
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
96
|
+
* yield 1;
|
|
97
|
+
* yield 2;
|
|
98
|
+
* yield 3;
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
102
|
+
* mux.add(gen123());
|
|
103
|
+
*
|
|
104
|
+
* const result = await Array.fromAsync(mux);
|
|
105
|
+
*
|
|
106
|
+
* assertEquals(result, [1, 2, 3]);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=mux_async_iterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mux_async_iterator.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,gBAAgB,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;;IAO1D;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAqB9B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,OAAO,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAsB1C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;CAG3C"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
6
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
12
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
13
|
+
};
|
|
14
|
+
var _MuxAsyncIterator_instances, _MuxAsyncIterator_iteratorCount, _MuxAsyncIterator_yields, _MuxAsyncIterator_throws, _MuxAsyncIterator_signal, _MuxAsyncIterator_callIteratorNext;
|
|
15
|
+
/**
|
|
16
|
+
* Multiplexes multiple async iterators into a single stream. It currently
|
|
17
|
+
* makes an assumption that the final result (the value returned and not
|
|
18
|
+
* yielded from the iterator) does not matter; if there is any result, it is
|
|
19
|
+
* discarded.
|
|
20
|
+
*
|
|
21
|
+
* @example Usage
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
24
|
+
* import { assertEquals } from "@std/assert";
|
|
25
|
+
*
|
|
26
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
27
|
+
* yield 1;
|
|
28
|
+
* yield 2;
|
|
29
|
+
* yield 3;
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* async function* gen456(): AsyncIterableIterator<number> {
|
|
33
|
+
* yield 4;
|
|
34
|
+
* yield 5;
|
|
35
|
+
* yield 6;
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
39
|
+
* mux.add(gen123());
|
|
40
|
+
* mux.add(gen456());
|
|
41
|
+
*
|
|
42
|
+
* const result = await Array.fromAsync(mux);
|
|
43
|
+
*
|
|
44
|
+
* assertEquals(result, [1, 4, 2, 5, 3, 6]);
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @typeParam T The type of the provided async iterables and generated async iterable.
|
|
48
|
+
*/
|
|
49
|
+
export class MuxAsyncIterator {
|
|
50
|
+
constructor() {
|
|
51
|
+
_MuxAsyncIterator_instances.add(this);
|
|
52
|
+
_MuxAsyncIterator_iteratorCount.set(this, 0);
|
|
53
|
+
_MuxAsyncIterator_yields.set(this, []);
|
|
54
|
+
// deno-lint-ignore no-explicit-any
|
|
55
|
+
_MuxAsyncIterator_throws.set(this, []);
|
|
56
|
+
_MuxAsyncIterator_signal.set(this, Promise.withResolvers());
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Add an async iterable to the stream.
|
|
60
|
+
*
|
|
61
|
+
* @param iterable The async iterable to add.
|
|
62
|
+
*
|
|
63
|
+
* @example Usage
|
|
64
|
+
* ```ts
|
|
65
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
66
|
+
* import { assertEquals } from "@std/assert";
|
|
67
|
+
*
|
|
68
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
69
|
+
* yield 1;
|
|
70
|
+
* yield 2;
|
|
71
|
+
* yield 3;
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
75
|
+
* mux.add(gen123());
|
|
76
|
+
*
|
|
77
|
+
* const result = await Array.fromAsync(mux.iterate());
|
|
78
|
+
*
|
|
79
|
+
* assertEquals(result, [1, 2, 3]);
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
add(iterable) {
|
|
83
|
+
var _a;
|
|
84
|
+
__classPrivateFieldSet(this, _MuxAsyncIterator_iteratorCount, (_a = __classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f"), ++_a), "f");
|
|
85
|
+
__classPrivateFieldGet(this, _MuxAsyncIterator_instances, "m", _MuxAsyncIterator_callIteratorNext).call(this, iterable[Symbol.asyncIterator]());
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns an async iterator of the stream.
|
|
89
|
+
* @returns the async iterator for all the added async iterables.
|
|
90
|
+
*
|
|
91
|
+
* @example Usage
|
|
92
|
+
* ```ts
|
|
93
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
94
|
+
* import { assertEquals } from "@std/assert";
|
|
95
|
+
*
|
|
96
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
97
|
+
* yield 1;
|
|
98
|
+
* yield 2;
|
|
99
|
+
* yield 3;
|
|
100
|
+
* }
|
|
101
|
+
*
|
|
102
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
103
|
+
* mux.add(gen123());
|
|
104
|
+
*
|
|
105
|
+
* const result = await Array.fromAsync(mux.iterate());
|
|
106
|
+
*
|
|
107
|
+
* assertEquals(result, [1, 2, 3]);
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
async *iterate() {
|
|
111
|
+
while (__classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f") > 0) {
|
|
112
|
+
// Sleep until any of the wrapped iterators yields.
|
|
113
|
+
await __classPrivateFieldGet(this, _MuxAsyncIterator_signal, "f").promise;
|
|
114
|
+
// Note that while we're looping over `yields`, new items may be added.
|
|
115
|
+
for (const { iterator, value } of __classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f")) {
|
|
116
|
+
yield value;
|
|
117
|
+
__classPrivateFieldGet(this, _MuxAsyncIterator_instances, "m", _MuxAsyncIterator_callIteratorNext).call(this, iterator);
|
|
118
|
+
}
|
|
119
|
+
if (__classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f").length) {
|
|
120
|
+
for (const e of __classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f")) {
|
|
121
|
+
throw e;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Clear the `yields` list and reset the `signal` promise.
|
|
125
|
+
__classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f").length = 0;
|
|
126
|
+
__classPrivateFieldSet(this, _MuxAsyncIterator_signal, Promise.withResolvers(), "f");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Implements an async iterator for the stream.
|
|
131
|
+
* @returns the async iterator for all the added async iterables.
|
|
132
|
+
*
|
|
133
|
+
* @example Usage
|
|
134
|
+
* ```ts
|
|
135
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
136
|
+
* import { assertEquals } from "@std/assert";
|
|
137
|
+
*
|
|
138
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
139
|
+
* yield 1;
|
|
140
|
+
* yield 2;
|
|
141
|
+
* yield 3;
|
|
142
|
+
* }
|
|
143
|
+
*
|
|
144
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
145
|
+
* mux.add(gen123());
|
|
146
|
+
*
|
|
147
|
+
* const result = await Array.fromAsync(mux);
|
|
148
|
+
*
|
|
149
|
+
* assertEquals(result, [1, 2, 3]);
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
[(_MuxAsyncIterator_iteratorCount = new WeakMap(), _MuxAsyncIterator_yields = new WeakMap(), _MuxAsyncIterator_throws = new WeakMap(), _MuxAsyncIterator_signal = new WeakMap(), _MuxAsyncIterator_instances = new WeakSet(), _MuxAsyncIterator_callIteratorNext = async function _MuxAsyncIterator_callIteratorNext(iterator) {
|
|
153
|
+
var _a;
|
|
154
|
+
try {
|
|
155
|
+
const { value, done } = await iterator.next();
|
|
156
|
+
if (done) {
|
|
157
|
+
__classPrivateFieldSet(this, _MuxAsyncIterator_iteratorCount, (_a = __classPrivateFieldGet(this, _MuxAsyncIterator_iteratorCount, "f"), --_a), "f");
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
__classPrivateFieldGet(this, _MuxAsyncIterator_yields, "f").push({ iterator, value });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
__classPrivateFieldGet(this, _MuxAsyncIterator_throws, "f").push(e);
|
|
165
|
+
}
|
|
166
|
+
__classPrivateFieldGet(this, _MuxAsyncIterator_signal, "f").resolve();
|
|
167
|
+
}, Symbol.asyncIterator)]() {
|
|
168
|
+
return this.iterate();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pooledMap transforms values from an (async) iterable into another async
|
|
3
|
+
* iterable. The transforms are done concurrently, with a max concurrency
|
|
4
|
+
* defined by the poolLimit.
|
|
5
|
+
*
|
|
6
|
+
* If an error is thrown from `iterableFn`, no new transformations will begin.
|
|
7
|
+
* All currently executing transformations are allowed to finish and still
|
|
8
|
+
* yielded on success. After that, the rejections among them are gathered and
|
|
9
|
+
* thrown by the iterator in an `AggregateError`.
|
|
10
|
+
*
|
|
11
|
+
* @example Usage
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { pooledMap } from "@std/async/pool";
|
|
14
|
+
* import { assertEquals } from "@std/assert";
|
|
15
|
+
*
|
|
16
|
+
* const results = pooledMap(
|
|
17
|
+
* 2,
|
|
18
|
+
* [1, 2, 3],
|
|
19
|
+
* (i) => new Promise((r) => setTimeout(() => r(i), 1000)),
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* assertEquals(await Array.fromAsync(results), [1, 2, 3]);
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @typeParam T the input type.
|
|
26
|
+
* @typeParam R the output type.
|
|
27
|
+
* @param poolLimit The maximum count of items being processed concurrently.
|
|
28
|
+
* @param array The input array for mapping.
|
|
29
|
+
* @param iteratorFn The function to call for every item of the array.
|
|
30
|
+
* @returns The async iterator with the transformed values.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pooledMap<T, R>(poolLimit: number, array: Iterable<T> | AsyncIterable<T>, iteratorFn: (data: T) => Promise<R>): AsyncIterableIterator<R>;
|
|
33
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/pool.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EACrC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAClC,qBAAqB,CAAC,CAAC,CAAC,CAqE1B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/** Error message emitted from the thrown error while mapping. */
|
|
4
|
+
const ERROR_WHILE_MAPPING_MESSAGE = "Cannot complete the mapping as an error was thrown from an item";
|
|
5
|
+
/**
|
|
6
|
+
* pooledMap transforms values from an (async) iterable into another async
|
|
7
|
+
* iterable. The transforms are done concurrently, with a max concurrency
|
|
8
|
+
* defined by the poolLimit.
|
|
9
|
+
*
|
|
10
|
+
* If an error is thrown from `iterableFn`, no new transformations will begin.
|
|
11
|
+
* All currently executing transformations are allowed to finish and still
|
|
12
|
+
* yielded on success. After that, the rejections among them are gathered and
|
|
13
|
+
* thrown by the iterator in an `AggregateError`.
|
|
14
|
+
*
|
|
15
|
+
* @example Usage
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { pooledMap } from "@std/async/pool";
|
|
18
|
+
* import { assertEquals } from "@std/assert";
|
|
19
|
+
*
|
|
20
|
+
* const results = pooledMap(
|
|
21
|
+
* 2,
|
|
22
|
+
* [1, 2, 3],
|
|
23
|
+
* (i) => new Promise((r) => setTimeout(() => r(i), 1000)),
|
|
24
|
+
* );
|
|
25
|
+
*
|
|
26
|
+
* assertEquals(await Array.fromAsync(results), [1, 2, 3]);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @typeParam T the input type.
|
|
30
|
+
* @typeParam R the output type.
|
|
31
|
+
* @param poolLimit The maximum count of items being processed concurrently.
|
|
32
|
+
* @param array The input array for mapping.
|
|
33
|
+
* @param iteratorFn The function to call for every item of the array.
|
|
34
|
+
* @returns The async iterator with the transformed values.
|
|
35
|
+
*/
|
|
36
|
+
export function pooledMap(poolLimit, array, iteratorFn) {
|
|
37
|
+
// Create the async iterable that is returned from this function.
|
|
38
|
+
const res = new TransformStream({
|
|
39
|
+
async transform(p, controller) {
|
|
40
|
+
try {
|
|
41
|
+
const s = await p;
|
|
42
|
+
controller.enqueue(s);
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
if (e instanceof AggregateError &&
|
|
46
|
+
e.message === ERROR_WHILE_MAPPING_MESSAGE) {
|
|
47
|
+
controller.error(e);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
// Start processing items from the iterator
|
|
53
|
+
(async () => {
|
|
54
|
+
const writer = res.writable.getWriter();
|
|
55
|
+
const executing = [];
|
|
56
|
+
try {
|
|
57
|
+
for await (const item of array) {
|
|
58
|
+
const p = Promise.resolve().then(() => iteratorFn(item));
|
|
59
|
+
// Only write on success. If we `writer.write()` a rejected promise,
|
|
60
|
+
// that will end the iteration. We don't want that yet. Instead let it
|
|
61
|
+
// fail the race, taking us to the catch block where all currently
|
|
62
|
+
// executing jobs are allowed to finish and all rejections among them
|
|
63
|
+
// can be reported together.
|
|
64
|
+
writer.write(p);
|
|
65
|
+
const e = p.then(() => executing.splice(executing.indexOf(e), 1));
|
|
66
|
+
executing.push(e);
|
|
67
|
+
if (executing.length >= poolLimit) {
|
|
68
|
+
await Promise.race(executing);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Wait until all ongoing events have processed, then close the writer.
|
|
72
|
+
await Promise.all(executing);
|
|
73
|
+
writer.close();
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
const errors = [];
|
|
77
|
+
for (const result of await Promise.allSettled(executing)) {
|
|
78
|
+
if (result.status === "rejected") {
|
|
79
|
+
errors.push(result.reason);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
writer.write(Promise.reject(new AggregateError(errors, ERROR_WHILE_MAPPING_MESSAGE))).catch(() => { });
|
|
83
|
+
}
|
|
84
|
+
})();
|
|
85
|
+
// Feature test until browser coverage is adequate
|
|
86
|
+
return Symbol.asyncIterator in res.readable &&
|
|
87
|
+
typeof res.readable[Symbol.asyncIterator] === "function"
|
|
88
|
+
? res.readable[Symbol.asyncIterator]()
|
|
89
|
+
: (async function* () {
|
|
90
|
+
const reader = res.readable.getReader();
|
|
91
|
+
while (true) {
|
|
92
|
+
const { done, value } = await reader.read();
|
|
93
|
+
if (done)
|
|
94
|
+
break;
|
|
95
|
+
yield value;
|
|
96
|
+
}
|
|
97
|
+
reader.releaseLock();
|
|
98
|
+
})();
|
|
99
|
+
}
|
|
@@ -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,107 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { exponentialBackoffWithJitter } from "./_util.js";
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown in {@linkcode retry} once the maximum number of failed attempts
|
|
6
|
+
* has been reached.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts no-assert ignore
|
|
10
|
+
* import { RetryError } from "@std/async/retry";
|
|
11
|
+
*
|
|
12
|
+
* throw new RetryError({ foo: "bar" }, 3);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export class RetryError extends Error {
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a new {@linkcode RetryError} instance.
|
|
18
|
+
*
|
|
19
|
+
* @param cause the cause for this error.
|
|
20
|
+
* @param attempts the number of retry attempts made.
|
|
21
|
+
*/
|
|
22
|
+
constructor(cause, attempts) {
|
|
23
|
+
super(`Retrying exceeded the maxAttempts (${attempts}).`);
|
|
24
|
+
this.name = "RetryError";
|
|
25
|
+
this.cause = cause;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Calls the given (possibly asynchronous) function up to `maxAttempts` times.
|
|
30
|
+
* Retries as long as the given function throws. If the attempts are exhausted,
|
|
31
|
+
* throws a {@linkcode RetryError} with `cause` set to the inner exception.
|
|
32
|
+
*
|
|
33
|
+
* 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.
|
|
34
|
+
* How long the actual delay is, depends on `jitter`.
|
|
35
|
+
*
|
|
36
|
+
* When `jitter` is the default value of `1`, waits between two attempts for a
|
|
37
|
+
* randomized amount between 0 and the backoff time. With the default options
|
|
38
|
+
* the maximal delay will be `15s = 1s + 2s + 4s + 8s`. If all five attempts
|
|
39
|
+
* are exhausted the mean delay will be `9.5s = ½(4s + 15s)`.
|
|
40
|
+
*
|
|
41
|
+
* When `jitter` is `0`, waits the full backoff time.
|
|
42
|
+
*
|
|
43
|
+
* @example Example configuration 1
|
|
44
|
+
* ```ts no-assert
|
|
45
|
+
* import { retry } from "@std/async/retry";
|
|
46
|
+
* const req = async () => {
|
|
47
|
+
* // some function that throws sometimes
|
|
48
|
+
* };
|
|
49
|
+
*
|
|
50
|
+
* // Below resolves to the first non-error result of `req`
|
|
51
|
+
* const retryPromise = await retry(req, {
|
|
52
|
+
* multiplier: 2,
|
|
53
|
+
* maxTimeout: 60000,
|
|
54
|
+
* maxAttempts: 5,
|
|
55
|
+
* minTimeout: 100,
|
|
56
|
+
* jitter: 1,
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @example Example configuration 2
|
|
61
|
+
* ```ts no-assert
|
|
62
|
+
* import { retry } from "@std/async/retry";
|
|
63
|
+
* const req = async () => {
|
|
64
|
+
* // some function that throws sometimes
|
|
65
|
+
* };
|
|
66
|
+
*
|
|
67
|
+
* // Make sure we wait at least 1 minute, but at most 2 minutes
|
|
68
|
+
* const retryPromise = await retry(req, {
|
|
69
|
+
* multiplier: 2.34,
|
|
70
|
+
* maxTimeout: 80000,
|
|
71
|
+
* maxAttempts: 7,
|
|
72
|
+
* minTimeout: 1000,
|
|
73
|
+
* jitter: 0.5,
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @typeParam T The return type of the function to retry and returned promise.
|
|
78
|
+
* @param fn The function to retry.
|
|
79
|
+
* @param options Additional options.
|
|
80
|
+
* @returns The promise that resolves with the value returned by the function to retry.
|
|
81
|
+
*/
|
|
82
|
+
export async function retry(fn, options) {
|
|
83
|
+
const { multiplier = 2, maxTimeout = 60000, maxAttempts = 5, minTimeout = 1000, jitter = 1, } = options ?? {};
|
|
84
|
+
if (maxTimeout <= 0) {
|
|
85
|
+
throw new TypeError(`Cannot retry as 'maxTimeout' must be positive: current value is ${maxTimeout}`);
|
|
86
|
+
}
|
|
87
|
+
if (minTimeout > maxTimeout) {
|
|
88
|
+
throw new TypeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${minTimeout}', 'maxTimeout=${maxTimeout}'`);
|
|
89
|
+
}
|
|
90
|
+
if (jitter > 1) {
|
|
91
|
+
throw new TypeError(`Cannot retry as 'jitter' must be <= 1: current value is ${jitter}`);
|
|
92
|
+
}
|
|
93
|
+
let attempt = 0;
|
|
94
|
+
while (true) {
|
|
95
|
+
try {
|
|
96
|
+
return await fn();
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (attempt + 1 >= maxAttempts) {
|
|
100
|
+
throw new RetryError(error, maxAttempts);
|
|
101
|
+
}
|
|
102
|
+
const timeout = exponentialBackoffWithJitter(maxTimeout, minTimeout, attempt, multiplier, jitter);
|
|
103
|
+
await new Promise((r) => setTimeout(r, timeout));
|
|
104
|
+
}
|
|
105
|
+
attempt++;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -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
|