@typeberry/convert 0.2.0-661fe38 → 0.2.0-663eeb1

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.
package/index.js CHANGED
@@ -4999,12 +4999,13 @@ class bytes_BytesBlob {
4999
4999
  }
5000
5000
  /** Display a hex-encoded version of this byte blob, but truncated if it's large. */
5001
5001
  toStringTruncated() {
5002
+ const bytes = `${this.raw.length} ${this.raw.length === 1 ? "byte" : "bytes"}`;
5002
5003
  if (this.raw.length > 32) {
5003
5004
  const start = bytesToHexString(this.raw.subarray(0, 16));
5004
5005
  const end = bytesToHexString(this.raw.subarray(this.raw.length - 16));
5005
- return `${start}...${end.substring(2)} (${this.raw.length} bytes)`;
5006
+ return `${start}...${end.substring(2)} (${bytes})`;
5006
5007
  }
5007
- return this.toString();
5008
+ return `${this.toString()} (${bytes})`;
5008
5009
  }
5009
5010
  toJSON() {
5010
5011
  return this.toString();