@schema-pack/message-pack 0.0.0-commit.03ddd0427843dd0e1b45dcd0325ecf52097255a4 → 0.0.0-commit.56d3200cf684346bbdb90bed64d3516657fdaaec

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 (114) hide show
  1. package/dist/cjs/benchmark/decoderDataTypesFactory.cjs +29 -29
  2. package/dist/cjs/{bigInt-BdjzezQQ.d.cts → bigInt-ALGpR4Rn.d.cts} +5 -5
  3. package/dist/cjs/bigInt-ALGpR4Rn.d.cts.map +1 -0
  4. package/dist/{esm/bufferWithExtensions-DzAs7yX1.d.mts → cjs/bufferWithExtensions-qiA6axeV.d.cts} +2 -2
  5. package/dist/{esm/bufferWithExtensions-DzAs7yX1.d.mts.map → cjs/bufferWithExtensions-qiA6axeV.d.cts.map} +1 -1
  6. package/dist/cjs/bufferWithExtensions.d.cts +1 -1
  7. package/dist/cjs/decoder/decoder.d.cts +1 -1
  8. package/dist/cjs/decoder/decoderBuffer.d.cts +1 -1
  9. package/dist/cjs/decoder/index.d.cts +2 -2
  10. package/dist/cjs/{decoder-3WpVBZjY.d.cts → decoder-BugzrbIU.d.cts} +3 -3
  11. package/dist/cjs/{decoder-3WpVBZjY.d.cts.map → decoder-BugzrbIU.d.cts.map} +1 -1
  12. package/dist/cjs/{decoderBuffer-CJU2hdt2.d.cts → decoderBuffer-BFoz1PcE.d.cts} +2 -2
  13. package/dist/cjs/{decoderBuffer-CJU2hdt2.d.cts.map → decoderBuffer-BFoz1PcE.d.cts.map} +1 -1
  14. package/dist/cjs/encoder/encode.cjs +3 -3
  15. package/dist/cjs/encoder/encoder.cjs +593 -26
  16. package/dist/cjs/encoder/encoder.d.cts +1 -1
  17. package/dist/cjs/encoder/index.cjs +0 -2
  18. package/dist/cjs/encoder/index.d.cts +3 -4
  19. package/dist/cjs/encoder/interfaces/index.d.cts +2 -2
  20. package/dist/cjs/encoder/interfaces/messagePackEncoder.d.cts +2 -0
  21. package/dist/cjs/encoder/types.d.cts +2 -2
  22. package/dist/cjs/{encoderBuffer-3ur0iCYR.d.cts → encoder-BliskZYy.d.cts} +9 -9
  23. package/dist/cjs/encoder-BliskZYy.d.cts.map +1 -0
  24. package/dist/cjs/extensions/bigint/bigInt.cjs +5 -5
  25. package/dist/cjs/extensions/bigint/bigInt.d.cts +1 -1
  26. package/dist/cjs/extensions/bigint/index.d.cts +1 -1
  27. package/dist/cjs/extensions/index.d.cts +2 -2
  28. package/dist/cjs/extensions/interfaces/index.d.cts +1 -1
  29. package/dist/cjs/extensions/interfaces/messagePackExtension.d.cts +1 -1
  30. package/dist/cjs/extensions/timestampDate/index.d.cts +1 -1
  31. package/dist/cjs/extensions/timestampDate/timestampDate.cjs +6 -6
  32. package/dist/cjs/extensions/timestampDate/timestampDate.d.cts +1 -1
  33. package/dist/cjs/index.cjs +0 -2
  34. package/dist/cjs/index.d.cts +8 -9
  35. package/dist/cjs/interfaces/index.d.cts +1 -1
  36. package/dist/cjs/interfaces/messagePackBufferWithExtensions.d.cts +1 -1
  37. package/dist/cjs/{messagePackExtension-Cd99Rw9t.d.cts → messagePackExtension-xBTe48A-.d.cts} +50 -50
  38. package/dist/cjs/messagePackExtension-xBTe48A-.d.cts.map +1 -0
  39. package/dist/cjs/{timestampDate-Bi1rnvVd.d.cts → timestampDate-B8IXKYcA.d.cts} +3 -3
  40. package/dist/cjs/timestampDate-B8IXKYcA.d.cts.map +1 -0
  41. package/dist/cjs/{untypedExtension-wx6-_4mg.d.cts → untypedExtension-DPZG3pQo.d.cts} +3 -3
  42. package/dist/cjs/{untypedExtension-wx6-_4mg.d.cts.map → untypedExtension-DPZG3pQo.d.cts.map} +1 -1
  43. package/dist/cjs/untypedExtension.d.cts +1 -1
  44. package/dist/esm/benchmark/decoderDataTypesFactory.mjs +29 -29
  45. package/dist/esm/benchmark/decoderDataTypesFactory.mjs.map +1 -1
  46. package/dist/esm/{bigInt-D37SPzzB.d.mts → bigInt-lSrNuXkn.d.mts} +5 -5
  47. package/dist/esm/bigInt-lSrNuXkn.d.mts.map +1 -0
  48. package/dist/{cjs/bufferWithExtensions-n6DtcUoA.d.cts → esm/bufferWithExtensions-Bc7vjIkw.d.mts} +2 -2
  49. package/dist/{cjs/bufferWithExtensions-n6DtcUoA.d.cts.map → esm/bufferWithExtensions-Bc7vjIkw.d.mts.map} +1 -1
  50. package/dist/esm/bufferWithExtensions.d.mts +1 -1
  51. package/dist/esm/decoder/decoder.d.mts +1 -1
  52. package/dist/esm/decoder/decoderBuffer.d.mts +1 -1
  53. package/dist/esm/decoder/index.d.mts +2 -2
  54. package/dist/esm/{decoder-ByAWOgvm.d.mts → decoder-CQrtmASU.d.mts} +3 -3
  55. package/dist/esm/{decoder-ByAWOgvm.d.mts.map → decoder-CQrtmASU.d.mts.map} +1 -1
  56. package/dist/esm/{decoderBuffer-93dMcsbx.d.mts → decoderBuffer-BKic0U2F.d.mts} +2 -2
  57. package/dist/esm/{decoderBuffer-93dMcsbx.d.mts.map → decoderBuffer-BKic0U2F.d.mts.map} +1 -1
  58. package/dist/esm/encoder/encode.mjs +4 -4
  59. package/dist/esm/encoder/encode.mjs.map +1 -1
  60. package/dist/esm/encoder/encoder.d.mts +1 -1
  61. package/dist/esm/encoder/encoder.mjs +593 -26
  62. package/dist/esm/encoder/encoder.mjs.map +1 -1
  63. package/dist/esm/encoder/index.d.mts +3 -4
  64. package/dist/esm/encoder/index.mjs +1 -2
  65. package/dist/esm/encoder/interfaces/index.d.mts +2 -2
  66. package/dist/esm/encoder/interfaces/messagePackEncoder.d.mts +2 -0
  67. package/dist/esm/encoder/types.d.mts +2 -2
  68. package/dist/esm/{encoderBuffer-BZMIF5I2.d.mts → encoder-ZmHoedsB.d.mts} +9 -9
  69. package/dist/esm/encoder-ZmHoedsB.d.mts.map +1 -0
  70. package/dist/esm/extensions/bigint/bigInt.d.mts +1 -1
  71. package/dist/esm/extensions/bigint/bigInt.mjs +5 -5
  72. package/dist/esm/extensions/bigint/bigInt.mjs.map +1 -1
  73. package/dist/esm/extensions/bigint/index.d.mts +1 -1
  74. package/dist/esm/extensions/index.d.mts +2 -2
  75. package/dist/esm/extensions/interfaces/index.d.mts +1 -1
  76. package/dist/esm/extensions/interfaces/messagePackExtension.d.mts +1 -1
  77. package/dist/esm/extensions/timestampDate/index.d.mts +1 -1
  78. package/dist/esm/extensions/timestampDate/timestampDate.d.mts +1 -1
  79. package/dist/esm/extensions/timestampDate/timestampDate.mjs +6 -6
  80. package/dist/esm/extensions/timestampDate/timestampDate.mjs.map +1 -1
  81. package/dist/esm/index.d.mts +8 -9
  82. package/dist/esm/index.mjs +1 -2
  83. package/dist/esm/interfaces/index.d.mts +1 -1
  84. package/dist/esm/interfaces/messagePackBufferWithExtensions.d.mts +1 -1
  85. package/dist/esm/{messagePackExtension-fq36EMAg.d.mts → messagePackExtension-Ceq7jzFB.d.mts} +50 -50
  86. package/dist/esm/messagePackExtension-Ceq7jzFB.d.mts.map +1 -0
  87. package/dist/esm/{timestampDate-C3Ch8aSB.d.mts → timestampDate-uQGrWim5.d.mts} +3 -3
  88. package/dist/esm/timestampDate-uQGrWim5.d.mts.map +1 -0
  89. package/dist/esm/{untypedExtension-Ckk9RwQw.d.mts → untypedExtension-DKgyS2ak.d.mts} +3 -3
  90. package/dist/esm/{untypedExtension-Ckk9RwQw.d.mts.map → untypedExtension-DKgyS2ak.d.mts.map} +1 -1
  91. package/dist/esm/untypedExtension.d.mts +1 -1
  92. package/dist/esm/untypedExtension.mjs.map +1 -1
  93. package/package.json +4 -8
  94. package/dist/cjs/bigInt-BdjzezQQ.d.cts.map +0 -1
  95. package/dist/cjs/encoder/encoderBuffer.cjs +0 -608
  96. package/dist/cjs/encoder/encoderBuffer.d.cts +0 -2
  97. package/dist/cjs/encoder/interfaces/messagePackEncoderBuffer.d.cts +0 -2
  98. package/dist/cjs/encoder-B-rTvI4P.d.cts +0 -23
  99. package/dist/cjs/encoder-B-rTvI4P.d.cts.map +0 -1
  100. package/dist/cjs/encoderBuffer-3ur0iCYR.d.cts.map +0 -1
  101. package/dist/cjs/messagePackExtension-Cd99Rw9t.d.cts.map +0 -1
  102. package/dist/cjs/timestampDate-Bi1rnvVd.d.cts.map +0 -1
  103. package/dist/esm/bigInt-D37SPzzB.d.mts.map +0 -1
  104. package/dist/esm/encoder/encoderBuffer.d.mts +0 -2
  105. package/dist/esm/encoder/encoderBuffer.mjs +0 -610
  106. package/dist/esm/encoder/encoderBuffer.mjs.map +0 -1
  107. package/dist/esm/encoder/interfaces/messagePackEncoderBuffer.d.mts +0 -2
  108. package/dist/esm/encoder-PfSLnKnK.d.mts +0 -23
  109. package/dist/esm/encoder-PfSLnKnK.d.mts.map +0 -1
  110. package/dist/esm/encoderBuffer-BZMIF5I2.d.mts.map +0 -1
  111. package/dist/esm/messagePackExtension-fq36EMAg.d.mts.map +0 -1
  112. package/dist/esm/timestampDate-C3Ch8aSB.d.mts.map +0 -1
  113. /package/dist/cjs/encoder/interfaces/{messagePackEncoderBuffer.cjs → messagePackEncoder.cjs} +0 -0
  114. /package/dist/esm/encoder/interfaces/{messagePackEncoderBuffer.mjs → messagePackEncoder.mjs} +0 -0
