@schema-pack/message-pack 0.0.0-commit.8d5dca5ce6fa2841d57d39bd48f82979461a0a69 → 0.0.0-commit.a13995b1ec0a9d8be0fcfbdf0d45a0c8a2c75b3c

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.
Files changed (380) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -123
  3. package/dist/cjs/bufferWithExtensions-Cg4LGSIy.d.cts +51 -0
  4. package/dist/cjs/bufferWithExtensions-Cg4LGSIy.d.cts.map +1 -0
  5. package/dist/cjs/bufferWithExtensions.cjs +79 -16
  6. package/dist/cjs/bufferWithExtensions.d.cts +1 -1
  7. package/dist/cjs/decode-BraWmoPw.d.cts +5 -0
  8. package/dist/cjs/decode-BraWmoPw.d.cts.map +1 -0
  9. package/dist/cjs/decoder/decode.cjs +8 -0
  10. package/dist/cjs/decoder/decode.d.cts +2 -0
  11. package/dist/cjs/decoder/decoder.cjs +268 -19
  12. package/dist/cjs/decoder/decoder.d.cts +1 -1
  13. package/dist/cjs/decoder/index.cjs +6 -2
  14. package/dist/cjs/decoder/index.d.cts +7 -5
  15. package/dist/cjs/decoder/interfaces/index.d.cts +4 -4
  16. package/dist/cjs/decoder/interfaces/messagePackDecoder.d.cts +2 -0
  17. package/dist/cjs/decoder/interfaces/messagePackTextDecoder.d.cts +1 -1
  18. package/dist/cjs/decoder/textDecoders/defaultTextDecoder.d.cts +1 -1
  19. package/dist/cjs/decoder/textDecoders/index.cjs +5 -0
  20. package/dist/cjs/decoder/textDecoders/index.d.cts +4 -0
  21. package/dist/cjs/decoder/textDecoders/nodeTextDecoder.cjs +8 -0
  22. package/dist/cjs/decoder/textDecoders/nodeTextDecoder.d.cts +2 -0
  23. package/dist/cjs/decoder/types.d.cts +2 -2
  24. package/dist/cjs/decoder-T6p4ZZJi.d.cts +30 -0
  25. package/dist/cjs/decoder-T6p4ZZJi.d.cts.map +1 -0
  26. package/dist/cjs/defaultNewBufferFn.cjs +1 -3
  27. package/dist/cjs/defaultNewBufferFn.d.cts +2 -1
  28. package/dist/cjs/defaultNewBufferFn.d.cts.map +1 -1
  29. package/dist/cjs/defaultTextDecoder-CyZtJbK1.d.cts +10 -0
  30. package/dist/cjs/defaultTextDecoder-CyZtJbK1.d.cts.map +1 -0
  31. package/dist/{esm/defaultTextEncoder-BkIjtDkg.d.mts → cjs/defaultTextEncoder-BpUrJKD9.d.cts} +2 -2
  32. package/dist/cjs/{defaultTextEncoder-DzdGBX6s.d.cts.map → defaultTextEncoder-BpUrJKD9.d.cts.map} +1 -1
  33. package/dist/cjs/encode-4SxHVw0M.d.cts +5 -0
  34. package/dist/cjs/encode-4SxHVw0M.d.cts.map +1 -0
  35. package/dist/cjs/encoder/encode.cjs +8 -0
  36. package/dist/cjs/encoder/encode.d.cts +2 -0
  37. package/dist/cjs/encoder/encoder.cjs +690 -26
  38. package/dist/cjs/encoder/encoder.d.cts +1 -1
  39. package/dist/cjs/encoder/index.cjs +2 -2
  40. package/dist/cjs/encoder/index.d.cts +7 -7
  41. package/dist/cjs/encoder/interfaces/index.d.cts +4 -4
  42. package/dist/cjs/encoder/interfaces/messagePackEncoder.d.cts +2 -0
  43. package/dist/cjs/encoder/interfaces/messagePackTextEncoder.d.cts +1 -1
  44. package/dist/cjs/encoder/textEncoders/defaultTextEncoder.d.cts +1 -1
  45. package/dist/cjs/encoder/textEncoders/index.d.cts +3 -3
  46. package/dist/cjs/encoder/textEncoders/nodeTextEncoder.d.cts +1 -1
  47. package/dist/cjs/encoder/types.d.cts +2 -2
  48. package/dist/cjs/{encoderBuffer-DWGIXXjj.d.cts → encoder-yQYOtvXU.d.cts} +38 -16
  49. package/dist/cjs/encoder-yQYOtvXU.d.cts.map +1 -0
  50. package/dist/cjs/{messagePackExtension-C_TQXlEn.d.cts → error-B129l__v.d.cts} +306 -52
  51. package/dist/cjs/error-B129l__v.d.cts.map +1 -0
  52. package/dist/cjs/extensions/error/defaultFactories.cjs +15 -0
  53. package/dist/cjs/extensions/error/defaultFactories.d.cts +6 -0
  54. package/dist/cjs/extensions/error/defaultFactories.d.cts.map +1 -0
  55. package/dist/cjs/extensions/error/error.cjs +139 -0
  56. package/dist/cjs/extensions/error/error.d.cts +2 -0
  57. package/dist/cjs/extensions/error/index.cjs +3 -0
  58. package/dist/cjs/extensions/error/index.d.cts +4 -0
  59. package/dist/cjs/extensions/error/symbols.cjs +19 -0
  60. package/dist/cjs/extensions/error/symbols.d.cts +19 -0
  61. package/dist/cjs/extensions/error/symbols.d.cts.map +1 -0
  62. package/dist/cjs/extensions/error/types.d.cts +2 -0
  63. package/dist/cjs/extensions/index.cjs +4 -0
  64. package/dist/cjs/extensions/index.d.cts +6 -3
  65. package/dist/cjs/extensions/interfaces/messagePackBuiltInExtension.d.cts +2 -0
  66. package/dist/cjs/extensions/interfaces/messagePackExtension.d.cts +1 -1
  67. package/dist/cjs/extensions/interfaces/messagePackExtensionBase.cjs +0 -0
  68. package/dist/cjs/extensions/interfaces/messagePackExtensionBase.d.cts +2 -0
  69. package/dist/cjs/extensions/interfaces/types.cjs +0 -0
  70. package/dist/cjs/extensions/interfaces/types.d.cts +2 -0
  71. package/dist/cjs/extensions/serializer/index.cjs +3 -0
  72. package/dist/cjs/extensions/serializer/index.d.cts +4 -0
  73. package/dist/cjs/extensions/serializer/serializer.cjs +27 -0
  74. package/dist/cjs/extensions/serializer/serializer.d.cts +2 -0
  75. package/dist/cjs/extensions/serializer/types.cjs +0 -0
  76. package/dist/cjs/extensions/serializer/types.d.cts +2 -0
  77. package/dist/cjs/extensions/timestampDate/index.d.cts +2 -2
  78. package/dist/cjs/extensions/timestampDate/timestampDate.cjs +41 -24
  79. package/dist/cjs/extensions/timestampDate/timestampDate.d.cts +1 -1
  80. package/dist/cjs/index-B5vbV8Ak.d.cts +1 -0
  81. package/dist/cjs/index.cjs +15 -32
  82. package/dist/cjs/index.d.cts +16 -23
  83. package/dist/cjs/interfaces/messagePackBufferWithExtensions.d.cts +1 -1
  84. package/dist/cjs/messagePackDecoder-BZOBJ2h5.d.cts +12 -0
  85. package/dist/cjs/messagePackDecoder-BZOBJ2h5.d.cts.map +1 -0
  86. package/dist/cjs/messagePackExtensionBase-DVMgQv12.d.cts +30 -0
  87. package/dist/cjs/messagePackExtensionBase-DVMgQv12.d.cts.map +1 -0
  88. package/dist/cjs/messagePackTextDecoder-CfBSOsxU.d.cts +8 -0
  89. package/dist/cjs/messagePackTextDecoder-CfBSOsxU.d.cts.map +1 -0
  90. package/dist/cjs/{messagePackTextEncoder-D7iCft_t.d.cts → messagePackTextEncoder-MeyNUt3L.d.cts} +2 -2
  91. package/dist/cjs/messagePackTextEncoder-MeyNUt3L.d.cts.map +1 -0
  92. package/dist/cjs/nodeTextDecoder-B48jwo-L.d.cts +9 -0
  93. package/dist/cjs/nodeTextDecoder-B48jwo-L.d.cts.map +1 -0
  94. package/dist/{esm/nodeTextEncoder-CegSnA6z.d.mts → cjs/nodeTextEncoder-BpJi8Jx-.d.cts} +3 -3
  95. package/dist/cjs/nodeTextEncoder-BpJi8Jx-.d.cts.map +1 -0
  96. package/dist/cjs/serializer-nJmZCyQ0.d.cts +19 -0
  97. package/dist/cjs/serializer-nJmZCyQ0.d.cts.map +1 -0
  98. package/dist/cjs/types-BLh5F2iA.d.cts +22 -0
  99. package/dist/cjs/types-BLh5F2iA.d.cts.map +1 -0
  100. package/dist/cjs/types-BcIA43h9.d.cts +5 -0
  101. package/dist/cjs/types-BcIA43h9.d.cts.map +1 -0
  102. package/dist/cjs/types-CbicLx9m.d.cts +21 -0
  103. package/dist/cjs/types-CbicLx9m.d.cts.map +1 -0
  104. package/dist/cjs/types-aODRmLZq.d.cts +7 -0
  105. package/dist/cjs/types-aODRmLZq.d.cts.map +1 -0
  106. package/dist/cjs/types.d.cts +2 -2
  107. package/dist/cjs/utils/assertValidExtensionType.cjs +7 -0
  108. package/dist/cjs/utils/assertValidExtensionType.d.cts +4 -0
  109. package/dist/cjs/utils/assertValidExtensionType.d.cts.map +1 -0
  110. package/dist/cjs/utils/fitIn16Bits.d.cts +4 -2
  111. package/dist/cjs/utils/fitIn16Bits.d.cts.map +1 -0
  112. package/dist/cjs/utils/fitIn32Bits.d.cts +4 -2
  113. package/dist/cjs/utils/fitIn32Bits.d.cts.map +1 -0
  114. package/dist/cjs/utils/fitIn7Bits.d.cts +4 -2
  115. package/dist/cjs/utils/fitIn7Bits.d.cts.map +1 -0
  116. package/dist/cjs/utils/fitIn8Bits.d.cts +4 -2
  117. package/dist/cjs/utils/fitIn8Bits.d.cts.map +1 -0
  118. package/dist/esm/bufferWithExtensions-DSU4ekuD.d.mts +51 -0
  119. package/dist/esm/bufferWithExtensions-DSU4ekuD.d.mts.map +1 -0
  120. package/dist/esm/bufferWithExtensions.d.mts +1 -1
  121. package/dist/esm/bufferWithExtensions.mjs +79 -16
  122. package/dist/esm/bufferWithExtensions.mjs.map +1 -1
  123. package/dist/esm/decode-BraWmoPw.d.mts +5 -0
  124. package/dist/esm/decode-BraWmoPw.d.mts.map +1 -0
  125. package/dist/esm/decoder/decode.d.mts +2 -0
  126. package/dist/esm/decoder/decode.mjs +11 -0
  127. package/dist/esm/decoder/decode.mjs.map +1 -0
  128. package/dist/esm/decoder/decoder.d.mts +1 -1
  129. package/dist/esm/decoder/decoder.mjs +268 -19
  130. package/dist/esm/decoder/decoder.mjs.map +1 -1
  131. package/dist/esm/decoder/index.d.mts +7 -5
  132. package/dist/esm/decoder/index.mjs +4 -2
  133. package/dist/esm/decoder/interfaces/index.d.mts +4 -4
  134. package/dist/esm/decoder/interfaces/messagePackDecoder.d.mts +2 -0
  135. package/dist/esm/decoder/interfaces/messagePackTextDecoder.d.mts +1 -1
  136. package/dist/esm/decoder/textDecoders/defaultTextDecoder.d.mts +1 -1
  137. package/dist/esm/decoder/textDecoders/defaultTextDecoder.mjs.map +1 -1
  138. package/dist/esm/decoder/textDecoders/index.d.mts +4 -0
  139. package/dist/esm/decoder/textDecoders/index.mjs +3 -0
  140. package/dist/esm/decoder/textDecoders/nodeTextDecoder.d.mts +2 -0
  141. package/dist/esm/decoder/textDecoders/nodeTextDecoder.mjs +10 -0
  142. package/dist/esm/decoder/textDecoders/nodeTextDecoder.mjs.map +1 -0
  143. package/dist/esm/decoder/types.d.mts +2 -2
  144. package/dist/esm/decoder-Bdqx1C7P.d.mts +30 -0
  145. package/dist/esm/decoder-Bdqx1C7P.d.mts.map +1 -0
  146. package/dist/esm/defaultNewBufferFn.d.mts +2 -1
  147. package/dist/esm/defaultNewBufferFn.d.mts.map +1 -1
  148. package/dist/esm/defaultNewBufferFn.mjs +1 -3
  149. package/dist/esm/defaultNewBufferFn.mjs.map +1 -1
  150. package/dist/esm/defaultTextDecoder-BkW5T2EO.d.mts +10 -0
  151. package/dist/esm/defaultTextDecoder-BkW5T2EO.d.mts.map +1 -0
  152. package/dist/{cjs/defaultTextEncoder-DzdGBX6s.d.cts → esm/defaultTextEncoder-9dqnRXnL.d.mts} +2 -2
  153. package/dist/esm/{defaultTextEncoder-BkIjtDkg.d.mts.map → defaultTextEncoder-9dqnRXnL.d.mts.map} +1 -1
  154. package/dist/esm/encode-4SxHVw0M.d.mts +5 -0
  155. package/dist/esm/encode-4SxHVw0M.d.mts.map +1 -0
  156. package/dist/esm/encoder/encode.d.mts +2 -0
  157. package/dist/esm/encoder/encode.mjs +11 -0
  158. package/dist/esm/encoder/encode.mjs.map +1 -0
  159. package/dist/esm/encoder/encoder.d.mts +1 -1
  160. package/dist/esm/encoder/encoder.mjs +690 -26
  161. package/dist/esm/encoder/encoder.mjs.map +1 -1
  162. package/dist/esm/encoder/index.d.mts +7 -7
  163. package/dist/esm/encoder/index.mjs +2 -2
  164. package/dist/esm/encoder/interfaces/index.d.mts +4 -4
  165. package/dist/esm/encoder/interfaces/messagePackEncoder.d.mts +2 -0
  166. package/dist/esm/encoder/interfaces/messagePackTextEncoder.d.mts +1 -1
  167. package/dist/esm/encoder/textEncoders/defaultTextEncoder.d.mts +1 -1
  168. package/dist/esm/encoder/textEncoders/index.d.mts +3 -3
  169. package/dist/esm/encoder/textEncoders/nodeTextEncoder.d.mts +1 -1
  170. package/dist/esm/encoder/textEncoders/nodeTextEncoder.mjs.map +1 -1
  171. package/dist/esm/encoder/types.d.mts +2 -2
  172. package/dist/esm/{encoderBuffer-DEy8CuWQ.d.mts → encoder-C5Oo57-h.d.mts} +38 -16
  173. package/dist/esm/encoder-C5Oo57-h.d.mts.map +1 -0
  174. package/dist/esm/{messagePackExtension-5TI02KG6.d.mts → error-BtKEZf6W.d.mts} +306 -52
  175. package/dist/esm/error-BtKEZf6W.d.mts.map +1 -0
  176. package/dist/esm/extensions/error/defaultFactories.d.mts +7 -0
  177. package/dist/esm/extensions/error/defaultFactories.d.mts.map +1 -0
  178. package/dist/esm/extensions/error/defaultFactories.mjs +17 -0
  179. package/dist/esm/extensions/error/defaultFactories.mjs.map +1 -0
  180. package/dist/esm/extensions/error/error.d.mts +2 -0
  181. package/dist/esm/extensions/error/error.mjs +141 -0
  182. package/dist/esm/extensions/error/error.mjs.map +1 -0
  183. package/dist/esm/extensions/error/index.d.mts +4 -0
  184. package/dist/esm/extensions/error/index.mjs +2 -0
  185. package/dist/esm/extensions/error/symbols.d.mts +20 -0
  186. package/dist/esm/extensions/error/symbols.d.mts.map +1 -0
  187. package/dist/esm/extensions/error/symbols.mjs +21 -0
  188. package/dist/esm/extensions/error/symbols.mjs.map +1 -0
  189. package/dist/esm/extensions/error/types.d.mts +2 -0
  190. package/dist/esm/extensions/index.d.mts +6 -3
  191. package/dist/esm/extensions/index.mjs +3 -1
  192. package/dist/esm/extensions/interfaces/messagePackBuiltInExtension.d.mts +2 -0
  193. package/dist/esm/extensions/interfaces/messagePackExtension.d.mts +1 -1
  194. package/dist/esm/extensions/interfaces/messagePackExtensionBase.d.mts +2 -0
  195. package/dist/esm/extensions/interfaces/messagePackExtensionBase.mjs +1 -0
  196. package/dist/esm/extensions/interfaces/types.d.mts +2 -0
  197. package/dist/esm/extensions/interfaces/types.mjs +1 -0
  198. package/dist/esm/extensions/serializer/index.d.mts +4 -0
  199. package/dist/esm/extensions/serializer/index.mjs +2 -0
  200. package/dist/esm/extensions/serializer/serializer.d.mts +2 -0
  201. package/dist/esm/extensions/serializer/serializer.mjs +29 -0
  202. package/dist/esm/extensions/serializer/serializer.mjs.map +1 -0
  203. package/dist/esm/extensions/serializer/types.d.mts +2 -0
  204. package/dist/esm/extensions/serializer/types.mjs +1 -0
  205. package/dist/esm/extensions/timestampDate/index.d.mts +2 -2
  206. package/dist/esm/extensions/timestampDate/timestampDate.d.mts +1 -1
  207. package/dist/esm/extensions/timestampDate/timestampDate.mjs +41 -24
  208. package/dist/esm/extensions/timestampDate/timestampDate.mjs.map +1 -1
  209. package/dist/esm/index-B5vbV8Ak.d.mts +1 -0
  210. package/dist/esm/index.d.mts +16 -23
  211. package/dist/esm/index.mjs +10 -17
  212. package/dist/esm/interfaces/messagePackBufferWithExtensions.d.mts +1 -1
  213. package/dist/esm/messagePackDecoder-96W4gsyQ.d.mts +12 -0
  214. package/dist/esm/messagePackDecoder-96W4gsyQ.d.mts.map +1 -0
  215. package/dist/esm/messagePackExtensionBase-w6KYZsVn.d.mts +30 -0
  216. package/dist/esm/messagePackExtensionBase-w6KYZsVn.d.mts.map +1 -0
  217. package/dist/esm/messagePackTextDecoder-CfBSOsxU.d.mts +8 -0
  218. package/dist/esm/messagePackTextDecoder-CfBSOsxU.d.mts.map +1 -0
  219. package/dist/esm/{messagePackTextEncoder-D7iCft_t.d.mts → messagePackTextEncoder-MeyNUt3L.d.mts} +2 -2
  220. package/dist/esm/messagePackTextEncoder-MeyNUt3L.d.mts.map +1 -0
  221. package/dist/esm/nodeTextDecoder-D95BppeH.d.mts +9 -0
  222. package/dist/esm/nodeTextDecoder-D95BppeH.d.mts.map +1 -0
  223. package/dist/{cjs/nodeTextEncoder-DJzFDBXd.d.cts → esm/nodeTextEncoder-Bv6YQGyH.d.mts} +3 -3
  224. package/dist/esm/nodeTextEncoder-Bv6YQGyH.d.mts.map +1 -0
  225. package/dist/esm/serializer-Bu3RyF09.d.mts +19 -0
  226. package/dist/esm/serializer-Bu3RyF09.d.mts.map +1 -0
  227. package/dist/esm/types-BcIA43h9.d.mts +5 -0
  228. package/dist/esm/types-BcIA43h9.d.mts.map +1 -0
  229. package/dist/esm/types-DcVlVqj4.d.mts +21 -0
  230. package/dist/esm/types-DcVlVqj4.d.mts.map +1 -0
  231. package/dist/esm/types-LHP7oHpt.d.mts +22 -0
  232. package/dist/esm/types-LHP7oHpt.d.mts.map +1 -0
  233. package/dist/esm/types-xD3JER2f.d.mts +7 -0
  234. package/dist/esm/types-xD3JER2f.d.mts.map +1 -0
  235. package/dist/esm/types.d.mts +2 -2
  236. package/dist/esm/utils/assertValidExtensionType.d.mts +5 -0
  237. package/dist/esm/utils/assertValidExtensionType.d.mts.map +1 -0
  238. package/dist/esm/utils/assertValidExtensionType.mjs +9 -0
  239. package/dist/esm/utils/assertValidExtensionType.mjs.map +1 -0
  240. package/dist/esm/utils/fitIn16Bits.d.mts +5 -2
  241. package/dist/esm/utils/fitIn16Bits.d.mts.map +1 -0
  242. package/dist/esm/utils/fitIn32Bits.d.mts +5 -2
  243. package/dist/esm/utils/fitIn32Bits.d.mts.map +1 -0
  244. package/dist/esm/utils/fitIn7Bits.d.mts +5 -2
  245. package/dist/esm/utils/fitIn7Bits.d.mts.map +1 -0
  246. package/dist/esm/utils/fitIn8Bits.d.mts +5 -2
  247. package/dist/esm/utils/fitIn8Bits.d.mts.map +1 -0
  248. package/package.json +68 -43
  249. package/dist/cjs/benchmark/decoderDataTypesFactory.cjs +0 -37
  250. package/dist/cjs/benchmark/decoderDataTypesFactory.d.cts +0 -5
  251. package/dist/cjs/benchmark/decoderDataTypesFactory.d.cts.map +0 -1
  252. package/dist/cjs/bigInt-CBB8PGpe.d.cts +0 -35
  253. package/dist/cjs/bigInt-CBB8PGpe.d.cts.map +0 -1
  254. package/dist/cjs/bufferWithExtensions-BAinwJsn.d.cts +0 -12
  255. package/dist/cjs/bufferWithExtensions-BAinwJsn.d.cts.map +0 -1
  256. package/dist/cjs/decoder/decoderBuffer.cjs +0 -239
  257. package/dist/cjs/decoder/decoderBuffer.d.cts +0 -2
  258. package/dist/cjs/decoder/interfaces/messagePackDecoderBuffer.d.cts +0 -2
  259. package/dist/cjs/decoder-C1cd4I8S.d.cts +0 -15
  260. package/dist/cjs/decoder-C1cd4I8S.d.cts.map +0 -1
  261. package/dist/cjs/decoderBuffer-C9_0y-3q.d.cts +0 -22
  262. package/dist/cjs/decoderBuffer-C9_0y-3q.d.cts.map +0 -1
  263. package/dist/cjs/defaultTextDecoder-Ji2hTZkf.d.cts +0 -10
  264. package/dist/cjs/defaultTextDecoder-Ji2hTZkf.d.cts.map +0 -1
  265. package/dist/cjs/encoder/encoderBuffer.cjs +0 -602
  266. package/dist/cjs/encoder/encoderBuffer.d.cts +0 -2
  267. package/dist/cjs/encoder/interfaces/messagePackEncoderBuffer.d.cts +0 -2
  268. package/dist/cjs/encoder-DXuhGwd7.d.cts +0 -23
  269. package/dist/cjs/encoder-DXuhGwd7.d.cts.map +0 -1
  270. package/dist/cjs/encoderBuffer-DWGIXXjj.d.cts.map +0 -1
  271. package/dist/cjs/extensions/bigint/bigInt.cjs +0 -54
  272. package/dist/cjs/extensions/bigint/bigInt.d.cts +0 -2
  273. package/dist/cjs/extensions/bigint/index.cjs +0 -2
  274. package/dist/cjs/extensions/bigint/index.d.cts +0 -3
  275. package/dist/cjs/extensions/interfaces/index.d.cts +0 -3
  276. package/dist/cjs/fitIn16Bits-D9lga-sP.d.cts +0 -5
  277. package/dist/cjs/fitIn16Bits-D9lga-sP.d.cts.map +0 -1
  278. package/dist/cjs/fitIn32Bits-BrGIMOff.d.cts +0 -5
  279. package/dist/cjs/fitIn32Bits-BrGIMOff.d.cts.map +0 -1
  280. package/dist/cjs/fitIn7Bits-BVHyKXCg.d.cts +0 -5
  281. package/dist/cjs/fitIn7Bits-BVHyKXCg.d.cts.map +0 -1
  282. package/dist/cjs/fitIn8Bits-DQnQIhdh.d.cts +0 -5
  283. package/dist/cjs/fitIn8Bits-DQnQIhdh.d.cts.map +0 -1
  284. package/dist/cjs/fitInt64Bits-CY7lVKne.d.cts +0 -5
  285. package/dist/cjs/fitInt64Bits-CY7lVKne.d.cts.map +0 -1
  286. package/dist/cjs/interfaces/index.d.cts +0 -2
  287. package/dist/cjs/messagePackDecoderBuffer-CMG0LPbJ.d.cts +0 -12
  288. package/dist/cjs/messagePackDecoderBuffer-CMG0LPbJ.d.cts.map +0 -1
  289. package/dist/cjs/messagePackExtension-C_TQXlEn.d.cts.map +0 -1
  290. package/dist/cjs/messagePackTextDecoder-CtyB0N6j.d.cts +0 -7
  291. package/dist/cjs/messagePackTextDecoder-CtyB0N6j.d.cts.map +0 -1
  292. package/dist/cjs/messagePackTextEncoder-D7iCft_t.d.cts.map +0 -1
  293. package/dist/cjs/nodeTextEncoder-DJzFDBXd.d.cts.map +0 -1
  294. package/dist/cjs/timestampDate-BtBd4bAx.d.cts +0 -33
  295. package/dist/cjs/timestampDate-BtBd4bAx.d.cts.map +0 -1
  296. package/dist/cjs/types-BJie2edF.d.cts +0 -20
  297. package/dist/cjs/types-BJie2edF.d.cts.map +0 -1
  298. package/dist/cjs/types-DHnp4kMw.d.cts +0 -6
  299. package/dist/cjs/types-DHnp4kMw.d.cts.map +0 -1
  300. package/dist/cjs/untypedExtension-WQvArYoO.d.cts +0 -16
  301. package/dist/cjs/untypedExtension-WQvArYoO.d.cts.map +0 -1
  302. package/dist/cjs/untypedExtension.cjs +0 -13
  303. package/dist/cjs/untypedExtension.d.cts +0 -2
  304. package/dist/cjs/utils/fitInt64Bits.cjs +0 -6
  305. package/dist/cjs/utils/fitInt64Bits.d.cts +0 -2
  306. package/dist/cjs/utils/index.cjs +0 -11
  307. package/dist/cjs/utils/index.d.cts +0 -6
  308. package/dist/esm/benchmark/decoderDataTypesFactory.d.mts +0 -6
  309. package/dist/esm/benchmark/decoderDataTypesFactory.d.mts.map +0 -1
  310. package/dist/esm/benchmark/decoderDataTypesFactory.mjs +0 -39
  311. package/dist/esm/benchmark/decoderDataTypesFactory.mjs.map +0 -1
  312. package/dist/esm/bigInt-BvNVHUwj.d.mts +0 -35
  313. package/dist/esm/bigInt-BvNVHUwj.d.mts.map +0 -1
  314. package/dist/esm/bufferWithExtensions-Bikyeyt1.d.mts +0 -12
  315. package/dist/esm/bufferWithExtensions-Bikyeyt1.d.mts.map +0 -1
  316. package/dist/esm/decoder/decoderBuffer.d.mts +0 -2
  317. package/dist/esm/decoder/decoderBuffer.mjs +0 -241
  318. package/dist/esm/decoder/decoderBuffer.mjs.map +0 -1
  319. package/dist/esm/decoder/interfaces/messagePackDecoderBuffer.d.mts +0 -2
  320. package/dist/esm/decoder-DEzsJjYj.d.mts +0 -15
  321. package/dist/esm/decoder-DEzsJjYj.d.mts.map +0 -1
  322. package/dist/esm/decoderBuffer-BxJJdy5k.d.mts +0 -22
  323. package/dist/esm/decoderBuffer-BxJJdy5k.d.mts.map +0 -1
  324. package/dist/esm/defaultTextDecoder-B6a1HH2u.d.mts +0 -10
  325. package/dist/esm/defaultTextDecoder-B6a1HH2u.d.mts.map +0 -1
  326. package/dist/esm/encoder/encoderBuffer.d.mts +0 -2
  327. package/dist/esm/encoder/encoderBuffer.mjs +0 -604
  328. package/dist/esm/encoder/encoderBuffer.mjs.map +0 -1
  329. package/dist/esm/encoder/interfaces/messagePackEncoderBuffer.d.mts +0 -2
  330. package/dist/esm/encoder-CQfcjnAe.d.mts +0 -23
  331. package/dist/esm/encoder-CQfcjnAe.d.mts.map +0 -1
  332. package/dist/esm/encoderBuffer-DEy8CuWQ.d.mts.map +0 -1
  333. package/dist/esm/extensions/bigint/bigInt.d.mts +0 -2
  334. package/dist/esm/extensions/bigint/bigInt.mjs +0 -56
  335. package/dist/esm/extensions/bigint/bigInt.mjs.map +0 -1
  336. package/dist/esm/extensions/bigint/index.d.mts +0 -3
  337. package/dist/esm/extensions/bigint/index.mjs +0 -2
  338. package/dist/esm/extensions/interfaces/index.d.mts +0 -3
  339. package/dist/esm/fitIn16Bits-D9lga-sP.d.mts +0 -5
  340. package/dist/esm/fitIn16Bits-D9lga-sP.d.mts.map +0 -1
  341. package/dist/esm/fitIn32Bits-BrGIMOff.d.mts +0 -5
  342. package/dist/esm/fitIn32Bits-BrGIMOff.d.mts.map +0 -1
  343. package/dist/esm/fitIn7Bits-BVHyKXCg.d.mts +0 -5
  344. package/dist/esm/fitIn7Bits-BVHyKXCg.d.mts.map +0 -1
  345. package/dist/esm/fitIn8Bits-DQnQIhdh.d.mts +0 -5
  346. package/dist/esm/fitIn8Bits-DQnQIhdh.d.mts.map +0 -1
  347. package/dist/esm/fitInt64Bits-CY7lVKne.d.mts +0 -5
  348. package/dist/esm/fitInt64Bits-CY7lVKne.d.mts.map +0 -1
  349. package/dist/esm/interfaces/index.d.mts +0 -2
  350. package/dist/esm/messagePackDecoderBuffer-CGyYSweZ.d.mts +0 -12
  351. package/dist/esm/messagePackDecoderBuffer-CGyYSweZ.d.mts.map +0 -1
  352. package/dist/esm/messagePackExtension-5TI02KG6.d.mts.map +0 -1
  353. package/dist/esm/messagePackTextDecoder-CtyB0N6j.d.mts +0 -7
  354. package/dist/esm/messagePackTextDecoder-CtyB0N6j.d.mts.map +0 -1
  355. package/dist/esm/messagePackTextEncoder-D7iCft_t.d.mts.map +0 -1
  356. package/dist/esm/nodeTextEncoder-CegSnA6z.d.mts.map +0 -1
  357. package/dist/esm/timestampDate-C1UzHhZL.d.mts +0 -33
  358. package/dist/esm/timestampDate-C1UzHhZL.d.mts.map +0 -1
  359. package/dist/esm/types-BJie2edF.d.mts +0 -20
  360. package/dist/esm/types-BJie2edF.d.mts.map +0 -1
  361. package/dist/esm/types-DoBZbRkk.d.mts +0 -6
  362. package/dist/esm/types-DoBZbRkk.d.mts.map +0 -1
  363. package/dist/esm/untypedExtension-6bNMj-lY.d.mts +0 -16
  364. package/dist/esm/untypedExtension-6bNMj-lY.d.mts.map +0 -1
  365. package/dist/esm/untypedExtension.d.mts +0 -2
  366. package/dist/esm/untypedExtension.mjs +0 -15
  367. package/dist/esm/untypedExtension.mjs.map +0 -1
  368. package/dist/esm/utils/fitInt64Bits.d.mts +0 -2
  369. package/dist/esm/utils/fitInt64Bits.mjs +0 -8
  370. package/dist/esm/utils/fitInt64Bits.mjs.map +0 -1
  371. package/dist/esm/utils/index.d.mts +0 -6
  372. package/dist/esm/utils/index.mjs +0 -6
  373. /package/dist/cjs/decoder/interfaces/{messagePackDecoderBuffer.cjs → messagePackDecoder.cjs} +0 -0
  374. /package/dist/cjs/encoder/interfaces/{messagePackEncoderBuffer.cjs → messagePackEncoder.cjs} +0 -0
  375. /package/dist/cjs/extensions/{interfaces/index.cjs → error/types.cjs} +0 -0
  376. /package/dist/cjs/{interfaces/index.cjs → extensions/interfaces/messagePackBuiltInExtension.cjs} +0 -0
  377. /package/dist/esm/decoder/interfaces/{messagePackDecoderBuffer.mjs → messagePackDecoder.mjs} +0 -0
  378. /package/dist/esm/encoder/interfaces/{messagePackEncoderBuffer.mjs → messagePackEncoder.mjs} +0 -0
  379. /package/dist/esm/extensions/{interfaces/index.mjs → error/types.mjs} +0 -0
  380. /package/dist/esm/{interfaces/index.mjs → extensions/interfaces/messagePackBuiltInExtension.mjs} +0 -0
