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