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', () => {