@@ -9,8 +9,8 @@ interface MessagePackTextEncoder<TBuffer extends Uint8Array = Uint8Array> {
9
9
  *
10
10
  * @returns The number of bytes written to the buffer.
11
11
  */
12
- writeBytes(source: string, buffer: TBuffer): number;
12
+ writeBytes: (source: string, buffer: TBuffer) => number;
13
13
  }
14
14
  //#endregion
15
15
  export { MessagePackTextEncoder as t };
16
- //# sourceMappingURL=messagePackTextEncoder-D7iCft_t.d.cts.map
16
+ //# sourceMappingURL=messagePackTextEncoder-MeyNUt3L.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messagePackTextEncoder-MeyNUt3L.d.cts","names":[],"sources":["../../src/encoder/interfaces/messagePackTextEncoder.ts"],"mappings":";;UACyB,uBACvB,gBAAgB,aAAa;;;;;;;;;EAe7B,aAAa,gBAAgB,QAAQ"}
@@ -0,0 +1,9 @@
1
+ import { t as MessagePackTextDecoder } from "./messagePackTextDecoder-CfBSOsxU.cjs";
2
+ import { Buffer } from "node:buffer";
3
+ //#region src/decoder/textDecoders/nodeTextDecoder.d.ts
4
+ declare class NodeTextDecoder implements MessagePackTextDecoder<Buffer> {
5
+ decode(buffer: Buffer, start: number, end: number): string;
6
+ }
7
+ //#endregion
8
+ export { NodeTextDecoder as t };
9
+ //# sourceMappingURL=nodeTextDecoder-B48jwo-L.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeTextDecoder-B48jwo-L.d.cts","names":[],"sources":["../../src/decoder/textDecoders/nodeTextDecoder.ts"],"mappings":";;;cAIM,2BAA2B,uBAAuB;EACtD,OAAO,QAAQ,QAAQ,eAAe"}
@@ -1,8 +1,8 @@
1
- import { t as MessagePackTextEncoder } from "./messagePackTextEncoder-D7iCft_t.mjs";
1
+ import { t as MessagePackTextEncoder } from "./messagePackTextEncoder-MeyNUt3L.cjs";
2
2
  //#region src/encoder/textEncoders/nodeTextEncoder.d.ts
