From 31dd894d68990a48c9b224a9042294d47e9bb597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Mon, 28 Sep 2026 09:12:36 +0200 Subject: [PATCH] fix: rename misleading byte method --- src/bytes/bytes.ts | 2 +- test/typed-bytes.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bytes/bytes.ts b/src/bytes/bytes.ts index 33ffb8e..f0b2a8a 100644 --- a/src/bytes/bytes.ts +++ b/src/bytes/bytes.ts @@ -156,7 +156,7 @@ export class Bytes { /** * Parses the bytes as UTF-8 JSON. */ - public parseJson(): unknown { + public parsePayloadAsJson(): unknown { return JSON.parse(this.toUtf8()) } diff --git a/test/typed-bytes.test.ts b/test/typed-bytes.test.ts index 3361efc..8079812 100644 --- a/test/typed-bytes.test.ts +++ b/test/typed-bytes.test.ts @@ -64,7 +64,7 @@ describe('Bytes', () => { it('parses JSON from its UTF-8 content', () => { const bytes = Bytes.fromUtf8(JSON.stringify({ a: 1 })) - expect(bytes.parseJson()).toEqual({ a: 1 }) + expect(bytes.parsePayloadAsJson()).toEqual({ a: 1 }) }) it('stringifies to hex, standalone and as a property', () => {