@solana/codecs-data-structures 2.0.0-experimental.ee4214c → 2.0.0-experimental.efe6f4d

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 (38) hide show
  1. package/dist/index.browser.cjs +96 -94
  2. package/dist/index.browser.cjs.map +1 -1
  3. package/dist/index.browser.js +96 -94
  4. package/dist/index.browser.js.map +1 -1
  5. package/dist/index.development.js +104 -104
  6. package/dist/index.development.js.map +1 -1
  7. package/dist/index.native.js +94 -94
  8. package/dist/index.native.js.map +1 -1
  9. package/dist/index.node.cjs +94 -94
  10. package/dist/index.node.cjs.map +1 -1
  11. package/dist/index.node.js +94 -94
  12. package/dist/index.node.js.map +1 -1
  13. package/dist/index.production.min.js +21 -21
  14. package/dist/types/array.d.ts +9 -9
  15. package/dist/types/array.d.ts.map +1 -1
  16. package/dist/types/bit-array.d.ts +9 -9
  17. package/dist/types/bit-array.d.ts.map +1 -1
  18. package/dist/types/boolean.d.ts +9 -9
  19. package/dist/types/boolean.d.ts.map +1 -1
  20. package/dist/types/bytes.d.ts +9 -9
  21. package/dist/types/bytes.d.ts.map +1 -1
  22. package/dist/types/data-enum.d.ts +9 -9
  23. package/dist/types/data-enum.d.ts.map +1 -1
  24. package/dist/types/map.d.ts +9 -9
  25. package/dist/types/map.d.ts.map +1 -1
  26. package/dist/types/nullable.d.ts +9 -9
  27. package/dist/types/nullable.d.ts.map +1 -1
  28. package/dist/types/scalar-enum.d.ts +9 -9
  29. package/dist/types/scalar-enum.d.ts.map +1 -1
  30. package/dist/types/set.d.ts +9 -9
  31. package/dist/types/set.d.ts.map +1 -1
  32. package/dist/types/struct.d.ts +9 -9
  33. package/dist/types/struct.d.ts.map +1 -1
  34. package/dist/types/tuple.d.ts +9 -9
  35. package/dist/types/tuple.d.ts.map +1 -1
  36. package/dist/types/unit.d.ts +9 -9
  37. package/dist/types/unit.d.ts.map +1 -1
  38. package/package.json +9 -9
@@ -72,10 +72,10 @@ function arrayCodecHelper(item, size, description) {
72
72
  maxSize: getArrayLikeCodecSizeFromChildren(size, [item.maxSize])
73
73
  };
74
74
  }