3
- declare class NodeTextEncoder implements MessagePackTextEncoder {
3
+ declare class NodeTextEncoder implements MessagePackTextEncoder<Buffer> {
4
4
  writeBytes(value: string, buffer: Buffer): number;
5
5
  }
6
6
  //#endregion
7
7
  export { NodeTextEncoder as t };
8
- //# sourceMappingURL=nodeTextEncoder-CegSnA6z.d.mts.map
8
+ //# sourceMappingURL=nodeTextEncoder-BpJi8Jx-.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeTextEncoder-BpJi8Jx-.d.cts","names":[],"sources":["../../src/encoder/textEncoders/nodeTextEncoder.ts"],"mappings":";;cAEM,2BAA2B,uBAAuB;EACtD,WAAW,eAAe,QAAQ"}
@@ -0,0 +1,19 @@
1
+ import { t as MessagePackDecoder } from "./messagePackDecoder-BZOBJ2h5.cjs";
2
+ import { t as Constructor } from "./types-BcIA43h9.cjs";
3
+ import { t as MessagePackExtensionBase } from "./messagePackExtensionBase-DVMgQv12.cjs";
4
+ import { n as SerializerExtensionFactory, t as SerializerExtensionFactories } from "./types-aODRmLZq.cjs";
5
+ //#region src/extensions/serializer/serializer.d.ts
6
+ declare abstract class SerializerExtension<TValue extends object, TInput, TFactory extends SerializerExtensionFactory<TValue, TInput>, TBuffer extends Uint8Array = Uint8Array> implements MessagePackExtensionBase<TValue, TBuffer> {
7
+ abstract readonly type: number;
8
+ readonly constructors: Constructor<TValue>[];
9
+ readonly factories: Map<Constructor<TValue>, TFactory>;
10
+ protected readonly factoriesByConstructorName: Map<string, TFactory>;
11
+ constructor(factories: SerializerExtensionFactories<TValue, TInput, TFactory>);
12
+ protected registerFactory(construct: Constructor<TValue>, factory: TFactory): void;
13
+ fetchFactoryByConstructor(constructor: Constructor<TValue>): TFactory;
14
+ fetchFactoryByConstructorName(constructorName: string): TFactory;
15
+ abstract decode(decoder: MessagePackDecoder<TBuffer>, size: number): TValue;
16
+ }
17
+ //#endregion
18
+ export { SerializerExtension as t };
19
+ //# sourceMappingURL=serializer-nJmZCyQ0.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer-nJmZCyQ0.d.cts","names":[],"sources":["../../src/extensions/serializer/serializer.ts"],"mappings":";;;;;uBAQe,oBACb,uBACA,QACA,iBAAiB,2BAA2B,QAAQ,SACpD,gBAAgB,aAAa,uBAClB,yBAAyB,QAAQ;oBAC1B;WACT,cAAc,YAAY;WAE1B,WAAS,IAAA,YAAA,SAAA;qBAEC,4BAA0B,YAAA;EAE7C,YACE,WAAW,6BAA6B,QAAQ,QAAQ;YAOhD,gBACR,WAAW,YAAY,SACvB,SAAS;EAgBX,0BAA0B,aAAa,YAAY,UAAU;EAY7D,8BAA8B,0BAA0B;WAY/C,OAAO,SAAS,mBAAmB,UAAU,eAAe"}
@@ -0,0 +1,22 @@
1
+ import { n as SerializerExtensionFactory, t as SerializerExtensionFactories } from "./types-aODRmLZq.cjs";
2
+ //#region src/extensions/error/types.d.ts
3
+ type ErrorExtensionFactories = SerializerExtensionFactories<Error, ErrorExtensionFactoryInput, ErrorExtensionFactory>;
4
+ interface ErrorExtensionFactoryInput {
5
+ message: string;
6
+ options?: globalThis.ErrorOptions;
7
+ errors?: globalThis.Error[];
8
+ properties: Record<string, unknown>;
9
+ }
10
+ type ErrorExtensionFactory = SerializerExtensionFactory<Error, ErrorExtensionFactoryInput>;
11
+ interface ErrorExtensionOptions {
12
+ /**
13
+ * The type identifier used for the error extension.
14
+ *
15
+ * @default 1
16
+ */
17
+ type?: number;
18
+ factories?: ErrorExtensionFactories;
19
+ }
20
+ //#endregion
21
+ export { ErrorExtensionFactoryInput as n, ErrorExtensionOptions as r, ErrorExtensionFactory as t };
22
+ //# sourceMappingURL=types-BLh5F2iA.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BLh5F2iA.d.cts","names":[],"sources":["../../src/extensions/error/types.ts"],"mappings":";;KAKK,0BAA0B,6BAC7B,OACA,4BACA;UAGe;EACf;EACA,UAAU,WAAW;EACrB,SAAS,WAAW;EACpB,YAAY;;KAGF,wBAAwB,2BAClC,OACA;UAGe;;;;;;EAMf;EAEA,YAAY"}
@@ -0,0 +1,5 @@
1
+ //#region src/extensions/interfaces/types.d.ts
2
+ type Constructor<TValue> = abstract new (...args: any[]) => TValue;
3
+ //#endregion
4
+ export { Constructor as t };
5
+ //# sourceMappingURL=types-BcIA43h9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BcIA43h9.d.cts","names":[],"sources":["../../src/extensions/interfaces/types.ts"],"mappings":";KAAY,YAAY,2BAEnB,gBACA"}
@@ -0,0 +1,21 @@
1
+ import { t as MessagePackTextDecoder } from "./messagePackTextDecoder-CfBSOsxU.cjs";
2
+ import { l as BufferOptions } from "./error-B129l__v.cjs";
3
+ //#region src/decoder/types.d.ts
4
+ type DecoderOptions<TBuffer extends Uint8Array = Uint8Array> = Omit<BufferOptions<TBuffer>, 'initialBufferSize'> & {
5
+ /**
6
+ * The TextDecoder instance used for decoding strings.
7
+ *
8
+ * @default DefaultTextDecoder
9
+ */
10
+ textDecoder?: MessagePackTextDecoder<TBuffer>;
11
+ /**
12
+ * Whether to copy buffers when decoding binary data instead of returning
13
+ * subarrays.
14
+ *
15
+ * @default false
16
+ */
17
+ copyBuffers?: boolean;
18
+ };
19
+ //#endregion
20
+ export { DecoderOptions as t };
21
+ //# sourceMappingURL=types-CbicLx9m.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CbicLx9m.d.cts","names":[],"sources":["../../src/decoder/types.ts"],"mappings":";;;KAGY,eAAe,gBAAgB,aAAa,cAAc,KACpE,cAAc;;;;;;EAQd,cAAc,uBAAuB;;;;;;;EAOrC"}
@@ -0,0 +1,7 @@
1
+ import { t as Constructor } from "./types-BcIA43h9.cjs";
2
+ //#region src/extensions/serializer/types.d.ts
3
+ type SerializerExtensionFactory<TValue extends object, TInput> = (input: TInput) => InstanceType<Constructor<TValue>>;
4
+ type SerializerExtensionFactories<TValue extends object, TInput, TFactory extends SerializerExtensionFactory<TValue, TInput>> = [Constructor<TValue>, TFactory][];
5
+ //#endregion
6
+ export { SerializerExtensionFactory as n, SerializerExtensionFactories as t };
7
+ //# sourceMappingURL=types-aODRmLZq.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-aODRmLZq.d.cts","names":[],"sources":["../../src/extensions/serializer/types.ts"],"mappings":";;KAEY,2BAA2B,uBAAuB,WAC5D,OAAO,WACJ,aAAa,YAAY;KAElB,6BACV,uBACA,QACA,iBAAiB,2BAA2B,QAAQ,YACjD,YAAY,SAAS"}
@@ -1,2 +1,2 @@
1
- import { n as NewBufferFn, t as BufferOptions } from "./types-BJie2edF.cjs";
2
- export { BufferOptions, NewBufferFn };
1
+ import { c as BufferFactory, l as BufferOptions, s as BigIntExtensionOptions, u as BufferWithExtensionsOptions } from "./error-B129l__v.cjs";
2
+ export { BigIntExtensionOptions, BufferFactory, BufferOptions, BufferWithExtensionsOptions };
@@ -0,0 +1,7 @@
1
+ //#region src/utils/assertValidExtensionType.ts
2
+ function assertValidExtensionType(type) {
3
+ if (!Number.isInteger(type)) throw new TypeError(`Extension type must be an integer, got ${type}`);
4
+ if (type < -128 || type > 127) throw new Error(`Extension type must be in the range -128 to 127, got ${type}`);
5
+ }
6
+ //#endregion
7
+ module.exports = assertValidExtensionType;
@@ -0,0 +1,4 @@
1
+ //#region src/utils/assertValidExtensionType.d.ts
2
+ declare function assertValidExtensionType(type: number): void;
3
+ export = assertValidExtensionType;
4
+ //# sourceMappingURL=assertValidExtensionType.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertValidExtensionType.d.cts","names":[],"sources":["../../../src/utils/assertValidExtensionType.ts"],"mappings":";iBAAwB,yBAAyB"}
@@ -1,2 +1,4 @@
1
- import { t as fitIn16Bits } from "../fitIn16Bits-D9lga-sP.cjs";
2
- export = fitIn16Bits;
1
+ //#region src/utils/fitIn16Bits.d.ts
2
+ declare function fitIn16Bits(length: number): boolean;
3
+ export = fitIn16Bits;
4
+ //# sourceMappingURL=fitIn16Bits.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitIn16Bits.d.cts","names":[],"sources":["../../../src/utils/fitIn16Bits.ts"],"mappings":";iBAAwB,YAAY"}
@@ -1,2 +1,4 @@
1
- import { t as fitIn32Bits } from "../fitIn32Bits-BrGIMOff.cjs";
2
- export = fitIn32Bits;
1
+ //#region src/utils/fitIn32Bits.d.ts
2
+ declare function fitIn32Bits(length: number): boolean;
3
+ export = fitIn32Bits;
4
+ //# sourceMappingURL=fitIn32Bits.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitIn32Bits.d.cts","names":[],"sources":["../../../src/utils/fitIn32Bits.ts"],"mappings":";iBAAwB,YAAY"}
@@ -1,2 +1,4 @@
1
- import { t as fitIn7Bits } from "../fitIn7Bits-BVHyKXCg.cjs";
2
- export = fitIn7Bits;
1
+ //#region src/utils/fitIn7Bits.d.ts
2
+ declare function fitIn7Bits(length: number): boolean;
3
+ export = fitIn7Bits;
4
+ //# sourceMappingURL=fitIn7Bits.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitIn7Bits.d.cts","names":[],"sources":["../../../src/utils/fitIn7Bits.ts"],"mappings":";iBAAwB,WAAW"}
@@ -1,2 +1,4 @@
1
- import { t as fitIn8Bits } from "../fitIn8Bits-DQnQIhdh.cjs";
2
- export = fitIn8Bits;
1
+ //#region src/utils/fitIn8Bits.d.ts
2
+ declare function fitIn8Bits(length: number): boolean;
3
+ export = fitIn8Bits;
4
+ //# sourceMappingURL=fitIn8Bits.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitIn8Bits.d.cts","names":[],"sources":["../../../src/utils/fitIn8Bits.ts"],"mappings":";iBAAwB,WAAW"}
@@ -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-BtKEZf6W.mjs";
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-DSU4ekuD.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferWithExtensions-DSU4ekuD.d.mts","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"}
@@ -1,2 +1,2 @@
1
- import { t as BufferWithExtensions } from "./bufferWithExtensions-Bikyeyt1.mjs";
1
+ import { t as BufferWithExtensions } from "./bufferWithExtensions-DSU4ekuD.mjs";
2
2
  export { BufferWithExtensions as default };
@@ -1,26 +1,89 @@
1
+ import ErrorExtension from "./extensions/error/error.mjs";
2
+ import TimestampDateExtension from "./extensions/timestampDate/timestampDate.mjs";
3
+ import assertValidExtensionType from "./utils/assertValidExtensionType.mjs";
1
4
  //#region src/bufferWithExtensions.ts
2
- var BufferWithExtensions = class {
3
- extensions;
4
- constructor() {
5
- this.extensions = /* @__PURE__ */ new Map();
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
+ assertValidExtensionType(this.bigIntExtension.type);
50
+ }
51
+ if (options?.extensions?.error !== false) {
52
+ if (options?.extensions?.error instanceof ErrorExtension) this.errorExtension = options.extensions.error;
53
+ else this.errorExtension = new ErrorExtension(options?.extensions?.error);
54
+ 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 TimestampDateExtension) this.timestampDateExtension = options.extensions.timestampDate;
59
+ else this.timestampDateExtension = new TimestampDateExtension();
60
+ this.builtInExtensions.set(TimestampDateExtension.DEFAULT_TYPE, this.timestampDateExtension);
61
+ }
62
+ }
6
63
  }