@@ -1,9 +1,9 @@
1
- import { i as ExtensionEncoderBuffer, n as MessagePackEncoderBuffer, r as EncoderBufferOptions, t as MessagePackExtension } from "./messagePackExtension-Cd99Rw9t.cjs";
2
1
  import { t as BufferFactory } from "./types-DTcs4Mkd.cjs";
2
+ import { a as MessagePackEncoder, n as EncoderOptions, r as ExtensionEncoder, t as MessagePackExtension } from "./messagePackExtension-xBTe48A-.cjs";
3
3
  import { t as MessagePackTextEncoder } from "./messagePackTextEncoder-D7iCft_t.cjs";
4
- import { t as BufferWithExtensions } from "./bufferWithExtensions-n6DtcUoA.cjs";
5
- //#region src/encoder/encoderBuffer.d.ts
6
- declare class EncoderBuffer<TBuffer extends Uint8Array = Uint8Array> extends BufferWithExtensions<TBuffer> implements MessagePackEncoderBuffer<TBuffer> {
4
+ import { t as BufferWithExtensions } from "./bufferWithExtensions-qiA6axeV.cjs";
5
+ //#region src/encoder/encoder.d.ts
6
+ declare class Encoder<TBuffer extends Uint8Array = Uint8Array> extends BufferWithExtensions<TBuffer> implements MessagePackEncoder<TBuffer> {
7
7
  #private;
8
8
  /** The current offset in the buffer where the next write operation will occur. */
9
9
  offset: number;
@@ -39,8 +39,8 @@ declare class EncoderBuffer<TBuffer extends Uint8Array = Uint8Array> extends Buf
39
39
  readonly textEncoder: MessagePackTextEncoder<TBuffer>;
40
40
  buffer: TBuffer;
41
41
  view: DataView;
42
- constructor(options?: Partial<EncoderBufferOptions<TBuffer>>);
43
- getExtensionBuffer(): EncoderBuffer<TBuffer>;
42
+ constructor(options?: Partial<EncoderOptions<TBuffer>>);
43
+ getExtensionEncoder(): Encoder<TBuffer>;
44
44
  resizeBuffer(newSize: number): this;
45
45
  ensureCapacity(sizeToWrite: number): this;
46
46
  resetBuffer(): this;
@@ -100,12 +100,12 @@ declare class EncoderBuffer<TBuffer extends Uint8Array = Uint8Array> extends Buf
100
100
  openArray(length: number): this;
101
101
  writeArray(value: unknown[]): this;
102
102
  writeUint8Array(value: Uint8Array): this;
103
- writeExtension(extension: MessagePackExtension, buffer: ExtensionEncoderBuffer<TBuffer>): this;
103
+ writeExtension(extension: MessagePackExtension, encoder: ExtensionEncoder<TBuffer>): this;
104
104
  tryToWriteExtensionValue(value: object | bigint): number;
105
105
  writeBigInt(value: bigint): this;
106
106
  writeObject(value: object): this;
107
107
  write(value: unknown): this;
108
108
  }
109
109
  //#endregion
110
- export { EncoderBuffer as t };
111
- //# sourceMappingURL=encoderBuffer-3ur0iCYR.d.cts.map
110
+ export { Encoder as t };
111
+ //# sourceMappingURL=encoder-BliskZYy.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoder-BliskZYy.d.cts","names":[],"sources":["../../src/encoder/encoder.ts"],"mappings":";;;;;cAuBM,QAAQ,gBAAgB,aAAa,oBACjC,qBAAqB,oBAClB,mBAAmB;;;EAG9B;;;;;;;YAQU,cAAc;;;;;;;WAQf;;;;;;;;WASA;;;;;;;YAQC,eAAe,cAAc;WAE9B,aAAa,uBAAuB;EAE7C,QAAQ;EACR,MAAM;EAcN,YAAY,UAAU,QAAQ,eAAe;EAwB7C,uBAAuB,QAAQ;EAc/B,aAAa;EAeb,eAAe;EAUf;EAMA,SAAS;EAST,oBAAoB;EAMpB,oBAAoB;EAOpB,SAAS,OAAO;EAQhB,aAAa;EAOb,aAAa;EAOb,WAAW;EAMX,YAAY;EAOZ,YAAY;EAOZ,YAAY;EAaZ,UAAU;EAMV,WAAW;EAOX,WAAW;EAOX,WAAW;EA0BX,SAAS;EAMT;EAMA;EAMA;EAMA,kBAAkB;EAMlB,oBAAoB;EAMpB,kBAAkB;EAMlB,gBAAgB;EAOhB,iBAAiB;EAQjB,iBAAiB;EAQjB;EAMA;EAMA;EAMA;EAMA;EAMA;EAMA;EAMA;EAMA;EAMA;EAMA,gBAAgB;EAOhB,iBAAiB;EASjB,iBAAiB;EASjB,mBAAmB;EASnB,mBAAmB;EASnB,iBAAiB;EASjB,iBAAiB;EASjB,mBAAmB;EAOnB,mBAAmB;EAOnB,mBAAmB;EAOnB,mBAAmB;EAOnB,oBAAoB;EAOpB,gBAAgB,cAAc;EAQ9B,iBAAiB,cAAc;EAW/B,iBAAiB,cAAc;EAW/B,YAAY;EAyGZ,YAAY;EA0EZ,QAAQ;EAqBR,SAAS,8BAA8B,QACrC,OAAO,OAAO,MAAM;EAqBtB,UAAU;EAqBV,WAAW;EAwBX,gBAAgB,OAAO;EAiBvB,eACE,WAAW,sBACX,SAAS,iBAAiB;EAiD5B,yBAAyB;EAqBzB,YAAY;EAYZ,YAAY;EAkBZ,MAAM"}
@@ -19,17 +19,17 @@ var BigIntExtension = class extends require_untypedExtension {
19
19
  * indicate negativity.
20
20
  *
21
21
  * @param value - The BigInt value to encode.
22
- * @param buffer - The buffer to write the encoded data to.
22
+ * @param encoder - The extension encoder to write the encoded data to.
23
23
  */
24
- encode(value, buffer) {
24
+ encode(value, encoder) {
25
25
  if (typeof value === "bigint") {
26
26
  let magnitude;
27
27
  if (value < 0n) magnitude = (-value << 1n) - 1n;
28
28
  else magnitude = value << 1n;
29
29
  while (magnitude > 0n) {
30
- buffer.ensureCapacity(8);
31
- buffer.view.setBigUint64(buffer.offset, magnitude & BIGINT_MASK, false);
32
- buffer.offset += 8;
30
+ encoder.ensureCapacity(8);
31
+ encoder.view.setBigUint64(encoder.offset, magnitude & BIGINT_MASK, false);
32
+ encoder.offset += 8;
33
33
  magnitude >>= 64n;
34
34
  }
35
35
  }
@@ -1,2 +1,2 @@
1
- import { t as BigIntExtension } from "../../bigInt-BdjzezQQ.cjs";
1
+ import { t as BigIntExtension } from "../../bigInt-ALGpR4Rn.cjs";
2
2
  export = BigIntExtension;
@@ -1,3 +1,3 @@
1
- import { t as BigIntExtension } from "../../bigInt-BdjzezQQ.cjs";
1
+ import { t as BigIntExtension } from "../../bigInt-ALGpR4Rn.cjs";
2
2
  import "../../index-5OuLsWCC.cjs";
3
3
  export = BigIntExtension;
@@ -1,4 +1,4 @@
1
- import { t as MessagePackExtension } from "../messagePackExtension-Cd99Rw9t.cjs";
1
+ import { t as MessagePackExtension } from "../messagePackExtension-xBTe48A-.cjs";
2
2
  import { t as MessagePackTime } from "../types-B9KMW-kD.cjs";
3
- import { t as TimestampDateExtension } from "../timestampDate-Bi1rnvVd.cjs";
3
+ import { t as TimestampDateExtension } from "../timestampDate-B8IXKYcA.cjs";
4
4
  export { type MessagePackExtension, type MessagePackTime, TimestampDateExtension };
@@ -1,3 +1,3 @@
1
- import { t as MessagePackExtension } from "../../messagePackExtension-Cd99Rw9t.cjs";
1
+ import { t as MessagePackExtension } from "../../messagePackExtension-xBTe48A-.cjs";
2
2
  import "../../index-B5vbV8Ak.cjs";
3
3
  export type { MessagePackExtension };
@@ -1,2 +1,2 @@
1
- import { t as MessagePackExtension } from "../../messagePackExtension-Cd99Rw9t.cjs";
1
+ import { t as MessagePackExtension } from "../../messagePackExtension-xBTe48A-.cjs";
2
2
  export = MessagePackExtension;
@@ -1,4 +1,4 @@
1
1
  import { t as MessagePackTime } from "../../types-B9KMW-kD.cjs";
2
- import { t as TimestampDateExtension } from "../../timestampDate-Bi1rnvVd.cjs";
2
+ import { t as TimestampDateExtension } from "../../timestampDate-B8IXKYcA.cjs";
3
3
  import "../../index-CUX405iZ.cjs";
4
4
  export { type MessagePackTime, TimestampDateExtension };
@@ -33,20 +33,20 @@ var TimestampDateExtension = class {
33
33
  sec: sec + nsecInSec
34
34
  };
35
35
  }
36
- encode(value, buffer) {
36
+ encode(value, encoder) {
37
37
  if (value instanceof Date) {
38
38
  const time = this.parseToMessagePackTime(value);
39
39
  if (time.sec >= 0 && time.nsec >= 0 && time.sec <= TIMESTAMP64_MAX_SEC) {
40
- if (time.nsec === 0 && time.sec <= TIMESTAMP32_MAX_SEC) buffer.writeUint32(time.sec);
40
+ if (time.nsec === 0 && time.sec <= TIMESTAMP32_MAX_SEC) encoder.writeUint32(time.sec);
41
41
  else {
42
42
  const secHigh = time.sec / 4294967296;
43
43
  const secLow = time.sec & 4294967295;
44
- buffer.writeUint32(time.nsec << 2 | secHigh & 3);
45
- buffer.writeUint32(secLow);
44
+ encoder.writeUint32(time.nsec << 2 | secHigh & 3);
45
+ encoder.writeUint32(secLow);
46
46
  }
47
47
  } else {
48
- buffer.writeUint32(time.nsec);
49
- buffer.writeInt64(time.sec);
48
+ encoder.writeUint32(time.nsec);
49
+ encoder.writeInt64(time.sec);
50
50
  }
51
51
  }
52
52
  }
@@ -1,2 +1,2 @@
1
- import { t as TimestampDateExtension } from "../../timestampDate-Bi1rnvVd.cjs";
1
+ import { t as TimestampDateExtension } from "../../timestampDate-B8IXKYcA.cjs";
2
2
  export = TimestampDateExtension;
@@ -8,7 +8,6 @@ const require_utils_fitIn8Bits = require("./utils/fitIn8Bits.cjs");
8
8
  const require_utils_fitIn16Bits = require("./utils/fitIn16Bits.cjs");
9
9
  const require_utils_fitIn32Bits = require("./utils/fitIn32Bits.cjs");
10
10
  const require_encoder_textEncoders_defaultTextEncoder = require("./encoder/textEncoders/defaultTextEncoder.cjs");
11
- const require_encoder_encoderBuffer = require("./encoder/encoderBuffer.cjs");
12
11
  const require_encoder_encoder = require("./encoder/encoder.cjs");
13
12
  const require_benchmark_decoderDataTypesFactory = require("./benchmark/decoderDataTypesFactory.cjs");
14
13
  const require_decoder_textDecoders_defaultTextDecoder = require("./decoder/textDecoders/defaultTextDecoder.cjs");
@@ -31,7 +30,6 @@ exports.DecoderBuffer = require_decoder_decoderBuffer;
31
30
  exports.DefaultTextDecoder = require_decoder_textDecoders_defaultTextDecoder;
32
31
  exports.DefaultTextEncoder = require_encoder_textEncoders_defaultTextEncoder;
33
32
  exports.Encoder = require_encoder_encoder;
34
- exports.EncoderBuffer = require_encoder_encoderBuffer;
35
33
  exports.INT32_MIN = require_constants.INT32_MIN;
36
34
  exports.INT64_MIN = require_constants.INT64_MIN;
37
35
  exports.NodeTextDecoder = require_decoder_textDecoders_nodeTextDecoder;
@@ -1,27 +1,26 @@
1
1
  import decoderDataTypesFactory from "./benchmark/decoderDataTypesFactory.cjs";
2
2
  import { t as MessagePackTextDecoder } from "./messagePackTextDecoder-J3fr-wQn.cjs";
3
3
  import { t as MessagePackDecoderBuffer } from "./messagePackDecoderBuffer-B2rRVlMX.cjs";
4
- import { a as OmitByPattern, i as ExtensionEncoderBuffer, n as MessagePackEncoderBuffer, o as MessagePackBufferWithExtensions, r as EncoderBufferOptions, t as MessagePackExtension } from "./messagePackExtension-Cd99Rw9t.cjs";
4
+ import { a as MessagePackEncoder, i as OmitByPattern, n as EncoderOptions, o as MessagePackBufferWithExtensions, r as ExtensionEncoder, t as MessagePackExtension } from "./messagePackExtension-xBTe48A-.cjs";
5
5
  import { t as MessagePackTextEncoder } from "./messagePackTextEncoder-D7iCft_t.cjs";
6
- import { t as BufferWithExtensions } from "./bufferWithExtensions-n6DtcUoA.cjs";
6
+ import { t as BufferWithExtensions } from "./bufferWithExtensions-qiA6axeV.cjs";
7
7
  import { DEFAULT_ALLOCATION_SIZE, INT32_MIN, INT64_MIN, UINT32_MAX, UINT64_MAX } from "./constants.cjs";
8
8
  import { t as decode } from "./decode-BraWmoPw.cjs";
9
9
  import { t as DefaultTextDecoder } from "./defaultTextDecoder-DY92jDSO.cjs";
10
- import { t as DecoderBuffer } from "./decoderBuffer-CJU2hdt2.cjs";
11
- import { t as Decoder } from "./decoder-3WpVBZjY.cjs";
10
+ import { t as DecoderBuffer } from "./decoderBuffer-BFoz1PcE.cjs";
11
+ import { t as Decoder } from "./decoder-BugzrbIU.cjs";
12
12
  import { t as NodeTextDecoder } from "./nodeTextDecoder-DrNFdTVk.cjs";
13
13
  import { t as encode } from "./encode-4SxHVw0M.cjs";
14
- import { t as EncoderBuffer } from "./encoderBuffer-3ur0iCYR.cjs";
15
- import { t as Encoder } from "./encoder-B-rTvI4P.cjs";
14
+ import { t as Encoder } from "./encoder-BliskZYy.cjs";
16
15
  import { t as DefaultTextEncoder } from "./defaultTextEncoder-DzdGBX6s.cjs";
17
16
  import { t as NodeTextEncoder } from "./nodeTextEncoder-DJzFDBXd.cjs";
18
- import { t as UntypedExtension } from "./untypedExtension-wx6-_4mg.cjs";
17
+ import { t as UntypedExtension } from "./untypedExtension-DPZG3pQo.cjs";
19
18
  import { t as MessagePackTime } from "./types-B9KMW-kD.cjs";
20
- import { t as TimestampDateExtension } from "./timestampDate-Bi1rnvVd.cjs";
19
+ import { t as TimestampDateExtension } from "./timestampDate-B8IXKYcA.cjs";
21
20
  import Symbols from "./symbols.cjs";
22
21
  import { t as fitIn7Bits } from "./fitIn7Bits-BVHyKXCg.cjs";
23
22
  import { t as fitIn8Bits } from "./fitIn8Bits-DQnQIhdh.cjs";
24
23
  import { t as fitIn16Bits } from "./fitIn16Bits-D9lga-sP.cjs";
25
24
  import { t as fitIn32Bits } from "./fitIn32Bits-BrGIMOff.cjs";
26
25
  import { t as fitInt64Bits } from "./fitInt64Bits-CY7lVKne.cjs";
27
- export { BufferWithExtensions, DEFAULT_ALLOCATION_SIZE, Decoder, DecoderBuffer, DefaultTextDecoder, DefaultTextEncoder, Encoder, EncoderBuffer, type EncoderBufferOptions, type ExtensionEncoderBuffer, INT32_MIN, INT64_MIN, type MessagePackBufferWithExtensions, type MessagePackDecoderBuffer, type MessagePackEncoderBuffer, type MessagePackExtension, type MessagePackTextDecoder, type MessagePackTextEncoder, type MessagePackTime, NodeTextDecoder, NodeTextEncoder, type OmitByPattern, Symbols, TimestampDateExtension, UINT32_MAX, UINT64_MAX, UntypedExtension, decode, decoderDataTypesFactory, encode, fitIn16Bits, fitIn32Bits, fitIn7Bits, fitIn8Bits, fitInt64Bits };
26
+ export { BufferWithExtensions, DEFAULT_ALLOCATION_SIZE, Decoder, DecoderBuffer, DefaultTextDecoder, DefaultTextEncoder, Encoder, type EncoderOptions, type ExtensionEncoder, INT32_MIN, INT64_MIN, type MessagePackBufferWithExtensions, type MessagePackDecoderBuffer, type MessagePackEncoder, type MessagePackExtension, type MessagePackTextDecoder, type MessagePackTextEncoder, type MessagePackTime, NodeTextDecoder, NodeTextEncoder, type OmitByPattern, Symbols, TimestampDateExtension, UINT32_MAX, UINT64_MAX, UntypedExtension, decode, decoderDataTypesFactory, encode, fitIn16Bits, fitIn32Bits, fitIn7Bits, fitIn8Bits, fitInt64Bits };
@@ -1,2 +1,2 @@
1
- import { o as MessagePackBufferWithExtensions } from "../messagePackExtension-Cd99Rw9t.cjs";
1
+ import { o as MessagePackBufferWithExtensions } from "../messagePackExtension-xBTe48A-.cjs";
2
2
  export type { MessagePackBufferWithExtensions };
@@ -1,2 +1,2 @@
1
- import { o as MessagePackBufferWithExtensions } from "../messagePackExtension-Cd99Rw9t.cjs";
1
+ import { o as MessagePackBufferWithExtensions } from "../messagePackExtension-xBTe48A-.cjs";
2
2
  export = MessagePackBufferWithExtensions;
@@ -13,56 +13,13 @@ interface MessagePackBufferWithExtensions<TBuffer extends Uint8Array = Uint8Arra
13
13
  addExtension(extension: MessagePackExtension<unknown, TBuffer>): this;
14
14
  }
15
15
  //#endregion
16
- //#region src/encoder/types.d.ts
17
- interface EncoderBufferOptions<TBuffer extends Uint8Array = Uint8Array> extends BufferOptions<TBuffer> {
18
- /**
19
- * The initial size of the shared buffer. Shared buffer is used to encode
20
- * strings, to avoid allocating a new buffer for each string. This helps to
21
- * improve performance by reducing memory allocations and garbage collection
22
- * overhead.
23
- *
24
- * @default 1024
25
- */
26
- initialSharedBufferSize?: number;
27
- /**
28
- * A text encoder that will be used to encode strings into bytes.
29
- *
30
- * @default DefaultTextEncoder
31
- */
32
- textEncoder?: MessagePackTextEncoder<TBuffer>;
33
- /**
34
- * If true, the keys of objects will be sorted before encoding. This can be
35
- * useful for ensuring consistent encoding of objects with the same keys but
36
- * in different orders.
37
- *
38
- * @default false
39
- */
40
- sortKeys?: boolean;
41
- /**
42
- * If true, all floats will be encoded as float32, but it may result in loss
43
- * of precision for some floats (like `1.2`), this is a JavaScript
44
- * limitation.
45
- *
46
- * If false, floats will be encoded as float64, which is more precise but
47
- * takes up more space.
48
- *
49
- * Set to true only if you are sure that your floats can be represented as
50
- * float32 without loss of precision.
51
- *
52
- * @default false
53
- */
54
- forceFloat32?: boolean;
55
- }
56
- type OmitByPattern<TRecord, Pattern extends string> = { [TKey in keyof TRecord as TKey extends Pattern ? never : TKey]: TRecord[TKey]; };
57
- type ExtensionEncoderBuffer<TBuffer extends Uint8Array = Uint8Array> = OmitByPattern<MessagePackEncoderBuffer<TBuffer>, `${string}Extension` | 'resetBuffer' | 'extensions'>;
58
- //#endregion
59
- //#region src/encoder/interfaces/messagePackEncoderBuffer.d.ts
16
+ //#region src/encoder/interfaces/messagePackEncoder.d.ts
60
17
  /**
61
18
  * Defines the core methods for managing a buffer. It serves as the foundation
62
19
  * for buffer management in the encoding process, allowing for efficient
63
20
  * handling of binary data while adhering to the MessagePack format.
64
21
  */
65
- interface MessagePackEncoderBuffer<TBuffer extends Uint8Array = Uint8Array> extends MessagePackBufferWithExtensions<TBuffer> {
22
+ interface MessagePackEncoder<TBuffer extends Uint8Array = Uint8Array> extends MessagePackBufferWithExtensions<TBuffer> {
66
23
  /** Buffer management * */
67
24
  /**
68
25
  * Returns the underlying buffer. This method provides access to the raw data
@@ -934,9 +891,52 @@ interface MessagePackEncoderBuffer<TBuffer extends Uint8Array = Uint8Array> exte
934
891
  * type is a signed 8-bit integer.
935
892
  * ```
936
893
  */
937
- writeExtension(extension: MessagePackExtension, buffer: ExtensionEncoderBuffer<TBuffer>): this;
894
+ writeExtension(extension: MessagePackExtension, buffer: ExtensionEncoder<TBuffer>): this;
938
895
  }
939
896
  //#endregion
897
+ //#region src/encoder/types.d.ts
898
+ interface EncoderOptions<TBuffer extends Uint8Array = Uint8Array> extends BufferOptions<TBuffer> {
899
+ /**
900
+ * The initial size of the shared buffer. Shared buffer is used to encode
901
+ * strings, to avoid allocating a new buffer for each string. This helps to
902
+ * improve performance by reducing memory allocations and garbage collection
903
+ * overhead.
904
+ *
905
+ * @default 1024
906
+ */
907
+ initialSharedBufferSize?: number;
908
+ /**
909
+ * A text encoder that will be used to encode strings into bytes.
910
+ *
911
+ * @default DefaultTextEncoder
912
+ */
913
+ textEncoder?: MessagePackTextEncoder<TBuffer>;
914
+ /**
915
+ * If true, the keys of objects will be sorted before encoding. This can be
916
+ * useful for ensuring consistent encoding of objects with the same keys but
917
+ * in different orders.
918
+ *
919
+ * @default false
920
+ */
921
+ sortKeys?: boolean;
922
+ /**
923
+ * If true, all floats will be encoded as float32, but it may result in loss
924
+ * of precision for some floats (like `1.2`), this is a JavaScript
925
+ * limitation.
926
+ *
927
+ * If false, floats will be encoded as float64, which is more precise but
928
+ * takes up more space.
929
+ *
930
+ * Set to true only if you are sure that your floats can be represented as
931
+ * float32 without loss of precision.
932
+ *
933
+ * @default false
934
+ */
935
+ forceFloat32?: boolean;
936
+ }
937
+ type OmitByPattern<TRecord, Pattern extends string> = { [TKey in keyof TRecord as TKey extends Pattern ? never : TKey]: TRecord[TKey]; };
938
+ type ExtensionEncoder<TBuffer extends Uint8Array = Uint8Array> = OmitByPattern<MessagePackEncoder<TBuffer>, `${string}Extension` | 'resetBuffer' | 'extensions'>;
939
+ //#endregion
940
940
  //#region src/extensions/interfaces/messagePackExtension.d.ts
941
941
  interface MessagePackExtension<TValue = unknown, TBuffer extends Uint8Array = Uint8Array> {
942
942
  /**
@@ -951,9 +951,9 @@ interface MessagePackExtension<TValue = unknown, TBuffer extends Uint8Array = Ui
951
951
  *
952
952
  * @param value - The value to be encoded. This can be of any type, but the
953
953
  * implementation should handle specific types as needed.
954
- * @param buffer - The buffer where the encoded data will be written.
954
+ * @param encoder - The extension encoder where the data will be written.
955
955
  */
956
- encode(value: object | bigint, buffer: MessagePackEncoderBuffer<TBuffer>): void;
956
+ encode(value: object | bigint, encoder: ExtensionEncoder<TBuffer>): void;
957
957
  /**
958
958
  * Decodes a value from the provided DataView starting at the specified
959
959
  * offset. The method should read the necessary bytes from the DataView,
@@ -968,5 +968,5 @@ interface MessagePackExtension<TValue = unknown, TBuffer extends Uint8Array = Ui
968
968
  decode(decoderBuffer: MessagePackDecoderBuffer, size: number): TValue;
969
969
  }
970
970
  //#endregion
971
- export { OmitByPattern as a, ExtensionEncoderBuffer as i, MessagePackEncoderBuffer as n, MessagePackBufferWithExtensions as o, EncoderBufferOptions as r, MessagePackExtension as t };
972
- //# sourceMappingURL=messagePackExtension-Cd99Rw9t.d.cts.map
971
+ export { MessagePackEncoder as a, OmitByPattern as i, EncoderOptions as n, MessagePackBufferWithExtensions as o, ExtensionEncoder as r, MessagePackExtension as t };
972
+ //# sourceMappingURL=messagePackExtension-xBTe48A-.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messagePackExtension-xBTe48A-.d.cts","names":[],"sources":["../../src/interfaces/messagePackBufferWithExtensions.ts","../../src/encoder/interfaces/messagePackEncoder.ts","../../src/encoder/types.ts","../../src/extensions/interfaces/messagePackExtension.ts"],"mappings":";;;;UA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Extension } from "./messagePackExtension-Cd99Rw9t.cjs";
2
+ import { r as ExtensionEncoder, t as MessagePackExtension } from "./messagePackExtension-xBTe48A-.cjs";
3
3
  import { t as MessagePackTime } from "./types-B9KMW-kD.cjs";
4
4
  //#region src/extensions/timestampDate/timestampDate.d.ts
5
5
  /**
@@ -25,9 +25,9 @@ import { t as MessagePackTime } from "./types-B9KMW-kD.cjs";
25
25
  declare class TimestampDateExtension<TBuffer extends Uint8Array = Uint8Array> implements MessagePackExtension<Date, TBuffer> {
26
26
  readonly type = -1;
27
27
  parseToMessagePackTime(date: Date): MessagePackTime;
28
- encode(value: object | bigint, buffer: MessagePackEncoderBuffer<TBuffer>): void;
28
+ encode(value: object | bigint, encoder: ExtensionEncoder<TBuffer>): void;
29
29
  decode(decoderBuffer: MessagePackDecoderBuffer<TBuffer>, size: number): Date;
30
30
  }
31
31
  //#endregion
32
32
  export { TimestampDateExtension as t };
33
- //# sourceMappingURL=timestampDate-Bi1rnvVd.d.cts.map
33
+ //# sourceMappingURL=timestampDate-B8IXKYcA.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timestampDate-B8IXKYcA.d.cts","names":[],"sources":["../../src/extensions/timestampDate/timestampDate.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;cA4BM,uBACJ,gBAAgB,aAAa,uBAClB,qBAAqB,MAAM;WAC7B;EAET,uBAAuB,MAAM,OAAO;EAcpC,OAAO,wBAAwB,SAAS,iBAAiB;EAsBzD,OAAO,eAAe,yBAAyB,UAAU,eAAe"}
@@ -1,5 +1,5 @@
1
1
  import { t as MessagePackDecoderBuffer } from "./messagePackDecoderBuffer-B2rRVlMX.cjs";
2
- import { n as MessagePackEncoderBuffer, t as MessagePackExtension } from "./messagePackExtension-Cd99Rw9t.cjs";
2
+ import { r as ExtensionEncoder, t as MessagePackExtension } from "./messagePackExtension-xBTe48A-.cjs";
3
3
  //#region src/untypedExtension.d.ts
4
4
  declare abstract class UntypedExtension<TValue = unknown, TBuffer extends Uint8Array = Uint8Array> implements MessagePackExtension<TValue, TBuffer> {
5
5
  readonly type: number;
@@ -8,9 +8,9 @@ declare abstract class UntypedExtension<TValue = unknown, TBuffer extends Uint8A
8
8
  * between 0 and 127, default is 0.
9
9
  */
10
10
  constructor(type?: number);
11
- abstract encode(value: object | bigint, buffer: MessagePackEncoderBuffer<TBuffer>): void;
11
+ abstract encode(value: object | bigint, encoder: ExtensionEncoder<TBuffer>): void;
12
12
  abstract decode(decoderBuffer: MessagePackDecoderBuffer, size: number): TValue;
13
13
  }
14
14
  //#endregion
15
15
  export { UntypedExtension as t };
16
- //# sourceMappingURL=untypedExtension-wx6-_4mg.d.cts.map
16
+ //# sourceMappingURL=untypedExtension-DPZG3pQo.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"untypedExtension-wx6-_4mg.d.cts","names":[],"sources":["../../src/untypedExtension.ts"],"mappings":";;;uBAIe,iBACb,kBACA,gBAAgB,aAAa,uBAClB,qBAAqB,QAAQ;WAC/B;;;;;EAMT,YAAY;WAIH,OACP,wBACA,QAAQ,yBAAyB;WAG1B,OACP,eAAe,0BACf,eACC"}
1
+ {"version":3,"file":"untypedExtension-DPZG3pQo.d.cts","names":[],"sources":["../../src/untypedExtension.ts"],"mappings":";;;uBAIe,iBACb,kBACA,gBAAgB,aAAa,uBAClB,qBAAqB,QAAQ;WAC/B;;;;;EAMT,YAAY;WAIH,OACP,wBACA,SAAS,iBAAiB;WAGnB,OACP,eAAe,0BACf,eACC"}
@@ -1,2 +1,2 @@
1
- import { t as UntypedExtension } from "./untypedExtension-wx6-_4mg.cjs";
1
+ import { t as UntypedExtension } from "./untypedExtension-DPZG3pQo.cjs";
2
2
  export = UntypedExtension;
@@ -3,35 +3,35 @@ import { dataTypesFactory } from "@schema-pack/benchmark";
3
3
  //#region src/benchmark/decoderDataTypesFactory.ts
4
4
  const encoder = new Encoder();
5
5
  const decoderDataTypesFactory = {
6
- array16: () => encoder.encode(dataTypesFactory.array16()),
7
- array32: () => encoder.encode(dataTypesFactory.array32()),
8
- bin16: () => encoder.encode(dataTypesFactory.bin16()),
9
- bin32: () => encoder.encode(dataTypesFactory.bin32()),
10
- bin8: () => encoder.encode(dataTypesFactory.bin8()),
11
- false: () => encoder.encode(dataTypesFactory.false()),
12
- fixarray: () => encoder.encode(dataTypesFactory.fixarray()),
13
- fixmap: () => encoder.encode(dataTypesFactory.fixmap()),
14
- fixstr: () => encoder.encode(dataTypesFactory.fixstr()),
15
- float32: () => encoder.encode(dataTypesFactory.float32()),
16
- float64: () => encoder.encode(dataTypesFactory.float64()),
17
- int16: () => encoder.encode(dataTypesFactory.int16()),
18
- int32: () => encoder.encode(dataTypesFactory.int32()),
19
- int64: () => encoder.encode(dataTypesFactory.int64()),
20
- int8: () => encoder.encode(dataTypesFactory.int8()),
21
- map16: () => encoder.encode(dataTypesFactory.map16()),
22
- map32: () => encoder.encode(dataTypesFactory.map32()),
23
- negativeFixint: () => encoder.encode(dataTypesFactory.negativeFixint()),
24
- nil: () => encoder.encode(dataTypesFactory.nil()),
25
- positiveFixint: () => encoder.encode(dataTypesFactory.positiveFixint()),
26
- str16: () => encoder.encode(dataTypesFactory.str16()),
27
- str32: () => encoder.encode(dataTypesFactory.str32()),
28
- str8: () => encoder.encode(dataTypesFactory.str8()),
29
- true: () => encoder.encode(dataTypesFactory.true()),
30
- uint16: () => encoder.encode(dataTypesFactory.uint16()),
31
- uint32: () => encoder.encode(dataTypesFactory.uint32()),
32
- uint64: () => encoder.encode(dataTypesFactory.uint64()),
33
- uint8: () => encoder.encode(dataTypesFactory.uint8()),
34
- undefined: () => encoder.encode(dataTypesFactory.undefined())
6
+ array16: () => encoder.write(dataTypesFactory.array16()).flush(),
7
+ array32: () => encoder.write(dataTypesFactory.array32()).flush(),
8
+ bin16: () => encoder.write(dataTypesFactory.bin16()).flush(),
9
+ bin32: () => encoder.write(dataTypesFactory.bin32()).flush(),
10
+ bin8: () => encoder.write(dataTypesFactory.bin8()).flush(),
11
+ false: () => encoder.write(dataTypesFactory.false()).flush(),
12
+ fixarray: () => encoder.write(dataTypesFactory.fixarray()).flush(),
13
+ fixmap: () => encoder.write(dataTypesFactory.fixmap()).flush(),
14
+ fixstr: () => encoder.write(dataTypesFactory.fixstr()).flush(),
15
+ float32: () => encoder.write(dataTypesFactory.float32()).flush(),
16
+ float64: () => encoder.write(dataTypesFactory.float64()).flush(),
17
+ int16: () => encoder.write(dataTypesFactory.int16()).flush(),
18
+ int32: () => encoder.write(dataTypesFactory.int32()).flush(),
19
+ int64: () => encoder.write(dataTypesFactory.int64()).flush(),
20
+ int8: () => encoder.write(dataTypesFactory.int8()).flush(),
21
+ map16: () => encoder.write(dataTypesFactory.map16()).flush(),
22
+ map32: () => encoder.write(dataTypesFactory.map32()).flush(),
23
+ negativeFixint: () => encoder.write(dataTypesFactory.negativeFixint()).flush(),
24
+ nil: () => encoder.write(dataTypesFactory.nil()).flush(),
25
+ positiveFixint: () => encoder.write(dataTypesFactory.positiveFixint()).flush(),
26
+ str16: () => encoder.write(dataTypesFactory.str16()).flush(),
27
+ str32: () => encoder.write(dataTypesFactory.str32()).flush(),
28
+ str8: () => encoder.write(dataTypesFactory.str8()).flush(),
29
+ true: () => encoder.write(dataTypesFactory.true()).flush(),
30
+ uint16: () => encoder.write(dataTypesFactory.uint16()).flush(),
31
+ uint32: () => encoder.write(dataTypesFactory.uint32()).flush(),
32
+ uint64: () => encoder.write(dataTypesFactory.uint64()).flush(),
33
+ uint8: () => encoder.write(dataTypesFactory.uint8()).flush(),
34
+ undefined: () => encoder.write(dataTypesFactory.undefined()).flush()
35
35
  };
36
36
  //#endregion
37
37
  export { decoderDataTypesFactory as default };
@@ -1 +1 @@
1
- {"version":3,"file":"decoderDataTypesFactory.mjs","names":[],"sources":["../../../src/benchmark/decoderDataTypesFactory.ts"],"sourcesContent":["import { dataTypesFactory } from '@schema-pack/benchmark';\n\nimport Encoder from '../encoder/encoder.ts';\n\nconst encoder = new Encoder();\n\nconst decoderDataTypesFactory: Record<\n keyof typeof dataTypesFactory,\n () => Uint8Array\n> = {\n array16: () => encoder.encode(dataTypesFactory.array16()),\n array32: () => encoder.encode(dataTypesFactory.array32()),\n // bigint: () => encoder.encode(dataTypesFactory.bigint()),\n bin16: () => encoder.encode(dataTypesFactory.bin16()),\n bin32: () => encoder.encode(dataTypesFactory.bin32()),\n bin8: () => encoder.encode(dataTypesFactory.bin8()),\n false: () => encoder.encode(dataTypesFactory.false()),\n fixarray: () => encoder.encode(dataTypesFactory.fixarray()),\n fixmap: () => encoder.encode(dataTypesFactory.fixmap()),\n fixstr: () => encoder.encode(dataTypesFactory.fixstr()),\n float32: () => encoder.encode(dataTypesFactory.float32()),\n float64: () => encoder.encode(dataTypesFactory.float64()),\n int16: () => encoder.encode(dataTypesFactory.int16()),\n int32: () => encoder.encode(dataTypesFactory.int32()),\n int64: () => encoder.encode(dataTypesFactory.int64()),\n int8: () => encoder.encode(dataTypesFactory.int8()),\n map16: () => encoder.encode(dataTypesFactory.map16()),\n map32: () => encoder.encode(dataTypesFactory.map32()),\n negativeFixint: () => encoder.encode(dataTypesFactory.negativeFixint()),\n nil: () => encoder.encode(dataTypesFactory.nil()),\n positiveFixint: () => encoder.encode(dataTypesFactory.positiveFixint()),\n str16: () => encoder.encode(dataTypesFactory.str16()),\n str32: () => encoder.encode(dataTypesFactory.str32()),\n str8: () => encoder.encode(dataTypesFactory.str8()),\n true: () => encoder.encode(dataTypesFactory.true()),\n uint16: () => encoder.encode(dataTypesFactory.uint16()),\n uint32: () => encoder.encode(dataTypesFactory.uint32()),\n uint64: () => encoder.encode(dataTypesFactory.uint64()),\n uint8: () => encoder.encode(dataTypesFactory.uint8()),\n // oxlint-disable-next-line typescript/no-confusing-void-expression\n undefined: () => encoder.encode(dataTypesFactory.undefined()),\n};\n\nexport default decoderDataTypesFactory;\n"],"mappings":";;;AAIA,MAAM,UAAU,IAAI,QAAQ;AAE5B,MAAM,0BAGF;CACF,eAAe,QAAQ,OAAO,iBAAiB,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,OAAO,iBAAiB,MAAM,CAAC;CAEpD,iBAAiB,QAAQ,OAAO,iBAAiB,UAAU,CAAC;AAC9D"}
1
+ {"version":3,"file":"decoderDataTypesFactory.mjs","names":[],"sources":["../../../src/benchmark/decoderDataTypesFactory.ts"],"sourcesContent":["import { dataTypesFactory } from '@schema-pack/benchmark';\n\nimport Encoder from '../encoder/encoder.ts';\n\nconst encoder = new Encoder();\n\nconst decoderDataTypesFactory: Record<\n keyof typeof dataTypesFactory,\n () => Uint8Array\n> = {\n array16: () => encoder.write(dataTypesFactory.array16()).flush(),\n array32: () => encoder.write(dataTypesFactory.array32()).flush(),\n // bigint: () => encoder.write(dataTypesFactory.bigint()).flush(),\n bin16: () => encoder.write(dataTypesFactory.bin16()).flush(),\n bin32: () => encoder.write(dataTypesFactory.bin32()).flush(),\n bin8: () => encoder.write(dataTypesFactory.bin8()).flush(),\n false: () => encoder.write(dataTypesFactory.false()).flush(),\n fixarray: () => encoder.write(dataTypesFactory.fixarray()).flush(),\n fixmap: () => encoder.write(dataTypesFactory.fixmap()).flush(),\n fixstr: () => encoder.write(dataTypesFactory.fixstr()).flush(),\n float32: () => encoder.write(dataTypesFactory.float32()).flush(),\n float64: () => encoder.write(dataTypesFactory.float64()).flush(),\n int16: () => encoder.write(dataTypesFactory.int16()).flush(),\n int32: () => encoder.write(dataTypesFactory.int32()).flush(),\n int64: () => encoder.write(dataTypesFactory.int64()).flush(),\n int8: () => encoder.write(dataTypesFactory.int8()).flush(),\n map16: () => encoder.write(dataTypesFactory.map16()).flush(),\n map32: () => encoder.write(dataTypesFactory.map32()).flush(),\n negativeFixint: () =>\n encoder.write(dataTypesFactory.negativeFixint()).flush(),\n nil: () => encoder.write(dataTypesFactory.nil()).flush(),\n positiveFixint: () =>\n encoder.write(dataTypesFactory.positiveFixint()).flush(),\n str16: () => encoder.write(dataTypesFactory.str16()).flush(),\n str32: () => encoder.write(dataTypesFactory.str32()).flush(),\n str8: () => encoder.write(dataTypesFactory.str8()).flush(),\n true: () => encoder.write(dataTypesFactory.true()).flush(),\n uint16: () => encoder.write(dataTypesFactory.uint16()).flush(),\n uint32: () => encoder.write(dataTypesFactory.uint32()).flush(),\n uint64: () => encoder.write(dataTypesFactory.uint64()).flush(),\n uint8: () => encoder.write(dataTypesFactory.uint8()).flush(),\n // oxlint-disable-next-line typescript/no-confusing-void-expression\n undefined: () => encoder.write(dataTypesFactory.undefined()).flush(),\n};\n\nexport default decoderDataTypesFactory;\n"],"mappings":";;;AAIA,MAAM,UAAU,IAAI,QAAQ;AAE5B,MAAM,0BAGF;CACF,eAAe,QAAQ,MAAM,iBAAiB,QAAQ,CAAC,CAAC,CAAC,MAAM;CAC/D,eAAe,QAAQ,MAAM,iBAAiB,QAAQ,CAAC,CAAC,CAAC,MAAM;CAE/D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,YAAY,QAAQ,MAAM,iBAAiB,KAAK,CAAC,CAAC,CAAC,MAAM;CACzD,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,gBAAgB,QAAQ,MAAM,iBAAiB,SAAS,CAAC,CAAC,CAAC,MAAM;CACjE,cAAc,QAAQ,MAAM,iBAAiB,OAAO,CAAC,CAAC,CAAC,MAAM;CAC7D,cAAc,QAAQ,MAAM,iBAAiB,OAAO,CAAC,CAAC,CAAC,MAAM;CAC7D,eAAe,QAAQ,MAAM,iBAAiB,QAAQ,CAAC,CAAC,CAAC,MAAM;CAC/D,eAAe,QAAQ,MAAM,iBAAiB,QAAQ,CAAC,CAAC,CAAC,MAAM;CAC/D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,YAAY,QAAQ,MAAM,iBAAiB,KAAK,CAAC,CAAC,CAAC,MAAM;CACzD,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,sBACE,QAAQ,MAAM,iBAAiB,eAAe,CAAC,CAAC,CAAC,MAAM;CACzD,WAAW,QAAQ,MAAM,iBAAiB,IAAI,CAAC,CAAC,CAAC,MAAM;CACvD,sBACE,QAAQ,MAAM,iBAAiB,eAAe,CAAC,CAAC,CAAC,MAAM;CACzD,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAC3D,YAAY,QAAQ,MAAM,iBAAiB,KAAK,CAAC,CAAC,CAAC,MAAM;CACzD,YAAY,QAAQ,MAAM,iBAAiB,KAAK,CAAC,CAAC,CAAC,MAAM;CACzD,cAAc,QAAQ,MAAM,iBAAiB,OAAO,CAAC,CAAC,CAAC,MAAM;CAC7D,cAAc,QAAQ,MAAM,iBAAiB,OAAO,CAAC,CAAC,CAAC,MAAM;CAC7D,cAAc,QAAQ,MAAM,iBAAiB,OAAO,CAAC,CAAC,CAAC,MAAM;CAC7D,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAM;CAE3D,iBAAiB,QAAQ,MAAM,iBAAiB,UAAU,CAAC,CAAC,CAAC,MAAM;AACrE"}
@@ -1,6 +1,6 @@
1
1
  import { t as MessagePackDecoderBuffer } from "./messagePackDecoderBuffer-Cqvg0zW7.mjs";
2
- import { i as ExtensionEncoderBuffer } from "./messagePackExtension-fq36EMAg.mjs";
3
- import { t as UntypedExtension } from "./untypedExtension-Ckk9RwQw.mjs";
2
+ import { r as ExtensionEncoder } from "./messagePackExtension-Ceq7jzFB.mjs";
3
+ import { t as UntypedExtension } from "./untypedExtension-DKgyS2ak.mjs";
4
4
  //#region src/extensions/bigint/bigInt.d.ts
5
5
  /**
6
6
  * This class encodes and decodes JavaScript BigInt values that are outside the
@@ -20,9 +20,9 @@ declare class BigIntExtension<TBuffer extends Uint8Array = Uint8Array> extends U
20
20
  * indicate negativity.
21
21
  *
22
22
  * @param value - The BigInt value to encode.
23
- * @param buffer - The buffer to write the encoded data to.
23
+ * @param encoder - The extension encoder to write the encoded data to.
24
24
  */
25
- encode(value: object | bigint, buffer: ExtensionEncoderBuffer<TBuffer>): void;
25
+ encode(value: object | bigint, encoder: ExtensionEncoder<TBuffer>): void;
26
26
  /**
27
27
  * Decodes a BigInt value from the provided DataView. It reads the encoded
28
28
  * data, reconstructs the magnitude, and determines the sign based on the
@@ -32,4 +32,4 @@ declare class BigIntExtension<TBuffer extends Uint8Array = Uint8Array> extends U
32
32
  }
33
33
  //#endregion
34
34
  export { BigIntExtension as t };
35
- //# sourceMappingURL=bigInt-D37SPzzB.d.mts.map
35
+ //# sourceMappingURL=bigInt-lSrNuXkn.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigInt-lSrNuXkn.d.mts","names":[],"sources":["../../src/extensions/bigint/bigInt.ts"],"mappings":";;;;;;;;;;;;cAcM,gBACJ,gBAAgB,aAAa,oBACrB,yBAAyB;;;;;;;;;;;;EAYjC,OAAO,wBAAwB,SAAS,iBAAiB;;;;;;EA4BzD,OAAO,QAAQ,0BAA0B"}
@@ -1,4 +1,4 @@
1
- import { o as MessagePackBufferWithExtensions, t as MessagePackExtension } from "./messagePackExtension-Cd99Rw9t.cjs";
1
+ import { o as MessagePackBufferWithExtensions, t as MessagePackExtension } from "./messagePackExtension-Ceq7jzFB.mjs";
2
2
  //#region src/bufferWithExtensions.d.ts
3
3
  declare abstract class BufferWithExtensions<TBuffer extends Uint8Array = Uint8Array> implements MessagePackBufferWithExtensions<TBuffer> {
4
4
  protected extensions: Map<number, MessagePackExtension<unknown, TBuffer>>;
@@ -9,4 +9,4 @@ declare abstract class BufferWithExtensions<TBuffer extends Uint8Array = Uint8Ar
9
9
  }
10
10
  //#endregion
11
11
  export { BufferWithExtensions as t };
12
- //# sourceMappingURL=bufferWithExtensions-n6DtcUoA.d.cts.map
12
+ //# sourceMappingURL=bufferWithExtensions-Bc7vjIkw.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferWithExtensions-n6DtcUoA.d.cts","names":[],"sources":["../../src/bufferWithExtensions.ts"],"mappings":";;uBAGe,qBACb,gBAAgB,aAAa,uBAClB,gCAAgC;YACjC,YAAY,YAAY,8BAA8B;EAEhE;EAIA,aAAa,WAAW,8BAA8B;EAsBtD,qBACE,WAAW,8BAA8B;EAuB3C,eAAe,eAAe,8BAA8B"}
1
+ {"version":3,"file":"bufferWithExtensions-Bc7vjIkw.d.mts","names":[],"sources":["../../src/bufferWithExtensions.ts"],"mappings":";;uBAGe,qBACb,gBAAgB,aAAa,uBAClB,gCAAgC;YACjC,YAAY,YAAY,8BAA8B;EAEhE;EAIA,aAAa,WAAW,8BAA8B;EAsBtD,qBACE,WAAW,8BAA8B;EAuB3C,eAAe,eAAe,8BAA8B"}
@@ -1,2 +1,2 @@
1
- import { t as BufferWithExtensions } from "./bufferWithExtensions-DzAs7yX1.mjs";
1
+ import { t as BufferWithExtensions } from "./bufferWithExtensions-Bc7vjIkw.mjs";
2
2
  export { BufferWithExtensions as default };
@@ -1,2 +1,2 @@
1
- import { t as Decoder } from "../decoder-ByAWOgvm.mjs";
1
+ import { t as Decoder } from "../decoder-CQrtmASU.mjs";
2
2
  export { Decoder as default };
@@ -1,2 +1,2 @@
1
- import { t as DecoderBuffer } from "../decoderBuffer-93dMcsbx.mjs";
1
+ import { t as DecoderBuffer } from "../decoderBuffer-BKic0U2F.mjs";
2
2
  export { DecoderBuffer as default };
@@ -2,7 +2,7 @@ import { t as MessagePackTextDecoder } from "../messagePackTextDecoder-J3fr-wQn.
2
2
  import { t as MessagePackDecoderBuffer } from "../messagePackDecoderBuffer-Cqvg0zW7.mjs";
3
3
  import { t as decode } from "../decode-BraWmoPw.mjs";
4
4
  import { t as DefaultTextDecoder } from "../defaultTextDecoder-DztyzoBV.mjs";
5
- import { t as DecoderBuffer } from "../decoderBuffer-93dMcsbx.mjs";
6
- import { t as Decoder } from "../decoder-ByAWOgvm.mjs";
5
+ import { t as DecoderBuffer } from "../decoderBuffer-BKic0U2F.mjs";
6
+ import { t as Decoder } from "../decoder-CQrtmASU.mjs";
7
7
  import { t as NodeTextDecoder } from "../nodeTextDecoder-Dhre7WkB.mjs";
8
8
  export { Decoder, DecoderBuffer, DefaultTextDecoder, type MessagePackDecoderBuffer, type MessagePackTextDecoder, NodeTextDecoder, decode };
@@ -1,6 +1,6 @@
1
- import { t as MessagePackExtension } from "./messagePackExtension-fq36EMAg.mjs";
1
+ import { t as MessagePackExtension } from "./messagePackExtension-Ceq7jzFB.mjs";
2
2
  import { t as DecoderBufferOptions } from "./types-CNR_qJsr.mjs";
3
- import { t as DecoderBuffer } from "./decoderBuffer-93dMcsbx.mjs";
3
+ import { t as DecoderBuffer } from "./decoderBuffer-BKic0U2F.mjs";
4
4
  //#region src/decoder/decoder.d.ts
5
5
  declare class Decoder<TBuffer extends Uint8Array = Uint8Array> {
6
6
  protected decoderBuffer: DecoderBuffer<TBuffer>;
@@ -12,4 +12,4 @@ declare class Decoder<TBuffer extends Uint8Array = Uint8Array> {
12
12
  }
13
13
  //#endregion
14
14
  export { Decoder as t };
15
- //# sourceMappingURL=decoder-ByAWOgvm.d.mts.map
15
+ //# sourceMappingURL=decoder-CQrtmASU.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decoder-ByAWOgvm.d.mts","names":[],"sources":["../../src/decoder/decoder.ts"],"mappings":";;;;cAIM,QAAQ,gBAAgB,aAAa;YAC/B,eAAe,cAAc;EAEvC,YAAY,UAAU,qBAAqB;EAI3C,OAAO,kBAAkB,eAAe,UAAU;EAQlD,aAAa,WAAW,8BAA8B;EAMtD,qBACE,WAAW,8BAA8B;EAO3C,iBACE,cACA,WAAW,KAAK,8BAA8B"}
1
+ {"version":3,"file":"decoder-CQrtmASU.d.mts","names":[],"sources":["../../src/decoder/decoder.ts"],"mappings":";;;;cAIM,QAAQ,gBAAgB,aAAa;YAC/B,eAAe,cAAc;EAEvC,YAAY,UAAU,qBAAqB;EAI3C,OAAO,kBAAkB,eAAe,UAAU;EAQlD,aAAa,WAAW,8BAA8B;EAMtD,qBACE,WAAW,8BAA8B;EAO3C,iBACE,cACA,WAAW,KAAK,8BAA8B"}
@@ -1,5 +1,5 @@
1
1
  import { t as MessagePackDecoderBuffer } from "./messagePackDecoderBuffer-Cqvg0zW7.mjs";
2
- import { t as BufferWithExtensions } from "./bufferWithExtensions-DzAs7yX1.mjs";
2
+ import { t as BufferWithExtensions } from "./bufferWithExtensions-Bc7vjIkw.mjs";
3
3
  import { t as DefaultTextDecoder } from "./defaultTextDecoder-DztyzoBV.mjs";
4
4
  import { t as DecoderBufferOptions } from "./types-CNR_qJsr.mjs";
5
5
  //#region src/decoder/decoderBuffer.d.ts
@@ -19,4 +19,4 @@ declare class DecoderBuffer<TBuffer extends Uint8Array = Uint8Array> extends Buf
19
19
  }
20
20
  //#endregion
21
21
  export { DecoderBuffer as t };
22
- //# sourceMappingURL=decoderBuffer-93dMcsbx.d.mts.map
22
+ //# sourceMappingURL=decoderBuffer-BKic0U2F.d.mts.map