@schema-pack/message-pack 0.0.0-commit.26afe064c7a56c37bf7fb74f67222a4decd06fd4 → 0.0.0-commit.2ea6fc3f9c377c8d3c31c5690c0f42c9add30ded
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 +21 -0
- package/README.md +9 -123
- package/dist/cjs/bufferWithExtensions-Cg4LGSIy.d.cts +51 -0
- package/dist/cjs/bufferWithExtensions-Cg4LGSIy.d.cts.map +1 -0
- package/dist/cjs/bufferWithExtensions.cjs +91 -0
- package/dist/cjs/bufferWithExtensions.d.cts +2 -0
- package/dist/cjs/constants.cjs +36 -0
- package/dist/cjs/constants.d.cts +32 -0
- package/dist/cjs/constants.d.cts.map +1 -0
- package/dist/cjs/decode-BraWmoPw.d.cts +5 -0
- package/dist/cjs/decode-BraWmoPw.d.cts.map +1 -0
- package/dist/cjs/decoder/decode.cjs +8 -0
- package/dist/cjs/decoder/decode.d.cts +2 -0
- package/dist/cjs/decoder/decoder.cjs +279 -0
- package/dist/cjs/decoder/decoder.d.cts +2 -0
- package/dist/cjs/decoder/index.cjs +9 -0
- package/dist/cjs/decoder/index.d.cts +7 -0
- package/dist/cjs/decoder/interfaces/index.cjs +0 -0
- package/dist/cjs/decoder/interfaces/index.d.cts +4 -0
- package/dist/cjs/decoder/interfaces/messagePackDecoder.cjs +0 -0
- package/dist/cjs/decoder/interfaces/messagePackDecoder.d.cts +2 -0
- package/dist/cjs/decoder/interfaces/messagePackTextDecoder.cjs +0 -0
- package/dist/cjs/decoder/interfaces/messagePackTextDecoder.d.cts +2 -0
- package/dist/cjs/decoder/textDecoders/defaultTextDecoder.cjs +12 -0
- package/dist/cjs/decoder/textDecoders/defaultTextDecoder.d.cts +2 -0
- package/dist/cjs/decoder/textDecoders/index.cjs +5 -0
- package/dist/cjs/decoder/textDecoders/index.d.cts +4 -0
- package/dist/cjs/decoder/textDecoders/nodeTextDecoder.cjs +8 -0
- package/dist/cjs/decoder/textDecoders/nodeTextDecoder.d.cts +2 -0
- package/dist/cjs/decoder/types.cjs +0 -0
- package/dist/cjs/decoder/types.d.cts +2 -0
- package/dist/cjs/decoder-T6p4ZZJi.d.cts +30 -0
- package/dist/cjs/decoder-T6p4ZZJi.d.cts.map +1 -0
- package/dist/cjs/defaultNewBufferFn.cjs +4 -0
- package/dist/cjs/defaultNewBufferFn.d.cts +5 -0
- package/dist/cjs/defaultNewBufferFn.d.cts.map +1 -0
- package/dist/cjs/defaultTextDecoder-CyZtJbK1.d.cts +10 -0
- package/dist/cjs/defaultTextDecoder-CyZtJbK1.d.cts.map +1 -0
- package/dist/cjs/defaultTextEncoder-BpUrJKD9.d.cts +14 -0
- package/dist/cjs/defaultTextEncoder-BpUrJKD9.d.cts.map +1 -0
- package/dist/cjs/encode-4SxHVw0M.d.cts +5 -0
- package/dist/cjs/encode-4SxHVw0M.d.cts.map +1 -0
- package/dist/cjs/encoder/encode.cjs +8 -0
- package/dist/cjs/encoder/encode.d.cts +2 -0
- package/dist/cjs/encoder/encoder.cjs +705 -0
- package/dist/cjs/encoder/encoder.d.cts +2 -0
- package/dist/cjs/encoder/index.cjs +9 -0
- package/dist/cjs/encoder/index.d.cts +7 -0
- package/dist/cjs/encoder/interfaces/index.cjs +0 -0
- package/dist/cjs/encoder/interfaces/index.d.cts +4 -0
- package/dist/cjs/encoder/interfaces/messagePackEncoder.cjs +0 -0
- package/dist/cjs/encoder/interfaces/messagePackEncoder.d.cts +2 -0
- package/dist/cjs/encoder/interfaces/messagePackTextEncoder.cjs +0 -0
- package/dist/cjs/encoder/interfaces/messagePackTextEncoder.d.cts +2 -0
- package/dist/cjs/encoder/textEncoders/defaultTextEncoder.cjs +14 -0
- package/dist/cjs/encoder/textEncoders/defaultTextEncoder.d.cts +2 -0
- package/dist/cjs/encoder/textEncoders/index.cjs +5 -0
- package/dist/cjs/encoder/textEncoders/index.d.cts +4 -0
- package/dist/cjs/encoder/textEncoders/nodeTextEncoder.cjs +8 -0
- package/dist/cjs/encoder/textEncoders/nodeTextEncoder.d.cts +2 -0
- package/dist/cjs/encoder/types.cjs +0 -0
- package/dist/cjs/encoder/types.d.cts +2 -0
- package/dist/cjs/encoder-yQYOtvXU.d.cts +131 -0
- package/dist/cjs/encoder-yQYOtvXU.d.cts.map +1 -0
- package/dist/cjs/error-B129l__v.d.cts +1204 -0
- package/dist/cjs/error-B129l__v.d.cts.map +1 -0
- package/dist/cjs/extensions/error/defaultFactories.cjs +15 -0
- package/dist/cjs/extensions/error/defaultFactories.d.cts +6 -0
- package/dist/cjs/extensions/error/defaultFactories.d.cts.map +1 -0
- package/dist/cjs/extensions/error/error.cjs +139 -0
- package/dist/cjs/extensions/error/error.d.cts +2 -0
- package/dist/cjs/extensions/error/index.cjs +3 -0
- package/dist/cjs/extensions/error/index.d.cts +4 -0
- package/dist/cjs/extensions/error/symbols.cjs +19 -0
- package/dist/cjs/extensions/error/symbols.d.cts +19 -0
- package/dist/cjs/extensions/error/symbols.d.cts.map +1 -0
- package/dist/cjs/extensions/error/types.cjs +0 -0
- package/dist/cjs/extensions/error/types.d.cts +2 -0
- package/dist/cjs/extensions/index.cjs +7 -0
- package/dist/cjs/extensions/index.d.cts +7 -0
- package/dist/cjs/extensions/interfaces/messagePackBuiltInExtension.cjs +0 -0
- package/dist/cjs/extensions/interfaces/messagePackBuiltInExtension.d.cts +2 -0
- package/dist/cjs/extensions/interfaces/messagePackExtension.cjs +0 -0
- package/dist/cjs/extensions/interfaces/messagePackExtension.d.cts +2 -0
- package/dist/cjs/extensions/interfaces/messagePackExtensionBase.cjs +0 -0
- package/dist/cjs/extensions/interfaces/messagePackExtensionBase.d.cts +2 -0
- package/dist/cjs/extensions/interfaces/types.cjs +0 -0
- package/dist/cjs/extensions/interfaces/types.d.cts +2 -0
- package/dist/cjs/extensions/serializer/index.cjs +3 -0
- package/dist/cjs/extensions/serializer/index.d.cts +4 -0
- package/dist/cjs/extensions/serializer/serializer.cjs +27 -0
- package/dist/cjs/extensions/serializer/serializer.d.cts +2 -0
- package/dist/cjs/extensions/serializer/types.cjs +0 -0
- package/dist/cjs/extensions/serializer/types.d.cts +2 -0
- package/dist/cjs/extensions/timestampDate/index.cjs +3 -0
- package/dist/cjs/extensions/timestampDate/index.d.cts +4 -0
- package/dist/cjs/extensions/timestampDate/timestampDate.cjs +96 -0
- package/dist/cjs/extensions/timestampDate/timestampDate.d.cts +2 -0
- package/dist/cjs/extensions/timestampDate/types.cjs +0 -0
- package/dist/cjs/extensions/timestampDate/types.d.cts +2 -0
- package/dist/cjs/index-5OuLsWCC.d.cts +1 -0
- package/dist/cjs/index-B5vbV8Ak.d.cts +1 -0
- package/dist/cjs/index-CQnkyOId.d.cts +1 -0
- package/dist/cjs/index-CUX405iZ.d.cts +1 -0
- package/dist/cjs/index-CaxrMD1A.d.cts +1 -0
- package/dist/cjs/index-DMnXy2Rv.d.cts +1 -0
- package/dist/cjs/index-DeSJDZGk.d.cts +1 -0
- package/dist/cjs/index.cjs +26 -0
- package/dist/cjs/index.d.cts +16 -0
- package/dist/cjs/interfaces/messagePackBufferWithExtensions.cjs +0 -0
- package/dist/cjs/interfaces/messagePackBufferWithExtensions.d.cts +2 -0
- package/dist/cjs/messagePackDecoder-BZOBJ2h5.d.cts +12 -0
- package/dist/cjs/messagePackDecoder-BZOBJ2h5.d.cts.map +1 -0
- package/dist/cjs/messagePackExtensionBase-DVMgQv12.d.cts +30 -0
- package/dist/cjs/messagePackExtensionBase-DVMgQv12.d.cts.map +1 -0
- package/dist/cjs/messagePackTextDecoder-CfBSOsxU.d.cts +8 -0
- package/dist/cjs/messagePackTextDecoder-CfBSOsxU.d.cts.map +1 -0
- package/dist/cjs/messagePackTextEncoder-MeyNUt3L.d.cts +16 -0
- package/dist/cjs/messagePackTextEncoder-MeyNUt3L.d.cts.map +1 -0
- package/dist/cjs/nodeTextDecoder-B48jwo-L.d.cts +9 -0
- package/dist/cjs/nodeTextDecoder-B48jwo-L.d.cts.map +1 -0
- package/dist/cjs/nodeTextEncoder-BpJi8Jx-.d.cts +8 -0
- package/dist/cjs/nodeTextEncoder-BpJi8Jx-.d.cts.map +1 -0
- package/dist/cjs/serializer-nJmZCyQ0.d.cts +19 -0
- package/dist/cjs/serializer-nJmZCyQ0.d.cts.map +1 -0
- package/dist/cjs/symbols.cjs +47 -0
- package/dist/cjs/symbols.d.cts +47 -0
- package/dist/cjs/symbols.d.cts.map +1 -0
- package/dist/cjs/types-B9KMW-kD.d.cts +8 -0
- package/dist/cjs/types-B9KMW-kD.d.cts.map +1 -0
- package/dist/cjs/types-BLh5F2iA.d.cts +22 -0
- package/dist/cjs/types-BLh5F2iA.d.cts.map +1 -0
- package/dist/cjs/types-BcIA43h9.d.cts +5 -0
- package/dist/cjs/types-BcIA43h9.d.cts.map +1 -0
- package/dist/cjs/types-CbicLx9m.d.cts +21 -0
- package/dist/cjs/types-CbicLx9m.d.cts.map +1 -0
- package/dist/cjs/types-aODRmLZq.d.cts +7 -0
- package/dist/cjs/types-aODRmLZq.d.cts.map +1 -0
- package/dist/cjs/types.cjs +0 -0
- package/dist/cjs/types.d.cts +2 -0
- package/dist/cjs/utils/assertValidExtensionType.cjs +7 -0
- package/dist/cjs/utils/assertValidExtensionType.d.cts +4 -0
- package/dist/cjs/utils/assertValidExtensionType.d.cts.map +1 -0
- package/dist/cjs/utils/fitIn16Bits.cjs +6 -0
- package/dist/cjs/utils/fitIn16Bits.d.cts +4 -0
- package/dist/cjs/utils/fitIn16Bits.d.cts.map +1 -0
- package/dist/cjs/utils/fitIn32Bits.cjs +6 -0
- package/dist/cjs/utils/fitIn32Bits.d.cts +4 -0
- package/dist/cjs/utils/fitIn32Bits.d.cts.map +1 -0
- package/dist/cjs/utils/fitIn7Bits.cjs +6 -0
- package/dist/cjs/utils/fitIn7Bits.d.cts +4 -0
- package/dist/cjs/utils/fitIn7Bits.d.cts.map +1 -0
- package/dist/cjs/utils/fitIn8Bits.cjs +6 -0
- package/dist/cjs/utils/fitIn8Bits.d.cts +4 -0
- package/dist/cjs/utils/fitIn8Bits.d.cts.map +1 -0
- package/dist/esm/bufferWithExtensions-DSU4ekuD.d.mts +51 -0
- package/dist/esm/bufferWithExtensions-DSU4ekuD.d.mts.map +1 -0
- package/dist/esm/bufferWithExtensions.d.mts +2 -0
- package/dist/esm/bufferWithExtensions.mjs +93 -0
- package/dist/esm/bufferWithExtensions.mjs.map +1 -0
- package/dist/esm/constants.d.mts +32 -0
- package/dist/esm/constants.d.mts.map +1 -0
- package/dist/esm/constants.mjs +33 -0
- package/dist/esm/constants.mjs.map +1 -0
- package/dist/esm/decode-BraWmoPw.d.mts +5 -0
- package/dist/esm/decode-BraWmoPw.d.mts.map +1 -0
- package/dist/esm/decoder/decode.d.mts +2 -0
- package/dist/esm/decoder/decode.mjs +11 -0
- package/dist/esm/decoder/decode.mjs.map +1 -0
- package/dist/esm/decoder/decoder.d.mts +2 -0
- package/dist/esm/decoder/decoder.mjs +281 -0
- package/dist/esm/decoder/decoder.mjs.map +1 -0
- package/dist/esm/decoder/index.d.mts +7 -0
- package/dist/esm/decoder/index.mjs +5 -0
- package/dist/esm/decoder/interfaces/index.d.mts +4 -0
- package/dist/esm/decoder/interfaces/index.mjs +1 -0
- package/dist/esm/decoder/interfaces/messagePackDecoder.d.mts +2 -0
- package/dist/esm/decoder/interfaces/messagePackDecoder.mjs +1 -0
- package/dist/esm/decoder/interfaces/messagePackTextDecoder.d.mts +2 -0
- package/dist/esm/decoder/interfaces/messagePackTextDecoder.mjs +1 -0
- package/dist/esm/decoder/textDecoders/defaultTextDecoder.d.mts +2 -0
- package/dist/esm/decoder/textDecoders/defaultTextDecoder.mjs +14 -0
- package/dist/esm/decoder/textDecoders/defaultTextDecoder.mjs.map +1 -0
- package/dist/esm/decoder/textDecoders/index.d.mts +4 -0
- package/dist/esm/decoder/textDecoders/index.mjs +3 -0
- package/dist/esm/decoder/textDecoders/nodeTextDecoder.d.mts +2 -0
- package/dist/esm/decoder/textDecoders/nodeTextDecoder.mjs +10 -0
- package/dist/esm/decoder/textDecoders/nodeTextDecoder.mjs.map +1 -0
- package/dist/esm/decoder/types.d.mts +2 -0
- package/dist/esm/decoder/types.mjs +1 -0
- package/dist/esm/decoder-Bdqx1C7P.d.mts +30 -0
- package/dist/esm/decoder-Bdqx1C7P.d.mts.map +1 -0
- package/dist/esm/defaultNewBufferFn.d.mts +6 -0
- package/dist/esm/defaultNewBufferFn.d.mts.map +1 -0
- package/dist/esm/defaultNewBufferFn.mjs +6 -0
- package/dist/esm/defaultNewBufferFn.mjs.map +1 -0
- package/dist/esm/defaultTextDecoder-BkW5T2EO.d.mts +10 -0
- package/dist/esm/defaultTextDecoder-BkW5T2EO.d.mts.map +1 -0
- package/dist/esm/defaultTextEncoder-9dqnRXnL.d.mts +14 -0
- package/dist/esm/defaultTextEncoder-9dqnRXnL.d.mts.map +1 -0
- package/dist/esm/encode-4SxHVw0M.d.mts +5 -0
- package/dist/esm/encode-4SxHVw0M.d.mts.map +1 -0
- package/dist/esm/encoder/encode.d.mts +2 -0
- package/dist/esm/encoder/encode.mjs +11 -0
- package/dist/esm/encoder/encode.mjs.map +1 -0
- package/dist/esm/encoder/encoder.d.mts +2 -0
- package/dist/esm/encoder/encoder.mjs +707 -0
- package/dist/esm/encoder/encoder.mjs.map +1 -0
- package/dist/esm/encoder/index.d.mts +7 -0
- package/dist/esm/encoder/index.mjs +5 -0
- package/dist/esm/encoder/interfaces/index.d.mts +4 -0
- package/dist/esm/encoder/interfaces/index.mjs +1 -0
- package/dist/esm/encoder/interfaces/messagePackEncoder.d.mts +2 -0
- package/dist/esm/encoder/interfaces/messagePackEncoder.mjs +1 -0
- package/dist/esm/encoder/interfaces/messagePackTextEncoder.d.mts +2 -0
- package/dist/esm/encoder/interfaces/messagePackTextEncoder.mjs +1 -0
- package/dist/esm/encoder/textEncoders/defaultTextEncoder.d.mts +2 -0
- package/dist/esm/encoder/textEncoders/defaultTextEncoder.mjs +16 -0
- package/dist/esm/encoder/textEncoders/defaultTextEncoder.mjs.map +1 -0
- package/dist/esm/encoder/textEncoders/index.d.mts +4 -0
- package/dist/esm/encoder/textEncoders/index.mjs +3 -0
- package/dist/esm/encoder/textEncoders/nodeTextEncoder.d.mts +2 -0
- package/dist/esm/encoder/textEncoders/nodeTextEncoder.mjs +10 -0
- package/dist/esm/encoder/textEncoders/nodeTextEncoder.mjs.map +1 -0
- package/dist/esm/encoder/types.d.mts +2 -0
- package/dist/esm/encoder/types.mjs +1 -0
- package/dist/esm/encoder-C5Oo57-h.d.mts +131 -0
- package/dist/esm/encoder-C5Oo57-h.d.mts.map +1 -0
- package/dist/esm/error-BtKEZf6W.d.mts +1204 -0
- package/dist/esm/error-BtKEZf6W.d.mts.map +1 -0
- package/dist/esm/extensions/error/defaultFactories.d.mts +7 -0
- package/dist/esm/extensions/error/defaultFactories.d.mts.map +1 -0
- package/dist/esm/extensions/error/defaultFactories.mjs +17 -0
- package/dist/esm/extensions/error/defaultFactories.mjs.map +1 -0
- package/dist/esm/extensions/error/error.d.mts +2 -0
- package/dist/esm/extensions/error/error.mjs +141 -0
- package/dist/esm/extensions/error/error.mjs.map +1 -0
- package/dist/esm/extensions/error/index.d.mts +4 -0
- package/dist/esm/extensions/error/index.mjs +2 -0
- package/dist/esm/extensions/error/symbols.d.mts +20 -0
- package/dist/esm/extensions/error/symbols.d.mts.map +1 -0
- package/dist/esm/extensions/error/symbols.mjs +21 -0
- package/dist/esm/extensions/error/symbols.mjs.map +1 -0
- package/dist/esm/extensions/error/types.d.mts +2 -0
- package/dist/esm/extensions/error/types.mjs +1 -0
- package/dist/esm/extensions/index.d.mts +7 -0
- package/dist/esm/extensions/index.mjs +4 -0
- package/dist/esm/extensions/interfaces/messagePackBuiltInExtension.d.mts +2 -0
- package/dist/esm/extensions/interfaces/messagePackBuiltInExtension.mjs +1 -0
- package/dist/esm/extensions/interfaces/messagePackExtension.d.mts +2 -0
- package/dist/esm/extensions/interfaces/messagePackExtension.mjs +1 -0
- package/dist/esm/extensions/interfaces/messagePackExtensionBase.d.mts +2 -0
- package/dist/esm/extensions/interfaces/messagePackExtensionBase.mjs +1 -0
- package/dist/esm/extensions/interfaces/types.d.mts +2 -0
- package/dist/esm/extensions/interfaces/types.mjs +1 -0
- package/dist/esm/extensions/serializer/index.d.mts +4 -0
- package/dist/esm/extensions/serializer/index.mjs +2 -0
- package/dist/esm/extensions/serializer/serializer.d.mts +2 -0
- package/dist/esm/extensions/serializer/serializer.mjs +29 -0
- package/dist/esm/extensions/serializer/serializer.mjs.map +1 -0
- package/dist/esm/extensions/serializer/types.d.mts +2 -0
- package/dist/esm/extensions/serializer/types.mjs +1 -0
- package/dist/esm/extensions/timestampDate/index.d.mts +4 -0
- package/dist/esm/extensions/timestampDate/index.mjs +2 -0
- package/dist/esm/extensions/timestampDate/timestampDate.d.mts +2 -0
- package/dist/esm/extensions/timestampDate/timestampDate.mjs +98 -0
- package/dist/esm/extensions/timestampDate/timestampDate.mjs.map +1 -0
- package/dist/esm/extensions/timestampDate/types.d.mts +2 -0
- package/dist/esm/extensions/timestampDate/types.mjs +1 -0
- package/dist/esm/index-5OuLsWCC.d.mts +1 -0
- package/dist/esm/index-B5vbV8Ak.d.mts +1 -0
- package/dist/esm/index-CQnkyOId.d.mts +1 -0
- package/dist/esm/index-CUX405iZ.d.mts +1 -0
- package/dist/esm/index-CaxrMD1A.d.mts +1 -0
- package/dist/esm/index-DMnXy2Rv.d.mts +1 -0
- package/dist/esm/index-DeSJDZGk.d.mts +1 -0
- package/dist/esm/index.d.mts +16 -0
- package/dist/esm/index.mjs +15 -0
- package/dist/esm/interfaces/messagePackBufferWithExtensions.d.mts +2 -0
- package/dist/esm/interfaces/messagePackBufferWithExtensions.mjs +1 -0
- package/dist/esm/messagePackDecoder-96W4gsyQ.d.mts +12 -0
- package/dist/esm/messagePackDecoder-96W4gsyQ.d.mts.map +1 -0
- package/dist/esm/messagePackExtensionBase-w6KYZsVn.d.mts +30 -0
- package/dist/esm/messagePackExtensionBase-w6KYZsVn.d.mts.map +1 -0
- package/dist/esm/messagePackTextDecoder-CfBSOsxU.d.mts +8 -0
- package/dist/esm/messagePackTextDecoder-CfBSOsxU.d.mts.map +1 -0
- package/dist/esm/messagePackTextEncoder-MeyNUt3L.d.mts +16 -0
- package/dist/esm/messagePackTextEncoder-MeyNUt3L.d.mts.map +1 -0
- package/dist/esm/nodeTextDecoder-D95BppeH.d.mts +9 -0
- package/dist/esm/nodeTextDecoder-D95BppeH.d.mts.map +1 -0
- package/dist/esm/nodeTextEncoder-Bv6YQGyH.d.mts +8 -0
- package/dist/esm/nodeTextEncoder-Bv6YQGyH.d.mts.map +1 -0
- package/dist/esm/serializer-Bu3RyF09.d.mts +19 -0
- package/dist/esm/serializer-Bu3RyF09.d.mts.map +1 -0
- package/dist/esm/symbols.d.mts +48 -0
- package/dist/esm/symbols.d.mts.map +1 -0
- package/dist/esm/symbols.mjs +49 -0
- package/dist/esm/symbols.mjs.map +1 -0
- package/dist/esm/types-B9KMW-kD.d.mts +8 -0
- package/dist/esm/types-B9KMW-kD.d.mts.map +1 -0
- package/dist/esm/types-BcIA43h9.d.mts +5 -0
- package/dist/esm/types-BcIA43h9.d.mts.map +1 -0
- package/dist/esm/types-DcVlVqj4.d.mts +21 -0
- package/dist/esm/types-DcVlVqj4.d.mts.map +1 -0
- package/dist/esm/types-LHP7oHpt.d.mts +22 -0
- package/dist/esm/types-LHP7oHpt.d.mts.map +1 -0
- package/dist/esm/types-xD3JER2f.d.mts +7 -0
- package/dist/esm/types-xD3JER2f.d.mts.map +1 -0
- package/dist/esm/types.d.mts +2 -0
- package/dist/esm/types.mjs +1 -0
- package/dist/esm/utils/assertValidExtensionType.d.mts +5 -0
- package/dist/esm/utils/assertValidExtensionType.d.mts.map +1 -0
- package/dist/esm/utils/assertValidExtensionType.mjs +9 -0
- package/dist/esm/utils/assertValidExtensionType.mjs.map +1 -0
- package/dist/esm/utils/fitIn16Bits.d.mts +5 -0
- package/dist/esm/utils/fitIn16Bits.d.mts.map +1 -0
- package/dist/esm/utils/fitIn16Bits.mjs +8 -0
- package/dist/esm/utils/fitIn16Bits.mjs.map +1 -0
- package/dist/esm/utils/fitIn32Bits.d.mts +5 -0
- package/dist/esm/utils/fitIn32Bits.d.mts.map +1 -0
- package/dist/esm/utils/fitIn32Bits.mjs +8 -0
- package/dist/esm/utils/fitIn32Bits.mjs.map +1 -0
- package/dist/esm/utils/fitIn7Bits.d.mts +5 -0
- package/dist/esm/utils/fitIn7Bits.d.mts.map +1 -0
- package/dist/esm/utils/fitIn7Bits.mjs +8 -0
- package/dist/esm/utils/fitIn7Bits.mjs.map +1 -0
- package/dist/esm/utils/fitIn8Bits.d.mts +5 -0
- package/dist/esm/utils/fitIn8Bits.d.mts.map +1 -0
- package/dist/esm/utils/fitIn8Bits.mjs +8 -0
- package/dist/esm/utils/fitIn8Bits.mjs.map +1 -0
- package/package.json +76 -43
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present Pawnary, Inc. and Elvis Muñoz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
# @schema-pack/message-pack
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Incremental
|
|
10
|
+
[MessagePack](https://github.com/msgpack/msgpack/blob/master/spec.md)
|
|
10
11
|
encoder/decoder for TypeScript and JavaScript. It targets full compliance with
|
|
11
12
|
the MessagePack spec and exposes a pluggable extension system for encoding
|
|
12
13
|
custom types.
|
|
@@ -14,137 +15,22 @@ custom types.
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
16
17
|
```bash
|
|
17
|
-
pnpm add @schema-pack/message-pack
|
|
18
|
+
pnpm add @schema-pack/message-pack@next
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
### Quick start
|
|
21
22
|
|
|
22
23
|
```ts
|
|
23
|
-
import {
|
|
24
|
+
import { encode, decode } from '@schema-pack/message-pack';
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
-
const bytes = encoder.encode({ hello: 'world', values: [1, 2, 3] });
|
|
26
|
+
const buffer = encode({ hello: 'world', values: [1, 2, 3] });
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
const value = decoder.decode(bytes);
|
|
28
|
+
const value = decode(buffer);
|
|
30
29
|
// { hello: 'world', values: [1, 2, 3] }
|
|
31
30
|
```
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
JavaScript numbers are IEEE 754 double-precision floats, so they can only
|
|
36
|
-
represent integers safely between `Number.MIN_SAFE_INTEGER` and
|
|
37
|
-
`Number.MAX_SAFE_INTEGER` (±(2^53 - 1)) — exported here as `INT64_MIN` and
|
|
38
|
-
`UINT64_MAX`. MessagePack's native `uint 64` / `int 64` formats, however, cover
|
|
39
|
-
the _full_ 64-bit range.
|
|
40
|
-
|
|
41
|
-
By default, the encoder and decoder read and write these formats as regular JS
|
|
42
|
-
`number`s, which is safe as long as your values stay within that safe integer
|
|
43
|
-
range. If you need the full 64-bit range — or want to work with `bigint`
|
|
44
|
-
directly — register the built-in `BigIntExtension`:
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
import { BigIntExtension, Decoder, Encoder } from '@schema-pack/message-pack';
|
|
48
|
-
|
|
49
|
-
const extension = new BigIntExtension(); // extension type 0-127, defaults to 0
|
|
50
|
-
|
|
51
|
-
const encoder = new Encoder().addExtension(extension);
|
|
52
|
-
const decoder = new Decoder().addExtension(extension);
|
|
53
|
-
|
|
54
|
-
const bytes = encoder.encode(123_456_789_012_345_678_901_234_567_890n);
|
|
55
|
-
decoder.decode(bytes); // 123456789012345678901234567890n
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Values within the safe integer range are still encoded as native MessagePack
|
|
59
|
-
`uint`/`int` formats even with the extension registered — `BigIntExtension` only
|
|
60
|
-
takes over once a `bigint` value falls outside that range.
|
|
61
|
-
|
|
62
|
-
## Built-in extensions
|
|
63
|
-
|
|
64
|
-
- **`BigIntExtension`** — encodes/decodes `bigint` values outside the safe
|
|
65
|
-
integer range, using a variable-length representation of the value's magnitude
|
|
66
|
-
plus sign.
|
|
67
|
-
- **`TimestampDateExtension`** — encodes/decodes JS `Date` objects using the
|
|
68
|
-
standard MessagePack
|
|
69
|
-
[timestamp extension type](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type)
|
|
70
|
-
(`-1`), automatically choosing the 32-bit, 64-bit, or 96-bit format based on
|
|
71
|
-
the date's range and precision. Because it uses the reserved timestamp type,
|
|
72
|
-
register it as an _internal_ extension:
|
|
73
|
-
|
|
74
|
-
```ts
|
|
75
|
-
import {
|
|
76
|
-
Decoder,
|
|
77
|
-
Encoder,
|
|
78
|
-
TimestampDateExtension,
|
|
79
|
-
} from '@schema-pack/message-pack';
|
|
80
|
-
|
|
81
|
-
const extension = new TimestampDateExtension();
|
|
82
|
-
|
|
83
|
-
const encoder = new Encoder().addInternalExtension(extension);
|
|
84
|
-
const decoder = new Decoder().addInternalExtension(extension);
|
|
85
|
-
|
|
86
|
-
const bytes = encoder.encode(new Date());
|
|
87
|
-
decoder.decode(bytes); // Date instance
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Writing your own extensions
|
|
91
|
-
|
|
92
|
-
Implement the `MessagePackExtension<TValue, TBuffer>` interface (or extend the
|
|
93
|
-
abstract `UntypedExtension` helper, which takes care of storing `type`):
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
interface MessagePackExtension<
|
|
97
|
-
TValue = unknown,
|
|
98
|
-
TBuffer extends Uint8Array = Uint8Array,
|
|
99
|
-
> {
|
|
100
|
-
readonly type: number;
|
|
101
|
-
encode(
|
|
102
|
-
value: object | bigint,
|
|
103
|
-
buffer: MessagePackEncoderBuffer<TBuffer>,
|
|
104
|
-
): void;
|
|
105
|
-
decode(decoderBuffer: MessagePackDecoderBuffer, size: number): TValue;
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Then register it on both the encoder and the decoder:
|
|
110
|
-
|
|
111
|
-
- `addExtension(extension)` — custom extension types, in the range `0` to `127`.
|
|
112
|
-
- `addExtensionType(type, extension)` — same as above, with the type passed as a
|
|
113
|
-
separate argument.
|
|
114
|
-
- `addInternalExtension(extension)` — reserved types, in the range `-128` to
|
|
115
|
-
`-1`, used for spec-defined extensions such as timestamps.
|
|
116
|
-
- `fetchExtension(type)` — look up a registered extension by its type.
|
|
117
|
-
|
|
118
|
-
Inside `encode()`, the buffer argument exposes low-level writers (`writeUint8`,
|
|
119
|
-
`writeUint32`, `writeBin`, `ensureCapacity`, `view`, `offset`, etc.) for
|
|
120
|
-
building a custom binary payload — see the `MessagePackEncoderBuffer` interface
|
|
121
|
-
for the full API.
|
|
122
|
-
|
|
123
|
-
## Encoder options
|
|
124
|
-
|
|
125
|
-
| Option | Default | Description |
|
|
126
|
-
| ------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
127
|
-
| `initialBufferSize` | `1024` | Initial size of the encoding buffer; grows automatically as needed. |
|
|
128
|
-
| `newBufferFn` | `(size) => new Uint8Array(size)` | Factory used to allocate new buffers. |
|
|
129
|
-
| `initialSharedBufferSize` | `1024` | Initial size of the shared buffer used when encoding strings, to reduce allocations. |
|
|
130
|
-
| `textEncoder` | `DefaultTextEncoder` | Encoder used to turn strings into bytes. A `NodeTextEncoder` is also provided for faster string encoding on Node. |
|
|
131
|
-
| `sortKeys` | `false` | Sort object keys before encoding, for deterministic output. |
|
|
132
|
-
| `forceFloat32` | `false` | Always encode floating point numbers as `float32` instead of `float64`. This may lose precision for values that don't fit exactly in 32 bits (e.g. `1.2`) — only enable it if you know your floats can round-trip safely. |
|
|
133
|
-
|
|
134
|
-
## Decoder options
|
|
135
|
-
|
|
136
|
-
| Option | Default | Description |
|
|
137
|
-
| ------------------- | -------------------------------- | ------------------------------------------------------------------- |
|
|
138
|
-
| `initialBufferSize` | `1024` | Initial size of the decoding buffer; grows automatically as needed. |
|
|
139
|
-
| `newBufferFn` | `(size) => new Uint8Array(size)` | Factory used to allocate new buffers. |
|
|
140
|
-
|
|
141
|
-
## Error handling
|
|
142
|
-
|
|
143
|
-
The encoder and decoder currently throw plain `Error`s for invalid usage — e.g.
|
|
144
|
-
registering a duplicate or out-of-range extension type, looking up an extension
|
|
145
|
-
that isn't registered, or decoding a malformed timestamp payload. There's no
|
|
146
|
-
dedicated error class hierarchy yet, so catch `Error` and inspect `message` if
|
|
147
|
-
you need to branch on failure.
|
|
32
|
+
For more information, visit the
|
|
33
|
+
[documentation](https://pawnary.github.io/schema-pack/docs/message-pack).
|
|
148
34
|
|
|
149
35
|
## License
|
|
150
36
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { d as TimestampDateExtension, f as MessagePackBuiltInExtension, i as MessagePackExtension, r as MessagePackBufferWithExtensions, s as BigIntExtensionOptions, t as ErrorExtension, u as BufferWithExtensionsOptions } from "./error-B129l__v.cjs";
|
|
2
|
+
//#region src/bufferWithExtensions.d.ts
|
|
3
|
+
type MessagePackExtensionLike<TBuffer extends Uint8Array> = MessagePackExtension<object, TBuffer> | MessagePackBuiltInExtension<object, TBuffer>;
|
|
4
|
+
declare abstract class BufferWithExtensions<TBuffer extends Uint8Array = Uint8Array> implements MessagePackBufferWithExtensions<TBuffer> {
|
|
5
|
+
/**
|
|
6
|
+
* Default extension type for `BigInt` values. This is used when the user does
|
|
7
|
+
* not provide a custom extension type for `BigInt` values.
|
|
8
|
+
*/
|
|
9
|
+
static readonly DEFAULT_BIG_INT_EXTENSION_TYPE = 0;
|
|
10
|
+
/**
|
|
11
|
+
* The extensions map is used to store the registered extensions. The key is
|
|
12
|
+
* the extension type, and the value is the extension instance.
|
|
13
|
+
*/
|
|
14
|
+
protected extensions: Map<number, MessagePackExtension<object, TBuffer>>;
|
|
15
|
+
/**
|
|
16
|
+
* The built-in extensions map is used to store the built-in extensions. The
|
|
17
|
+
* key is the extension type, and the value is the extension instance.
|
|
18
|
+
*/
|
|
19
|
+
protected builtInExtensions: Map<number, MessagePackBuiltInExtension<object, TBuffer>>;
|
|
20
|
+
/**
|
|
21
|
+
* The timestamp date extension is used to encode and decode `Date` values. It
|
|
22
|
+
* is optional and can be disabled by setting the `extensions.timestampDate`
|
|
23
|
+
* option to `false`.
|
|
24
|
+
*/
|
|
25
|
+
readonly timestampDateExtension?: TimestampDateExtension<TBuffer>;
|
|
26
|
+
/**
|
|
27
|
+
* The big integer extension is used to encode and decode `BigInt` values. It
|
|
28
|
+
* is optional and can be disabled by setting the `extensions.bigInt` option
|
|
29
|
+
* to `false`.
|
|
30
|
+
*
|
|
31
|
+
* If enabled, the user can provide a custom extension type for `BigInt`
|
|
32
|
+
* values by setting the `extensions.bigInt.type` option.
|
|
33
|
+
*/
|
|
34
|
+
readonly bigIntExtension?: BigIntExtensionOptions;
|
|
35
|
+
/**
|
|
36
|
+
* The error extension is used to encode and decode `Error` values. It is
|
|
37
|
+
* optional and can be disabled by setting the `extensions.error` option to
|
|
38
|
+
* `false`.
|
|
39
|
+
*
|
|
40
|
+
* If enabled, the user can provide a custom extension for `Error` values by
|
|
41
|
+
* setting the `extensions.error` option to an instance of `ErrorExtension`.
|
|
42
|
+
*/
|
|
43
|
+
readonly errorExtension?: ErrorExtension<TBuffer>;
|
|
44
|
+
constructor(options?: BufferWithExtensionsOptions<TBuffer>);
|
|
45
|
+
getExtensions(): ReadonlyMap<number, MessagePackExtension<object, TBuffer>>;
|
|
46
|
+
addExtension<TValue extends object>(extension: MessagePackExtension<TValue, TBuffer>): this;
|
|
47
|
+
fetchExtension(type: number): MessagePackExtensionLike<TBuffer>;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { BufferWithExtensions as t };
|
|
51
|
+
//# sourceMappingURL=bufferWithExtensions-Cg4LGSIy.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferWithExtensions-Cg4LGSIy.d.cts","names":[],"sources":["../../src/bufferWithExtensions.ts"],"mappings":";;KAYK,yBAAyB,gBAAgB,cAC1C,6BAA6B,WAC7B,oCAAoC;uBAEzB,qBACb,gBAAgB,aAAa,uBAClB,gCAAgC;;;;;kBAK3B;;;;;YAMN,YAAU,YAAA,6BAAA;;;;;YASV,mBAAiB,YAAA,oCAAA;;;;;;WAUlB,yBAAyB,uBAAuB;;;;;;;;;WAUhD,kBAAkB;;;;;;;;;WAUlB,iBAAiB,eAAe;EAEzC,YAAY,UAAU,4BAA4B;EA0ClD,iBAAiB,oBAAoB,6BAA6B;EAIlE,aAAa,uBACX,WAAW,qBAAqB,QAAQ;EAiC1C,eAAe,eAAe,yBAAyB"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const require_extensions_error_error = require("./extensions/error/error.cjs");
|
|
2
|
+
const require_extensions_timestampDate_timestampDate = require("./extensions/timestampDate/timestampDate.cjs");
|
|
3
|
+
const require_utils_assertValidExtensionType = require("./utils/assertValidExtensionType.cjs");
|
|
4
|
+
//#region src/bufferWithExtensions.ts
|
|
5
|
+
var BufferWithExtensions = class BufferWithExtensions {
|
|
6
|
+
/**
|
|
7
|
+
* Default extension type for `BigInt` values. This is used when the user does
|
|
8
|
+
* not provide a custom extension type for `BigInt` values.
|
|
9
|
+
*/
|
|
10
|
+
static DEFAULT_BIG_INT_EXTENSION_TYPE = 0;
|
|
11
|
+
/**
|
|
12
|
+
* The extensions map is used to store the registered extensions. The key is
|
|
13
|
+
* the extension type, and the value is the extension instance.
|
|
14
|
+
*/
|
|
15
|
+
extensions = /* @__PURE__ */ new Map();
|
|
16
|
+
/**
|
|
17
|
+
* The built-in extensions map is used to store the built-in extensions. The
|
|
18
|
+
* key is the extension type, and the value is the extension instance.
|
|
19
|
+
*/
|
|
20
|
+
builtInExtensions = /* @__PURE__ */ new Map();
|
|
21
|
+
/**
|
|
22
|
+
* The timestamp date extension is used to encode and decode `Date` values. It
|
|
23
|
+
* is optional and can be disabled by setting the `extensions.timestampDate`
|
|
24
|
+
* option to `false`.
|
|
25
|
+
*/
|
|
26
|
+
timestampDateExtension = void 0;
|
|
27
|
+
/**
|
|
28
|
+
* The big integer extension is used to encode and decode `BigInt` values. It
|
|
29
|
+
* is optional and can be disabled by setting the `extensions.bigInt` option
|
|
30
|
+
* to `false`.
|
|
31
|
+
*
|
|
32
|
+
* If enabled, the user can provide a custom extension type for `BigInt`
|
|
33
|
+
* values by setting the `extensions.bigInt.type` option.
|
|
34
|
+
*/
|
|
35
|
+
bigIntExtension = void 0;
|
|
36
|
+
/**
|
|
37
|
+
* The error extension is used to encode and decode `Error` values. It is
|
|
38
|
+
* optional and can be disabled by setting the `extensions.error` option to
|
|
39
|
+
* `false`.
|
|
40
|
+
*
|
|
41
|
+
* If enabled, the user can provide a custom extension for `Error` values by
|
|
42
|
+
* setting the `extensions.error` option to an instance of `ErrorExtension`.
|
|
43
|
+
*/
|
|
44
|
+
errorExtension = void 0;
|
|
45
|
+
constructor(options) {
|
|
46
|
+
if (options?.extensions !== false) {
|
|
47
|
+
if (options?.extensions?.bigInt !== false) {
|
|
48
|
+
this.bigIntExtension = options?.extensions?.bigInt ?? { type: BufferWithExtensions.DEFAULT_BIG_INT_EXTENSION_TYPE };
|
|
49
|
+
require_utils_assertValidExtensionType(this.bigIntExtension.type);
|
|
50
|
+
}
|
|
51
|
+
if (options?.extensions?.error !== false) {
|
|
52
|
+
if (options?.extensions?.error instanceof require_extensions_error_error) this.errorExtension = options.extensions.error;
|
|
53
|
+
else this.errorExtension = new require_extensions_error_error(options?.extensions?.error);
|
|
54
|
+
require_utils_assertValidExtensionType(this.errorExtension.type);
|
|
55
|
+
this.builtInExtensions.set(this.errorExtension.type, this.errorExtension);
|
|
56
|
+
}
|
|
57
|
+
if (options?.extensions?.timestampDate !== false) {
|
|
58
|
+
if (options?.extensions?.timestampDate instanceof require_extensions_timestampDate_timestampDate) this.timestampDateExtension = options.extensions.timestampDate;
|
|
59
|
+
else this.timestampDateExtension = new require_extensions_timestampDate_timestampDate();
|
|
60
|
+
this.builtInExtensions.set(require_extensions_timestampDate_timestampDate.DEFAULT_TYPE, this.timestampDateExtension);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
getExtensions() {
|
|
65
|
+
return this.extensions;
|
|
66
|
+
}
|
|
67
|
+
addExtension(extension) {
|
|
68
|
+
if (this.extensions.has(extension.type)) {
|
|
69
|
+
const existent = this.extensions.get(extension.type);
|
|
70
|
+
throw new Error(`Extension with type ${extension.type} already registered for ${existent.constructor.name}`);
|
|
71
|
+
}
|
|
72
|
+
require_utils_assertValidExtensionType(extension.type);
|
|
73
|
+
if (this.builtInExtensions.has(extension.type)) {
|
|
74
|
+
const existent = this.builtInExtensions.get(extension.type);
|
|
75
|
+
throw new Error(`Extension with type ${extension.type} conflicts with built-in extension ${existent.constructor.name}`);
|
|
76
|
+
}
|
|
77
|
+
if (extension.type === this.bigIntExtension?.type) throw new Error(`Extension with type ${extension.type} conflicts with built-in BigInt extension`);
|
|
78
|
+
this.extensions.set(extension.type, extension);
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
fetchExtension(type) {
|
|
82
|
+
let extension = this.builtInExtensions.get(type);
|
|
83
|
+
if (!extension) {
|
|
84
|
+
extension = this.extensions.get(type);
|
|
85
|
+
if (!extension) throw new Error(`Extension with type ${type} not found`);
|
|
86
|
+
}
|
|
87
|
+
return extension;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
module.exports = BufferWithExtensions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/constants.ts
|
|
3
|
+
/**
|
|
4
|
+
* JavaScript numbers are stored as IEEE 754 double precision floating point
|
|
5
|
+
* numbers, which means that they can only safely represent max uint64 as:
|
|
6
|
+
*
|
|
7
|
+
* 2^53 - 1 = 9007199254740991, or Number.MAX_SAFE_INTEGER.
|
|
8
|
+
*
|
|
9
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
|
|
10
|
+
*/
|
|
11
|
+
const UINT64_MAX = Number.MAX_SAFE_INTEGER;
|
|
12
|
+
/**
|
|
13
|
+
* JavaScript numbers are stored as IEEE 754 double precision floating point
|
|
14
|
+
* numbers, which means that they can only safely represent min int64 as:
|
|
15
|
+
*
|
|
16
|
+
* -(2^53 - 1) = -9007199254740991, or Number.MIN_SAFE_INTEGER.
|
|
17
|
+
*
|
|
18
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER
|
|
19
|
+
*/
|
|
20
|
+
const INT64_MIN = Number.MIN_SAFE_INTEGER;
|
|
21
|
+
/** 4294967295. */
|
|
22
|
+
const UINT32_MAX = -1 >>> 0;
|
|
23
|
+
/** -2147483648. */
|
|
24
|
+
const INT32_MIN = -2147483648;
|
|
25
|
+
/**
|
|
26
|
+
* Default allocation size for the encoder and decoder buffers. This is the
|
|
27
|
+
* initial size of the buffer when it is created, and it will grow as needed
|
|
28
|
+
* when more data is written to it.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_ALLOCATION_SIZE = 1024;
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.DEFAULT_ALLOCATION_SIZE = DEFAULT_ALLOCATION_SIZE;
|
|
33
|
+
exports.INT32_MIN = INT32_MIN;
|
|
34
|
+
exports.INT64_MIN = INT64_MIN;
|
|
35
|
+
exports.UINT32_MAX = UINT32_MAX;
|
|
36
|
+
exports.UINT64_MAX = UINT64_MAX;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/constants.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* JavaScript numbers are stored as IEEE 754 double precision floating point
|
|
4
|
+
* numbers, which means that they can only safely represent max uint64 as:
|
|
5
|
+
*
|
|
6
|
+
* 2^53 - 1 = 9007199254740991, or Number.MAX_SAFE_INTEGER.
|
|
7
|
+
*
|
|
8
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
|
|
9
|
+
*/
|
|
10
|
+
declare const UINT64_MAX: number;
|
|
11
|
+
/**
|
|
12
|
+
* JavaScript numbers are stored as IEEE 754 double precision floating point
|
|
13
|
+
* numbers, which means that they can only safely represent min int64 as:
|
|
14
|
+
*
|
|
15
|
+
* -(2^53 - 1) = -9007199254740991, or Number.MIN_SAFE_INTEGER.
|
|
16
|
+
*
|
|
17
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER
|
|
18
|
+
*/
|
|
19
|
+
declare const INT64_MIN: number;
|
|
20
|
+
/** 4294967295. */
|
|
21
|
+
declare const UINT32_MAX: number;
|
|
22
|
+
/** -2147483648. */
|
|
23
|
+
declare const INT32_MIN = -2147483648;
|
|
24
|
+
/**
|
|
25
|
+
* Default allocation size for the encoder and decoder buffers. This is the
|
|
26
|
+
* initial size of the buffer when it is created, and it will grow as needed
|
|
27
|
+
* when more data is written to it.
|
|
28
|
+
*/
|
|
29
|
+
declare const DEFAULT_ALLOCATION_SIZE = 1024;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { DEFAULT_ALLOCATION_SIZE, INT32_MIN, INT64_MIN, UINT32_MAX, UINT64_MAX };
|
|
32
|
+
//# sourceMappingURL=constants.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.cts","names":[],"sources":["../../src/constants.ts"],"mappings":";;;;;;;;;cAQa;;;;;;;;;cAUA;;cAGA;;cAGA;;;;;;cAOA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-BraWmoPw.d.cts","names":[],"sources":["../../src/decoder/decode.ts"],"mappings":";iBAIwB,OAAO,kBAAkB,QAAQ,aAAa"}
|