@typeberry/lib 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.cjs +3 -2
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -769,12 +769,13 @@ class BytesBlob {
|
|
|
769
769
|
}
|
|
770
770
|
/** Display a hex-encoded version of this byte blob, but truncated if it's large. */
|
|
771
771
|
toStringTruncated() {
|
|
772
|
+
const bytes = `${this.raw.length} ${this.raw.length === 1 ? "byte" : "bytes"}`;
|
|
772
773
|
if (this.raw.length > 32) {
|
|
773
774
|
const start = bytesToHexString(this.raw.subarray(0, 16));
|
|
774
775
|
const end = bytesToHexString(this.raw.subarray(this.raw.length - 16));
|
|
775
|
-
return `${start}...${end.substring(2)} (${
|
|
776
|
+
return `${start}...${end.substring(2)} (${bytes})`;
|
|
776
777
|
}
|
|
777
|
-
return this.toString()
|
|
778
|
+
return `${this.toString()} (${bytes})`;
|
|
778
779
|
}
|
|
779
780
|
toJSON() {
|
|
780
781
|
return this.toString();
|
package/index.d.ts
CHANGED
|
@@ -877,12 +877,13 @@ declare class BytesBlob {
|
|
|
877
877
|
|
|
878
878
|
/** Display a hex-encoded version of this byte blob, but truncated if it's large. */
|
|
879
879
|
toStringTruncated() {
|
|
880
|
+
const bytes = `${this.raw.length} ${this.raw.length === 1 ? "byte" : "bytes"}`;
|
|
880
881
|
if (this.raw.length > 32) {
|
|
881
882
|
const start = bytesToHexString(this.raw.subarray(0, 16));
|
|
882
883
|
const end = bytesToHexString(this.raw.subarray(this.raw.length - 16));
|
|
883
|
-
return `${start}...${end.substring(2)} (${
|
|
884
|
+
return `${start}...${end.substring(2)} (${bytes})`;
|
|
884
885
|
}
|
|
885
|
-
return this.toString()
|
|
886
|
+
return `${this.toString()} (${bytes})`;
|
|
886
887
|
}
|
|
887
888
|
|
|
888
889
|
toJSON() {
|
package/index.js
CHANGED
|
@@ -766,12 +766,13 @@ class BytesBlob {
|
|
|
766
766
|
}
|
|
767
767
|
/** Display a hex-encoded version of this byte blob, but truncated if it's large. */
|
|
768
768
|
toStringTruncated() {
|
|
769
|
+
const bytes = `${this.raw.length} ${this.raw.length === 1 ? "byte" : "bytes"}`;
|
|
769
770
|
if (this.raw.length > 32) {
|
|
770
771
|
const start = bytesToHexString(this.raw.subarray(0, 16));
|
|
771
772
|
const end = bytesToHexString(this.raw.subarray(this.raw.length - 16));
|
|
772
|
-
return `${start}...${end.substring(2)} (${
|
|
773
|
+
return `${start}...${end.substring(2)} (${bytes})`;
|
|
773
774
|
}
|
|
774
|
-
return this.toString()
|
|
775
|
+
return `${this.toString()} (${bytes})`;
|
|
775
776
|
}
|
|
776
777
|
toJSON() {
|
|
777
778
|
return this.toString();
|