@solana/codecs-core 5.1.0-canary-20251202173352 → 5.1.0-canary-20251202174830

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.
@@ -108,7 +108,7 @@ function combineCodec(encoder, decoder) {
108
108
 
109
109
  // src/add-codec-sentinel.ts
110
110
  function addEncoderSentinel(encoder, sentinel) {
111
- const write = (value, bytes, offset) => {
111
+ const write = ((value, bytes, offset) => {
112
112
  const encoderBytes = encoder.encode(value);
113
113
  if (findSentinelIndex(encoderBytes, sentinel) >= 0) {
114
114
  throw new SolanaError(SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL, {
@@ -123,7 +123,7 @@ function addEncoderSentinel(encoder, sentinel) {
123
123
  bytes.set(sentinel, offset);
124
124
  offset += sentinel.length;
125
125
  return offset;
126
- };
126
+ });
127
127
  if (isFixedSize(encoder)) {
128
128
  return createEncoder({ ...encoder, fixedSize: encoder.fixedSize + sentinel.length, write });
129
129
  }
@@ -135,7 +135,7 @@ function addEncoderSentinel(encoder, sentinel) {
135
135
  });
136
136
  }
137
137
  function addDecoderSentinel(decoder, sentinel) {
138
- const read = (bytes, offset) => {
138
+ const read = ((bytes, offset) => {
139
139
  const candidateBytes = offset === 0 ? bytes : bytes.slice(offset);
140
140
  const sentinelIndex = findSentinelIndex(candidateBytes, sentinel);
141
141
  if (sentinelIndex === -1) {
@@ -148,7 +148,7 @@ function addDecoderSentinel(decoder, sentinel) {
148
148
  }
149
149
  const preSentinelBytes = candidateBytes.slice(0, sentinelIndex);
150
150
  return [decoder.decode(preSentinelBytes), offset + preSentinelBytes.length + sentinel.length];
151
- };
151
+ });
152
152
  if (isFixedSize(decoder)) {
153
153
  return createDecoder({ ...decoder, fixedSize: decoder.fixedSize + sentinel.length, read });
154
154
  }
@@ -199,12 +199,12 @@ function assertByteArrayOffsetIsNotOutOfRange(codecDescription, offset, bytesLen
199
199
 
200
200
  // src/add-codec-size-prefix.ts
201
201
  function addEncoderSizePrefix(encoder, prefix) {
202
- const write = (value, bytes, offset) => {
202
+ const write = ((value, bytes, offset) => {
203
203
  const encoderBytes = encoder.encode(value);
204
204
  offset = prefix.write(encoderBytes.length, bytes, offset);
205
205
  bytes.set(encoderBytes, offset);
206
206
  return offset + encoderBytes.length;
207
- };
207
+ });
208
208
  if (isFixedSize(prefix) && isFixedSize(encoder)) {
209
209
  return createEncoder({ ...encoder, fixedSize: prefix.fixedSize + encoder.fixedSize, write });
210
210
  }
@@ -222,7 +222,7 @@ function addEncoderSizePrefix(encoder, prefix) {
222
222
  });
223
223
  }
224
224
  function addDecoderSizePrefix(decoder, prefix) {
225
- const read = (bytes, offset) => {
225
+ const read = ((bytes, offset) => {
226
226
  const [bigintSize, decoderOffset] = prefix.read(bytes, offset);
227
227
  const size = Number(bigintSize);
228
228
  offset = decoderOffset;
@@ -231,7 +231,7 @@ function addDecoderSizePrefix(decoder, prefix) {
231
231
  }
232
232
  assertByteArrayHasEnoughBytesForCodec("addDecoderSizePrefix", size, bytes);
233
233
  return [decoder.decode(bytes), offset + size];
234
- };
234
+ });
235
235
  if (isFixedSize(prefix) && isFixedSize(decoder)) {
236
236
  return createDecoder({ ...decoder, fixedSize: prefix.fixedSize + decoder.fixedSize, read });
237
237
  }