@effectionx/worker 0.3.1 → 0.4.0
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/dist/message-channel.d.ts.map +1 -0
- package/dist/mod.d.ts +4 -0
- package/dist/mod.d.ts.map +1 -0
- package/{esm → dist}/mod.js +1 -0
- package/dist/test-simple-worker.d.ts +2 -0
- package/dist/test-simple-worker.d.ts.map +1 -0
- package/dist/test-simple-worker.js +11 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts.map +1 -0
- package/{esm → dist}/worker-main.d.ts +1 -1
- package/dist/worker-main.d.ts.map +1 -0
- package/{esm → dist}/worker-main.js +34 -16
- package/dist/worker.d.ts.map +1 -0
- package/{esm → dist}/worker.js +3 -4
- package/message-channel.ts +13 -0
- package/mod.ts +3 -0
- package/package.json +22 -16
- package/test-assets/boom-result-worker.ts +5 -0
- package/test-assets/boom-worker.ts +7 -0
- package/test-assets/counter-worker.ts +15 -0
- package/test-assets/crash-worker.ts +1 -0
- package/test-assets/echo-worker.ts +7 -0
- package/test-assets/result-worker.ts +5 -0
- package/test-assets/shutdown-worker.ts +24 -0
- package/test-assets/suspend-worker.ts +4 -0
- package/test-simple-worker.ts +12 -0
- package/tsconfig.json +20 -0
- package/types.ts +38 -0
- package/worker-main.ts +248 -0
- package/worker.test.ts +179 -0
- package/worker.ts +159 -0
- package/esm/_dnt.shims.d.ts +0 -2
- package/esm/_dnt.shims.d.ts.map +0 -1
- package/esm/_dnt.shims.js +0 -57
- package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts +0 -16
- package/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/assert.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/equal.js +0 -186
- package/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts +0 -35
- package/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/equals.js +0 -59
- package/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/exists.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/fail.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.js +0 -52
- package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts +0 -25
- package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/less.js +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/mod.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts +0 -21
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.js +0 -33
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.js +0 -167
- package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts +0 -42
- package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.js +0 -58
- package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/throws.js +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.js +0 -20
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts +0 -80
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.js +0 -116
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts +0 -140
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff.js +0 -276
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts +0 -99
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.js +0 -182
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts +0 -29
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.js +0 -70
- package/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts +0 -25
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.js +0 -3
- package/esm/message-channel.d.ts.map +0 -1
- package/esm/mod.d.ts +0 -3
- package/esm/mod.d.ts.map +0 -1
- package/esm/package.json +0 -3
- package/esm/types.d.ts.map +0 -1
- package/esm/worker-main.d.ts.map +0 -1
- package/esm/worker.d.ts.map +0 -1
- package/script/_dnt.shims.d.ts +0 -2
- package/script/_dnt.shims.d.ts.map +0 -1
- package/script/_dnt.shims.js +0 -60
- package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.js +0 -49
- package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.js +0 -49
- package/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts +0 -16
- package/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/assert.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts +0 -17
- package/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/equal.js +0 -222
- package/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/equals.js +0 -62
- package/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/exists.js +0 -30
- package/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/fail.js +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/greater.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.js +0 -55
- package/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/is_error.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts +0 -19
- package/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/less.js +0 -31
- package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts +0 -44
- package/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/mod.js +0 -61
- package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts +0 -21
- package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.js +0 -36
- package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/object_match.js +0 -170
- package/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts +0 -42
- package/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/rejects.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.js +0 -61
- package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts +0 -45
- package/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/throws.js +0 -47
- package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.js +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.js +0 -23
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts +0 -80
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.js +0 -121
- package/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts +0 -140
- package/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.12/diff.js +0 -283
- package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts +0 -99
- package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.js +0 -188
- package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts +0 -29
- package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.12/format.js +0 -106
- package/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts +0 -159
- package/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.12/styles.js +0 -252
- package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts +0 -25
- package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.12/types.js +0 -4
- package/script/message-channel.d.ts +0 -3
- package/script/message-channel.d.ts.map +0 -1
- package/script/message-channel.js +0 -16
- package/script/mod.d.ts +0 -3
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -18
- package/script/package.json +0 -3
- package/script/types.d.ts +0 -33
- package/script/types.d.ts.map +0 -1
- package/script/types.js +0 -2
- package/script/worker-main.d.ts +0 -84
- package/script/worker-main.d.ts.map +0 -1
- package/script/worker-main.js +0 -190
- package/script/worker.d.ts +0 -63
- package/script/worker.d.ts.map +0 -1
- package/script/worker.js +0 -124
- /package/{esm → dist}/message-channel.d.ts +0 -0
- /package/{esm → dist}/message-channel.js +0 -0
- /package/{esm → dist}/types.d.ts +0 -0
- /package/{esm → dist}/types.js +0 -0
- /package/{esm → dist}/worker.d.ts +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
|
4
|
-
/**
|
|
5
|
-
* Make an assertion, error will be thrown if `expr` have truthy value.
|
|
6
|
-
*
|
|
7
|
-
* @example Usage
|
|
8
|
-
* ```ts ignore
|
|
9
|
-
* import { assertFalse } from "@std/assert";
|
|
10
|
-
*
|
|
11
|
-
* assertFalse(false); // Doesn't throw
|
|
12
|
-
* assertFalse(true); // Throws
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @param expr The expression to test.
|
|
16
|
-
* @param msg The optional message to display if the assertion fails.
|
|
17
|
-
*/
|
|
18
|
-
export function assertFalse(expr, msg = "") {
|
|
19
|
-
if (expr) {
|
|
20
|
-
throw new AssertionError(msg);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` is greater than `expected`.
|
|
3
|
-
* If not then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertGreater } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertGreater(2, 1); // Doesn't throw
|
|
10
|
-
* assertGreater(1, 1); // Throws
|
|
11
|
-
* assertGreater(0, 1); // Throws
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @typeParam T The type of the values to compare.
|
|
15
|
-
* @param actual The actual value to compare.
|
|
16
|
-
* @param expected The expected value to compare.
|
|
17
|
-
* @param msg The optional message to display if the assertion fails.
|
|
18
|
-
*/
|
|
19
|
-
export declare function assertGreater<T>(actual: T, expected: T, msg?: string): void;
|
|
20
|
-
//# sourceMappingURL=greater.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"greater.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/greater.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMpE"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { format } from "../../internal/1.0.12/format.js";
|
|
4
|
-
import { AssertionError } from "./assertion_error.js";
|
|
5
|
-
/**
|
|
6
|
-
* Make an assertion that `actual` is greater than `expected`.
|
|
7
|
-
* If not then throw.
|
|
8
|
-
*
|
|
9
|
-
* @example Usage
|
|
10
|
-
* ```ts ignore
|
|
11
|
-
* import { assertGreater } from "@std/assert";
|
|
12
|
-
*
|
|
13
|
-
* assertGreater(2, 1); // Doesn't throw
|
|
14
|
-
* assertGreater(1, 1); // Throws
|
|
15
|
-
* assertGreater(0, 1); // Throws
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @typeParam T The type of the values to compare.
|
|
19
|
-
* @param actual The actual value to compare.
|
|
20
|
-
* @param expected The expected value to compare.
|
|
21
|
-
* @param msg The optional message to display if the assertion fails.
|
|
22
|
-
*/
|
|
23
|
-
export function assertGreater(actual, expected, msg) {
|
|
24
|
-
if (actual > expected)
|
|
25
|
-
return;
|
|
26
|
-
const actualString = format(actual);
|
|
27
|
-
const expectedString = format(expected);
|
|
28
|
-
throw new AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
|
|
29
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` is greater than or equal to `expected`.
|
|
3
|
-
* If not then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertGreaterOrEqual } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertGreaterOrEqual(2, 1); // Doesn't throw
|
|
10
|
-
* assertGreaterOrEqual(1, 1); // Doesn't throw
|
|
11
|
-
* assertGreaterOrEqual(0, 1); // Throws
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @typeParam T The type of the values to compare.
|
|
15
|
-
* @param actual The actual value to compare.
|
|
16
|
-
* @param expected The expected value to compare.
|
|
17
|
-
* @param msg The optional message to display if the assertion fails.
|
|
18
|
-
*/
|
|
19
|
-
export declare function assertGreaterOrEqual<T>(actual: T, expected: T, msg?: string): void;
|
|
20
|
-
//# sourceMappingURL=greater_or_equal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"greater_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { format } from "../../internal/1.0.12/format.js";
|
|
4
|
-
import { AssertionError } from "./assertion_error.js";
|
|
5
|
-
/**
|
|
6
|
-
* Make an assertion that `actual` is greater than or equal to `expected`.
|
|
7
|
-
* If not then throw.
|
|
8
|
-
*
|
|
9
|
-
* @example Usage
|
|
10
|
-
* ```ts ignore
|
|
11
|
-
* import { assertGreaterOrEqual } from "@std/assert";
|
|
12
|
-
*
|
|
13
|
-
* assertGreaterOrEqual(2, 1); // Doesn't throw
|
|
14
|
-
* assertGreaterOrEqual(1, 1); // Doesn't throw
|
|
15
|
-
* assertGreaterOrEqual(0, 1); // Throws
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @typeParam T The type of the values to compare.
|
|
19
|
-
* @param actual The actual value to compare.
|
|
20
|
-
* @param expected The expected value to compare.
|
|
21
|
-
* @param msg The optional message to display if the assertion fails.
|
|
22
|
-
*/
|
|
23
|
-
export function assertGreaterOrEqual(actual, expected, msg) {
|
|
24
|
-
if (actual >= expected)
|
|
25
|
-
return;
|
|
26
|
-
const actualString = format(actual);
|
|
27
|
-
const expectedString = format(expected);
|
|
28
|
-
throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
|
|
29
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** Any constructor */
|
|
2
|
-
export type AnyConstructor = new (...args: any[]) => any;
|
|
3
|
-
/** Gets constructor type */
|
|
4
|
-
export type GetConstructorType<T extends AnyConstructor> = InstanceType<T>;
|
|
5
|
-
/**
|
|
6
|
-
* Make an assertion that `obj` is an instance of `type`.
|
|
7
|
-
* If not then throw.
|
|
8
|
-
*
|
|
9
|
-
* @example Usage
|
|
10
|
-
* ```ts ignore
|
|
11
|
-
* import { assertInstanceOf } from "@std/assert";
|
|
12
|
-
*
|
|
13
|
-
* assertInstanceOf(new Date(), Date); // Doesn't throw
|
|
14
|
-
* assertInstanceOf(new Date(), Number); // Throws
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @typeParam T The expected type of the object.
|
|
18
|
-
* @param actual The object to check.
|
|
19
|
-
* @param expectedType The expected class constructor.
|
|
20
|
-
* @param msg The optional message to display if the assertion fails.
|
|
21
|
-
*/
|
|
22
|
-
export declare function assertInstanceOf<T extends abstract new (...args: any[]) => any>(actual: unknown, expectedType: T, msg?: string): asserts actual is InstanceType<T>;
|
|
23
|
-
//# sourceMappingURL=instance_of.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAE9B,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAE9C,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CA6BnC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
|
4
|
-
/**
|
|
5
|
-
* Make an assertion that `obj` is an instance of `type`.
|
|
6
|
-
* If not then throw.
|
|
7
|
-
*
|
|
8
|
-
* @example Usage
|
|
9
|
-
* ```ts ignore
|
|
10
|
-
* import { assertInstanceOf } from "@std/assert";
|
|
11
|
-
*
|
|
12
|
-
* assertInstanceOf(new Date(), Date); // Doesn't throw
|
|
13
|
-
* assertInstanceOf(new Date(), Number); // Throws
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @typeParam T The expected type of the object.
|
|
17
|
-
* @param actual The object to check.
|
|
18
|
-
* @param expectedType The expected class constructor.
|
|
19
|
-
* @param msg The optional message to display if the assertion fails.
|
|
20
|
-
*/
|
|
21
|
-
export function assertInstanceOf(actual, expectedType, msg = "") {
|
|
22
|
-
if (actual instanceof expectedType)
|
|
23
|
-
return;
|
|
24
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
25
|
-
const expectedTypeStr = expectedType.name;
|
|
26
|
-
let actualTypeStr = "";
|
|
27
|
-
if (actual === null) {
|
|
28
|
-
actualTypeStr = "null";
|
|
29
|
-
}
|
|
30
|
-
else if (actual === undefined) {
|
|
31
|
-
actualTypeStr = "undefined";
|
|
32
|
-
}
|
|
33
|
-
else if (typeof actual === "object") {
|
|
34
|
-
actualTypeStr = actual.constructor?.name ?? "Object";
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
actualTypeStr = typeof actual;
|
|
38
|
-
}
|
|
39
|
-
if (expectedTypeStr === actualTypeStr) {
|
|
40
|
-
msg =
|
|
41
|
-
`Expected object to be an instance of "${expectedTypeStr}"${msgSuffix}`;
|
|
42
|
-
}
|
|
43
|
-
else if (actualTypeStr === "function") {
|
|
44
|
-
msg =
|
|
45
|
-
`Expected object to be an instance of "${expectedTypeStr}" but was not an instanced object${msgSuffix}`;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
msg =
|
|
49
|
-
`Expected object to be an instance of "${expectedTypeStr}" but was "${actualTypeStr}"${msgSuffix}`;
|
|
50
|
-
}
|
|
51
|
-
throw new AssertionError(msg);
|
|
52
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `error` is an `Error`.
|
|
3
|
-
* If not then an error will be thrown.
|
|
4
|
-
* An error class and a string that should be included in the
|
|
5
|
-
* error message can also be asserted.
|
|
6
|
-
*
|
|
7
|
-
* @example Usage
|
|
8
|
-
* ```ts ignore
|
|
9
|
-
* import { assertIsError } from "@std/assert";
|
|
10
|
-
*
|
|
11
|
-
* assertIsError(null); // Throws
|
|
12
|
-
* assertIsError(new RangeError("Out of range")); // Doesn't throw
|
|
13
|
-
* assertIsError(new RangeError("Out of range"), SyntaxError); // Throws
|
|
14
|
-
* assertIsError(new RangeError("Out of range"), SyntaxError, "Out of range"); // Doesn't throw
|
|
15
|
-
* assertIsError(new RangeError("Out of range"), SyntaxError, "Within range"); // Throws
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @typeParam E The type of the error to assert.
|
|
19
|
-
* @param error The error to assert.
|
|
20
|
-
* @param ErrorClass The optional error class to assert.
|
|
21
|
-
* @param msgMatches The optional string or RegExp to assert in the error message.
|
|
22
|
-
* @param msg The optional message to display if the assertion fails.
|
|
23
|
-
*/
|
|
24
|
-
export declare function assertIsError<E extends Error = Error>(error: unknown, ErrorClass?: abstract new (...args: any[]) => E, msgMatches?: string | RegExp, msg?: string): asserts error is E;
|
|
25
|
-
//# sourceMappingURL=is_error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
|
4
|
-
import { stripAnsiCode } from "../../internal/1.0.12/styles.js";
|
|
5
|
-
/**
|
|
6
|
-
* Make an assertion that `error` is an `Error`.
|
|
7
|
-
* If not then an error will be thrown.
|
|
8
|
-
* An error class and a string that should be included in the
|
|
9
|
-
* error message can also be asserted.
|
|
10
|
-
*
|
|
11
|
-
* @example Usage
|
|
12
|
-
* ```ts ignore
|
|
13
|
-
* import { assertIsError } from "@std/assert";
|
|
14
|
-
*
|
|
15
|
-
* assertIsError(null); // Throws
|
|
16
|
-
* assertIsError(new RangeError("Out of range")); // Doesn't throw
|
|
17
|
-
* assertIsError(new RangeError("Out of range"), SyntaxError); // Throws
|
|
18
|
-
* assertIsError(new RangeError("Out of range"), SyntaxError, "Out of range"); // Doesn't throw
|
|
19
|
-
* assertIsError(new RangeError("Out of range"), SyntaxError, "Within range"); // Throws
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @typeParam E The type of the error to assert.
|
|
23
|
-
* @param error The error to assert.
|
|
24
|
-
* @param ErrorClass The optional error class to assert.
|
|
25
|
-
* @param msgMatches The optional string or RegExp to assert in the error message.
|
|
26
|
-
* @param msg The optional message to display if the assertion fails.
|
|
27
|
-
*/
|
|
28
|
-
export function assertIsError(error,
|
|
29
|
-
// deno-lint-ignore no-explicit-any
|
|
30
|
-
ErrorClass, msgMatches, msg) {
|
|
31
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
32
|
-
if (!(error instanceof Error)) {
|
|
33
|
-
throw new AssertionError(`Expected "error" to be an Error object${msgSuffix}`);
|
|
34
|
-
}
|
|
35
|
-
if (ErrorClass && !(error instanceof ErrorClass)) {
|
|
36
|
-
msg =
|
|
37
|
-
`Expected error to be instance of "${ErrorClass.name}", but was "${error?.constructor?.name}"${msgSuffix}`;
|
|
38
|
-
throw new AssertionError(msg);
|
|
39
|
-
}
|
|
40
|
-
let msgCheck;
|
|
41
|
-
if (typeof msgMatches === "string") {
|
|
42
|
-
msgCheck = stripAnsiCode(error.message).includes(stripAnsiCode(msgMatches));
|
|
43
|
-
}
|
|
44
|
-
if (msgMatches instanceof RegExp) {
|
|
45
|
-
msgCheck = msgMatches.test(stripAnsiCode(error.message));
|
|
46
|
-
}
|
|
47
|
-
if (msgMatches && !msgCheck) {
|
|
48
|
-
msg = `Expected error message to include ${msgMatches instanceof RegExp
|
|
49
|
-
? msgMatches.toString()
|
|
50
|
-
: JSON.stringify(msgMatches)}, but got ${JSON.stringify(error?.message)}${msgSuffix}`;
|
|
51
|
-
throw new AssertionError(msg);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` is less than `expected`.
|
|
3
|
-
* If not then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertLess } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertLess(1, 2); // Doesn't throw
|
|
10
|
-
* assertLess(2, 1); // Throws
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @typeParam T The type of the values to compare.
|
|
14
|
-
* @param actual The actual value to compare.
|
|
15
|
-
* @param expected The expected value to compare.
|
|
16
|
-
* @param msg The optional message to display if the assertion fails.
|
|
17
|
-
*/
|
|
18
|
-
export declare function assertLess<T>(actual: T, expected: T, msg?: string): void;
|
|
19
|
-
//# sourceMappingURL=less.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"less.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/less.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMjE"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { format } from "../../internal/1.0.12/format.js";
|
|
4
|
-
import { AssertionError } from "./assertion_error.js";
|
|
5
|
-
/**
|
|
6
|
-
* Make an assertion that `actual` is less than `expected`.
|
|
7
|
-
* If not then throw.
|
|
8
|
-
*
|
|
9
|
-
* @example Usage
|
|
10
|
-
* ```ts ignore
|
|
11
|
-
* import { assertLess } from "@std/assert";
|
|
12
|
-
*
|
|
13
|
-
* assertLess(1, 2); // Doesn't throw
|
|
14
|
-
* assertLess(2, 1); // Throws
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @typeParam T The type of the values to compare.
|
|
18
|
-
* @param actual The actual value to compare.
|
|
19
|
-
* @param expected The expected value to compare.
|
|
20
|
-
* @param msg The optional message to display if the assertion fails.
|
|
21
|
-
*/
|
|
22
|
-
export function assertLess(actual, expected, msg) {
|
|
23
|
-
if (actual < expected)
|
|
24
|
-
return;
|
|
25
|
-
const actualString = format(actual);
|
|
26
|
-
const expectedString = format(expected);
|
|
27
|
-
throw new AssertionError(msg ?? `Expect ${actualString} < ${expectedString}`);
|
|
28
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` is less than or equal to `expected`.
|
|
3
|
-
* If not then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertLessOrEqual } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertLessOrEqual(1, 2); // Doesn't throw
|
|
10
|
-
* assertLessOrEqual(1, 1); // Doesn't throw
|
|
11
|
-
* assertLessOrEqual(1, 0); // Throws
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @typeParam T The type of the values to compare.
|
|
15
|
-
* @param actual The actual value to compare.
|
|
16
|
-
* @param expected The expected value to compare.
|
|
17
|
-
* @param msg The optional message to display if the assertion fails.
|
|
18
|
-
*/
|
|
19
|
-
export declare function assertLessOrEqual<T>(actual: T, expected: T, msg?: string): void;
|
|
20
|
-
//# sourceMappingURL=less_or_equal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"less_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/less_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { format } from "../../internal/1.0.12/format.js";
|
|
4
|
-
import { AssertionError } from "./assertion_error.js";
|
|
5
|
-
/**
|
|
6
|
-
* Make an assertion that `actual` is less than or equal to `expected`.
|
|
7
|
-
* If not then throw.
|
|
8
|
-
*
|
|
9
|
-
* @example Usage
|
|
10
|
-
* ```ts ignore
|
|
11
|
-
* import { assertLessOrEqual } from "@std/assert";
|
|
12
|
-
*
|
|
13
|
-
* assertLessOrEqual(1, 2); // Doesn't throw
|
|
14
|
-
* assertLessOrEqual(1, 1); // Doesn't throw
|
|
15
|
-
* assertLessOrEqual(1, 0); // Throws
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @typeParam T The type of the values to compare.
|
|
19
|
-
* @param actual The actual value to compare.
|
|
20
|
-
* @param expected The expected value to compare.
|
|
21
|
-
* @param msg The optional message to display if the assertion fails.
|
|
22
|
-
*/
|
|
23
|
-
export function assertLessOrEqual(actual, expected, msg) {
|
|
24
|
-
if (actual <= expected)
|
|
25
|
-
return;
|
|
26
|
-
const actualString = format(actual);
|
|
27
|
-
const expectedString = format(expected);
|
|
28
|
-
throw new AssertionError(msg ?? `Expect ${actualString} <= ${expectedString}`);
|
|
29
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` match RegExp `expected`. If not
|
|
3
|
-
* then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertMatch } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertMatch("Raptor", /Raptor/); // Doesn't throw
|
|
10
|
-
* assertMatch("Denosaurus", /Raptor/); // Throws
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param actual The actual value to be matched.
|
|
14
|
-
* @param expected The expected pattern to match.
|
|
15
|
-
* @param msg The optional message to display if the assertion fails.
|
|
16
|
-
*/
|
|
17
|
-
export declare function assertMatch(actual: string, expected: RegExp, msg?: string): void;
|
|
18
|
-
//# sourceMappingURL=match.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
|
4
|
-
/**
|
|
5
|
-
* Make an assertion that `actual` match RegExp `expected`. If not
|
|
6
|
-
* then throw.
|
|
7
|
-
*
|
|
8
|
-
* @example Usage
|
|
9
|
-
* ```ts ignore
|
|
10
|
-
* import { assertMatch } from "@std/assert";
|
|
11
|
-
*
|
|
12
|
-
* assertMatch("Raptor", /Raptor/); // Doesn't throw
|
|
13
|
-
* assertMatch("Denosaurus", /Raptor/); // Throws
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @param actual The actual value to be matched.
|
|
17
|
-
* @param expected The expected pattern to match.
|
|
18
|
-
* @param msg The optional message to display if the assertion fails.
|
|
19
|
-
*/
|
|
20
|
-
export function assertMatch(actual, expected, msg) {
|
|
21
|
-
if (expected.test(actual))
|
|
22
|
-
return;
|
|
23
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
24
|
-
msg = `Expected actual: "${actual}" to match: "${expected}"${msgSuffix}`;
|
|
25
|
-
throw new AssertionError(msg);
|
|
26
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** A library of assertion functions.
|
|
2
|
-
* If the assertion is false an `AssertionError` will be thrown which will
|
|
3
|
-
* result in pretty-printed diff of the failing assertion.
|
|
4
|
-
*
|
|
5
|
-
* This module is browser compatible, but do not rely on good formatting of
|
|
6
|
-
* values for AssertionError messages in browsers.
|
|
7
|
-
*
|
|
8
|
-
* ```ts ignore
|
|
9
|
-
* import { assert } from "@std/assert";
|
|
10
|
-
*
|
|
11
|
-
* assert("I am truthy"); // Doesn't throw
|
|
12
|
-
* assert(false); // Throws `AssertionError`
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @module
|
|
16
|
-
*/
|
|
17
|
-
export * from "./almost_equals.js";
|
|
18
|
-
export * from "./array_includes.js";
|
|
19
|
-
export * from "./equals.js";
|
|
20
|
-
export * from "./exists.js";
|
|
21
|
-
export * from "./false.js";
|
|
22
|
-
export * from "./greater_or_equal.js";
|
|
23
|
-
export * from "./greater.js";
|
|
24
|
-
export * from "./instance_of.js";
|
|
25
|
-
export * from "./is_error.js";
|
|
26
|
-
export * from "./less_or_equal.js";
|
|
27
|
-
export * from "./less.js";
|
|
28
|
-
export * from "./match.js";
|
|
29
|
-
export * from "./not_equals.js";
|
|
30
|
-
export * from "./not_instance_of.js";
|
|
31
|
-
export * from "./not_match.js";
|
|
32
|
-
export * from "./not_strict_equals.js";
|
|
33
|
-
export * from "./object_match.js";
|
|
34
|
-
export * from "./rejects.js";
|
|
35
|
-
export * from "./strict_equals.js";
|
|
36
|
-
export * from "./string_includes.js";
|
|
37
|
-
export * from "./throws.js";
|
|
38
|
-
export * from "./assert.js";
|
|
39
|
-
export * from "./assertion_error.js";
|
|
40
|
-
export * from "./equal.js";
|
|
41
|
-
export * from "./fail.js";
|
|
42
|
-
export * from "./unimplemented.js";
|
|
43
|
-
export * from "./unreachable.js";
|
|
44
|
-
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
/** A library of assertion functions.
|
|
4
|
-
* If the assertion is false an `AssertionError` will be thrown which will
|
|
5
|
-
* result in pretty-printed diff of the failing assertion.
|
|
6
|
-
*
|
|
7
|
-
* This module is browser compatible, but do not rely on good formatting of
|
|
8
|
-
* values for AssertionError messages in browsers.
|
|
9
|
-
*
|
|
10
|
-
* ```ts ignore
|
|
11
|
-
* import { assert } from "@std/assert";
|
|
12
|
-
*
|
|
13
|
-
* assert("I am truthy"); // Doesn't throw
|
|
14
|
-
* assert(false); // Throws `AssertionError`
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @module
|
|
18
|
-
*/
|
|
19
|
-
export * from "./almost_equals.js";
|
|
20
|
-
export * from "./array_includes.js";
|
|
21
|
-
export * from "./equals.js";
|
|
22
|
-
export * from "./exists.js";
|
|
23
|
-
export * from "./false.js";
|
|
24
|
-
export * from "./greater_or_equal.js";
|
|
25
|
-
export * from "./greater.js";
|
|
26
|
-
export * from "./instance_of.js";
|
|
27
|
-
export * from "./is_error.js";
|
|
28
|
-
export * from "./less_or_equal.js";
|
|
29
|
-
export * from "./less.js";
|
|
30
|
-
export * from "./match.js";
|
|
31
|
-
export * from "./not_equals.js";
|
|
32
|
-
export * from "./not_instance_of.js";
|
|
33
|
-
export * from "./not_match.js";
|
|
34
|
-
export * from "./not_strict_equals.js";
|
|
35
|
-
export * from "./object_match.js";
|
|
36
|
-
export * from "./rejects.js";
|
|
37
|
-
export * from "./strict_equals.js";
|
|
38
|
-
export * from "./string_includes.js";
|
|
39
|
-
export * from "./throws.js";
|
|
40
|
-
export * from "./assert.js";
|
|
41
|
-
export * from "./assertion_error.js";
|
|
42
|
-
export * from "./equal.js";
|
|
43
|
-
export * from "./fail.js";
|
|
44
|
-
export * from "./unimplemented.js";
|
|
45
|
-
export * from "./unreachable.js";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `actual` and `expected` are not equal, deeply.
|
|
3
|
-
* If not then throw.
|
|
4
|
-
*
|
|
5
|
-
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
6
|
-
*
|
|
7
|
-
* @example Usage
|
|
8
|
-
* ```ts ignore
|
|
9
|
-
* import { assertNotEquals } from "@std/assert";
|
|
10
|
-
*
|
|
11
|
-
* assertNotEquals(1, 2); // Doesn't throw
|
|
12
|
-
* assertNotEquals(1, 1); // Throws
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @typeParam T The type of the values to compare.
|
|
16
|
-
* @param actual The actual value to compare.
|
|
17
|
-
* @param expected The expected value to compare.
|
|
18
|
-
* @param msg The optional message to display if the assertion fails.
|
|
19
|
-
*/
|
|
20
|
-
export declare function assertNotEquals<T>(actual: T, expected: T, msg?: string): void;
|
|
21
|
-
//# sourceMappingURL=not_equals.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
import { equal } from "./equal.js";
|
|
4
|
-
import { AssertionError } from "./assertion_error.js";
|
|
5
|
-
import { format } from "../../internal/1.0.12/format.js";
|
|
6
|
-
/**
|
|
7
|
-
* Make an assertion that `actual` and `expected` are not equal, deeply.
|
|
8
|
-
* If not then throw.
|
|
9
|
-
*
|
|
10
|
-
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
11
|
-
*
|
|
12
|
-
* @example Usage
|
|
13
|
-
* ```ts ignore
|
|
14
|
-
* import { assertNotEquals } from "@std/assert";
|
|
15
|
-
*
|
|
16
|
-
* assertNotEquals(1, 2); // Doesn't throw
|
|
17
|
-
* assertNotEquals(1, 1); // Throws
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @typeParam T The type of the values to compare.
|
|
21
|
-
* @param actual The actual value to compare.
|
|
22
|
-
* @param expected The expected value to compare.
|
|
23
|
-
* @param msg The optional message to display if the assertion fails.
|
|
24
|
-
*/
|
|
25
|
-
export function assertNotEquals(actual, expected, msg) {
|
|
26
|
-
if (!equal(actual, expected)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const actualString = format(actual);
|
|
30
|
-
const expectedString = format(expected);
|
|
31
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
32
|
-
throw new AssertionError(`Expected actual: ${actualString} not to be: ${expectedString}${msgSuffix}`);
|
|
33
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make an assertion that `obj` is not an instance of `type`.
|
|
3
|
-
* If so, then throw.
|
|
4
|
-
*
|
|
5
|
-
* @example Usage
|
|
6
|
-
* ```ts ignore
|
|
7
|
-
* import { assertNotInstanceOf } from "@std/assert";
|
|
8
|
-
*
|
|
9
|
-
* assertNotInstanceOf(new Date(), Number); // Doesn't throw
|
|
10
|
-
* assertNotInstanceOf(new Date(), Date); // Throws
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @typeParam A The type of the object to check.
|
|
14
|
-
* @typeParam T The type of the class to check against.
|
|
15
|
-
* @param actual The object to check.
|
|
16
|
-
* @param unexpectedType The class constructor to check against.
|
|
17
|
-
* @param msg The optional message to display if the assertion fails.
|
|
18
|
-
*/
|
|
19
|
-
export declare function assertNotInstanceOf<A, T>(actual: A, unexpectedType: abstract new (...args: any[]) => T, msg?: string): asserts actual is Exclude<A, T>;
|
|
20
|
-
//# sourceMappingURL=not_instance_of.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not_instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_instance_of.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,EAET,cAAc,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAClD,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAKjC"}
|