structured-outputs 0.1.0-beta.20 → 0.1.0-beta.22
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +46 -40
- package/esm/ResponseFormat.d.ts +21 -0
- package/esm/ResponseFormat.d.ts.map +1 -0
- package/esm/ResponseFormat.js +43 -19
- package/esm/ResponseFormat.js.map +1 -1
- package/{types → esm}/Tool.d.ts +1 -0
- package/esm/Tool.d.ts.map +1 -0
- package/esm/Tool.js +1 -0
- package/esm/Tool.js.map +1 -1
- package/esm/oai.d.ts +5 -0
- package/esm/oai.d.ts.map +1 -0
- package/esm/oai.js +2 -0
- package/esm/oai.js.map +1 -0
- package/esm/types/Ref.d.ts.map +1 -0
- package/esm/types/Ref.js +6 -3
- package/esm/types/Ref.js.map +1 -1
- package/esm/types/RootTy.d.ts +8 -0
- package/esm/types/RootTy.d.ts.map +1 -0
- package/esm/types/RootTy.js +5 -7
- package/esm/types/RootTy.js.map +1 -1
- package/esm/types/Ty.d.ts +23 -0
- package/esm/types/Ty.d.ts.map +1 -0
- package/esm/types/Ty.js +5 -9
- package/esm/types/Ty.js.map +1 -1
- package/{types → esm}/types/array.d.ts +1 -1
- package/{types → esm}/types/array.d.ts.map +1 -1
- package/esm/types/array.js +1 -2
- package/esm/types/array.js.map +1 -1
- package/{types → esm}/types/constant.d.ts.map +1 -1
- package/esm/types/constant.js +1 -2
- package/esm/types/constant.js.map +1 -1
- package/{types → esm}/types/constantUnion.d.ts.map +1 -1
- package/esm/types/constantUnion.js +16 -19
- package/esm/types/constantUnion.js.map +1 -1
- package/{types → esm}/types/mod.d.ts +3 -3
- package/esm/types/mod.d.ts.map +1 -0
- package/esm/types/mod.js +3 -3
- package/esm/types/mod.js.map +1 -1
- package/{types → esm}/types/object.d.ts +2 -2
- package/{types → esm}/types/object.d.ts.map +1 -1
- package/esm/types/object.js +1 -2
- package/esm/types/object.js.map +1 -1
- package/{types/types/leaves.d.ts → esm/types/primitives.d.ts} +1 -1
- package/esm/types/primitives.d.ts.map +1 -0
- package/esm/types/primitives.js +14 -0
- package/esm/types/primitives.js.map +1 -0
- package/esm/types/std/Option.js +1 -1
- package/esm/types/std/Option.js.map +1 -1
- package/{types → esm}/types/std/Wrapper.d.ts +0 -1
- package/esm/types/std/Wrapper.d.ts.map +1 -0
- package/esm/types/std/Wrapper.js.map +1 -1
- package/{types → esm}/types/taggedUnion.d.ts +2 -2
- package/{types → esm}/types/taggedUnion.d.ts.map +1 -1
- package/esm/types/taggedUnion.js +1 -2
- package/esm/types/taggedUnion.js.map +1 -1
- package/package.json +6 -11
- package/src/ResponseFormat.ts +48 -41
- package/src/Tool.ts +1 -0
- package/src/oai.ts +5 -0
- package/src/types/Ref.ts +7 -4
- package/src/types/RootTy.ts +11 -13
- package/src/types/Ty.ts +23 -30
- package/src/types/array.ts +2 -3
- package/src/types/constant.ts +1 -2
- package/src/types/constantUnion.ts +16 -19
- package/src/types/mod.ts +3 -3
- package/src/types/object.ts +4 -6
- package/src/types/primitives.ts +17 -0
- package/src/types/std/Option.ts +1 -1
- package/src/types/std/Wrapper.ts +0 -2
- package/src/types/taggedUnion.ts +3 -4
- package/esm/_dnt.shims.js +0 -58
- package/esm/_dnt.shims.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js +0 -47
- package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js +0 -47
- package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js +0 -31
- package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js +0 -184
- package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js +0 -21
- package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/false.js +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.8/false.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js +0 -54
- package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/less.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.8/less.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/match.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.8/match.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js +0 -33
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js +0 -33
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js +0 -160
- package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js +0 -54
- package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js +0 -58
- package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js +0 -21
- package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js +0 -21
- package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -111
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -180
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -38
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -208
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js.map +0 -1
- package/esm/types/leaves.js +0 -18
- package/esm/types/leaves.js.map +0 -1
- package/src/_dnt.shims.ts +0 -60
- package/src/deps/jsr.io/@std/assert/1.0.8/almost_equals.ts +0 -55
- package/src/deps/jsr.io/@std/assert/1.0.8/array_includes.ts +0 -57
- package/src/deps/jsr.io/@std/assert/1.0.8/assert.ts +0 -23
- package/src/deps/jsr.io/@std/assert/1.0.8/assertion_error.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.8/equal.ts +0 -210
- package/src/deps/jsr.io/@std/assert/1.0.8/equals.ts +0 -52
- package/src/deps/jsr.io/@std/assert/1.0.8/exists.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.8/fail.ts +0 -21
- package/src/deps/jsr.io/@std/assert/1.0.8/false.ts +0 -26
- package/src/deps/jsr.io/@std/assert/1.0.8/greater.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.ts +0 -36
- package/src/deps/jsr.io/@std/assert/1.0.8/instance_of.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.8/is_error.ts +0 -65
- package/src/deps/jsr.io/@std/assert/1.0.8/less.ts +0 -29
- package/src/deps/jsr.io/@std/assert/1.0.8/less_or_equal.ts +0 -36
- package/src/deps/jsr.io/@std/assert/1.0.8/match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.8/mod.ts +0 -47
- package/src/deps/jsr.io/@std/assert/1.0.8/not_equals.ts +0 -36
- package/src/deps/jsr.io/@std/assert/1.0.8/not_instance_of.ts +0 -33
- package/src/deps/jsr.io/@std/assert/1.0.8/not_match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.ts +0 -42
- package/src/deps/jsr.io/@std/assert/1.0.8/object_match.ts +0 -202
- package/src/deps/jsr.io/@std/assert/1.0.8/rejects.ts +0 -123
- package/src/deps/jsr.io/@std/assert/1.0.8/strict_equals.ts +0 -67
- package/src/deps/jsr.io/@std/assert/1.0.8/string_includes.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.8/throws.ts +0 -111
- package/src/deps/jsr.io/@std/assert/1.0.8/unimplemented.ts +0 -21
- package/src/deps/jsr.io/@std/assert/1.0.8/unreachable.ts +0 -21
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +0 -134
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +0 -317
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +0 -204
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +0 -39
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +0 -233
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +0 -18
- package/src/types/leaves.ts +0 -21
- package/types/ResponseFormat.d.ts +0 -26
- package/types/ResponseFormat.d.ts.map +0 -1
- package/types/Tool.d.ts.map +0 -1
- package/types/_dnt.shims.d.ts +0 -2
- package/types/_dnt.shims.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts +0 -29
- package/types/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts +0 -24
- package/types/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/assert.d.ts +0 -16
- package/types/deps/jsr.io/@std/assert/1.0.8/assert.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts +0 -26
- package/types/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/equal.d.ts +0 -17
- package/types/deps/jsr.io/@std/assert/1.0.8/equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/equals.d.ts +0 -22
- package/types/deps/jsr.io/@std/assert/1.0.8/equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/exists.d.ts +0 -18
- package/types/deps/jsr.io/@std/assert/1.0.8/exists.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/fail.d.ts +0 -15
- package/types/deps/jsr.io/@std/assert/1.0.8/fail.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/false.d.ts +0 -18
- package/types/deps/jsr.io/@std/assert/1.0.8/false.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/greater.d.ts +0 -20
- package/types/deps/jsr.io/@std/assert/1.0.8/greater.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts +0 -20
- package/types/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts +0 -23
- package/types/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts +0 -25
- package/types/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/less.d.ts +0 -19
- package/types/deps/jsr.io/@std/assert/1.0.8/less.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts +0 -20
- package/types/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/match.d.ts +0 -18
- package/types/deps/jsr.io/@std/assert/1.0.8/match.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/mod.d.ts +0 -44
- package/types/deps/jsr.io/@std/assert/1.0.8/mod.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts +0 -21
- package/types/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts +0 -20
- package/types/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts +0 -18
- package/types/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts +0 -23
- package/types/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts +0 -28
- package/types/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts +0 -42
- package/types/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts +0 -24
- package/types/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts +0 -18
- package/types/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/throws.d.ts +0 -45
- package/types/deps/jsr.io/@std/assert/1.0.8/throws.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts +0 -15
- package/types/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts +0 -15
- package/types/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/types/types/Ref.d.ts.map +0 -1
- package/types/types/RootTy.d.ts +0 -8
- package/types/types/RootTy.d.ts.map +0 -1
- package/types/types/Ty.d.ts +0 -27
- package/types/types/Ty.d.ts.map +0 -1
- package/types/types/leaves.d.ts.map +0 -1
- package/types/types/mod.d.ts.map +0 -1
- package/types/types/std/Wrapper.d.ts.map +0 -1
- /package/{types → esm}/_dnt.polyfills.d.ts +0 -0
- /package/{types → esm}/_dnt.polyfills.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/mod.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/mod.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/omit.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/omit.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/pick.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/pick.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sample.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sample.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/union.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/union.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts.map +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/zip.d.ts +0 -0
- /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/zip.d.ts.map +0 -0
- /package/{types → esm}/mod.d.ts +0 -0
- /package/{types → esm}/mod.d.ts.map +0 -0
- /package/{types → esm}/types/Ref.d.ts +0 -0
- /package/{types → esm}/types/constant.d.ts +0 -0
- /package/{types → esm}/types/constantUnion.d.ts +0 -0
- /package/{types → esm}/types/std/Option.d.ts +0 -0
- /package/{types → esm}/types/std/Option.d.ts.map +0 -0
- /package/{types → esm}/types/std/mod.d.ts +0 -0
- /package/{types → esm}/types/std/mod.d.ts.map +0 -0
- /package/{types → esm}/util/phantoms.d.ts +0 -0
- /package/{types → esm}/util/phantoms.d.ts.map +0 -0
- /package/{types → esm}/util/recombineTaggedTemplateArgs.d.ts +0 -0
- /package/{types → esm}/util/recombineTaggedTemplateArgs.d.ts.map +0 -0
@@ -1,47 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
4
|
-
/**
|
5
|
-
* Make an assertion that `actual` and `expected` are almost equal numbers
|
6
|
-
* through a given tolerance. It can be used to take into account IEEE-754
|
7
|
-
* double-precision floating-point representation limitations. If the values
|
8
|
-
* are not almost equal then throw.
|
9
|
-
*
|
10
|
-
* The default tolerance is one hundred thousandth of a percent of the
|
11
|
-
* expected value.
|
12
|
-
*
|
13
|
-
* @example Usage
|
14
|
-
* ```ts ignore
|
15
|
-
* import { assertAlmostEquals } from "@std/assert";
|
16
|
-
*
|
17
|
-
* assertAlmostEquals(0.01, 0.02); // Throws
|
18
|
-
* assertAlmostEquals(1e-8, 1e-9); // Throws
|
19
|
-
* assertAlmostEquals(1.000000001e-8, 1.000000002e-8); // Doesn't throw
|
20
|
-
* assertAlmostEquals(0.01, 0.02, 0.1); // Doesn't throw
|
21
|
-
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); // Doesn't throw
|
22
|
-
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17); // Throws
|
23
|
-
* ```
|
24
|
-
*
|
25
|
-
* @param actual The actual value to compare.
|
26
|
-
* @param expected The expected value to compare.
|
27
|
-
* @param tolerance The tolerance to consider the values almost equal. The
|
28
|
-
* default is one hundred thousandth of a percent of the expected value.
|
29
|
-
* @param msg The optional message to include in the error.
|
30
|
-
*/
|
31
|
-
export function assertAlmostEquals(actual, expected, tolerance, msg) {
|
32
|
-
if (Object.is(actual, expected)) {
|
33
|
-
return;
|
34
|
-
}
|
35
|
-
const delta = Math.abs(expected - actual);
|
36
|
-
if (tolerance === undefined) {
|
37
|
-
tolerance = isFinite(expected) ? Math.abs(expected * 1e-7) : 1e-7;
|
38
|
-
}
|
39
|
-
if (delta <= tolerance) {
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
43
|
-
const f = (n) => Number.isInteger(n) ? n : n.toExponential();
|
44
|
-
throw new AssertionError(`Expected actual: "${f(actual)}" to be close to "${f(expected)}": \
|
45
|
-
delta "${f(delta)}" is greater than "${f(tolerance)}"${msgSuffix}`);
|
46
|
-
}
|
47
|
-
//# sourceMappingURL=almost_equals.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"almost_equals.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/almost_equals.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,QAAgB,EAChB,SAAkB,EAClB,GAAY;IAEZ,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;QAChC,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;IAC1C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,CAAC;IACD,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,MAAM,CAAC,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IACrE,MAAM,IAAI,cAAc,CACtB,qBAAqB,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC;SACzD,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,IAAI,SAAS,EAAE,CAC/D,CAAC;AACJ,CAAC"}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { equal } from "./equal.js";
|
4
|
-
import { format } from "../../internal/1.0.5/format.js";
|
5
|
-
import { AssertionError } from "./assertion_error.js";
|
6
|
-
/**
|
7
|
-
* Make an assertion that `actual` includes the `expected` values. If not then
|
8
|
-
* an error will be thrown.
|
9
|
-
*
|
10
|
-
* Type parameter can be specified to ensure values under comparison have the
|
11
|
-
* same type.
|
12
|
-
*
|
13
|
-
* @example Usage
|
14
|
-
* ```ts ignore
|
15
|
-
* import { assertArrayIncludes } from "@std/assert";
|
16
|
-
*
|
17
|
-
* assertArrayIncludes([1, 2], [2]); // Doesn't throw
|
18
|
-
* assertArrayIncludes([1, 2], [3]); // Throws
|
19
|
-
* ```
|
20
|
-
*
|
21
|
-
* @typeParam T The type of the elements in the array to compare.
|
22
|
-
* @param actual The array-like object to check for.
|
23
|
-
* @param expected The array-like object to check for.
|
24
|
-
* @param msg The optional message to display if the assertion fails.
|
25
|
-
*/
|
26
|
-
export function assertArrayIncludes(actual, expected, msg) {
|
27
|
-
const missing = [];
|
28
|
-
for (let i = 0; i < expected.length; i++) {
|
29
|
-
let found = false;
|
30
|
-
for (let j = 0; j < actual.length; j++) {
|
31
|
-
if (equal(expected[i], actual[j])) {
|
32
|
-
found = true;
|
33
|
-
break;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
if (!found) {
|
37
|
-
missing.push(expected[i]);
|
38
|
-
}
|
39
|
-
}
|
40
|
-
if (missing.length === 0) {
|
41
|
-
return;
|
42
|
-
}
|
43
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
44
|
-
msg = `Expected actual: "${format(actual)}" to include: "${format(expected)}"${msgSuffix}\nmissing: ${format(missing)}`;
|
45
|
-
throw new AssertionError(msg);
|
46
|
-
}
|
47
|
-
//# sourceMappingURL=array_includes.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"array_includes.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/array_includes.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAuB,EACvB,QAAyB,EACzB,GAAY;IAEZ,MAAM,OAAO,GAAc,EAAE,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClC,KAAK,GAAG,IAAI,CAAC;gBACb,MAAM;YACR,CAAC;QACH,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,GAAG,GAAG,qBAAqB,MAAM,CAAC,MAAM,CAAC,kBACvC,MAAM,CAAC,QAAQ,CACjB,IAAI,SAAS,cAAc,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7C,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. 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` does not have truthy value.
|
6
|
-
*
|
7
|
-
* @example Usage
|
8
|
-
* ```ts ignore
|
9
|
-
* import { assert } from "@std/assert";
|
10
|
-
*
|
11
|
-
* assert("hello".includes("ello")); // Doesn't throw
|
12
|
-
* assert("hello".includes("world")); // 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 assert(expr, msg = "") {
|
19
|
-
if (!expr) {
|
20
|
-
throw new AssertionError(msg);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
//# sourceMappingURL=assert.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/assert.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,MAAM,CAAC,IAAa,EAAE,GAAG,GAAG,EAAE;IAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
/**
|
4
|
-
* Error thrown when an assertion fails.
|
5
|
-
*
|
6
|
-
* @example Usage
|
7
|
-
* ```ts ignore
|
8
|
-
* import { AssertionError } from "@std/assert";
|
9
|
-
*
|
10
|
-
* try {
|
11
|
-
* throw new AssertionError("foo", { cause: "bar" });
|
12
|
-
* } catch (error) {
|
13
|
-
* if (error instanceof AssertionError) {
|
14
|
-
* error.message === "foo"; // true
|
15
|
-
* error.cause === "bar"; // true
|
16
|
-
* }
|
17
|
-
* }
|
18
|
-
* ```
|
19
|
-
*/
|
20
|
-
export class AssertionError extends Error {
|
21
|
-
/** Constructs a new instance.
|
22
|
-
*
|
23
|
-
* @param message The error message.
|
24
|
-
* @param options Additional options. This argument is still unstable. It may change in the future release.
|
25
|
-
*/
|
26
|
-
constructor(message, options) {
|
27
|
-
super(message, options);
|
28
|
-
this.name = "AssertionError";
|
29
|
-
}
|
30
|
-
}
|
31
|
-
//# sourceMappingURL=assertion_error.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"assertion_error.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/assertion_error.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;IACH,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF"}
|
@@ -1,184 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import * as dntShim from "../../../../../_dnt.shims.js";
|
4
|
-
function isKeyedCollection(x) {
|
5
|
-
return x instanceof Set || x instanceof Map;
|
6
|
-
}
|
7
|
-
function prototypesEqual(a, b) {
|
8
|
-
const pa = Object.getPrototypeOf(a);
|
9
|
-
const pb = Object.getPrototypeOf(b);
|
10
|
-
return pa === pb ||
|
11
|
-
pa === Object.prototype && pb === null ||
|
12
|
-
pa === null && pb === Object.prototype;
|
13
|
-
}
|
14
|
-
function isBasicObjectOrArray(obj) {
|
15
|
-
const proto = Object.getPrototypeOf(obj);
|
16
|
-
return proto === null || proto === Object.prototype ||
|
17
|
-
proto === Array.prototype;
|
18
|
-
}
|
19
|
-
// Slightly faster than Reflect.ownKeys in V8 as of 12.9.202.13-rusty (2024-10-28)
|
20
|
-
function ownKeys(obj) {
|
21
|
-
return [
|
22
|
-
...Object.getOwnPropertyNames(obj),
|
23
|
-
...Object.getOwnPropertySymbols(obj),
|
24
|
-
];
|
25
|
-
}
|
26
|
-
function getKeysDeep(obj) {
|
27
|
-
const keys = new Set();
|
28
|
-
while (obj !== Object.prototype && obj !== Array.prototype && obj != null) {
|
29
|
-
for (const key of ownKeys(obj)) {
|
30
|
-
keys.add(key);
|
31
|
-
}
|
32
|
-
obj = Object.getPrototypeOf(obj);
|
33
|
-
}
|
34
|
-
return keys;
|
35
|
-
}
|
36
|
-
// deno-lint-ignore no-explicit-any
|
37
|
-
const Temporal = dntShim.dntGlobalThis.Temporal ??
|
38
|
-
new Proxy({}, { get: () => { } });
|
39
|
-
/** A non-exhaustive list of prototypes that can be accurately fast-path compared with `String(instance)` */
|
40
|
-
const stringComparablePrototypes = new Set([
|
41
|
-
Intl.Locale,
|
42
|
-
RegExp,
|
43
|
-
Temporal.Duration,
|
44
|
-
Temporal.Instant,
|
45
|
-
Temporal.PlainDate,
|
46
|
-
Temporal.PlainDateTime,
|
47
|
-
Temporal.PlainTime,
|
48
|
-
Temporal.PlainYearMonth,
|
49
|
-
Temporal.PlainMonthDay,
|
50
|
-
Temporal.ZonedDateTime,
|
51
|
-
URL,
|
52
|
-
URLSearchParams,
|
53
|
-
].filter((x) => x != null).map((x) => x.prototype));
|
54
|
-
function isPrimitive(x) {
|
55
|
-
return typeof x === "string" ||
|
56
|
-
typeof x === "number" ||
|
57
|
-
typeof x === "boolean" ||
|
58
|
-
typeof x === "bigint" ||
|
59
|
-
typeof x === "symbol" ||
|
60
|
-
x == null;
|
61
|
-
}
|
62
|
-
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
63
|
-
function compareTypedArrays(a, b) {
|
64
|
-
if (a.length !== b.length)
|
65
|
-
return false;
|
66
|
-
for (let i = 0; i < b.length; i++) {
|
67
|
-
if (!sameValueZero(a[i], b[i]))
|
68
|
-
return false;
|
69
|
-
}
|
70
|
-
return true;
|
71
|
-
}
|
72
|
-
/** Check both strict equality (`0 == -0`) and `Object.is` (`NaN == NaN`) */
|
73
|
-
function sameValueZero(a, b) {
|
74
|
-
return a === b || Object.is(a, b);
|
75
|
-
}
|
76
|
-
/**
|
77
|
-
* Deep equality comparison used in assertions.
|
78
|
-
*
|
79
|
-
* @param a The actual value
|
80
|
-
* @param b The expected value
|
81
|
-
* @returns `true` if the values are deeply equal, `false` otherwise
|
82
|
-
*
|
83
|
-
* @example Usage
|
84
|
-
* ```ts
|
85
|
-
* import { equal } from "@std/assert/equal";
|
86
|
-
*
|
87
|
-
* equal({ foo: "bar" }, { foo: "bar" }); // Returns `true`
|
88
|
-
* equal({ foo: "bar" }, { foo: "baz" }); // Returns `false`
|
89
|
-
* ```
|
90
|
-
*/
|
91
|
-
export function equal(a, b) {
|
92
|
-
const seen = new Map();
|
93
|
-
return (function compare(a, b) {
|
94
|
-
if (sameValueZero(a, b))
|
95
|
-
return true;
|
96
|
-
if (isPrimitive(a) || isPrimitive(b))
|
97
|
-
return false;
|
98
|
-
if (a instanceof Date && b instanceof Date) {
|
99
|
-
return Object.is(a.getTime(), b.getTime());
|
100
|
-
}
|
101
|
-
if (a && typeof a === "object" && b && typeof b === "object") {
|
102
|
-
if (!prototypesEqual(a, b)) {
|
103
|
-
return false;
|
104
|
-
}
|
105
|
-
if (a instanceof TypedArray) {
|
106
|
-
return compareTypedArrays(a, b);
|
107
|
-
}
|
108
|
-
if (a instanceof WeakMap) {
|
109
|
-
throw new TypeError("cannot compare WeakMap instances");
|
110
|
-
}
|
111
|
-
if (a instanceof WeakSet) {
|
112
|
-
throw new TypeError("cannot compare WeakSet instances");
|
113
|
-
}
|
114
|
-
if (a instanceof WeakRef) {
|
115
|
-
return compare(a.deref(), b.deref());
|
116
|
-
}
|
117
|
-
if (seen.get(a) === b) {
|
118
|
-
return true;
|
119
|
-
}
|
120
|
-
if (Object.keys(a).length !== Object.keys(b).length) {
|
121
|
-
return false;
|
122
|
-
}
|
123
|
-
seen.set(a, b);
|
124
|
-
if (isKeyedCollection(a) && isKeyedCollection(b)) {
|
125
|
-
if (a.size !== b.size) {
|
126
|
-
return false;
|
127
|
-
}
|
128
|
-
const aKeys = [...a.keys()];
|
129
|
-
const primitiveKeysFastPath = aKeys.every(isPrimitive);
|
130
|
-
if (primitiveKeysFastPath) {
|
131
|
-
if (a instanceof Set) {
|
132
|
-
return a.symmetricDifference(b).size === 0;
|
133
|
-
}
|
134
|
-
for (const key of aKeys) {
|
135
|
-
if (!b.has(key) ||
|
136
|
-
!compare(a.get(key), b.get(key))) {
|
137
|
-
return false;
|
138
|
-
}
|
139
|
-
}
|
140
|
-
return true;
|
141
|
-
}
|
142
|
-
let unmatchedEntries = a.size;
|
143
|
-
for (const [aKey, aValue] of a.entries()) {
|
144
|
-
for (const [bKey, bValue] of b.entries()) {
|
145
|
-
/* Given that Map keys can be references, we need
|
146
|
-
* to ensure that they are also deeply equal */
|
147
|
-
if (!compare(aKey, bKey))
|
148
|
-
continue;
|
149
|
-
if ((aKey === aValue && bKey === bValue) ||
|
150
|
-
(compare(aValue, bValue))) {
|
151
|
-
unmatchedEntries--;
|
152
|
-
break;
|
153
|
-
}
|
154
|
-
}
|
155
|
-
}
|
156
|
-
return unmatchedEntries === 0;
|
157
|
-
}
|
158
|
-
let keys;
|
159
|
-
if (isBasicObjectOrArray(a)) {
|
160
|
-
// fast path
|
161
|
-
keys = ownKeys({ ...a, ...b });
|
162
|
-
}
|
163
|
-
else if (stringComparablePrototypes.has(Object.getPrototypeOf(a))) {
|
164
|
-
// medium path
|
165
|
-
return String(a) === String(b);
|
166
|
-
}
|
167
|
-
else {
|
168
|
-
// slow path
|
169
|
-
keys = getKeysDeep(a).union(getKeysDeep(b));
|
170
|
-
}
|
171
|
-
for (const key of keys) {
|
172
|
-
if (!compare(a[key], b[key])) {
|
173
|
-
return false;
|
174
|
-
}
|
175
|
-
if (((key in a) && (!(key in b))) || ((key in b) && (!(key in a)))) {
|
176
|
-
return false;
|
177
|
-
}
|
178
|
-
}
|
179
|
-
return true;
|
180
|
-
}
|
181
|
-
return false;
|
182
|
-
})(a, b);
|
183
|
-
}
|
184
|
-
//# sourceMappingURL=equal.js.map
|
@@ -1 +0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,CAAC;gBACpE,cAAc;gBACd,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,YAAY;gBACZ,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,CAAC;YAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBAEvB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAU,CAAC,EAAE,CAAC,CAAC,GAAU,CAAC,CAAC,EAAE,CAAC;oBAC3C,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACnE,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACX,CAAC"}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { equal } from "./equal.js";
|
4
|
-
import { buildMessage } from "../../internal/1.0.5/build_message.js";
|
5
|
-
import { diff } from "../../internal/1.0.5/diff.js";
|
6
|
-
import { diffStr } from "../../internal/1.0.5/diff_str.js";
|
7
|
-
import { format } from "../../internal/1.0.5/format.js";
|
8
|
-
import { AssertionError } from "./assertion_error.js";
|
9
|
-
/**
|
10
|
-
* Make an assertion that `actual` and `expected` are equal, deeply. If not
|
11
|
-
* deeply equal, then throw.
|
12
|
-
*
|
13
|
-
* Type parameter can be specified to ensure values under comparison have the
|
14
|
-
* same type.
|
15
|
-
*
|
16
|
-
* @example Usage
|
17
|
-
* ```ts ignore
|
18
|
-
* import { assertEquals } from "@std/assert";
|
19
|
-
*
|
20
|
-
* assertEquals("world", "world"); // Doesn't throw
|
21
|
-
* assertEquals("hello", "world"); // Throws
|
22
|
-
* ```
|
23
|
-
*
|
24
|
-
* @typeParam T The type of the values to compare. This is usually inferred.
|
25
|
-
* @param actual The actual value to compare.
|
26
|
-
* @param expected The expected value to compare.
|
27
|
-
* @param msg The optional message to display if the assertion fails.
|
28
|
-
*/
|
29
|
-
export function assertEquals(actual, expected, msg) {
|
30
|
-
if (equal(actual, expected)) {
|
31
|
-
return;
|
32
|
-
}
|
33
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
34
|
-
let message = `Values are not equal${msgSuffix}`;
|
35
|
-
const actualString = format(actual);
|
36
|
-
const expectedString = format(expected);
|
37
|
-
const stringDiff = (typeof actual === "string") &&
|
38
|
-
(typeof expected === "string");
|
39
|
-
const diffResult = stringDiff
|
40
|
-
? diffStr(actual, expected)
|
41
|
-
: diff(actualString.split("\n"), expectedString.split("\n"));
|
42
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
43
|
-
message = `${message}\n${diffMsg}`;
|
44
|
-
throw new AssertionError(message);
|
45
|
-
}
|
46
|
-
//# sourceMappingURL=equals.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"equals.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/equals.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAS,EACT,QAAW,EACX,GAAY;IAEZ,IAAI,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO;IACT,CAAC;IACD,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,IAAI,OAAO,GAAG,uBAAuB,SAAS,EAAE,CAAC;IAEjD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC;QAC7C,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC;IACjC,MAAM,UAAU,GAAG,UAAU;QAC3B,CAAC,CAAC,OAAO,CAAC,MAAgB,EAAE,QAAkB,CAAC;QAC/C,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,GAAG,GAAG,OAAO,KAAK,OAAO,EAAE,CAAC;IACnC,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
4
|
-
/**
|
5
|
-
* Make an assertion that actual is not null or undefined.
|
6
|
-
* If not then throw.
|
7
|
-
*
|
8
|
-
* @example Usage
|
9
|
-
* ```ts ignore
|
10
|
-
* import { assertExists } from "@std/assert";
|
11
|
-
*
|
12
|
-
* assertExists("something"); // Doesn't throw
|
13
|
-
* assertExists(undefined); // Throws
|
14
|
-
* ```
|
15
|
-
*
|
16
|
-
* @typeParam T The type of the actual value.
|
17
|
-
* @param actual The actual value to check.
|
18
|
-
* @param msg The optional message to include in the error if the assertion fails.
|
19
|
-
*/
|
20
|
-
export function assertExists(actual, msg) {
|
21
|
-
if (actual === undefined || actual === null) {
|
22
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
23
|
-
msg =
|
24
|
-
`Expected actual: "${actual}" to not be null or undefined${msgSuffix}`;
|
25
|
-
throw new AssertionError(msg);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
//# sourceMappingURL=exists.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"exists.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/exists.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAS,EACT,GAAY;IAEZ,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAC5C,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACzC,GAAG;YACD,qBAAqB,MAAM,gCAAgC,SAAS,EAAE,CAAC;QACzE,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { AssertionError } from "./assertion_error.js";
|
4
|
-
/**
|
5
|
-
* Forcefully throws a failed assertion.
|
6
|
-
*
|
7
|
-
* @example Usage
|
8
|
-
* ```ts ignore
|
9
|
-
* import { fail } from "@std/assert";
|
10
|
-
*
|
11
|
-
* fail("Deliberately failed!"); // Throws
|
12
|
-
* ```
|
13
|
-
*
|
14
|
-
* @param msg Optional message to include in the error.
|
15
|
-
* @returns Never returns, always throws.
|
16
|
-
*/
|
17
|
-
export function fail(msg) {
|
18
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
19
|
-
throw new AssertionError(`Failed assertion${msgSuffix}`);
|
20
|
-
}
|
21
|
-
//# sourceMappingURL=fail.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"fail.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/fail.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,IAAI,CAAC,GAAY;IAC/B,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,MAAM,IAAI,cAAc,CAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC;AAC3D,CAAC"}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. 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
|
-
}
|
23
|
-
//# sourceMappingURL=false.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"false.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/false.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,GAAG,GAAG,EAAE;IACjD,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { format } from "../../internal/1.0.5/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
|
-
}
|
30
|
-
//# sourceMappingURL=greater.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"greater.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/greater.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,aAAa,CAAI,MAAS,EAAE,QAAW,EAAE,GAAY;IACnE,IAAI,MAAM,GAAG,QAAQ;QAAE,OAAO;IAE9B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,IAAI,cAAc,CAAC,GAAG,IAAI,UAAU,YAAY,MAAM,cAAc,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
-
// This module is browser compatible.
|
3
|
-
import { format } from "../../internal/1.0.5/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
|
-
}
|
30
|
-
//# sourceMappingURL=greater_or_equal.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"greater_or_equal.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAS,EACT,QAAW,EACX,GAAY;IAEZ,IAAI,MAAM,IAAI,QAAQ;QAAE,OAAO;IAE/B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,IAAI,cAAc,CACtB,GAAG,IAAI,UAAU,YAAY,OAAO,cAAc,EAAE,CACrD,CAAC;AACJ,CAAC"}
|
@@ -1,53 +0,0 @@
|
|
1
|
-
// Copyright 2018-2024 the Deno authors. All rights reserved. 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
|
-
}
|
53
|
-
//# sourceMappingURL=instance_of.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"instance_of.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/instance_of.ts"],"names":[],"mappings":"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