@typeberry/jam 0.1.2-ef67dce → 0.1.3-707962d

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.
@@ -23914,13 +23914,15 @@ function validateLength(range, length, context) {
23914
23914
 
23915
23915
  /** A caching wrapper for either object or sequence item. */
23916
23916
  class ViewField {
23917
+ name;
23917
23918
  getView;
23918
23919
  getValue;
23919
23920
  getEncoded;
23920
23921
  cachedValue;
23921
23922
  cachedView;
23922
23923
  cachedBlob;
23923
- constructor(getView, getValue, getEncoded) {
23924
+ constructor(name, getView, getValue, getEncoded) {
23925
+ this.name = name;
23924
23926
  this.getView = getView;
23925
23927
  this.getValue = getValue;
23926
23928
  this.getEncoded = getEncoded;
@@ -23946,6 +23948,9 @@ class ViewField {
23946
23948
  }
23947
23949
  return this.cachedBlob;
23948
23950
  }
23951
+ toString() {
23952
+ return `ViewField<${this.name}>`;
23953
+ }
23949
23954
  }
23950
23955
  /**
23951
23956
  * A base class for all the lazy views.
@@ -24020,7 +24025,7 @@ class ObjectView {
24020
24025
  const fieldDecoder = skipper.decoder.clone();
24021
24026
  const field = this.descriptorsKeys[i];
24022
24027
  const type = this.descriptors[field];
24023
- lastItem = new ViewField(() => type.View.decode(fieldDecoder.clone()), () => type.decode(fieldDecoder.clone()), () => type.skipEncoded(fieldDecoder.clone()));
24028
+ lastItem = new ViewField(`${this.toString()}.${String(field)}`, () => type.View.decode(fieldDecoder.clone()), () => type.decode(fieldDecoder.clone()), () => type.skipEncoded(fieldDecoder.clone()));
24024
24029
  // skip the field
24025
24030
  type.skip(skipper);
24026
24031
  // cache data
@@ -24032,6 +24037,9 @@ class ObjectView {
24032
24037
  }
24033
24038
  return lastItem;
24034
24039
  }
24040
+ toString() {
24041
+ return `View<${this.materializedConstructor.name}>(cache: ${this.cache.size})`;
24042
+ }
24035
24043
  }
24036
24044
  /**
24037
24045
  * A lazy-evaluated decoder of a sequence.
@@ -24120,7 +24128,7 @@ class SequenceView {
24120
24128
  // create new cached prop
24121
24129
  const fieldDecoder = skipper.decoder.clone();
24122
24130
  const type = this.descriptor;
24123
- lastItem = new ViewField(() => type.View.decode(fieldDecoder.clone()), () => type.decode(fieldDecoder.clone()), () => type.skipEncoded(fieldDecoder.clone()));
24131
+ lastItem = new ViewField(`${this.toString()}[${index}]`, () => type.View.decode(fieldDecoder.clone()), () => type.decode(fieldDecoder.clone()), () => type.skipEncoded(fieldDecoder.clone()));
24124
24132
  // skip the field
24125
24133
  type.skip(skipper);
24126
24134
  // cache data
@@ -24132,6 +24140,9 @@ class SequenceView {
24132
24140
  }
24133
24141
  return lastItem;
24134
24142
  }
24143
+ toString() {
24144
+ return `SequenceView<${this.descriptor.name}>(cache: ${this.cache.size})`;
24145
+ }
24135
24146
  }
24136
24147
 
24137
24148
  ;// CONCATENATED MODULE: ./packages/core/codec/descriptors.ts