@mtkruto/node 0.63.3 → 0.63.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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_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 -37
- 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}/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/session/1_session.js +4 -4
- package/esm/session/2_session_encrypted.d.ts.map +1 -1
- package/esm/session/2_session_encrypted.js +2 -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_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 -36
- 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}/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/session/1_session.js +3 -3
- package/script/session/2_session_encrypted.d.ts.map +1 -1
- package/script/session/2_session_encrypted.js +1 -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/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/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}/equals.js +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/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}/equals.js +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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_util.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/_util.ts"],"names":[],"mappings":"AAGA,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,UAIf"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
export function exponentialBackoffWithJitter(cap, base, attempt, multiplier, jitter) {
|
|
4
|
+
const exp = Math.min(cap, base * multiplier ** attempt);
|
|
5
|
+
return (1 - jitter * Math.random()) * exp;
|
|
6
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make a {@linkcode Promise} abortable with the given signal.
|
|
3
|
+
*
|
|
4
|
+
* @throws {DOMException} If the signal is already aborted and `signal.reason`
|
|
5
|
+
* is undefined. Otherwise, throws `signal.reason`.
|
|
6
|
+
* @typeParam T The type of the provided and returned promise.
|
|
7
|
+
* @param p The promise to make abortable.
|
|
8
|
+
* @param signal The signal to abort the promise with.
|
|
9
|
+
* @returns A promise that can be aborted.
|
|
10
|
+
*
|
|
11
|
+
* @example Error-handling a timeout
|
|
12
|
+
* ```ts ignore
|
|
13
|
+
* import { abortable, delay } from "@std/async";
|
|
14
|
+
* import { assertRejects, assertEquals } from "@std/assert";
|
|
15
|
+
*
|
|
16
|
+
* const promise = delay(1_000);
|
|
17
|
+
*
|
|
18
|
+
* // Rejects with `DOMException` after 100 ms
|
|
19
|
+
* await assertRejects(
|
|
20
|
+
* () => abortable(promise, AbortSignal.timeout(100)),
|
|
21
|
+
* DOMException,
|
|
22
|
+
* "Signal timed out."
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Error-handling an abort
|
|
27
|
+
* ```ts ignore
|
|
28
|
+
* import { abortable, delay } from "@std/async";
|
|
29
|
+
* import { assertRejects, assertEquals } from "@std/assert";
|
|
30
|
+
*
|
|
31
|
+
* const promise = delay(1_000);
|
|
32
|
+
* const controller = new AbortController();
|
|
33
|
+
* controller.abort(new Error("This is my reason"));
|
|
34
|
+
*
|
|
35
|
+
* // Rejects with `DOMException` immediately
|
|
36
|
+
* await assertRejects(
|
|
37
|
+
* () => abortable(promise, controller.signal),
|
|
38
|
+
* Error,
|
|
39
|
+
* "This is my reason"
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function abortable<T>(p: Promise<T>, signal: AbortSignal): Promise<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Make an {@linkcode AsyncIterable} abortable with the given signal.
|
|
46
|
+
*
|
|
47
|
+
* @throws {DOMException} If the signal is already aborted and `signal.reason`
|
|
48
|
+
* is undefined. Otherwise, throws `signal.reason`.
|
|
49
|
+
* @typeParam T The type of the provided and returned async iterable.
|
|
50
|
+
* @param p The async iterable to make abortable.
|
|
51
|
+
* @param signal The signal to abort the promise with.
|
|
52
|
+
* @returns An async iterable that can be aborted.
|
|
53
|
+
*
|
|
54
|
+
* @example Error-handling a timeout
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { abortable, delay } from "@std/async";
|
|
57
|
+
* import { assertRejects, assertEquals } from "@std/assert";
|
|
58
|
+
*
|
|
59
|
+
* const asyncIter = async function* () {
|
|
60
|
+
* yield "Hello";
|
|
61
|
+
* await delay(1_000);
|
|
62
|
+
* yield "World";
|
|
63
|
+
* };
|
|
64
|
+
*
|
|
65
|
+
* const items: string[] = [];
|
|
66
|
+
* // Below throws `DOMException` after 100 ms and items become `["Hello"]`
|
|
67
|
+
* await assertRejects(
|
|
68
|
+
* async () => {
|
|
69
|
+
* for await (const item of abortable(asyncIter(), AbortSignal.timeout(100))) {
|
|
70
|
+
* items.push(item);
|
|
71
|
+
* }
|
|
72
|
+
* },
|
|
73
|
+
* DOMException,
|
|
74
|
+
* "Signal timed out."
|
|
75
|
+
* );
|
|
76
|
+
* assertEquals(items, ["Hello"]);
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @example Error-handling an abort
|
|
80
|
+
* ```ts
|
|
81
|
+
* import { abortable, delay } from "@std/async";
|
|
82
|
+
* import { assertRejects, assertEquals } from "@std/assert";
|
|
83
|
+
*
|
|
84
|
+
* const asyncIter = async function* () {
|
|
85
|
+
* yield "Hello";
|
|
86
|
+
* await delay(1_000);
|
|
87
|
+
* yield "World";
|
|
88
|
+
* };
|
|
89
|
+
* const controller = new AbortController();
|
|
90
|
+
* controller.abort(new Error("This is my reason"));
|
|
91
|
+
*
|
|
92
|
+
* const items: string[] = [];
|
|
93
|
+
* // Below throws `DOMException` immediately
|
|
94
|
+
* await assertRejects(
|
|
95
|
+
* async () => {
|
|
96
|
+
* for await (const item of abortable(asyncIter(), controller.signal)) {
|
|
97
|
+
* items.push(item);
|
|
98
|
+
* }
|
|
99
|
+
* },
|
|
100
|
+
* Error,
|
|
101
|
+
* "This is my reason"
|
|
102
|
+
* );
|
|
103
|
+
* assertEquals(items, []);
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function abortable<T>(p: AsyncIterable<T>, signal: AbortSignal): AsyncGenerator<T>;
|
|
107
|
+
//# sourceMappingURL=abortable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/abortable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,wBAAgB,SAAS,CAAC,CAAC,EACzB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EACnB,MAAM,EAAE,WAAW,GAClB,cAAc,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
export function abortable(p, signal) {
|
|
4
|
+
if (p instanceof Promise) {
|
|
5
|
+
return abortablePromise(p, signal);
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
return abortableAsyncIterable(p, signal);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function abortablePromise(p, signal) {
|
|
12
|
+
if (signal.aborted)
|
|
13
|
+
return Promise.reject(signal.reason);
|
|
14
|
+
const { promise, reject } = Promise.withResolvers();
|
|
15
|
+
const abort = () => reject(signal.reason);
|
|
16
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
17
|
+
return Promise.race([promise, p]).finally(() => {
|
|
18
|
+
signal.removeEventListener("abort", abort);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function* abortableAsyncIterable(p, signal) {
|
|
22
|
+
signal.throwIfAborted();
|
|
23
|
+
const { promise, reject } = Promise.withResolvers();
|
|
24
|
+
const abort = () => reject(signal.reason);
|
|
25
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
26
|
+
const it = p[Symbol.asyncIterator]();
|
|
27
|
+
try {
|
|
28
|
+
while (true) {
|
|
29
|
+
const race = Promise.race([promise, it.next()]);
|
|
30
|
+
race.catch(() => {
|
|
31
|
+
signal.removeEventListener("abort", abort);
|
|
32
|
+
});
|
|
33
|
+
const { done, value } = await race;
|
|
34
|
+
if (done) {
|
|
35
|
+
signal.removeEventListener("abort", abort);
|
|
36
|
+
const result = await it.return?.(value);
|
|
37
|
+
return result?.value;
|
|
38
|
+
}
|
|
39
|
+
yield value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
await it.return?.();
|
|
44
|
+
throw e;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Options for {@linkcode deadline}. */
|
|
2
|
+
export interface DeadlineOptions {
|
|
3
|
+
/** Signal used to abort the deadline. */
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Create a promise which will be rejected with {@linkcode DOMException} when
|
|
8
|
+
* a given delay is exceeded.
|
|
9
|
+
*
|
|
10
|
+
* Note: Prefer to use {@linkcode AbortSignal.timeout} instead for the APIs
|
|
11
|
+
* that accept {@linkcode AbortSignal}.
|
|
12
|
+
*
|
|
13
|
+
* @throws {DOMException & { name: "TimeoutError" }} If the provided duration
|
|
14
|
+
* runs out before resolving.
|
|
15
|
+
* @throws {DOMException & { name: "AbortError" }} If the optional signal is
|
|
16
|
+
* aborted with the default `reason` before resolving or timing out.
|
|
17
|
+
* @throws {AbortSignal["reason"]} If the optional signal is aborted with a
|
|
18
|
+
* custom `reason` before resolving or timing out.
|
|
19
|
+
* @typeParam T The type of the provided and returned promise.
|
|
20
|
+
* @param p The promise to make rejectable.
|
|
21
|
+
* @param ms Duration in milliseconds for when the promise should time out.
|
|
22
|
+
* @param options Additional options.
|
|
23
|
+
* @returns A promise that will reject if the provided duration runs out before resolving.
|
|
24
|
+
*
|
|
25
|
+
* @example Usage
|
|
26
|
+
* ```ts ignore
|
|
27
|
+
* import { deadline } from "@std/async/deadline";
|
|
28
|
+
* import { delay } from "@std/async/delay";
|
|
29
|
+
*
|
|
30
|
+
* const delayedPromise = delay(1_000);
|
|
31
|
+
* // Below throws `DOMException` after 10 ms
|
|
32
|
+
* const result = await deadline(delayedPromise, 10);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function deadline<T>(p: Promise<T>, ms: number, options?: DeadlineOptions): Promise<T>;
|
|
36
|
+
//# sourceMappingURL=deadline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/deadline.ts"],"names":[],"mappings":"AAKA,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EACb,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,CAAC,CAAC,CAIZ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { abortable } from "./abortable.js";
|
|
4
|
+
/**
|
|
5
|
+
* Create a promise which will be rejected with {@linkcode DOMException} when
|
|
6
|
+
* a given delay is exceeded.
|
|
7
|
+
*
|
|
8
|
+
* Note: Prefer to use {@linkcode AbortSignal.timeout} instead for the APIs
|
|
9
|
+
* that accept {@linkcode AbortSignal}.
|
|
10
|
+
*
|
|
11
|
+
* @throws {DOMException & { name: "TimeoutError" }} If the provided duration
|
|
12
|
+
* runs out before resolving.
|
|
13
|
+
* @throws {DOMException & { name: "AbortError" }} If the optional signal is
|
|
14
|
+
* aborted with the default `reason` before resolving or timing out.
|
|
15
|
+
* @throws {AbortSignal["reason"]} If the optional signal is aborted with a
|
|
16
|
+
* custom `reason` before resolving or timing out.
|
|
17
|
+
* @typeParam T The type of the provided and returned promise.
|
|
18
|
+
* @param p The promise to make rejectable.
|
|
19
|
+
* @param ms Duration in milliseconds for when the promise should time out.
|
|
20
|
+
* @param options Additional options.
|
|
21
|
+
* @returns A promise that will reject if the provided duration runs out before resolving.
|
|
22
|
+
*
|
|
23
|
+
* @example Usage
|
|
24
|
+
* ```ts ignore
|
|
25
|
+
* import { deadline } from "@std/async/deadline";
|
|
26
|
+
* import { delay } from "@std/async/delay";
|
|
27
|
+
*
|
|
28
|
+
* const delayedPromise = delay(1_000);
|
|
29
|
+
* // Below throws `DOMException` after 10 ms
|
|
30
|
+
* const result = await deadline(delayedPromise, 10);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export async function deadline(p, ms, options = {}) {
|
|
34
|
+
const signals = [AbortSignal.timeout(ms)];
|
|
35
|
+
if (options.signal)
|
|
36
|
+
signals.push(options.signal);
|
|
37
|
+
return await abortable(p, AbortSignal.any(signals));
|
|
38
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A debounced function that will be delayed by a given `wait`
|
|
3
|
+
* time in milliseconds. If the method is called again before
|
|
4
|
+
* the timeout expires, the previous call will be aborted.
|
|
5
|
+
*/
|
|
6
|
+
export interface DebouncedFunction<T extends Array<unknown>> {
|
|
7
|
+
(...args: T): void;
|
|
8
|
+
/** Clears the debounce timeout and omits calling the debounced function. */
|
|
9
|
+
clear(): void;
|
|
10
|
+
/** Clears the debounce timeout and calls the debounced function immediately. */
|
|
11
|
+
flush(): void;
|
|
12
|
+
/** Returns a boolean whether a debounce call is pending or not. */
|
|
13
|
+
readonly pending: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a debounced function that delays the given `func`
|
|
17
|
+
* by a given `wait` time in milliseconds. If the method is called
|
|
18
|
+
* again before the timeout expires, the previous call will be
|
|
19
|
+
* aborted.
|
|
20
|
+
*
|
|
21
|
+
* @example Usage
|
|
22
|
+
* ```ts ignore
|
|
23
|
+
* import { debounce } from "@std/async/debounce";
|
|
24
|
+
*
|
|
25
|
+
* const log = debounce(
|
|
26
|
+
* (event: Deno.FsEvent) =>
|
|
27
|
+
* console.log("[%s] %s", event.kind, event.paths[0]),
|
|
28
|
+
* 200,
|
|
29
|
+
* );
|
|
30
|
+
*
|
|
31
|
+
* for await (const event of Deno.watchFs("./")) {
|
|
32
|
+
* log(event);
|
|
33
|
+
* }
|
|
34
|
+
* // wait 200ms ...
|
|
35
|
+
* // output: Function debounced after 200ms with baz
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @typeParam T The arguments of the provided function.
|
|
39
|
+
* @param fn The function to debounce.
|
|
40
|
+
* @param wait The time in milliseconds to delay the function.
|
|
41
|
+
* @returns The debounced function.
|
|
42
|
+
*/
|
|
43
|
+
export declare function debounce<T extends Array<any>>(fn: (this: DebouncedFunction<T>, ...args: T) => void, wait: number): DebouncedFunction<T>;
|
|
44
|
+
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/debounce.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC;IACzD,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACnB,4EAA4E;IAC5E,KAAK,IAAI,IAAI,CAAC;IACd,gFAAgF;IAChF,KAAK,IAAI,IAAI,CAAC;IACd,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,EAC3C,EAAE,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,EACpD,IAAI,EAAE,MAAM,GACX,iBAAiB,CAAC,CAAC,CAAC,CA8BtB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Creates a debounced function that delays the given `func`
|
|
5
|
+
* by a given `wait` time in milliseconds. If the method is called
|
|
6
|
+
* again before the timeout expires, the previous call will be
|
|
7
|
+
* aborted.
|
|
8
|
+
*
|
|
9
|
+
* @example Usage
|
|
10
|
+
* ```ts ignore
|
|
11
|
+
* import { debounce } from "@std/async/debounce";
|
|
12
|
+
*
|
|
13
|
+
* const log = debounce(
|
|
14
|
+
* (event: Deno.FsEvent) =>
|
|
15
|
+
* console.log("[%s] %s", event.kind, event.paths[0]),
|
|
16
|
+
* 200,
|
|
17
|
+
* );
|
|
18
|
+
*
|
|
19
|
+
* for await (const event of Deno.watchFs("./")) {
|
|
20
|
+
* log(event);
|
|
21
|
+
* }
|
|
22
|
+
* // wait 200ms ...
|
|
23
|
+
* // output: Function debounced after 200ms with baz
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @typeParam T The arguments of the provided function.
|
|
27
|
+
* @param fn The function to debounce.
|
|
28
|
+
* @param wait The time in milliseconds to delay the function.
|
|
29
|
+
* @returns The debounced function.
|
|
30
|
+
*/
|
|
31
|
+
// deno-lint-ignore no-explicit-any
|
|
32
|
+
export function debounce(fn, wait) {
|
|
33
|
+
let timeout = null;
|
|
34
|
+
let flush = null;
|
|
35
|
+
const debounced = ((...args) => {
|
|
36
|
+
debounced.clear();
|
|
37
|
+
flush = () => {
|
|
38
|
+
debounced.clear();
|
|
39
|
+
fn.call(debounced, ...args);
|
|
40
|
+
};
|
|
41
|
+
timeout = Number(setTimeout(flush, wait));
|
|
42
|
+
});
|
|
43
|
+
debounced.clear = () => {
|
|
44
|
+
if (typeof timeout === "number") {
|
|
45
|
+
clearTimeout(timeout);
|
|
46
|
+
timeout = null;
|
|
47
|
+
flush = null;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
debounced.flush = () => {
|
|
51
|
+
flush?.();
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(debounced, "pending", {
|
|
54
|
+
get: () => typeof timeout === "number",
|
|
55
|
+
});
|
|
56
|
+
return debounced;
|
|
57
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface DelayOptions {
|
|
2
|
+
/** Signal used to abort the delay. */
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
/** Indicates whether the process should continue to run as long as the timer exists.
|
|
5
|
+
*
|
|
6
|
+
* @default {true}
|
|
7
|
+
*/
|
|
8
|
+
persistent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a {@linkcode Promise} after a given amount of milliseconds.
|
|
12
|
+
*
|
|
13
|
+
* @throws {DOMException} If the optional signal is aborted before the delay
|
|
14
|
+
* duration, and `signal.reason` is undefined.
|
|
15
|
+
* @param ms Duration in milliseconds for how long the delay should last.
|
|
16
|
+
* @param options Additional options.
|
|
17
|
+
*
|
|
18
|
+
* @example Basic usage
|
|
19
|
+
* ```ts no-assert
|
|
20
|
+
* import { delay } from "@std/async/delay";
|
|
21
|
+
*
|
|
22
|
+
* // ...
|
|
23
|
+
* const delayedPromise = delay(100);
|
|
24
|
+
* const result = await delayedPromise;
|
|
25
|
+
* // ...
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Disable persistence
|
|
29
|
+
*
|
|
30
|
+
* Setting `persistent` to `false` will allow the process to continue to run as
|
|
31
|
+
* long as the timer exists.
|
|
32
|
+
*
|
|
33
|
+
* ```ts no-assert ignore
|
|
34
|
+
* import { delay } from "@std/async/delay";
|
|
35
|
+
*
|
|
36
|
+
* // ...
|
|
37
|
+
* await delay(100, { persistent: false });
|
|
38
|
+
* // ...
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function delay(ms: number, options?: DelayOptions): Promise<void>;
|
|
42
|
+
//# sourceMappingURL=delay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/delay.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B3E"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/** Options for {@linkcode delay}. */
|
|
4
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a {@linkcode Promise} after a given amount of milliseconds.
|
|
7
|
+
*
|
|
8
|
+
* @throws {DOMException} If the optional signal is aborted before the delay
|
|
9
|
+
* duration, and `signal.reason` is undefined.
|
|
10
|
+
* @param ms Duration in milliseconds for how long the delay should last.
|
|
11
|
+
* @param options Additional options.
|
|
12
|
+
*
|
|
13
|
+
* @example Basic usage
|
|
14
|
+
* ```ts no-assert
|
|
15
|
+
* import { delay } from "@std/async/delay";
|
|
16
|
+
*
|
|
17
|
+
* // ...
|
|
18
|
+
* const delayedPromise = delay(100);
|
|
19
|
+
* const result = await delayedPromise;
|
|
20
|
+
* // ...
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Disable persistence
|
|
24
|
+
*
|
|
25
|
+
* Setting `persistent` to `false` will allow the process to continue to run as
|
|
26
|
+
* long as the timer exists.
|
|
27
|
+
*
|
|
28
|
+
* ```ts no-assert ignore
|
|
29
|
+
* import { delay } from "@std/async/delay";
|
|
30
|
+
*
|
|
31
|
+
* // ...
|
|
32
|
+
* await delay(100, { persistent: false });
|
|
33
|
+
* // ...
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function delay(ms, options = {}) {
|
|
37
|
+
const { signal, persistent = true } = options;
|
|
38
|
+
if (signal?.aborted)
|
|
39
|
+
return Promise.reject(signal.reason);
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const abort = () => {
|
|
42
|
+
clearTimeout(i);
|
|
43
|
+
reject(signal?.reason);
|
|
44
|
+
};
|
|
45
|
+
const done = () => {
|
|
46
|
+
signal?.removeEventListener("abort", abort);
|
|
47
|
+
resolve();
|
|
48
|
+
};
|
|
49
|
+
const i = setTimeout(done, ms);
|
|
50
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
51
|
+
if (persistent === false) {
|
|
52
|
+
try {
|
|
53
|
+
// @ts-ignore For browser compatibility
|
|
54
|
+
dntShim.Deno.unrefTimer(i);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (!(error instanceof ReferenceError)) {
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
// deno-lint-ignore no-console
|
|
61
|
+
console.error("`persistent` option is only available in Deno");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provide helpers with asynchronous tasks like {@linkcode delay | delays},
|
|
3
|
+
* {@linkcode debounce | debouncing}, {@linkcode retry | retrying}, or
|
|
4
|
+
* {@linkcode pooledMap | pooling}.
|
|
5
|
+
*
|
|
6
|
+
* ```ts no-assert
|
|
7
|
+
* import { delay } from "@std/async/delay";
|
|
8
|
+
*
|
|
9
|
+
* await delay(100); // waits for 100 milliseconds
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
export * from "./abortable.js";
|
|
15
|
+
export * from "./deadline.js";
|
|
16
|
+
export * from "./debounce.js";
|
|
17
|
+
export * from "./delay.js";
|
|
18
|
+
export * from "./mux_async_iterator.js";
|
|
19
|
+
export * from "./pool.js";
|
|
20
|
+
export * from "./tee.js";
|
|
21
|
+
export * from "./retry.js";
|
|
22
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Provide helpers with asynchronous tasks like {@linkcode delay | delays},
|
|
5
|
+
* {@linkcode debounce | debouncing}, {@linkcode retry | retrying}, or
|
|
6
|
+
* {@linkcode pooledMap | pooling}.
|
|
7
|
+
*
|
|
8
|
+
* ```ts no-assert
|
|
9
|
+
* import { delay } from "@std/async/delay";
|
|
10
|
+
*
|
|
11
|
+
* await delay(100); // waits for 100 milliseconds
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
export * from "./abortable.js";
|
|
17
|
+
export * from "./deadline.js";
|
|
18
|
+
export * from "./debounce.js";
|
|
19
|
+
export * from "./delay.js";
|
|
20
|
+
export * from "./mux_async_iterator.js";
|
|
21
|
+
export * from "./pool.js";
|
|
22
|
+
export * from "./tee.js";
|
|
23
|
+
export * from "./retry.js";
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplexes multiple async iterators into a single stream. It currently
|
|
3
|
+
* makes an assumption that the final result (the value returned and not
|
|
4
|
+
* yielded from the iterator) does not matter; if there is any result, it is
|
|
5
|
+
* discarded.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
10
|
+
* import { assertEquals } from "@std/assert";
|
|
11
|
+
*
|
|
12
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
13
|
+
* yield 1;
|
|
14
|
+
* yield 2;
|
|
15
|
+
* yield 3;
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* async function* gen456(): AsyncIterableIterator<number> {
|
|
19
|
+
* yield 4;
|
|
20
|
+
* yield 5;
|
|
21
|
+
* yield 6;
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
25
|
+
* mux.add(gen123());
|
|
26
|
+
* mux.add(gen456());
|
|
27
|
+
*
|
|
28
|
+
* const result = await Array.fromAsync(mux);
|
|
29
|
+
*
|
|
30
|
+
* assertEquals(result, [1, 4, 2, 5, 3, 6]);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @typeParam T The type of the provided async iterables and generated async iterable.
|
|
34
|
+
*/
|
|
35
|
+
export declare class MuxAsyncIterator<T> implements AsyncIterable<T> {
|
|
36
|
+
#private;
|
|
37
|
+
/**
|
|
38
|
+
* Add an async iterable to the stream.
|
|
39
|
+
*
|
|
40
|
+
* @param iterable The async iterable to add.
|
|
41
|
+
*
|
|
42
|
+
* @example Usage
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
45
|
+
* import { assertEquals } from "@std/assert";
|
|
46
|
+
*
|
|
47
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
48
|
+
* yield 1;
|
|
49
|
+
* yield 2;
|
|
50
|
+
* yield 3;
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
54
|
+
* mux.add(gen123());
|
|
55
|
+
*
|
|
56
|
+
* const result = await Array.fromAsync(mux.iterate());
|
|
57
|
+
*
|
|
58
|
+
* assertEquals(result, [1, 2, 3]);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
add(iterable: AsyncIterable<T>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Returns an async iterator of the stream.
|
|
64
|
+
* @returns the async iterator for all the added async iterables.
|
|
65
|
+
*
|
|
66
|
+
* @example Usage
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
69
|
+
* import { assertEquals } from "@std/assert";
|
|
70
|
+
*
|
|
71
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
72
|
+
* yield 1;
|
|
73
|
+
* yield 2;
|
|
74
|
+
* yield 3;
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
78
|
+
* mux.add(gen123());
|
|
79
|
+
*
|
|
80
|
+
* const result = await Array.fromAsync(mux.iterate());
|
|
81
|
+
*
|
|
82
|
+
* assertEquals(result, [1, 2, 3]);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
iterate(): AsyncIterableIterator<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Implements an async iterator for the stream.
|
|
88
|
+
* @returns the async iterator for all the added async iterables.
|
|
89
|
+
*
|
|
90
|
+
* @example Usage
|
|
91
|
+
* ```ts
|
|
92
|
+
* import { MuxAsyncIterator } from "@std/async/mux-async-iterator";
|
|
93
|
+
* import { assertEquals } from "@std/assert";
|
|
94
|
+
*
|
|
95
|
+
* async function* gen123(): AsyncIterableIterator<number> {
|
|
96
|
+
* yield 1;
|
|
97
|
+
* yield 2;
|
|
98
|
+
* yield 3;
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* const mux = new MuxAsyncIterator<number>();
|
|
102
|
+
* mux.add(gen123());
|
|
103
|
+
*
|
|
104
|
+
* const result = await Array.fromAsync(mux);
|
|
105
|
+
*
|
|
106
|
+
* assertEquals(result, [1, 2, 3]);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=mux_async_iterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mux_async_iterator.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,gBAAgB,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;;IAO1D;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAqB9B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,OAAO,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAsB1C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;CAG3C"}
|