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,164 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Utilities for
|
|
5
|
+
* {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4 | base64}
|
|
6
|
+
* encoding and decoding.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import {
|
|
10
|
+
* encodeBase64,
|
|
11
|
+
* decodeBase64,
|
|
12
|
+
* } from "@std/encoding/base64";
|
|
13
|
+
* import { assertEquals } from "@std/assert";
|
|
14
|
+
*
|
|
15
|
+
* const foobar = new TextEncoder().encode("foobar");
|
|
16
|
+
*
|
|
17
|
+
* assertEquals(encodeBase64(foobar), "Zm9vYmFy");
|
|
18
|
+
* assertEquals(decodeBase64("Zm9vYmFy"), foobar);
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
24
|
+
const base64abc = [
|
|
25
|
+
"A",
|
|
26
|
+
"B",
|
|
27
|
+
"C",
|
|
28
|
+
"D",
|
|
29
|
+
"E",
|
|
30
|
+
"F",
|
|
31
|
+
"G",
|
|
32
|
+
"H",
|
|
33
|
+
"I",
|
|
34
|
+
"J",
|
|
35
|
+
"K",
|
|
36
|
+
"L",
|
|
37
|
+
"M",
|
|
38
|
+
"N",
|
|
39
|
+
"O",
|
|
40
|
+
"P",
|
|
41
|
+
"Q",
|
|
42
|
+
"R",
|
|
43
|
+
"S",
|
|
44
|
+
"T",
|
|
45
|
+
"U",
|
|
46
|
+
"V",
|
|
47
|
+
"W",
|
|
48
|
+
"X",
|
|
49
|
+
"Y",
|
|
50
|
+
"Z",
|
|
51
|
+
"a",
|
|
52
|
+
"b",
|
|
53
|
+
"c",
|
|
54
|
+
"d",
|
|
55
|
+
"e",
|
|
56
|
+
"f",
|
|
57
|
+
"g",
|
|
58
|
+
"h",
|
|
59
|
+
"i",
|
|
60
|
+
"j",
|
|
61
|
+
"k",
|
|
62
|
+
"l",
|
|
63
|
+
"m",
|
|
64
|
+
"n",
|
|
65
|
+
"o",
|
|
66
|
+
"p",
|
|
67
|
+
"q",
|
|
68
|
+
"r",
|
|
69
|
+
"s",
|
|
70
|
+
"t",
|
|
71
|
+
"u",
|
|
72
|
+
"v",
|
|
73
|
+
"w",
|
|
74
|
+
"x",
|
|
75
|
+
"y",
|
|
76
|
+
"z",
|
|
77
|
+
"0",
|
|
78
|
+
"1",
|
|
79
|
+
"2",
|
|
80
|
+
"3",
|
|
81
|
+
"4",
|
|
82
|
+
"5",
|
|
83
|
+
"6",
|
|
84
|
+
"7",
|
|
85
|
+
"8",
|
|
86
|
+
"9",
|
|
87
|
+
"+",
|
|
88
|
+
"/",
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* Converts data into a base64-encoded string.
|
|
92
|
+
*
|
|
93
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
|
|
94
|
+
*
|
|
95
|
+
* @param data The data to encode.
|
|
96
|
+
* @returns The base64-encoded string.
|
|
97
|
+
*
|
|
98
|
+
* @example Usage
|
|
99
|
+
* ```ts
|
|
100
|
+
* import { encodeBase64 } from "@std/encoding/base64";
|
|
101
|
+
* import { assertEquals } from "@std/assert";
|
|
102
|
+
*
|
|
103
|
+
* assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export function encodeBase64(data) {
|
|
107
|
+
// CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
108
|
+
const uint8 = validateBinaryLike(data);
|
|
109
|
+
let result = "";
|
|
110
|
+
let i;
|
|
111
|
+
const l = uint8.length;
|
|
112
|
+
for (i = 2; i < l; i += 3) {
|
|
113
|
+
result += base64abc[(uint8[i - 2]) >> 2];
|
|
114
|
+
result += base64abc[(((uint8[i - 2]) & 0x03) << 4) |
|
|
115
|
+
((uint8[i - 1]) >> 4)];
|
|
116
|
+
result += base64abc[(((uint8[i - 1]) & 0x0f) << 2) |
|
|
117
|
+
((uint8[i]) >> 6)];
|
|
118
|
+
result += base64abc[(uint8[i]) & 0x3f];
|
|
119
|
+
}
|
|
120
|
+
if (i === l + 1) {
|
|
121
|
+
// 1 octet yet to write
|
|
122
|
+
result += base64abc[(uint8[i - 2]) >> 2];
|
|
123
|
+
result += base64abc[((uint8[i - 2]) & 0x03) << 4];
|
|
124
|
+
result += "==";
|
|
125
|
+
}
|
|
126
|
+
if (i === l) {
|
|
127
|
+
// 2 octets yet to write
|
|
128
|
+
result += base64abc[(uint8[i - 2]) >> 2];
|
|
129
|
+
result += base64abc[(((uint8[i - 2]) & 0x03) << 4) |
|
|
130
|
+
((uint8[i - 1]) >> 4)];
|
|
131
|
+
result += base64abc[((uint8[i - 1]) & 0x0f) << 2];
|
|
132
|
+
result += "=";
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Decodes a base64-encoded string.
|
|
138
|
+
*
|
|
139
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
|
|
140
|
+
*
|
|
141
|
+
* @param b64 The base64-encoded string to decode.
|
|
142
|
+
* @returns The decoded data.
|
|
143
|
+
*
|
|
144
|
+
* @example Usage
|
|
145
|
+
* ```ts
|
|
146
|
+
* import { decodeBase64 } from "@std/encoding/base64";
|
|
147
|
+
* import { assertEquals } from "@std/assert";
|
|
148
|
+
*
|
|
149
|
+
* assertEquals(
|
|
150
|
+
* decodeBase64("Zm9vYmFy"),
|
|
151
|
+
* new TextEncoder().encode("foobar")
|
|
152
|
+
* );
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export function decodeBase64(b64) {
|
|
156
|
+
const binString = atob(b64);
|
|
157
|
+
const size = binString.length;
|
|
158
|
+
const bytes = new Uint8Array(size);
|
|
159
|
+
for (let i = 0; i < size; i++) {
|
|
160
|
+
bytes[i] = binString.charCodeAt(i);
|
|
161
|
+
}
|
|
162
|
+
return bytes;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/base64.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AA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,IAAI,CAAC,CAAC,CACvB,CAAC;QACF,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC;IAC9B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert data into a base64url-encoded string.
|
|
3
|
+
*
|
|
4
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
|
|
5
|
+
*
|
|
6
|
+
* @param data The data to encode.
|
|
7
|
+
* @returns The base64url-encoded string.
|
|
8
|
+
*
|
|
9
|
+
* @example Usage
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { encodeBase64Url } from "@std/encoding/base64url";
|
|
12
|
+
* import { assertEquals } from "@std/assert";
|
|
13
|
+
*
|
|
14
|
+
* assertEquals(encodeBase64Url("foobar"), "Zm9vYmFy");
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function encodeBase64Url(data: ArrayBuffer | Uint8Array | string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Decodes a given base64url-encoded string.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
|
|
22
|
+
*
|
|
23
|
+
* @param b64url The base64url-encoded string to decode.
|
|
24
|
+
* @returns The decoded data.
|
|
25
|
+
*
|
|
26
|
+
* @example Usage
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { decodeBase64Url } from "@std/encoding/base64url";
|
|
29
|
+
* import { assertEquals } from "@std/assert";
|
|
30
|
+
*
|
|
31
|
+
* assertEquals(
|
|
32
|
+
* decodeBase64Url("Zm9vYmFy"),
|
|
33
|
+
* new TextEncoder().encode("foobar")
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function decodeBase64Url(b64url: string): Uint8Array;
|
|
38
|
+
//# sourceMappingURL=base64url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/base64url.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GACtC,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAE1D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Utilities for
|
|
5
|
+
* {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5 | base64url}
|
|
6
|
+
* encoding and decoding.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import * as base64 from "./base64.js";
|
|
11
|
+
/**
|
|
12
|
+
* Some variants allow or require omitting the padding '=' signs:
|
|
13
|
+
* https://en.wikipedia.org/wiki/Base64#The_URL_applications
|
|
14
|
+
*
|
|
15
|
+
* @param base64url
|
|
16
|
+
*/
|
|
17
|
+
function addPaddingToBase64url(base64url) {
|
|
18
|
+
if (base64url.length % 4 === 2)
|
|
19
|
+
return base64url + "==";
|
|
20
|
+
if (base64url.length % 4 === 3)
|
|
21
|
+
return base64url + "=";
|
|
22
|
+
if (base64url.length % 4 === 1) {
|
|
23
|
+
throw new TypeError("Illegal base64url string");
|
|
24
|
+
}
|
|
25
|
+
return base64url;
|
|
26
|
+
}
|
|
27
|
+
function convertBase64urlToBase64(b64url) {
|
|
28
|
+
if (!/^[-_A-Z0-9]*?={0,2}$/i.test(b64url)) {
|
|
29
|
+
// Contains characters not part of base64url spec.
|
|
30
|
+
throw new TypeError("Failed to decode base64url: invalid character");
|
|
31
|
+
}
|
|
32
|
+
return addPaddingToBase64url(b64url).replace(/\-/g, "+").replace(/_/g, "/");
|
|
33
|
+
}
|
|
34
|
+
function convertBase64ToBase64url(b64) {
|
|
35
|
+
return b64.endsWith("=")
|
|
36
|
+
? b64.endsWith("==")
|
|
37
|
+
? b64.replace(/\+/g, "-").replace(/\//g, "_").slice(0, -2)
|
|
38
|
+
: b64.replace(/\+/g, "-").replace(/\//g, "_").slice(0, -1)
|
|
39
|
+
: b64.replace(/\+/g, "-").replace(/\//g, "_");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Convert data into a base64url-encoded string.
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
|
|
45
|
+
*
|
|
46
|
+
* @param data The data to encode.
|
|
47
|
+
* @returns The base64url-encoded string.
|
|
48
|
+
*
|
|
49
|
+
* @example Usage
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { encodeBase64Url } from "@std/encoding/base64url";
|
|
52
|
+
* import { assertEquals } from "@std/assert";
|
|
53
|
+
*
|
|
54
|
+
* assertEquals(encodeBase64Url("foobar"), "Zm9vYmFy");
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export function encodeBase64Url(data) {
|
|
58
|
+
return convertBase64ToBase64url(base64.encodeBase64(data));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Decodes a given base64url-encoded string.
|
|
62
|
+
*
|
|
63
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
|
|
64
|
+
*
|
|
65
|
+
* @param b64url The base64url-encoded string to decode.
|
|
66
|
+
* @returns The decoded data.
|
|
67
|
+
*
|
|
68
|
+
* @example Usage
|
|
69
|
+
* ```ts
|
|
70
|
+
* import { decodeBase64Url } from "@std/encoding/base64url";
|
|
71
|
+
* import { assertEquals } from "@std/assert";
|
|
72
|
+
*
|
|
73
|
+
* assertEquals(
|
|
74
|
+
* decodeBase64Url("Zm9vYmFy"),
|
|
75
|
+
* new TextEncoder().encode("foobar")
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export function decodeBase64Url(b64url) {
|
|
80
|
+
return base64.decodeBase64(convertBase64urlToBase64(b64url));
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=base64url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64url.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/base64url.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,GAAG,IAAI,CAAC;IACxD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,GAAG,GAAG,CAAC;IACvD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,E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C5C,OAAO,MAAM,CAAC,YAAY,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts data into a hex-encoded string.
|
|
3
|
+
*
|
|
4
|
+
* @param src The data to encode.
|
|
5
|
+
*
|
|
6
|
+
* @returns The hex-encoded string.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { encodeHex } from "@std/encoding/hex";
|
|
11
|
+
* import { assertEquals } from "@std/assert";
|
|
12
|
+
*
|
|
13
|
+
* assertEquals(encodeHex("abc"), "616263");
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function encodeHex(src: string | Uint8Array | ArrayBuffer): string;
|
|
17
|
+
/**
|
|
18
|
+
* Decodes the given hex-encoded string. If the input is malformed, an error is
|
|
19
|
+
* thrown.
|
|
20
|
+
*
|
|
21
|
+
* @param src The hex-encoded string to decode.
|
|
22
|
+
*
|
|
23
|
+
* @returns The decoded data.
|
|
24
|
+
*
|
|
25
|
+
* @example Usage
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { decodeHex } from "@std/encoding/hex";
|
|
28
|
+
* import { assertEquals } from "@std/assert";
|
|
29
|
+
*
|
|
30
|
+
* assertEquals(
|
|
31
|
+
* decodeHex("616263"),
|
|
32
|
+
* new TextEncoder().encode("abc"),
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function decodeHex(src: string): Uint8Array;
|
|
37
|
+
//# sourceMappingURL=hex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/hex.ts"],"names":[],"mappings":"AAwDA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAUxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAiBjD"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Copyright 2009 The Go Authors. All rights reserved.
|
|
2
|
+
// https://github.com/golang/go/blob/master/LICENSE
|
|
3
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
4
|
+
// This module is browser compatible.
|
|
5
|
+
/**
|
|
6
|
+
* Port of the Go
|
|
7
|
+
* {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
|
|
8
|
+
* library.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import {
|
|
12
|
+
* decodeHex,
|
|
13
|
+
* encodeHex,
|
|
14
|
+
* } from "@std/encoding/hex";
|
|
15
|
+
* import { assertEquals } from "@std/assert";
|
|
16
|
+
*
|
|
17
|
+
* assertEquals(encodeHex("abc"), "616263");
|
|
18
|
+
*
|
|
19
|
+
* assertEquals(
|
|
20
|
+
* decodeHex("616263"),
|
|
21
|
+
* new TextEncoder().encode("abc"),
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @module
|
|
26
|
+
*/
|
|
27
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
28
|
+
const hexTable = new TextEncoder().encode("0123456789abcdef");
|
|
29
|
+
const textEncoder = new TextEncoder();
|
|
30
|
+
const textDecoder = new TextDecoder();
|
|
31
|
+
function errInvalidByte(byte) {
|
|
32
|
+
return new TypeError(`Invalid byte '${String.fromCharCode(byte)}'`);
|
|
33
|
+
}
|
|
34
|
+
function errLength(len) {
|
|
35
|
+
return new RangeError(`Cannot decode the hex string as the input length should be even: length is ${len}`);
|
|
36
|
+
}
|
|
37
|
+
/** Converts a hex character into its value. */
|
|
38
|
+
function fromHexChar(byte) {
|
|
39
|
+
// '0' <= byte && byte <= '9'
|
|
40
|
+
if (48 <= byte && byte <= 57)
|
|
41
|
+
return byte - 48;
|
|
42
|
+
// 'a' <= byte && byte <= 'f'
|
|
43
|
+
if (97 <= byte && byte <= 102)
|
|
44
|
+
return byte - 97 + 10;
|
|
45
|
+
// 'A' <= byte && byte <= 'F'
|
|
46
|
+
if (65 <= byte && byte <= 70)
|
|
47
|
+
return byte - 65 + 10;
|
|
48
|
+
throw errInvalidByte(byte);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Converts data into a hex-encoded string.
|
|
52
|
+
*
|
|
53
|
+
* @param src The data to encode.
|
|
54
|
+
*
|
|
55
|
+
* @returns The hex-encoded string.
|
|
56
|
+
*
|
|
57
|
+
* @example Usage
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { encodeHex } from "@std/encoding/hex";
|
|
60
|
+
* import { assertEquals } from "@std/assert";
|
|
61
|
+
*
|
|
62
|
+
* assertEquals(encodeHex("abc"), "616263");
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export function encodeHex(src) {
|
|
66
|
+
const u8 = validateBinaryLike(src);
|
|
67
|
+
const dst = new Uint8Array(u8.length * 2);
|
|
68
|
+
for (let i = 0; i < u8.length; i++) {
|
|
69
|
+
const v = u8[i];
|
|
70
|
+
dst[i * 2] = hexTable[v >> 4];
|
|
71
|
+
dst[i * 2 + 1] = hexTable[v & 0x0f];
|
|
72
|
+
}
|
|
73
|
+
return textDecoder.decode(dst);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Decodes the given hex-encoded string. If the input is malformed, an error is
|
|
77
|
+
* thrown.
|
|
78
|
+
*
|
|
79
|
+
* @param src The hex-encoded string to decode.
|
|
80
|
+
*
|
|
81
|
+
* @returns The decoded data.
|
|
82
|
+
*
|
|
83
|
+
* @example Usage
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { decodeHex } from "@std/encoding/hex";
|
|
86
|
+
* import { assertEquals } from "@std/assert";
|
|
87
|
+
*
|
|
88
|
+
* assertEquals(
|
|
89
|
+
* decodeHex("616263"),
|
|
90
|
+
* new TextEncoder().encode("abc"),
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export function decodeHex(src) {
|
|
95
|
+
const u8 = textEncoder.encode(src);
|
|
96
|
+
const dst = new Uint8Array(u8.length / 2);
|
|
97
|
+
for (let i = 0; i < dst.length; i++) {
|
|
98
|
+
const a = fromHexChar(u8[i * 2]);
|
|
99
|
+
const b = fromHexChar(u8[i * 2 + 1]);
|
|
100
|
+
dst[i] = (a << 4) | b;
|
|
101
|
+
}
|
|
102
|
+
if (u8.length % 2 === 1) {
|
|
103
|
+
// Check for invalid char before reporting bad length,
|
|
104
|
+
// since the invalid char (if present) is an earlier problem.
|
|
105
|
+
fromHexChar(u8[dst.length * 2]);
|
|
106
|
+
throw errLength(u8.length);
|
|
107
|
+
}
|
|
108
|
+
return dst;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=hex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hex.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/hex.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,mDAAmD;AACnD,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9D,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AACtC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAEtC,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,SAAS,CAAC,iBAAiB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtE,CA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,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAE,CAAC,CAAC;QACtC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,sDAAsD;QACtD,6DAA6D;QAC7D,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for encoding and decoding common formats like hex, base64, and varint.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { encodeBase64, decodeBase64 } from "@std/encoding";
|
|
6
|
+
* import { assertEquals } from "@std/assert";
|
|
7
|
+
*
|
|
8
|
+
* const foobar = new TextEncoder().encode("foobar");
|
|
9
|
+
* assertEquals(encodeBase64(foobar), "Zm9vYmFy");
|
|
10
|
+
* assertEquals(decodeBase64("Zm9vYmFy"), foobar);
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
export * from "./ascii85.js";
|
|
16
|
+
export * from "./base32.js";
|
|
17
|
+
export * from "./base58.js";
|
|
18
|
+
export * from "./base64.js";
|
|
19
|
+
export * from "./base64url.js";
|
|
20
|
+
export * from "./hex.js";
|
|
21
|
+
export * from "./varint.js";
|
|
22
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
/**
|
|
3
|
+
* Utilities for encoding and decoding common formats like hex, base64, and varint.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { encodeBase64, decodeBase64 } from "@std/encoding";
|
|
7
|
+
* import { assertEquals } from "@std/assert";
|
|
8
|
+
*
|
|
9
|
+
* const foobar = new TextEncoder().encode("foobar");
|
|
10
|
+
* assertEquals(encodeBase64(foobar), "Zm9vYmFy");
|
|
11
|
+
* assertEquals(decodeBase64("Zm9vYmFy"), foobar);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
export * from "./ascii85.js";
|
|
17
|
+
export * from "./base32.js";
|
|
18
|
+
export * from "./base58.js";
|
|
19
|
+
export * from "./base64.js";
|
|
20
|
+
export * from "./base64url.js";
|
|
21
|
+
export * from "./hex.js";
|
|
22
|
+
export * from "./varint.js";
|
|
23
|
+
//# sourceMappingURL=mod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/mod.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E;;;;;;;;;;;;;GAaG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for {@link https://protobuf.dev/programming-guides/encoding/#varints Varint} encoding
|
|
3
|
+
* of typed integers. Varint encoding represents integers using a variable number of bytes, with
|
|
4
|
+
* smaller values requiring fewer bytes.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { encodeVarint, decodeVarint } from "@std/encoding/varint";
|
|
8
|
+
* import { assertEquals } from "@std/assert";
|
|
9
|
+
*
|
|
10
|
+
* const buf = new Uint8Array(10);
|
|
11
|
+
* assertEquals(
|
|
12
|
+
* encodeVarint(42n, buf),
|
|
13
|
+
* [new Uint8Array([42]), 1]
|
|
14
|
+
* );
|
|
15
|
+
*
|
|
16
|
+
* assertEquals(
|
|
17
|
+
* decodeVarint(new Uint8Array([42])),
|
|
18
|
+
* [ 42n, 1 ]
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The maximum value of an unsigned 64-bit integer.
|
|
26
|
+
* Equivalent to `2n**64n - 1n`
|
|
27
|
+
*/
|
|
28
|
+
export declare const MaxUint64 = 18446744073709551615n;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum length, in bytes, of a Varint encoded 64-bit integer.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MaxVarintLen64 = 10;
|
|
33
|
+
/**
|
|
34
|
+
* The maximum length, in bytes, of a Varint encoded 32-bit integer.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MaxVarintLen32 = 5;
|
|
37
|
+
/**
|
|
38
|
+
* Given a non empty `buf`, starting at `offset` (default: 0), begin decoding bytes as
|
|
39
|
+
* Varint encoded bytes, for a maximum of 10 bytes (offset + 10). The returned
|
|
40
|
+
* tuple is of the decoded varint 32-bit number, and the new offset with which
|
|
41
|
+
* to continue decoding other data.
|
|
42
|
+
*
|
|
43
|
+
* If a `bigint` in return is undesired, the `decode32` function will return a
|
|
44
|
+
* `number`, but this should only be used in cases where the varint is
|
|
45
|
+
* _assured_ to be 32-bits. If in doubt, use `decode()`.
|
|
46
|
+
*
|
|
47
|
+
* To know how many bytes the Varint took to encode, simply negate `offset`
|
|
48
|
+
* from the returned new `offset`.
|
|
49
|
+
*
|
|
50
|
+
* @param buf The buffer to decode from.
|
|
51
|
+
* @param offset The offset to start decoding from.
|
|
52
|
+
* @returns A tuple of the decoded varint 64-bit number, and the new offset.
|
|
53
|
+
*
|
|
54
|
+
* @example Usage
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { decodeVarint } from "@std/encoding/varint";
|
|
57
|
+
* import { assertEquals } from "@std/assert";
|
|
58
|
+
*
|
|
59
|
+
* const buf = new Uint8Array([0x8E, 0x02]);
|
|
60
|
+
* assertEquals(decodeVarint(buf), [270n, 2]);
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function decodeVarint(buf: Uint8Array, offset?: number): [bigint, number];
|
|
64
|
+
/**
|
|
65
|
+
* Given a `buf`, starting at `offset` (default: 0), begin decoding bytes as
|
|
66
|
+
* Varint encoded bytes, for a maximum of 5 bytes (offset + 5). The returned
|
|
67
|
+
* tuple is of the decoded varint 32-bit number, and the new offset with which
|
|
68
|
+
* to continue decoding other data.
|
|
69
|
+
*
|
|
70
|
+
* Varints are _not 32-bit by default_ so this should only be used in cases
|
|
71
|
+
* where the varint is _assured_ to be 32-bits. If in doubt, use `decode()`.
|
|
72
|
+
*
|
|
73
|
+
* To know how many bytes the Varint took to encode, simply negate `offset`
|
|
74
|
+
* from the returned new `offset`.
|
|
75
|
+
*
|
|
76
|
+
* @param buf The buffer to decode from.
|
|
77
|
+
* @param offset The offset to start decoding from.
|
|
78
|
+
* @returns A tuple of the decoded varint 32-bit number, and the new offset.
|
|
79
|
+
*
|
|
80
|
+
* @example Usage
|
|
81
|
+
* ```ts
|
|
82
|
+
* import { decodeVarint32 } from "@std/encoding/varint";
|
|
83
|
+
* import { assertEquals } from "@std/assert";
|
|
84
|
+
*
|
|
85
|
+
* const buf = new Uint8Array([0x8E, 0x02]);
|
|
86
|
+
* assertEquals(decodeVarint32(buf), [270, 2]);
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function decodeVarint32(buf: Uint8Array, offset?: number): [number, number];
|
|
90
|
+
/**
|
|
91
|
+
* Takes unsigned number `num` and converts it into a Varint encoded
|
|
92
|
+
* `Uint8Array`, returning a tuple consisting of a `Uint8Array` slice of the
|
|
93
|
+
* encoded Varint, and an offset where the Varint encoded bytes end within the
|
|
94
|
+
* `Uint8Array`.
|
|
95
|
+
*
|
|
96
|
+
* If `buf` is not given then a Uint8Array will be created.
|
|
97
|
+
* `offset` defaults to `0`.
|
|
98
|
+
*
|
|
99
|
+
* If passed `buf` then that will be written into, starting at `offset`. The
|
|
100
|
+
* resulting returned `Uint8Array` will be a slice of `buf`. The resulting
|
|
101
|
+
* returned number is effectively `offset + bytesWritten`.
|
|
102
|
+
*
|
|
103
|
+
* @param num The number to encode.
|
|
104
|
+
* @param buf The buffer to write into.
|
|
105
|
+
* @param offset The offset to start writing at.
|
|
106
|
+
* @returns A tuple of the encoded Varint `Uint8Array` and the new offset.
|
|
107
|
+
*
|
|
108
|
+
* @example Usage
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { encodeVarint } from "@std/encoding/varint";
|
|
111
|
+
* import { assertEquals } from "@std/assert";
|
|
112
|
+
*
|
|
113
|
+
* const buf = new Uint8Array(10);
|
|
114
|
+
* assertEquals(encodeVarint(42n, buf), [new Uint8Array([42]), 1]);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare function encodeVarint(num: bigint | number, buf?: Uint8Array, offset?: number): [Uint8Array, number];
|
|
118
|
+
//# sourceMappingURL=varint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"varint.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/varint.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;GAGG;AACH,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC;;GAEG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAahC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAe5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,GAAG,GAAE,UAA2C,EAChD,MAAM,SAAI,GACT,CAAC,UAAU,EAAE,MAAM,CAAC,CAuBtB"}
|