liminal 0.1.0-beta.25
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/LICENSE +202 -0
- package/README.md +26 -0
- package/esm/_dnt.shims.d.ts +2 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +58 -0
- package/esm/_dnt.shims.js.map +1 -0
- package/esm/client/Adapter.d.ts +46 -0
- package/esm/client/Adapter.d.ts.map +1 -0
- package/esm/client/Adapter.js +2 -0
- package/esm/client/Adapter.js.map +1 -0
- package/esm/client/Liminal.d.ts +19 -0
- package/esm/client/Liminal.d.ts.map +1 -0
- package/esm/client/Liminal.js +154 -0
- package/esm/client/Liminal.js.map +1 -0
- package/esm/client/Tool.d.ts +15 -0
- package/esm/client/Tool.d.ts.map +1 -0
- package/esm/client/Tool.js +23 -0
- package/esm/client/Tool.js.map +1 -0
- package/esm/client/constants.d.ts +2 -0
- package/esm/client/constants.d.ts.map +1 -0
- package/esm/client/constants.js +7 -0
- package/esm/client/constants.js.map +1 -0
- package/esm/client/mod.d.ts +5 -0
- package/esm/client/mod.d.ts.map +1 -0
- package/esm/client/mod.js +6 -0
- package/esm/client/mod.js.map +1 -0
- package/esm/core/DescriptionContext.d.ts +11 -0
- package/esm/core/DescriptionContext.d.ts.map +1 -0
- package/esm/core/DescriptionContext.js +103 -0
- package/esm/core/DescriptionContext.js.map +1 -0
- package/esm/core/L.d.ts +4 -0
- package/esm/core/L.d.ts.map +1 -0
- package/esm/core/L.js +4 -0
- package/esm/core/L.js.map +1 -0
- package/esm/core/ReduceDependencies.d.ts +6 -0
- package/esm/core/ReduceDependencies.d.ts.map +1 -0
- package/esm/core/ReduceDependencies.js +2 -0
- package/esm/core/ReduceDependencies.js.map +1 -0
- package/esm/core/Type.d.ts +30 -0
- package/esm/core/Type.d.ts.map +1 -0
- package/esm/core/Type.js +2 -0
- package/esm/core/Type.js.map +1 -0
- package/esm/core/TypeVisitor.d.ts +15 -0
- package/esm/core/TypeVisitor.d.ts.map +1 -0
- package/esm/core/TypeVisitor.js +12 -0
- package/esm/core/TypeVisitor.js.map +1 -0
- package/esm/core/annotations/Annotation.d.ts +7 -0
- package/esm/core/annotations/Annotation.d.ts.map +1 -0
- package/esm/core/annotations/Annotation.js +2 -0
- package/esm/core/annotations/Annotation.js.map +1 -0
- package/esm/core/annotations/Assertion.d.ts +8 -0
- package/esm/core/annotations/Assertion.d.ts.map +1 -0
- package/esm/core/annotations/Assertion.js +8 -0
- package/esm/core/annotations/Assertion.js.map +1 -0
- package/esm/core/annotations/Description.d.ts +7 -0
- package/esm/core/annotations/Description.d.ts.map +1 -0
- package/esm/core/annotations/Description.js +8 -0
- package/esm/core/annotations/Description.js.map +1 -0
- package/esm/core/annotations/Param.d.ts +13 -0
- package/esm/core/annotations/Param.d.ts.map +1 -0
- package/esm/core/annotations/Param.js +11 -0
- package/esm/core/annotations/Param.js.map +1 -0
- package/esm/core/annotations/Template.d.ts +10 -0
- package/esm/core/annotations/Template.d.ts.map +1 -0
- package/esm/core/annotations/Template.js +2 -0
- package/esm/core/annotations/Template.js.map +1 -0
- package/esm/core/annotations/mod.d.ts +6 -0
- package/esm/core/annotations/mod.d.ts.map +1 -0
- package/esm/core/annotations/mod.js +7 -0
- package/esm/core/annotations/mod.js.map +1 -0
- package/esm/core/assert.d.ts +22 -0
- package/esm/core/assert.d.ts.map +1 -0
- package/esm/core/assert.js +155 -0
- package/esm/core/assert.js.map +1 -0
- package/esm/core/declareIntrinsic.d.ts +4 -0
- package/esm/core/declareIntrinsic.d.ts.map +1 -0
- package/esm/core/declareIntrinsic.js +26 -0
- package/esm/core/declareIntrinsic.js.map +1 -0
- package/esm/core/deserialize.d.ts +3 -0
- package/esm/core/deserialize.d.ts.map +1 -0
- package/esm/core/deserialize.js +32 -0
- package/esm/core/deserialize.js.map +1 -0
- package/esm/core/display.d.ts +3 -0
- package/esm/core/display.d.ts.map +1 -0
- package/esm/core/display.js +75 -0
- package/esm/core/display.js.map +1 -0
- package/esm/core/inspect.node.d.ts +5 -0
- package/esm/core/inspect.node.d.ts.map +1 -0
- package/esm/core/inspect.node.js +7 -0
- package/esm/core/inspect.node.js.map +1 -0
- package/esm/core/intrinsics.d.ts +19 -0
- package/esm/core/intrinsics.d.ts.map +1 -0
- package/esm/core/intrinsics.js +64 -0
- package/esm/core/intrinsics.js.map +1 -0
- package/esm/core/intrinsics_util.d.ts +6 -0
- package/esm/core/intrinsics_util.d.ts.map +1 -0
- package/esm/core/intrinsics_util.js +46 -0
- package/esm/core/intrinsics_util.js.map +1 -0
- package/esm/core/isType.d.ts +4 -0
- package/esm/core/isType.d.ts.map +1 -0
- package/esm/core/isType.js +18 -0
- package/esm/core/isType.js.map +1 -0
- package/esm/core/mod.d.ts +13 -0
- package/esm/core/mod.d.ts.map +1 -0
- package/esm/core/mod.js +14 -0
- package/esm/core/mod.js.map +1 -0
- package/esm/core/signature.d.ts +4 -0
- package/esm/core/signature.d.ts.map +1 -0
- package/esm/core/signature.js +93 -0
- package/esm/core/signature.js.map +1 -0
- package/esm/core/utility/Flatten.d.ts +8 -0
- package/esm/core/utility/Flatten.d.ts.map +1 -0
- package/esm/core/utility/Flatten.js +6 -0
- package/esm/core/utility/Flatten.js.map +1 -0
- package/esm/core/utility/Intersection.d.ts +12 -0
- package/esm/core/utility/Intersection.d.ts.map +1 -0
- package/esm/core/utility/Intersection.js +5 -0
- package/esm/core/utility/Intersection.js.map +1 -0
- package/esm/core/utility/Option.d.ts +3 -0
- package/esm/core/utility/Option.d.ts.map +1 -0
- package/esm/core/utility/Option.js +5 -0
- package/esm/core/utility/Option.js.map +1 -0
- package/esm/core/utility/Record.d.ts +3 -0
- package/esm/core/utility/Record.d.ts.map +1 -0
- package/esm/core/utility/Record.js +6 -0
- package/esm/core/utility/Record.js.map +1 -0
- package/esm/core/utility/Set.d.ts +4 -0
- package/esm/core/utility/Set.d.ts.map +1 -0
- package/esm/core/utility/Set.js +7 -0
- package/esm/core/utility/Set.js.map +1 -0
- package/esm/core/utility/TaggedUnion.d.ts +13 -0
- package/esm/core/utility/TaggedUnion.d.ts.map +1 -0
- package/esm/core/utility/TaggedUnion.js +8 -0
- package/esm/core/utility/TaggedUnion.js.map +1 -0
- package/esm/core/utility/Tuple.d.ts +9 -0
- package/esm/core/utility/Tuple.d.ts.map +1 -0
- package/esm/core/utility/Tuple.js +11 -0
- package/esm/core/utility/Tuple.js.map +1 -0
- package/esm/core/utility/mod.d.ts +8 -0
- package/esm/core/utility/mod.d.ts.map +1 -0
- package/esm/core/utility/mod.js +9 -0
- package/esm/core/utility/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.js +47 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts +16 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.js +31 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.js +184 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts +35 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.js +59 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.js +28 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.js +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts +44 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.js +46 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.js +34 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.js +33 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.js +161 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts +42 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.js +58 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.js +27 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.js +45 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.js +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.js.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.js +21 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.d.ts +17 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.js +184 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.d.ts +2 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js +27 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.d.ts +59 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.js +153 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.d.ts +38 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.js +70 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.d.ts +38 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.js +132 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.d.ts +38 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.js +164 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.d.ts +38 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.js +82 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts +37 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.js +110 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.d.ts +22 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.js +23 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.d.ts +118 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.js +208 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +38 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +208 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +3 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js.map +1 -0
- package/esm/json_schema/Hydrated.d.ts +4 -0
- package/esm/json_schema/Hydrated.d.ts.map +1 -0
- package/esm/json_schema/Hydrated.js +49 -0
- package/esm/json_schema/Hydrated.js.map +1 -0
- package/esm/json_schema/JSONSchema.d.ts +50 -0
- package/esm/json_schema/JSONSchema.d.ts.map +1 -0
- package/esm/json_schema/JSONSchema.js +46 -0
- package/esm/json_schema/JSONSchema.js.map +1 -0
- package/esm/json_schema/MetaType.d.ts +4 -0
- package/esm/json_schema/MetaType.d.ts.map +1 -0
- package/esm/json_schema/MetaType.js +25 -0
- package/esm/json_schema/MetaType.js.map +1 -0
- package/esm/json_schema/MetaTypeMigration.d.ts +19 -0
- package/esm/json_schema/MetaTypeMigration.d.ts.map +1 -0
- package/esm/json_schema/MetaTypeMigration.js +15 -0
- package/esm/json_schema/MetaTypeMigration.js.map +1 -0
- package/esm/json_schema/PathLike.d.ts +4 -0
- package/esm/json_schema/PathLike.d.ts.map +1 -0
- package/esm/json_schema/PathLike.js +3 -0
- package/esm/json_schema/PathLike.js.map +1 -0
- package/esm/json_schema/mod.d.ts +7 -0
- package/esm/json_schema/mod.d.ts.map +1 -0
- package/esm/json_schema/mod.js +8 -0
- package/esm/json_schema/mod.js.map +1 -0
- package/esm/json_schema/toJSONSchema.d.ts +4 -0
- package/esm/json_schema/toJSONSchema.d.ts.map +1 -0
- package/esm/json_schema/toJSONSchema.js +117 -0
- package/esm/json_schema/toJSONSchema.js.map +1 -0
- package/esm/mod.d.ts +4 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +4 -0
- package/esm/mod.js.map +1 -0
- package/esm/package.json +3 -0
- package/esm/providers/OpenAI/OpenAIAdapter.d.ts +17 -0
- package/esm/providers/OpenAI/OpenAIAdapter.d.ts.map +1 -0
- package/esm/providers/OpenAI/OpenAIAdapter.js +56 -0
- package/esm/providers/OpenAI/OpenAIAdapter.js.map +1 -0
- package/esm/providers/OpenAI/OpenAIResponseFormat.d.ts +18 -0
- package/esm/providers/OpenAI/OpenAIResponseFormat.d.ts.map +1 -0
- package/esm/providers/OpenAI/OpenAIResponseFormat.js +26 -0
- package/esm/providers/OpenAI/OpenAIResponseFormat.js.map +1 -0
- package/esm/providers/OpenAI/TokenAllowance.d.ts +17 -0
- package/esm/providers/OpenAI/TokenAllowance.d.ts.map +1 -0
- package/esm/providers/OpenAI/TokenAllowance.js +32 -0
- package/esm/providers/OpenAI/TokenAllowance.js.map +1 -0
- package/esm/providers/OpenAI/mod.d.ts +6 -0
- package/esm/providers/OpenAI/mod.d.ts.map +1 -0
- package/esm/providers/OpenAI/mod.js +7 -0
- package/esm/providers/OpenAI/mod.js.map +1 -0
- package/esm/providers/OpenAI/openai_util.d.ts +4 -0
- package/esm/providers/OpenAI/openai_util.d.ts.map +1 -0
- package/esm/providers/OpenAI/openai_util.js +14 -0
- package/esm/providers/OpenAI/openai_util.js.map +1 -0
- package/esm/providers/OpenAI/refine.d.ts +2 -0
- package/esm/providers/OpenAI/refine.d.ts.map +1 -0
- package/esm/providers/OpenAI/refine.js +166 -0
- package/esm/providers/OpenAI/refine.js.map +1 -0
- package/esm/util/ArrayOfLength.d.ts +2 -0
- package/esm/util/ArrayOfLength.d.ts.map +1 -0
- package/esm/util/ArrayOfLength.js +2 -0
- package/esm/util/ArrayOfLength.js.map +1 -0
- package/esm/util/PromiseOr.d.ts +2 -0
- package/esm/util/PromiseOr.d.ts.map +1 -0
- package/esm/util/PromiseOr.js +2 -0
- package/esm/util/PromiseOr.js.map +1 -0
- package/esm/util/WeakMemo.d.ts +7 -0
- package/esm/util/WeakMemo.d.ts.map +1 -0
- package/esm/util/WeakMemo.js +32 -0
- package/esm/util/WeakMemo.js.map +1 -0
- package/esm/util/collect.d.ts +2 -0
- package/esm/util/collect.d.ts.map +1 -0
- package/esm/util/collect.js +8 -0
- package/esm/util/collect.js.map +1 -0
- package/esm/util/isPromise.d.ts +2 -0
- package/esm/util/isPromise.d.ts.map +1 -0
- package/esm/util/isPromise.js +7 -0
- package/esm/util/isPromise.js.map +1 -0
- package/esm/util/isTemplateStringsArray.d.ts +2 -0
- package/esm/util/isTemplateStringsArray.d.ts.map +1 -0
- package/esm/util/isTemplateStringsArray.js +4 -0
- package/esm/util/isTemplateStringsArray.js.map +1 -0
- package/esm/util/mod.d.ts +10 -0
- package/esm/util/mod.d.ts.map +1 -0
- package/esm/util/mod.js +11 -0
- package/esm/util/mod.js.map +1 -0
- package/esm/util/recombine.d.ts +2 -0
- package/esm/util/recombine.d.ts.map +1 -0
- package/esm/util/recombine.js +11 -0
- package/esm/util/recombine.js.map +1 -0
- package/esm/util/splitLast.d.ts +2 -0
- package/esm/util/splitLast.d.ts.map +1 -0
- package/esm/util/splitLast.js +8 -0
- package/esm/util/splitLast.js.map +1 -0
- package/esm/util/type_util.d.ts +5 -0
- package/esm/util/type_util.d.ts.map +1 -0
- package/esm/util/type_util.js +2 -0
- package/esm/util/type_util.js.map +1 -0
- package/package.json +22 -0
- package/src/_dnt.shims.ts +60 -0
- package/src/client/Adapter.ts +50 -0
- package/src/client/Liminal.ts +113 -0
- package/src/client/Tool.ts +17 -0
- package/src/client/constants.ts +6 -0
- package/src/client/mod.ts +6 -0
- package/src/core/DescriptionContext.ts +89 -0
- package/src/core/L.ts +3 -0
- package/src/core/ReduceDependencies.ts +9 -0
- package/src/core/Type.ts +45 -0
- package/src/core/TypeVisitor.ts +44 -0
- package/src/core/annotations/Annotation.ts +14 -0
- package/src/core/annotations/Assertion.ts +18 -0
- package/src/core/annotations/Description.ts +16 -0
- package/src/core/annotations/Param.ts +30 -0
- package/src/core/annotations/Template.ts +11 -0
- package/src/core/annotations/mod.ts +7 -0
- package/src/core/assert.ts +145 -0
- package/src/core/declareIntrinsic.ts +45 -0
- package/src/core/deserialize.ts +36 -0
- package/src/core/display.ts +68 -0
- package/src/core/inspect.node.ts +13 -0
- package/src/core/intrinsics.ts +86 -0
- package/src/core/intrinsics_util.ts +50 -0
- package/src/core/isType.ts +20 -0
- package/src/core/mod.ts +15 -0
- package/src/core/signature.ts +90 -0
- package/src/core/utility/Flatten.ts +14 -0
- package/src/core/utility/Intersection.ts +24 -0
- package/src/core/utility/Option.ts +6 -0
- package/src/core/utility/Record.ts +7 -0
- package/src/core/utility/Set.ts +8 -0
- package/src/core/utility/TaggedUnion.ts +23 -0
- package/src/core/utility/Tuple.ts +24 -0
- package/src/core/utility/mod.ts +9 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.ts +55 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/array_includes.ts +57 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/assert.ts +23 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/equal.ts +210 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/equals.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/exists.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/fail.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/greater.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/less.ts +29 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.ts +36 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/mod.ts +47 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/not_equals.ts +37 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/object_match.ts +203 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/string_includes.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/throws.ts +111 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.ts +21 -0
- package/src/deps/jsr.io/@std/assert/1.0.10/unreachable.ts +21 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/_base32_common.ts +218 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.ts +29 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/ascii85.ts +203 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/base32.ts +73 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/base58.ts +173 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/base64.ts +174 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/base64url.ts +88 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/hex.ts +120 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/mod.ts +24 -0
- package/src/deps/jsr.io/@std/encoding/1.0.6/varint.ts +242 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +18 -0
- package/src/json_schema/Hydrated.ts +52 -0
- package/src/json_schema/JSONSchema.ts +95 -0
- package/src/json_schema/MetaType.ts +32 -0
- package/src/json_schema/MetaTypeMigration.ts +31 -0
- package/src/json_schema/PathLike.ts +9 -0
- package/src/json_schema/mod.ts +8 -0
- package/src/json_schema/toJSONSchema.ts +114 -0
- package/src/mod.ts +3 -0
- package/src/providers/OpenAI/OpenAIAdapter.ts +89 -0
- package/src/providers/OpenAI/OpenAIResponseFormat.ts +54 -0
- package/src/providers/OpenAI/TokenAllowance.ts +29 -0
- package/src/providers/OpenAI/mod.ts +7 -0
- package/src/providers/OpenAI/openai_util.ts +19 -0
- package/src/providers/OpenAI/refine.ts +171 -0
- package/src/util/ArrayOfLength.ts +5 -0
- package/src/util/PromiseOr.ts +1 -0
- package/src/util/WeakMemo.ts +13 -0
- package/src/util/collect.ts +7 -0
- package/src/util/isPromise.ts +8 -0
- package/src/util/isTemplateStringsArray.ts +3 -0
- package/src/util/mod.ts +11 -0
- package/src/util/recombine.ts +10 -0
- package/src/util/splitLast.ts +7 -0
- package/src/util/type_util.ts +3 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executes a function which returns a promise, expecting it to reject.
|
|
3
|
+
*
|
|
4
|
+
* To assert that a synchronous function throws, use {@linkcode assertThrows}.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts ignore
|
|
8
|
+
* import { assertRejects } from "@std/assert";
|
|
9
|
+
*
|
|
10
|
+
* await assertRejects(async () => Promise.reject(new Error())); // Doesn't throw
|
|
11
|
+
* await assertRejects(async () => console.log("Hello world")); // Throws
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param fn The function to execute.
|
|
15
|
+
* @param msg The optional message to display if the assertion fails.
|
|
16
|
+
* @returns The promise which resolves to the thrown error.
|
|
17
|
+
*/
|
|
18
|
+
export declare function assertRejects(fn: () => PromiseLike<unknown>, msg?: string): Promise<unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* Executes a function which returns a promise, expecting it to reject.
|
|
21
|
+
* If it does not, then it throws. An error class and a string that should be
|
|
22
|
+
* included in the error message can also be asserted.
|
|
23
|
+
*
|
|
24
|
+
* To assert that a synchronous function throws, use {@linkcode assertThrows}.
|
|
25
|
+
*
|
|
26
|
+
* @example Usage
|
|
27
|
+
* ```ts ignore
|
|
28
|
+
* import { assertRejects } from "@std/assert";
|
|
29
|
+
*
|
|
30
|
+
* await assertRejects(async () => Promise.reject(new Error()), Error); // Doesn't throw
|
|
31
|
+
* await assertRejects(async () => Promise.reject(new Error()), SyntaxError); // Throws
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @typeParam E The error class to assert.
|
|
35
|
+
* @param fn The function to execute.
|
|
36
|
+
* @param ErrorClass The error class to assert.
|
|
37
|
+
* @param msgIncludes The string that should be included in the error message.
|
|
38
|
+
* @param msg The optional message to display if the assertion fails.
|
|
39
|
+
* @returns The promise which resolves to the thrown error.
|
|
40
|
+
*/
|
|
41
|
+
export declare function assertRejects<E extends Error = Error>(fn: () => PromiseLike<unknown>, ErrorClass: abstract new (...args: any[]) => E, msgIncludes?: string, msg?: string): Promise<E>;
|
|
42
|
+
//# sourceMappingURL=rejects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejects.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/rejects.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAAC;AACpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAE9B,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
import { assertIsError } from "./is_error.js";
|
|
5
|
+
export async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
6
|
+
// deno-lint-ignore no-explicit-any
|
|
7
|
+
let ErrorClass;
|
|
8
|
+
let msgIncludes;
|
|
9
|
+
let err;
|
|
10
|
+
if (typeof errorClassOrMsg !== "string") {
|
|
11
|
+
if (errorClassOrMsg === undefined ||
|
|
12
|
+
errorClassOrMsg.prototype instanceof Error ||
|
|
13
|
+
errorClassOrMsg.prototype === Error.prototype) {
|
|
14
|
+
ErrorClass = errorClassOrMsg;
|
|
15
|
+
msgIncludes = msgIncludesOrMsg;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
msg = errorClassOrMsg;
|
|
20
|
+
}
|
|
21
|
+
let doesThrow = false;
|
|
22
|
+
let isPromiseReturned = false;
|
|
23
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
24
|
+
try {
|
|
25
|
+
const possiblePromise = fn();
|
|
26
|
+
if (possiblePromise &&
|
|
27
|
+
typeof possiblePromise === "object" &&
|
|
28
|
+
typeof possiblePromise.then === "function") {
|
|
29
|
+
isPromiseReturned = true;
|
|
30
|
+
await possiblePromise;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new Error();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (!isPromiseReturned) {
|
|
38
|
+
throw new AssertionError(`Function throws when expected to reject${msgSuffix}`);
|
|
39
|
+
}
|
|
40
|
+
if (ErrorClass) {
|
|
41
|
+
if (!(error instanceof Error)) {
|
|
42
|
+
throw new AssertionError(`A non-Error object was rejected${msgSuffix}`);
|
|
43
|
+
}
|
|
44
|
+
assertIsError(error, ErrorClass, msgIncludes, msg);
|
|
45
|
+
}
|
|
46
|
+
err = error;
|
|
47
|
+
doesThrow = true;
|
|
48
|
+
}
|
|
49
|
+
if (!doesThrow) {
|
|
50
|
+
throw new AssertionError(`Expected function to reject${msgSuffix}`);
|
|
51
|
+
}
|
|
52
|
+
return err;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=rejects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejects.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/rejects.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAoD9C,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,EAA8B,EAC9B,eAGU,EACV,gBAAyB,EACzB,GAAY;IAEZ,mCAAmC;IACnC,IAAI,UAA4D,CAAC;IACjE,IAAI,WAA+B,CAAC;IACpC,IAAI,GAAG,CAAC;IAER,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,IACE,eAAe,KAAK,SAAS;YAC7B,eAAe,CAAC,SAAS,YAAY,KAAK;YAC1C,eAAe,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,EAC7C,CAAC;YACD,UAAU,GAAG,eAAe,CAAC;YAC7B,WAAW,GAAG,gBAAgB,CAAC;QACjC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,GAAG,GAAG,eAAe,CAAC;IACxB,CAAC;IACD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,EAAE,EAAE,CAAC;QAC7B,IACE,eAAe;YACf,OAAO,eAAe,KAAK,QAAQ;YACnC,OAAO,eAAe,CAAC,IAAI,KAAK,UAAU,EAC1C,CAAC;YACD,iBAAiB,GAAG,IAAI,CAAC;YACzB,MAAM,eAAe,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,MAAM,IAAI,cAAc,CACtB,0CAA0C,SAAS,EAAE,CACtD,CAAC;QACJ,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAI,cAAc,CAAC,kCAAkC,SAAS,EAAE,CAAC,CAAC;YAC1E,CAAC;YACD,aAAa,CACX,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,CACJ,CAAC;QACJ,CAAC;QACD,GAAG,GAAG,KAAK,CAAC;QACZ,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,cAAc,CACtB,8BAA8B,SAAS,EAAE,CAC1C,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an assertion that `actual` and `expected` are strictly equal, using
|
|
3
|
+
* {@linkcode Object.is} for equality comparison. If not, then throw.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts ignore
|
|
7
|
+
* import { assertStrictEquals } from "@std/assert";
|
|
8
|
+
*
|
|
9
|
+
* const a = {};
|
|
10
|
+
* const b = a;
|
|
11
|
+
* assertStrictEquals(a, b); // Doesn't throw
|
|
12
|
+
*
|
|
13
|
+
* const c = {};
|
|
14
|
+
* const d = {};
|
|
15
|
+
* assertStrictEquals(c, d); // Throws
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @typeParam T The type of the expected value.
|
|
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 declare function assertStrictEquals<T>(actual: unknown, expected: T, msg?: string): asserts actual is T;
|
|
24
|
+
//# sourceMappingURL=strict_equals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/strict_equals.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,CAAC,CA+BrB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { buildMessage } from "../../internal/1.0.5/build_message.js";
|
|
4
|
+
import { diff } from "../../internal/1.0.5/diff.js";
|
|
5
|
+
import { diffStr } from "../../internal/1.0.5/diff_str.js";
|
|
6
|
+
import { format } from "../../internal/1.0.5/format.js";
|
|
7
|
+
import { red } from "../../internal/1.0.5/styles.js";
|
|
8
|
+
import { AssertionError } from "./assertion_error.js";
|
|
9
|
+
/**
|
|
10
|
+
* Make an assertion that `actual` and `expected` are strictly equal, using
|
|
11
|
+
* {@linkcode Object.is} for equality comparison. If not, then throw.
|
|
12
|
+
*
|
|
13
|
+
* @example Usage
|
|
14
|
+
* ```ts ignore
|
|
15
|
+
* import { assertStrictEquals } from "@std/assert";
|
|
16
|
+
*
|
|
17
|
+
* const a = {};
|
|
18
|
+
* const b = a;
|
|
19
|
+
* assertStrictEquals(a, b); // Doesn't throw
|
|
20
|
+
*
|
|
21
|
+
* const c = {};
|
|
22
|
+
* const d = {};
|
|
23
|
+
* assertStrictEquals(c, d); // Throws
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @typeParam T The type of the expected value.
|
|
27
|
+
* @param actual The actual value to compare.
|
|
28
|
+
* @param expected The expected value to compare.
|
|
29
|
+
* @param msg The optional message to display if the assertion fails.
|
|
30
|
+
*/
|
|
31
|
+
export function assertStrictEquals(actual, expected, msg) {
|
|
32
|
+
if (Object.is(actual, expected)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
36
|
+
let message;
|
|
37
|
+
const actualString = format(actual);
|
|
38
|
+
const expectedString = format(expected);
|
|
39
|
+
if (actualString === expectedString) {
|
|
40
|
+
const withOffset = actualString
|
|
41
|
+
.split("\n")
|
|
42
|
+
.map((l) => ` ${l}`)
|
|
43
|
+
.join("\n");
|
|
44
|
+
message =
|
|
45
|
+
`Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(withOffset)}\n`;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const stringDiff = (typeof actual === "string") &&
|
|
49
|
+
(typeof expected === "string");
|
|
50
|
+
const diffResult = stringDiff
|
|
51
|
+
? diffStr(actual, expected)
|
|
52
|
+
: diff(actualString.split("\n"), expectedString.split("\n"));
|
|
53
|
+
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
54
|
+
message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
|
|
55
|
+
}
|
|
56
|
+
throw new AssertionError(message);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=strict_equals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict_equals.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/strict_equals.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,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;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,QAAW,EACX,GAAY;IAEZ,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;QAChC,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,IAAI,OAAe,CAAC;IAEpB,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAExC,IAAI,YAAY,KAAK,cAAc,EAAE,CAAC;QACpC,MAAM,UAAU,GAAG,YAAY;aAC5B,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;aACtB,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,OAAO;YACL,6DAA6D,SAAS,OACpE,GAAG,CAAC,UAAU,CAChB,IAAI,CAAC;IACT,CAAC;SAAM,CAAC;QACN,MAAM,UAAU,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC;YAC7C,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC;QACjC,MAAM,UAAU,GAAG,UAAU;YAC3B,CAAC,CAAC,OAAO,CAAC,MAAgB,EAAE,QAAkB,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpE,OAAO,GAAG,gCAAgC,SAAS,KAAK,OAAO,EAAE,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an assertion that actual includes expected. If not
|
|
3
|
+
* then throw.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts ignore
|
|
7
|
+
* import { assertStringIncludes } from "@std/assert";
|
|
8
|
+
*
|
|
9
|
+
* assertStringIncludes("Hello", "ello"); // Doesn't throw
|
|
10
|
+
* assertStringIncludes("Hello", "world"); // Throws
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param actual The actual string to check for inclusion.
|
|
14
|
+
* @param expected The expected string to check for inclusion.
|
|
15
|
+
* @param msg The optional message to display if the assertion fails.
|
|
16
|
+
*/
|
|
17
|
+
export declare function assertStringIncludes(actual: string, expected: string, msg?: string): void;
|
|
18
|
+
//# sourceMappingURL=string_includes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/string_includes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 includes expected. If not
|
|
6
|
+
* then throw.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts ignore
|
|
10
|
+
* import { assertStringIncludes } from "@std/assert";
|
|
11
|
+
*
|
|
12
|
+
* assertStringIncludes("Hello", "ello"); // Doesn't throw
|
|
13
|
+
* assertStringIncludes("Hello", "world"); // Throws
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param actual The actual string to check for inclusion.
|
|
17
|
+
* @param expected The expected string to check for inclusion.
|
|
18
|
+
* @param msg The optional message to display if the assertion fails.
|
|
19
|
+
*/
|
|
20
|
+
export function assertStringIncludes(actual, expected, msg) {
|
|
21
|
+
if (actual.includes(expected))
|
|
22
|
+
return;
|
|
23
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
24
|
+
msg = `Expected actual: "${actual}" to contain: "${expected}"${msgSuffix}`;
|
|
25
|
+
throw new AssertionError(msg);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=string_includes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string_includes.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/string_includes.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,QAAgB,EAChB,GAAY;IAEZ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO;IACtC,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,GAAG,GAAG,qBAAqB,MAAM,kBAAkB,QAAQ,IAAI,SAAS,EAAE,CAAC;IAC3E,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executes a function, expecting it to throw. If it does not, then it
|
|
3
|
+
* throws.
|
|
4
|
+
*
|
|
5
|
+
* To assert that an asynchronous function rejects, use
|
|
6
|
+
* {@linkcode assertRejects}.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts ignore
|
|
10
|
+
* import { assertThrows } from "@std/assert";
|
|
11
|
+
*
|
|
12
|
+
* assertThrows(() => { throw new TypeError("hello world!"); }); // Doesn't throw
|
|
13
|
+
* assertThrows(() => console.log("hello world!")); // Throws
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param fn The function to execute.
|
|
17
|
+
* @param msg The optional message to display if the assertion fails.
|
|
18
|
+
* @returns The error that was thrown.
|
|
19
|
+
*/
|
|
20
|
+
export declare function assertThrows(fn: () => unknown, msg?: string): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Executes a function, expecting it to throw. If it does not, then it
|
|
23
|
+
* throws. An error class and a string that should be included in the
|
|
24
|
+
* error message can also be asserted.
|
|
25
|
+
*
|
|
26
|
+
* To assert that an asynchronous function rejects, use
|
|
27
|
+
* {@linkcode assertRejects}.
|
|
28
|
+
*
|
|
29
|
+
* @example Usage
|
|
30
|
+
* ```ts ignore
|
|
31
|
+
* import { assertThrows } from "@std/assert";
|
|
32
|
+
*
|
|
33
|
+
* assertThrows(() => { throw new TypeError("hello world!"); }, TypeError); // Doesn't throw
|
|
34
|
+
* assertThrows(() => { throw new TypeError("hello world!"); }, RangeError); // Throws
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @typeParam E The error class to assert.
|
|
38
|
+
* @param fn The function to execute.
|
|
39
|
+
* @param ErrorClass The error class to assert.
|
|
40
|
+
* @param msgIncludes The string that should be included in the error message.
|
|
41
|
+
* @param msg The optional message to display if the assertion fails.
|
|
42
|
+
* @returns The error that was thrown.
|
|
43
|
+
*/
|
|
44
|
+
export declare function assertThrows<E extends Error = Error>(fn: () => unknown, ErrorClass: abstract new (...args: any[]) => E, msgIncludes?: string, msg?: string): E;
|
|
45
|
+
//# sourceMappingURL=throws.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { assertIsError } from "./is_error.js";
|
|
4
|
+
import { AssertionError } from "./assertion_error.js";
|
|
5
|
+
export function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
6
|
+
// deno-lint-ignore no-explicit-any
|
|
7
|
+
let ErrorClass;
|
|
8
|
+
let msgIncludes;
|
|
9
|
+
let err;
|
|
10
|
+
if (typeof errorClassOrMsg !== "string") {
|
|
11
|
+
if (errorClassOrMsg === undefined ||
|
|
12
|
+
errorClassOrMsg?.prototype instanceof Error ||
|
|
13
|
+
errorClassOrMsg?.prototype === Error.prototype) {
|
|
14
|
+
ErrorClass = errorClassOrMsg;
|
|
15
|
+
msgIncludes = msgIncludesOrMsg;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
msg = msgIncludesOrMsg;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
msg = errorClassOrMsg;
|
|
23
|
+
}
|
|
24
|
+
let doesThrow = false;
|
|
25
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
26
|
+
try {
|
|
27
|
+
fn();
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (ErrorClass) {
|
|
31
|
+
if (error instanceof Error === false) {
|
|
32
|
+
throw new AssertionError(`A non-Error object was thrown${msgSuffix}`);
|
|
33
|
+
}
|
|
34
|
+
assertIsError(error, ErrorClass, msgIncludes, msg);
|
|
35
|
+
}
|
|
36
|
+
err = error;
|
|
37
|
+
doesThrow = true;
|
|
38
|
+
}
|
|
39
|
+
if (!doesThrow) {
|
|
40
|
+
msg = `Expected function to throw${msgSuffix}`;
|
|
41
|
+
throw new AssertionError(msg);
|
|
42
|
+
}
|
|
43
|
+
return err;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=throws.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/throws.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAuDtD,MAAM,UAAU,YAAY,CAC1B,EAAiB,EACjB,eAGU,EACV,gBAAyB,EACzB,GAAY;IAEZ,mCAAmC;IACnC,IAAI,UAA4D,CAAC;IACjE,IAAI,WAA+B,CAAC;IACpC,IAAI,GAAG,CAAC;IAER,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,IACE,eAAe,KAAK,SAAS;YAC7B,eAAe,EAAE,SAAS,YAAY,KAAK;YAC3C,eAAe,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,EAC9C,CAAC;YACD,UAAU,GAAG,eAAe,CAAC;YAC7B,WAAW,GAAG,gBAAgB,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,gBAAgB,CAAC;QACzB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,GAAG,GAAG,eAAe,CAAC;IACxB,CAAC;IACD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,IAAI,CAAC;QACH,EAAE,EAAE,CAAC;IACP,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,KAAK,KAAK,EAAE,CAAC;gBACrC,MAAM,IAAI,cAAc,CAAC,gCAAgC,SAAS,EAAE,CAAC,CAAC;YACxE,CAAC;YACD,aAAa,CACX,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,CACJ,CAAC;QACJ,CAAC;QACD,GAAG,GAAG,KAAK,CAAC;QACZ,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,GAAG,GAAG,6BAA6B,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use this to stub out methods that will throw when invoked.
|
|
3
|
+
*
|
|
4
|
+
* @example Usage
|
|
5
|
+
* ```ts ignore
|
|
6
|
+
* import { unimplemented } from "@std/assert";
|
|
7
|
+
*
|
|
8
|
+
* unimplemented(); // Throws
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @param msg Optional message to include in the error.
|
|
12
|
+
* @returns Never returns, always throws.
|
|
13
|
+
*/
|
|
14
|
+
export declare function unimplemented(msg?: string): never;
|
|
15
|
+
//# sourceMappingURL=unimplemented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unimplemented.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/unimplemented.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGjD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* Use this to stub out methods that will throw when invoked.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts ignore
|
|
9
|
+
* import { unimplemented } from "@std/assert";
|
|
10
|
+
*
|
|
11
|
+
* unimplemented(); // Throws
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param msg Optional message to include in the error.
|
|
15
|
+
* @returns Never returns, always throws.
|
|
16
|
+
*/
|
|
17
|
+
export function unimplemented(msg) {
|
|
18
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
19
|
+
throw new AssertionError(`Unimplemented${msgSuffix}`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=unimplemented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unimplemented.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/unimplemented.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,MAAM,IAAI,cAAc,CAAC,gBAAgB,SAAS,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use this to assert unreachable code.
|
|
3
|
+
*
|
|
4
|
+
* @example Usage
|
|
5
|
+
* ```ts ignore
|
|
6
|
+
* import { unreachable } from "@std/assert";
|
|
7
|
+
*
|
|
8
|
+
* unreachable(); // Throws
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @param msg Optional message to include in the error.
|
|
12
|
+
* @returns Never returns, always throws.
|
|
13
|
+
*/
|
|
14
|
+
export declare function unreachable(msg?: string): never;
|
|
15
|
+
//# sourceMappingURL=unreachable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* Use this to assert unreachable code.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts ignore
|
|
9
|
+
* import { unreachable } from "@std/assert";
|
|
10
|
+
*
|
|
11
|
+
* unreachable(); // Throws
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param msg Optional message to include in the error.
|
|
15
|
+
* @returns Never returns, always throws.
|
|
16
|
+
*/
|
|
17
|
+
export function unreachable(msg) {
|
|
18
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
19
|
+
throw new AssertionError(`Unreachable${msgSuffix}`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=unreachable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreachable.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.10/unreachable.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACzC,MAAM,IAAI,cAAc,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decodes an encoded string with the given lookup table.
|
|
3
|
+
*
|
|
4
|
+
* @param b32 The string to encode.
|
|
5
|
+
* @param lookup The lookup table
|
|
6
|
+
* @returns The encoded string.
|
|
7
|
+
*/
|
|
8
|
+
export declare function decode(b32: string, lookup: ReadonlyArray<string>): Uint8Array;
|
|
9
|
+
/**
|
|
10
|
+
* Encodes the given data using the lookup table.
|
|
11
|
+
*
|
|
12
|
+
* @param data The data to encode.
|
|
13
|
+
* @param lookup The lookup table.
|
|
14
|
+
* @returns The encoded string.
|
|
15
|
+
*/
|
|
16
|
+
export declare function encode(data: ArrayBuffer | Uint8Array | string, lookup: ReadonlyArray<string>): string;
|
|
17
|
+
//# sourceMappingURL=_base32_common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_base32_common.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/_base32_common.ts"],"names":[],"mappings":"AAyCA;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,UAAU,CAqE7E;AA6BD;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,EACvC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5B,MAAM,CA6DR"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// Copyright (c) 2014 Jameson Little. MIT License.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
/**
|
|
5
|
+
* common code for base32 and base32hex encodings.
|
|
6
|
+
*/
|
|
7
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
8
|
+
const placeHolderPadLookup = [0, 1, , 2, 3, , 4];
|
|
9
|
+
function getPadLength(placeHoldersLen) {
|
|
10
|
+
const maybeLen = placeHolderPadLookup[placeHoldersLen];
|
|
11
|
+
if (typeof maybeLen !== "number") {
|
|
12
|
+
throw new Error("Invalid pad length");
|
|
13
|
+
}
|
|
14
|
+
return maybeLen;
|
|
15
|
+
}
|
|
16
|
+
function getLens(b32) {
|
|
17
|
+
const len = b32.length;
|
|
18
|
+
if (len % 8 > 0) {
|
|
19
|
+
throw new Error(`Cannot decode base32 string as the length must be a multiple of 8: received length ${len}`);
|
|
20
|
+
}
|
|
21
|
+
let validLen = b32.indexOf("=");
|
|
22
|
+
if (validLen === -1)
|
|
23
|
+
validLen = len;
|
|
24
|
+
const placeHoldersLen = validLen === len ? 0 : 8 - (validLen % 8);
|
|
25
|
+
return [validLen, placeHoldersLen];
|
|
26
|
+
}
|
|
27
|
+
function getByteLength(validLen, placeHoldersLen) {
|
|
28
|
+
return ((validLen + placeHoldersLen) * 5) / 8 - getPadLength(placeHoldersLen);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Decodes an encoded string with the given lookup table.
|
|
32
|
+
*
|
|
33
|
+
* @param b32 The string to encode.
|
|
34
|
+
* @param lookup The lookup table
|
|
35
|
+
* @returns The encoded string.
|
|
36
|
+
*/
|
|
37
|
+
export function decode(b32, lookup) {
|
|
38
|
+
const revLookup = [];
|
|
39
|
+
lookup.forEach((c, i) => (revLookup[c.charCodeAt(0)] = i));
|
|
40
|
+
let tmp;
|
|
41
|
+
const [validLen, placeHoldersLen] = getLens(b32);
|
|
42
|
+
const arr = new Uint8Array(getByteLength(validLen, placeHoldersLen));
|
|
43
|
+
let curByte = 0;
|
|
44
|
+
// if there are placeholders, only get up to the last complete 8 chars
|
|
45
|
+
const len = placeHoldersLen > 0 ? validLen - 8 : validLen;
|
|
46
|
+
let i;
|
|
47
|
+
for (i = 0; i < len; i += 8) {
|
|
48
|
+
tmp = (revLookup[b32.charCodeAt(i)] << 20) |
|
|
49
|
+
(revLookup[b32.charCodeAt(i + 1)] << 15) |
|
|
50
|
+
(revLookup[b32.charCodeAt(i + 2)] << 10) |
|
|
51
|
+
(revLookup[b32.charCodeAt(i + 3)] << 5) |
|
|
52
|
+
revLookup[b32.charCodeAt(i + 4)];
|
|
53
|
+
arr[curByte++] = (tmp >> 17) & 0xff;
|
|
54
|
+
arr[curByte++] = (tmp >> 9) & 0xff;
|
|
55
|
+
arr[curByte++] = (tmp >> 1) & 0xff;
|
|
56
|
+
tmp = ((tmp & 1) << 15) |
|
|
57
|
+
(revLookup[b32.charCodeAt(i + 5)] << 10) |
|
|
58
|
+
(revLookup[b32.charCodeAt(i + 6)] << 5) |
|
|
59
|
+
revLookup[b32.charCodeAt(i + 7)];
|
|
60
|
+
arr[curByte++] = (tmp >> 8) & 0xff;
|
|
61
|
+
arr[curByte++] = tmp & 0xff;
|
|
62
|
+
}
|
|
63
|
+
if (placeHoldersLen === 1) {
|
|
64
|
+
tmp = (revLookup[b32.charCodeAt(i)] << 20) |
|
|
65
|
+
(revLookup[b32.charCodeAt(i + 1)] << 15) |
|
|
66
|
+
(revLookup[b32.charCodeAt(i + 2)] << 10) |
|
|
67
|
+
(revLookup[b32.charCodeAt(i + 3)] << 5) |
|
|
68
|
+
revLookup[b32.charCodeAt(i + 4)];
|
|
69
|
+
arr[curByte++] = (tmp >> 17) & 0xff;
|
|
70
|
+
arr[curByte++] = (tmp >> 9) & 0xff;
|
|
71
|
+
arr[curByte++] = (tmp >> 1) & 0xff;
|
|
72
|
+
tmp = ((tmp & 1) << 7) |
|
|
73
|
+
(revLookup[b32.charCodeAt(i + 5)] << 2) |
|
|
74
|
+
(revLookup[b32.charCodeAt(i + 6)] >> 3);
|
|
75
|
+
arr[curByte++] = tmp & 0xff;
|
|
76
|
+
}
|
|
77
|
+
else if (placeHoldersLen === 3) {
|
|
78
|
+
tmp = (revLookup[b32.charCodeAt(i)] << 19) |
|
|
79
|
+
(revLookup[b32.charCodeAt(i + 1)] << 14) |
|
|
80
|
+
(revLookup[b32.charCodeAt(i + 2)] << 9) |
|
|
81
|
+
(revLookup[b32.charCodeAt(i + 3)] << 4) |
|
|
82
|
+
(revLookup[b32.charCodeAt(i + 4)] >> 1);
|
|
83
|
+
arr[curByte++] = (tmp >> 16) & 0xff;
|
|
84
|
+
arr[curByte++] = (tmp >> 8) & 0xff;
|
|
85
|
+
arr[curByte++] = tmp & 0xff;
|
|
86
|
+
}
|
|
87
|
+
else if (placeHoldersLen === 4) {
|
|
88
|
+
tmp = (revLookup[b32.charCodeAt(i)] << 11) |
|
|
89
|
+
(revLookup[b32.charCodeAt(i + 1)] << 6) |
|
|
90
|
+
(revLookup[b32.charCodeAt(i + 2)] << 1) |
|
|
91
|
+
(revLookup[b32.charCodeAt(i + 3)] >> 4);
|
|
92
|
+
arr[curByte++] = (tmp >> 8) & 0xff;
|
|
93
|
+
arr[curByte++] = tmp & 0xff;
|
|
94
|
+
}
|
|
95
|
+
else if (placeHoldersLen === 6) {
|
|
96
|
+
tmp = (revLookup[b32.charCodeAt(i)] << 3) |
|
|
97
|
+
(revLookup[b32.charCodeAt(i + 1)] >> 2);
|
|
98
|
+
arr[curByte++] = tmp & 0xff;
|
|
99
|
+
}
|
|
100
|
+
return arr;
|
|
101
|
+
}
|
|
102
|
+
function encodeChunk(uint8, start, end, lookup) {
|
|
103
|
+
let tmp;
|
|
104
|
+
const output = [];
|
|
105
|
+
for (let i = start; i < end; i += 5) {
|
|
106
|
+
tmp = ((uint8[i] << 16) & 0xff0000) |
|
|
107
|
+
((uint8[i + 1] << 8) & 0xff00) |
|
|
108
|
+
(uint8[i + 2] & 0xff);
|
|
109
|
+
output.push(lookup[(tmp >> 19) & 0x1f]);
|
|
110
|
+
output.push(lookup[(tmp >> 14) & 0x1f]);
|
|
111
|
+
output.push(lookup[(tmp >> 9) & 0x1f]);
|
|
112
|
+
output.push(lookup[(tmp >> 4) & 0x1f]);
|
|
113
|
+
tmp = ((tmp & 0xf) << 16) |
|
|
114
|
+
((uint8[i + 3] << 8) & 0xff00) |
|
|
115
|
+
(uint8[i + 4] & 0xff);
|
|
116
|
+
output.push(lookup[(tmp >> 15) & 0x1f]);
|
|
117
|
+
output.push(lookup[(tmp >> 10) & 0x1f]);
|
|
118
|
+
output.push(lookup[(tmp >> 5) & 0x1f]);
|
|
119
|
+
output.push(lookup[tmp & 0x1f]);
|
|
120
|
+
}
|
|
121
|
+
return output.join("");
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Encodes the given data using the lookup table.
|
|
125
|
+
*
|
|
126
|
+
* @param data The data to encode.
|
|
127
|
+
* @param lookup The lookup table.
|
|
128
|
+
* @returns The encoded string.
|
|
129
|
+
*/
|
|
130
|
+
export function encode(data, lookup) {
|
|
131
|
+
const uint8 = validateBinaryLike(data);
|
|
132
|
+
let tmp;
|
|
133
|
+
const len = uint8.length;
|
|
134
|
+
const extraBytes = len % 5;
|
|
135
|
+
const parts = [];
|
|
136
|
+
const maxChunkLength = 16385; // must be multiple of 5
|
|
137
|
+
const len2 = len - extraBytes;
|
|
138
|
+
// go through the array every 5 bytes, we'll deal with trailing stuff later
|
|
139
|
+
for (let i = 0; i < len2; i += maxChunkLength) {
|
|
140
|
+
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength, lookup));
|
|
141
|
+
}
|
|
142
|
+
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
143
|
+
if (extraBytes === 4) {
|
|
144
|
+
tmp = ((uint8[len2] & 0xff) << 16) |
|
|
145
|
+
((uint8[len2 + 1] & 0xff) << 8) |
|
|
146
|
+
(uint8[len2 + 2] & 0xff);
|
|
147
|
+
parts.push(lookup[(tmp >> 19) & 0x1f]);
|
|
148
|
+
parts.push(lookup[(tmp >> 14) & 0x1f]);
|
|
149
|
+
parts.push(lookup[(tmp >> 9) & 0x1f]);
|
|
150
|
+
parts.push(lookup[(tmp >> 4) & 0x1f]);
|
|
151
|
+
tmp = ((tmp & 0xf) << 11) | (uint8[len2 + 3] << 3);
|
|
152
|
+
parts.push(lookup[(tmp >> 10) & 0x1f]);
|
|
153
|
+
parts.push(lookup[(tmp >> 5) & 0x1f]);
|
|
154
|
+
parts.push(lookup[tmp & 0x1f]);
|
|
155
|
+
parts.push("=");
|
|
156
|
+
}
|
|
157
|
+
else if (extraBytes === 3) {
|
|
158
|
+
tmp = ((uint8[len2] & 0xff) << 17) |
|
|
159
|
+
((uint8[len2 + 1] & 0xff) << 9) |
|
|
160
|
+
((uint8[len2 + 2] & 0xff) << 1);
|
|
161
|
+
parts.push(lookup[(tmp >> 20) & 0x1f]);
|
|
162
|
+
parts.push(lookup[(tmp >> 15) & 0x1f]);
|
|
163
|
+
parts.push(lookup[(tmp >> 10) & 0x1f]);
|
|
164
|
+
parts.push(lookup[(tmp >> 5) & 0x1f]);
|
|
165
|
+
parts.push(lookup[tmp & 0x1f]);
|
|
166
|
+
parts.push("===");
|
|
167
|
+
}
|
|
168
|
+
else if (extraBytes === 2) {
|
|
169
|
+
tmp = ((uint8[len2] & 0xff) << 12) | ((uint8[len2 + 1] & 0xff) << 4);
|
|
170
|
+
parts.push(lookup[(tmp >> 15) & 0x1f]);
|
|
171
|
+
parts.push(lookup[(tmp >> 10) & 0x1f]);
|
|
172
|
+
parts.push(lookup[(tmp >> 5) & 0x1f]);
|
|
173
|
+
parts.push(lookup[tmp & 0x1f]);
|
|
174
|
+
parts.push("====");
|
|
175
|
+
}
|
|
176
|
+
else if (extraBytes === 1) {
|
|
177
|
+
tmp = (uint8[len2] & 0xff) << 2;
|
|
178
|
+
parts.push(lookup[(tmp >> 5) & 0x1f]);
|
|
179
|
+
parts.push(lookup[tmp & 0x1f]);
|
|
180
|
+
parts.push("======");
|
|
181
|
+
}
|
|
182
|
+
return parts.join("");
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=_base32_common.js.map
|