75
- function getArrayEncoder(item, options = {}) {
76
- const size = options.size ?? codecsNumbers.getU32Encoder();
75
+ function getArrayEncoder(item, config = {}) {
76
+ const size = config.size ?? codecsNumbers.getU32Encoder();
77
77
  return {
78
- ...arrayCodecHelper(item, size, options.description),
78
+ ...arrayCodecHelper(item, size, config.description),
79
79
  encode: (value) => {
80
80
  if (typeof size === "number") {
81
81
  assertValidNumberOfItemsForCodec("array", size, value.length);
@@ -84,10 +84,10 @@ function getArrayEncoder(item, options = {}) {
84
84
  }
85
85
  };
86
86
  }
87
- function getArrayDecoder(item, options = {}) {
88
- const size = options.size ?? codecsNumbers.getU32Decoder();
87
+ function getArrayDecoder(item, config = {}) {
88
+ const size = config.size ?? codecsNumbers.getU32Decoder();
89
89
  return {
90
- ...arrayCodecHelper(item, size, options.description),
90
+ ...arrayCodecHelper(item, size, config.description),
91
91
  decode: (bytes, offset = 0) => {
92
92
  if (typeof size === "object" && bytes.slice(offset).length === 0) {
93
93
  return [[], offset];
@@ -104,15 +104,15 @@ function getArrayDecoder(item, options = {}) {
104
104
  }
105
105
  };
106
106
  }
107
- function getArrayCodec(item, options = {}) {
108
- return codecsCore.combineCodec(getArrayEncoder(item, options), getArrayDecoder(item, options));
107
+ function getArrayCodec(item, config = {}) {
108
+ return codecsCore.combineCodec(getArrayEncoder(item, config), getArrayDecoder(item, config));
109
109
  }
110
- var getBitArrayEncoder = (size, options = {}) => {
111
- const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
112
- const backward = parsedOptions.backward ?? false;
110
+ var getBitArrayEncoder = (size, config = {}) => {
111
+ const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
112
+ const backward = parsedConfig.backward ?? false;
113
113
  const backwardSuffix = backward ? "; backward" : "";
114
114
  return {
115
- description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
115
+ description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
116
116
  encode(value) {
117
117
  const bytes = [];
118
118
  for (let i = 0; i < size; i += 1) {
@@ -133,9 +133,9 @@ var getBitArrayEncoder = (size, options = {}) => {
133
133
  maxSize: size
134
134
  };
135
135
  };
136
- var getBitArrayDecoder = (size, options = {}) => {
137
- const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
138
- const backward = parsedOptions.backward ?? false;
136
+ var getBitArrayDecoder = (size, config = {}) => {
137
+ const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
138
+ const backward = parsedConfig.backward ?? false;
139
139
  const backwardSuffix = backward ? "; backward" : "";
140
140
  return {
141
141
  decode(bytes, offset = 0) {
@@ -156,24 +156,24 @@ var getBitArrayDecoder = (size, options = {}) => {
156
156
  });
157
157
  return [booleans, offset + size];
158
158
  },
159
- description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
159
+ description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
160
160
  fixedSize: size,
161
161
  maxSize: size
162
162
  };
163
163
  };
164
- var getBitArrayCodec = (size, options = {}) => codecsCore.combineCodec(getBitArrayEncoder(size, options), getBitArrayDecoder(size, options));
165
- function getBooleanEncoder(options = {}) {
166
- const size = options.size ?? codecsNumbers.getU8Encoder();
164
+ var getBitArrayCodec = (size, config = {}) => codecsCore.combineCodec(getBitArrayEncoder(size, config), getBitArrayDecoder(size, config));
165
+ function getBooleanEncoder(config = {}) {
166
+ const size = config.size ?? codecsNumbers.getU8Encoder();
167
167
  codecsCore.assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");
168
168
  return {
169
- description: options.description ?? `bool(${size.description})`,
169
+ description: config.description ?? `bool(${size.description})`,
170
170
  encode: (value) => size.encode(value ? 1 : 0),
171
171
  fixedSize: size.fixedSize,
172
172
  maxSize: size.fixedSize
173
173
  };
174
174
  }
175
- function getBooleanDecoder(options = {}) {
176
- const size = options.size ?? codecsNumbers.getU8Decoder();
175
+ function getBooleanDecoder(config = {}) {
176
+ const size = config.size ?? codecsNumbers.getU8Decoder();
177
177
  codecsCore.assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");
178
178
  return {
179
179
  decode: (bytes, offset = 0) => {
@@ -181,18 +181,18 @@ function getBooleanDecoder(options = {}) {
181
181
  const [value, vOffset] = size.decode(bytes, offset);
182
182
  return [value === 1, vOffset];
183
183
  },
184
- description: options.description ?? `bool(${size.description})`,
184
+ description: config.description ?? `bool(${size.description})`,
185
185
  fixedSize: size.fixedSize,
186
186
  maxSize: size.fixedSize
187
187
  };
188
188
  }
189
- function getBooleanCodec(options = {}) {
190
- return codecsCore.combineCodec(getBooleanEncoder(options), getBooleanDecoder(options));
189
+ function getBooleanCodec(config = {}) {
190
+ return codecsCore.combineCodec(getBooleanEncoder(config), getBooleanDecoder(config));
191
191
  }
192
- function getBytesEncoder(options = {}) {
193
- const size = options.size ?? "variable";
192
+ function getBytesEncoder(config = {}) {
193
+ const size = config.size ?? "variable";
194
194
  const sizeDescription = typeof size === "object" ? size.description : `${size}`;
195
- const description = options.description ?? `bytes(${sizeDescription})`;
195
+ const description = config.description ?? `bytes(${sizeDescription})`;
196
196
  const byteEncoder = {
197
197
  description,
198
198
  encode: (value) => value,
@@ -214,10 +214,10 @@ function getBytesEncoder(options = {}) {
214
214
  }
215
215
  };
216
216
  }
217
- function getBytesDecoder(options = {}) {
218
- const size = options.size ?? "variable";
217
+ function getBytesDecoder(config = {}) {
218
+ const size = config.size ?? "variable";
219
219
  const sizeDescription = typeof size === "object" ? size.description : `${size}`;
220
- const description = options.description ?? `bytes(${sizeDescription})`;
220
+ const description = config.description ?? `bytes(${sizeDescription})`;
221
221
  const byteDecoder = {
222
222
  decode: (bytes, offset = 0) => {
223
223
  const slice = bytes.slice(offset);
@@ -248,8 +248,8 @@ function getBytesDecoder(options = {}) {
248
248
  }
249
249
  };
250
250
  }
251
- function getBytesCodec(options = {}) {
252
- return codecsCore.combineCodec(getBytesEncoder(options), getBytesDecoder(options));
251
+ function getBytesCodec(config = {}) {
252
+ return codecsCore.combineCodec(getBytesEncoder(config), getBytesDecoder(config));
253
253
  }
254
254
  function dataEnumCodecHelper(variants, prefix, description) {
255
255
  const fieldDescriptions = variants.map(([name, codec]) => `${String(name)}${codec ? `: ${codec.description}` : ""}`).join(", ");
@@ -262,10 +262,10 @@ function dataEnumCodecHelper(variants, prefix, description) {
262
262
  maxSize: variants.length === 0 ? prefix.maxSize : sumCodecSizes([prefix.maxSize, maxVariantSize])
263
263
  };
264
264
  }
265
- function getDataEnumEncoder(variants, options = {}) {
266
- const prefix = options.size ?? codecsNumbers.getU8Encoder();
265
+ function getDataEnumEncoder(variants, config = {}) {
266
+ const prefix = config.size ?? codecsNumbers.getU8Encoder();
267
267
  return {
268
- ...dataEnumCodecHelper(variants, prefix, options.description),
268
+ ...dataEnumCodecHelper(variants, prefix, config.description),
269
269
  encode: (variant) => {
270
270
  const discriminator = variants.findIndex(([key]) => variant.__kind === key);
271
271
  if (discriminator < 0) {
@@ -280,10 +280,10 @@ function getDataEnumEncoder(variants, options = {}) {
280
280
  }
281
281
  };
282
282
  }
283
- function getDataEnumDecoder(variants, options = {}) {
284
- const prefix = options.size ?? codecsNumbers.getU8Decoder();
283
+ function getDataEnumDecoder(variants, config = {}) {
284
+ const prefix = config.size ?? codecsNumbers.getU8Decoder();
285
285
  return {
286
- ...dataEnumCodecHelper(variants, prefix, options.description),
286
+ ...dataEnumCodecHelper(variants, prefix, config.description),
287
287
  decode: (bytes, offset = 0) => {
288
288
  codecsCore.assertByteArrayIsNotEmptyForCodec("dataEnum", bytes, offset);
289
289
  const [discriminator, dOffset] = prefix.decode(bytes, offset);
@@ -300,8 +300,8 @@ function getDataEnumDecoder(variants, options = {}) {
300
300
  }
301
301
  };
302
302
  }
303
- function getDataEnumCodec(variants, options = {}) {
304
- return codecsCore.combineCodec(getDataEnumEncoder(variants, options), getDataEnumDecoder(variants, options));
303
+ function getDataEnumCodec(variants, config = {}) {
304
+ return codecsCore.combineCodec(getDataEnumEncoder(variants, config), getDataEnumDecoder(variants, config));
305
305
  }
306
306
  function mapCodecHelper(key, value, size, description) {
307
307
  if (size === "remainder" && (key.fixedSize === null || value.fixedSize === null)) {
@@ -313,10 +313,10 @@ function mapCodecHelper(key, value, size, description) {
313
313
  maxSize: getArrayLikeCodecSizeFromChildren(size, [key.maxSize, value.maxSize])
314
314
  };
315
315
  }
316
- function getMapEncoder(key, value, options = {}) {
317
- const size = options.size ?? codecsNumbers.getU32Encoder();
316
+ function getMapEncoder(key, value, config = {}) {
317
+ const size = config.size ?? codecsNumbers.getU32Encoder();
318
318
  return {
319
- ...mapCodecHelper(key, value, size, options.description),
319
+ ...mapCodecHelper(key, value, size, config.description),
320
320
  encode: (map) => {
321
321
  if (typeof size === "number") {
322
322
  assertValidNumberOfItemsForCodec("map", size, map.size);
@@ -326,10 +326,10 @@ function getMapEncoder(key, value, options = {}) {
326
326
  }
327
327
  };
328
328
  }
329
- function getMapDecoder(key, value, options = {}) {
330
- const size = options.size ?? codecsNumbers.getU32Decoder();
329
+ function getMapDecoder(key, value, config = {}) {
330
+ const size = config.size ?? codecsNumbers.getU32Decoder();
331
331
  return {
332
- ...mapCodecHelper(key, value, size, options.description),
332
+ ...mapCodecHelper(key, value, size, config.description),
333
333
  decode: (bytes, offset = 0) => {
334
334
  const map = /* @__PURE__ */ new Map();
335
335
  if (typeof size === "object" && bytes.slice(offset).length === 0) {
@@ -353,8 +353,8 @@ function getMapDecoder(key, value, options = {}) {
353
353
  }
354
354
  };
355
355
  }
356
- function getMapCodec(key, value, options = {}) {
357
- return codecsCore.combineCodec(getMapEncoder(key, value, options), getMapDecoder(key, value, options));
356
+ function getMapCodec(key, value, config = {}) {
357
+ return codecsCore.combineCodec(getMapEncoder(key, value, config), getMapDecoder(key, value, config));
358
358
  }
359
359
  function nullableCodecHelper(item, prefix, fixed, description) {
360
360
  let descriptionSuffix = `; ${prefix.description}`;
@@ -371,11 +371,11 @@ function nullableCodecHelper(item, prefix, fixed, description) {
371
371
  maxSize: sumCodecSizes([prefix.maxSize, item.maxSize])
372
372
  };
373
373
  }
374
- function getNullableEncoder(item, options = {}) {
375
- const prefix = options.prefix ?? codecsNumbers.getU8Encoder();
376
- const fixed = options.fixed ?? false;
374
+ function getNullableEncoder(item, config = {}) {
375
+ const prefix = config.prefix ?? codecsNumbers.getU8Encoder();
376
+ const fixed = config.fixed ?? false;
377
377
  return {
378
- ...nullableCodecHelper(item, prefix, fixed, options.description),
378
+ ...nullableCodecHelper(item, prefix, fixed, config.description),
379
379
  encode: (option) => {
380
380
  const prefixByte = prefix.encode(Number(option !== null));
381
381
  let itemBytes = option !== null ? item.encode(option) : new Uint8Array();
@@ -384,11 +384,11 @@ function getNullableEncoder(item, options = {}) {
384
384
  }
385
385
  };
386
386
  }
387
- function getNullableDecoder(item, options = {}) {
388
- const prefix = options.prefix ?? codecsNumbers.getU8Decoder();
389
- const fixed = options.fixed ?? false;
387
+ function getNullableDecoder(item, config = {}) {
388
+ const prefix = config.prefix ?? codecsNumbers.getU8Decoder();
389
+ const fixed = config.fixed ?? false;
390
390
  return {
391
- ...nullableCodecHelper(item, prefix, fixed, options.description),
391
+ ...nullableCodecHelper(item, prefix, fixed, config.description),
392
392
  decode: (bytes, offset = 0) => {
393
393
  if (bytes.length - offset <= 0) {
394
394
  return [null, offset];
@@ -405,8 +405,8 @@ function getNullableDecoder(item, options = {}) {
405
405
  }
406
406
  };
407
407
  }
408
- function getNullableCodec(item, options = {}) {
409
- return codecsCore.combineCodec(getNullableEncoder(item, options), getNullableDecoder(item, options));
408
+ function getNullableCodec(item, config = {}) {
409
+ return codecsCore.combineCodec(getNullableEncoder(item, config), getNullableDecoder(item, config));
410
410
  }
411
411
  function scalarEnumCoderHelper(constructor, prefix, description) {
412
412
  const enumKeys = Object.keys(constructor);
@@ -428,9 +428,9 @@ function scalarEnumCoderHelper(constructor, prefix, description) {
428
428
  stringValues
429
429
  };
430
430
  }
431
- function getScalarEnumEncoder(constructor, options = {}) {
432
- const prefix = options.size ?? codecsNumbers.getU8Encoder();
433
- const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, options.description);
431
+ function getScalarEnumEncoder(constructor, config = {}) {
432
+ const prefix = config.size ?? codecsNumbers.getU8Encoder();
433
+ const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, config.description);
434
434
  return {
435
435
  description,
436
436
  encode: (value) => {
@@ -452,12 +452,12 @@ function getScalarEnumEncoder(constructor, options = {}) {
452
452
  maxSize
453
453
  };
454
454
  }
455
- function getScalarEnumDecoder(constructor, options = {}) {
456
- const prefix = options.size ?? codecsNumbers.getU8Decoder();
455
+ function getScalarEnumDecoder(constructor, config = {}) {
456
+ const prefix = config.size ?? codecsNumbers.getU8Decoder();
457
457
  const { description, fixedSize, maxSize, minRange, maxRange, isNumericEnum, enumValues } = scalarEnumCoderHelper(
458
458
  constructor,
459
459
  prefix,
460
- options.description
460
+ config.description
461
461
  );
462
462
  return {
463
463
  decode: (bytes, offset = 0) => {
@@ -477,8 +477,8 @@ function getScalarEnumDecoder(constructor, options = {}) {
477
477
  maxSize
478
478
  };
479
479
  }
480
- function getScalarEnumCodec(constructor, options = {}) {
481
- return codecsCore.combineCodec(getScalarEnumEncoder(constructor, options), getScalarEnumDecoder(constructor, options));
480
+ function getScalarEnumCodec(constructor, config = {}) {
481
+ return codecsCore.combineCodec(getScalarEnumEncoder(constructor, config), getScalarEnumDecoder(constructor, config));
482
482
  }
483
483
  function setCodecHelper(item, size, description) {
484
484
  if (size === "remainder" && item.fixedSize === null) {
@@ -490,10 +490,10 @@ function setCodecHelper(item, size, description) {
490
490
  maxSize: getArrayLikeCodecSizeFromChildren(size, [item.maxSize])
491
491
  };
492
492
  }
493
- function getSetEncoder(item, options = {}) {
494
- const size = options.size ?? codecsNumbers.getU32Encoder();
493
+ function getSetEncoder(item, config = {}) {
494
+ const size = config.size ?? codecsNumbers.getU32Encoder();
495
495
  return {
496
- ...setCodecHelper(item, size, options.description),
496
+ ...setCodecHelper(item, size, config.description),
497
497
  encode: (set) => {
498
498
  if (typeof size === "number" && set.size !== size) {
499
499
  assertValidNumberOfItemsForCodec("set", size, set.size);
@@ -503,10 +503,10 @@ function getSetEncoder(item, options = {}) {
503
503
  }
504
504
  };
505
505
  }
506
- function getSetDecoder(item, options = {}) {
507
- const size = options.size ?? codecsNumbers.getU32Decoder();
506
+ function getSetDecoder(item, config = {}) {
507
+ const size = config.size ?? codecsNumbers.getU32Decoder();
508
508
  return {
509
- ...setCodecHelper(item, size, options.description),
509
+ ...setCodecHelper(item, size, config.description),
510
510
  decode: (bytes, offset = 0) => {
511
511
  const set = /* @__PURE__ */ new Set();
512
512
  if (typeof size === "object" && bytes.slice(offset).length === 0) {
@@ -523,8 +523,8 @@ function getSetDecoder(item, options = {}) {
523
523
  }
524
524
  };
525
525
  }
526
- function getSetCodec(item, options = {}) {
527
- return codecsCore.combineCodec(getSetEncoder(item, options), getSetDecoder(item, options));
526
+ function getSetCodec(item, config = {}) {
527
+ return codecsCore.combineCodec(getSetEncoder(item, config), getSetDecoder(item, config));
528
528
  }
529
529
  function structCodecHelper(fields, description) {
530
530
  const fieldDescriptions = fields.map(([name, codec]) => `${String(name)}: ${codec.description}`).join(", ");
@@ -534,18 +534,18 @@ function structCodecHelper(fields, description) {
534
534
  maxSize: sumCodecSizes(fields.map(([, field]) => field.maxSize))
535
535
  };
536
536
  }
537
- function getStructEncoder(fields, options = {}) {
537
+ function getStructEncoder(fields, config = {}) {
538
538
  return {
539
- ...structCodecHelper(fields, options.description),
539
+ ...structCodecHelper(fields, config.description),
540
540
  encode: (struct) => {
541
541
  const fieldBytes = fields.map(([key, codec]) => codec.encode(struct[key]));
542
542
  return codecsCore.mergeBytes(fieldBytes);
543
543
  }
544
544
  };
545
545
  }
546
- function getStructDecoder(fields, options = {}) {
546
+ function getStructDecoder(fields, config = {}) {
547
547
  return {
548
- ...structCodecHelper(fields, options.description),
548
+ ...structCodecHelper(fields, config.description),
549
549
  decode: (bytes, offset = 0) => {
550
550
  const struct = {};
551
551
  fields.forEach(([key, codec]) => {
@@ -557,8 +557,8 @@ function getStructDecoder(fields, options = {}) {
557
557
  }
558
558
  };
559
559
  }
560
- function getStructCodec(fields, options = {}) {
561
- return codecsCore.combineCodec(getStructEncoder(fields, options), getStructDecoder(fields, options));
560
+ function getStructCodec(fields, config = {}) {
561
+ return codecsCore.combineCodec(getStructEncoder(fields, config), getStructDecoder(fields, config));
562
562
  }
563
563
  function tupleCodecHelper(items, description) {
564
564
  const itemDescriptions = items.map((item) => item.description).join(", ");
@@ -568,18 +568,18 @@ function tupleCodecHelper(items, description) {
568
568
  maxSize: sumCodecSizes(items.map((item) => item.maxSize))
569
569
  };
570
570
  }
571
- function getTupleEncoder(items, options = {}) {
571
+ function getTupleEncoder(items, config = {}) {
572
572
  return {
573
- ...tupleCodecHelper(items, options.description),
573
+ ...tupleCodecHelper(items, config.description),
574
574
  encode: (value) => {
575
575
  assertValidNumberOfItemsForCodec("tuple", items.length, value.length);
576
576
  return codecsCore.mergeBytes(items.map((item, index) => item.encode(value[index])));
577
577
  }
578
578
  };
579
579
  }
580
- function getTupleDecoder(items, options = {}) {
580
+ function getTupleDecoder(items, config = {}) {
581
581
  return {
582
- ...tupleCodecHelper(items, options.description),
582
+ ...tupleCodecHelper(items, config.description),
583
583
  decode: (bytes, offset = 0) => {
584
584
  const values = [];
585
585
  items.forEach((codec) => {
@@ -591,30 +591,30 @@ function getTupleDecoder(items, options = {}) {
591
591
  }
592
592
  };
593
593
  }
594
- function getTupleCodec(items, options = {}) {
594
+ function getTupleCodec(items, config = {}) {
595
595
  return codecsCore.combineCodec(
596
- getTupleEncoder(items, options),
597
- getTupleDecoder(items, options)
596
+ getTupleEncoder(items, config),
597
+ getTupleDecoder(items, config)
598
598
  );
599
599
  }
600
- function getUnitEncoder(options = {}) {
600
+ function getUnitEncoder(config = {}) {
601
601
  return {
602
- description: options.description ?? "unit",
602
+ description: config.description ?? "unit",
603
603
  encode: () => new Uint8Array(),
604
604
  fixedSize: 0,
605
605
  maxSize: 0
606
606
  };
607
607
  }
608
- function getUnitDecoder(options = {}) {
608
+ function getUnitDecoder(config = {}) {
609
609
  return {
610
610
  decode: (_bytes, offset = 0) => [void 0, offset],
611
- description: options.description ?? "unit",
611
+ description: config.description ?? "unit",
612
612
  fixedSize: 0,
613
613
  maxSize: 0
614
614
  };
615
615
  }
616
- function getUnitCodec(options = {}) {
617
- return codecsCore.combineCodec(getUnitEncoder(options), getUnitDecoder(options));
616
+ function getUnitCodec(config = {}) {
617
+ return codecsCore.combineCodec(getUnitEncoder(config), getUnitDecoder(config));
618
618
  }
619
619
 
620
620
  exports.assertValidNumberOfItemsForCodec = assertValidNumberOfItemsForCodec;
@@ -658,3 +658,5 @@ exports.getTupleEncoder = getTupleEncoder;
658
658
  exports.getUnitCodec = getUnitCodec;
659
659
  exports.getUnitDecoder = getUnitDecoder;
660
660
  exports.getUnitEncoder = getUnitEncoder;
661
+ //# sourceMappingURL=out.js.map
662
+ //# sourceMappingURL=index.browser.cjs.map