7
- addExtension(extension) {
8
- if (this.extensions.has(extension.type)) throw new Error(`Extension with type ${extension.type} already exists`);
9
- if (extension.type < 0) throw new Error(`Extension type must be a non-negative integer, got ${extension.type}. Extensions between -128 and -1 are reserved for internal use. Use addInternalExtension() to register an internal extension.`);
10
- if (extension.type > 127) throw new Error(`Extension type must be in the range 0 to 127, got ${extension.type}`);
11
- this.extensions.set(extension.type, extension);
12
- return this;
64
+ getExtensions() {
65
+ return this.extensions;
13
66
  }
14
- addInternalExtension(extension) {
15
- if (this.extensions.has(extension.type)) throw new Error(`Extension with type ${extension.type} already exists`);
16
- if (extension.type >= 0) throw new Error(`Internal extension type must be a negative integer, got ${extension.type}. Use addExtension() to register a custom extension.`);
17
- if (extension.type < -128) throw new Error(`Internal extension type must be in the range -128 to -1, got ${extension.type}`);
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
+ 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`);
18
78
  this.extensions.set(extension.type, extension);
19
79
  return this;
20
80
  }
21
81
  fetchExtension(type) {
22
- const extension = this.extensions.get(type);
23
- if (!extension) throw new Error(`Extension with type ${type} not found`);
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
+ }
24
87
  return extension;
25
88
  }
26
89
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bufferWithExtensions.mjs","names":[],"sources":["../../src/bufferWithExtensions.ts"],"sourcesContent":["import type MessagePackExtension from './extensions/interfaces/messagePackExtension.ts';\nimport type MessagePackBufferWithExtensions from './interfaces/messagePackBufferWithExtensions.ts';\n\nabstract class BufferWithExtensions<\n TBuffer extends Uint8Array = Uint8Array,\n> implements MessagePackBufferWithExtensions<TBuffer> {\n protected extensions: Map<number, MessagePackExtension<unknown, TBuffer>>;\n\n constructor() {\n this.extensions = new Map();\n }\n\n addExtension(extension: MessagePackExtension<unknown, TBuffer>): this {\n if (this.extensions.has(extension.type)) {\n throw new Error(`Extension with type ${extension.type} already exists`);\n }\n\n if (extension.type < 0) {\n throw new Error(\n `Extension type must be a non-negative integer, got ${extension.type}. Extensions between -128 and -1 are reserved for internal use. Use addInternalExtension() to register an internal extension.`,\n );\n }\n\n if (extension.type > 127) {\n throw new Error(\n `Extension type must be in the range 0 to 127, got ${extension.type}`,\n );\n }\n\n this.extensions.set(extension.type, extension);\n\n return this;\n }\n\n addInternalExtension(\n extension: MessagePackExtension<unknown, TBuffer>,\n ): this {\n if (this.extensions.has(extension.type)) {\n throw new Error(`Extension with type ${extension.type} already exists`);\n }\n\n if (extension.type >= 0) {\n throw new Error(\n `Internal extension type must be a negative integer, got ${extension.type}. Use addExtension() to register a custom extension.`,\n );\n }\n\n if (extension.type < -128) {\n throw new Error(\n `Internal extension type must be in the range -128 to -1, got ${extension.type}`,\n );\n }\n\n this.extensions.set(extension.type, extension);\n\n return this;\n }\n\n fetchExtension(type: number): MessagePackExtension<unknown, TBuffer> {\n const extension = this.extensions.get(type);\n\n if (!extension) {\n throw new Error(`Extension with type ${type} not found`);\n }\n\n return extension;\n }\n}\n\nexport default BufferWithExtensions;\n"],"mappings":";AAGA,IAAe,uBAAf,MAEsD;CACpD;CAEA,cAAc;EACZ,KAAK,6BAAa,IAAI,IAAI;CAC5B;CAEA,aAAa,WAAyD;EACpE,IAAI,KAAK,WAAW,IAAI,UAAU,IAAI,GACpC,MAAM,IAAI,MAAM,uBAAuB,UAAU,KAAK,gBAAgB;EAGxE,IAAI,UAAU,OAAO,GACnB,MAAM,IAAI,MACR,sDAAsD,UAAU,KAAK,8HACvE;EAGF,IAAI,UAAU,OAAO,KACnB,MAAM,IAAI,MACR,qDAAqD,UAAU,MACjE;EAGF,KAAK,WAAW,IAAI,UAAU,MAAM,SAAS;EAE7C,OAAO;CACT;CAEA,qBACE,WACM;EACN,IAAI,KAAK,WAAW,IAAI,UAAU,IAAI,GACpC,MAAM,IAAI,MAAM,uBAAuB,UAAU,KAAK,gBAAgB;EAGxE,IAAI,UAAU,QAAQ,GACpB,MAAM,IAAI,MACR,2DAA2D,UAAU,KAAK,qDAC5E;EAGF,IAAI,UAAU,OAAO,MACnB,MAAM,IAAI,MACR,gEAAgE,UAAU,MAC5E;EAGF,KAAK,WAAW,IAAI,UAAU,MAAM,SAAS;EAE7C,OAAO;CACT;CAEA,eAAe,MAAsD;EACnE,MAAM,YAAY,KAAK,WAAW,IAAI,IAAI;EAE1C,IAAI,CAAC,WACH,MAAM,IAAI,MAAM,uBAAuB,KAAK,WAAW;EAGzD,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"bufferWithExtensions.mjs","names":[],"sources":["../../src/bufferWithExtensions.ts"],"sourcesContent":["// oxlint-disable complexity\nimport ErrorExtension from './extensions/error/error.ts';\nimport type MessagePackBuiltInExtension from './extensions/interfaces/messagePackBuiltInExtension.ts';\nimport type MessagePackExtension from './extensions/interfaces/messagePackExtension.ts';\nimport TimestampDateExtension from './extensions/timestampDate/timestampDate.ts';\nimport type MessagePackBufferWithExtensions from './interfaces/messagePackBufferWithExtensions.ts';\nimport type {\n BigIntExtensionOptions,\n BufferWithExtensionsOptions,\n} from './types.ts';\nimport assertValidExtensionType from './utils/assertValidExtensionType.ts';\n\ntype MessagePackExtensionLike<TBuffer extends Uint8Array> =\n | MessagePackExtension<object, TBuffer>\n | MessagePackBuiltInExtension<object, TBuffer>;\n\nabstract class BufferWithExtensions<\n TBuffer extends Uint8Array = Uint8Array,\n> implements MessagePackBufferWithExtensions<TBuffer> {\n /**\n * Default extension type for `BigInt` values. This is used when the user does\n * not provide a custom extension type for `BigInt` values.\n */\n static readonly DEFAULT_BIG_INT_EXTENSION_TYPE = 0;\n\n /**\n * The extensions map is used to store the registered extensions. The key is\n * the extension type, and the value is the extension instance.\n */\n protected extensions = new Map<\n number,\n MessagePackExtension<object, TBuffer>\n >();\n\n /**\n * The built-in extensions map is used to store the built-in extensions. The\n * key is the extension type, and the value is the extension instance.\n */\n protected builtInExtensions = new Map<\n number,\n MessagePackBuiltInExtension<object, TBuffer>\n >();\n\n /**\n * The timestamp date extension is used to encode and decode `Date` values. It\n * is optional and can be disabled by setting the `extensions.timestampDate`\n * option to `false`.\n */\n readonly timestampDateExtension?: TimestampDateExtension<TBuffer> = undefined;\n\n /**\n * The big integer extension is used to encode and decode `BigInt` values. It\n * is optional and can be disabled by setting the `extensions.bigInt` option\n * to `false`.\n *\n * If enabled, the user can provide a custom extension type for `BigInt`\n * values by setting the `extensions.bigInt.type` option.\n */\n readonly bigIntExtension?: BigIntExtensionOptions = undefined;\n\n /**\n * The error extension is used to encode and decode `Error` values. It is\n * optional and can be disabled by setting the `extensions.error` option to\n * `false`.\n *\n * If enabled, the user can provide a custom extension for `Error` values by\n * setting the `extensions.error` option to an instance of `ErrorExtension`.\n */\n readonly errorExtension?: ErrorExtension<TBuffer> = undefined;\n\n constructor(options?: BufferWithExtensionsOptions<TBuffer>) {\n if (options?.extensions !== false) {\n if (options?.extensions?.bigInt !== false) {\n this.bigIntExtension = options?.extensions?.bigInt ?? {\n type: BufferWithExtensions.DEFAULT_BIG_INT_EXTENSION_TYPE,\n };\n\n assertValidExtensionType(this.bigIntExtension.type);\n }\n\n if (options?.extensions?.error !== false) {\n if (options?.extensions?.error instanceof ErrorExtension) {\n this.errorExtension = options.extensions.error;\n } else {\n this.errorExtension = new ErrorExtension(options?.extensions?.error);\n }\n\n assertValidExtensionType(this.errorExtension.type);\n\n this.builtInExtensions.set(\n this.errorExtension.type,\n this.errorExtension,\n );\n }\n\n if (options?.extensions?.timestampDate !== false) {\n if (\n options?.extensions?.timestampDate instanceof TimestampDateExtension\n ) {\n this.timestampDateExtension = options.extensions.timestampDate;\n } else {\n this.timestampDateExtension = new TimestampDateExtension();\n }\n\n this.builtInExtensions.set(\n TimestampDateExtension.DEFAULT_TYPE,\n this.timestampDateExtension,\n );\n }\n }\n }\n\n getExtensions(): ReadonlyMap<number, MessagePackExtension<object, TBuffer>> {\n return this.extensions;\n }\n\n addExtension<TValue extends object>(\n extension: MessagePackExtension<TValue, TBuffer>,\n ): this {\n if (this.extensions.has(extension.type)) {\n // oxlint-disable-next-line typescript/no-non-null-assertion - Already checked that the extension exists\n const existent = this.extensions.get(extension.type)!;\n\n throw new Error(\n `Extension with type ${extension.type} already registered for ${existent.constructor.name}`,\n );\n }\n\n assertValidExtensionType(extension.type);\n\n if (this.builtInExtensions.has(extension.type)) {\n // oxlint-disable-next-line typescript/no-non-null-assertion - Already checked that the extension exists\n const existent = this.builtInExtensions.get(extension.type)!;\n\n throw new Error(\n `Extension with type ${extension.type} conflicts with built-in extension ${existent.constructor.name}`,\n );\n }\n\n if (extension.type === this.bigIntExtension?.type) {\n throw new Error(\n `Extension with type ${extension.type} conflicts with built-in BigInt extension`,\n );\n }\n\n this.extensions.set(extension.type, extension);\n\n return this;\n }\n\n fetchExtension(type: number): MessagePackExtensionLike<TBuffer> {\n let extension: MessagePackExtensionLike<TBuffer> | undefined =\n this.builtInExtensions.get(type);\n\n if (!extension) {\n extension = this.extensions.get(type);\n\n if (!extension) {\n throw new Error(`Extension with type ${type} not found`);\n }\n }\n\n return extension;\n }\n}\n\nexport default BufferWithExtensions;\n"],"mappings":";;;;AAgBA,IAAe,uBAAf,MAAe,qBAEuC;;;;;CAKpD,OAAgB,iCAAiC;;;;;CAMjD,6BAAuB,IAAI,IAGzB;;;;;CAMF,oCAA8B,IAAI,IAGhC;;;;;;CAOF,yBAAoE,KAAA;;;;;;;;;CAUpE,kBAAoD,KAAA;;;;;;;;;CAUpD,iBAAoD,KAAA;CAEpD,YAAY,SAAgD;EAC1D,IAAI,SAAS,eAAe,OAAO;GACjC,IAAI,SAAS,YAAY,WAAW,OAAO;IACzC,KAAK,kBAAkB,SAAS,YAAY,UAAU,EACpD,MAAM,qBAAqB,+BAC7B;IAEA,yBAAyB,KAAK,gBAAgB,IAAI;GACpD;GAEA,IAAI,SAAS,YAAY,UAAU,OAAO;IACxC,IAAI,SAAS,YAAY,iBAAiB,gBACxC,KAAK,iBAAiB,QAAQ,WAAW;SAEzC,KAAK,iBAAiB,IAAI,eAAe,SAAS,YAAY,KAAK;IAGrE,yBAAyB,KAAK,eAAe,IAAI;IAEjD,KAAK,kBAAkB,IACrB,KAAK,eAAe,MACpB,KAAK,cACP;GACF;GAEA,IAAI,SAAS,YAAY,kBAAkB,OAAO;IAChD,IACE,SAAS,YAAY,yBAAyB,wBAE9C,KAAK,yBAAyB,QAAQ,WAAW;SAEjD,KAAK,yBAAyB,IAAI,uBAAuB;IAG3D,KAAK,kBAAkB,IACrB,uBAAuB,cACvB,KAAK,sBACP;GACF;EACF;CACF;CAEA,gBAA4E;EAC1E,OAAO,KAAK;CACd;CAEA,aACE,WACM;EACN,IAAI,KAAK,WAAW,IAAI,UAAU,IAAI,GAAG;GAEvC,MAAM,WAAW,KAAK,WAAW,IAAI,UAAU,IAAI;GAEnD,MAAM,IAAI,MACR,uBAAuB,UAAU,KAAK,0BAA0B,SAAS,YAAY,MACvF;EACF;EAEA,yBAAyB,UAAU,IAAI;EAEvC,IAAI,KAAK,kBAAkB,IAAI,UAAU,IAAI,GAAG;GAE9C,MAAM,WAAW,KAAK,kBAAkB,IAAI,UAAU,IAAI;GAE1D,MAAM,IAAI,MACR,uBAAuB,UAAU,KAAK,qCAAqC,SAAS,YAAY,MAClG;EACF;EAEA,IAAI,UAAU,SAAS,KAAK,iBAAiB,MAC3C,MAAM,IAAI,MACR,uBAAuB,UAAU,KAAK,0CACxC;EAGF,KAAK,WAAW,IAAI,UAAU,MAAM,SAAS;EAE7C,OAAO;CACT;CAEA,eAAe,MAAiD;EAC9D,IAAI,YACF,KAAK,kBAAkB,IAAI,IAAI;EAEjC,IAAI,CAAC,WAAW;GACd,YAAY,KAAK,WAAW,IAAI,IAAI;GAEpC,IAAI,CAAC,WACH,MAAM,IAAI,MAAM,uBAAuB,KAAK,WAAW;EAE3D;EAEA,OAAO;CACT;AACF"}
@@ -0,0 +1,5 @@
1
+ //#region src/decoder/decode.d.ts
2
+ declare function decode<TValue = unknown>(buffer: Uint8Array): TValue;
3
+ //#endregion
4
+ export { decode as t };
5
+ //# sourceMappingURL=decode-BraWmoPw.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode-BraWmoPw.d.mts","names":[],"sources":["../../src/decoder/decode.ts"],"mappings":";iBAIwB,OAAO,kBAAkB,QAAQ,aAAa"}
@@ -0,0 +1,2 @@
1
+ import { t as decode } from "../decode-BraWmoPw.mjs";
2
+ export { decode as default };
@@ -0,0 +1,11 @@
1
+ import Decoder from "./decoder.mjs";
2
+ //#region src/decoder/decode.ts
3
+ const sharedDecoder = new Decoder();
4
+ function decode(buffer) {
5
+ sharedDecoder.setBuffer(buffer);
6
+ return sharedDecoder.nextValue();
7
+ }
8
+ //#endregion
9
+ export { decode as default };
10
+
11
+ //# sourceMappingURL=decode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode.mjs","names":[],"sources":["../../../src/decoder/decode.ts"],"sourcesContent":["import Decoder from './decoder.ts';\n\nconst sharedDecoder = new Decoder();\n\nexport default function decode<TValue = unknown>(buffer: Uint8Array): TValue {\n sharedDecoder.setBuffer(buffer);\n\n return sharedDecoder.nextValue<TValue>();\n}\n"],"mappings":";;AAEA,MAAM,gBAAgB,IAAI,QAAQ;AAElC,SAAwB,OAAyB,QAA4B;CAC3E,cAAc,UAAU,MAAM;CAE9B,OAAO,cAAc,UAAkB;AACzC"}
@@ -1,2 +1,2 @@
1
- import { t as Decoder } from "../decoder-DEzsJjYj.mjs";
1
+ import { t as Decoder } from "../decoder-Bdqx1C7P.mjs";
2
2
  export { Decoder as default };