diff --git a/packages/protobuf/src/from-binary.ts b/packages/protobuf/src/from-binary.ts index 1c1267ad9..9d5153e0c 100644 --- a/packages/protobuf/src/from-binary.ts +++ b/packages/protobuf/src/from-binary.ts @@ -77,7 +77,7 @@ export function mergeFromBinary( target: MessageShape, bytes: Uint8Array, options?: Partial, -): MessageShape { +): void { readMessage( reflect(messageDesc, target), new BinaryReader(bytes), @@ -85,7 +85,6 @@ export function mergeFromBinary( false, bytes.byteLength, ); - return target; } /** diff --git a/packages/protobuf/src/from-json.ts b/packages/protobuf/src/from-json.ts index 68f662b4c..e1fdb86c1 100644 --- a/packages/protobuf/src/from-json.ts +++ b/packages/protobuf/src/from-json.ts @@ -110,8 +110,8 @@ export function mergeFromJsonString( target: MessageShape, json: string, options?: Partial, -): MessageShape { - return mergeFromJson( +): void { + mergeFromJson( messageDesc, target, parseJsonString(json, messageDesc.typeName), @@ -156,7 +156,7 @@ export function mergeFromJson( target: MessageShape, json: JsonValue, options?: Partial, -): MessageShape { +): void { try { readMessage(reflect(messageDesc, target), json, makeReadOptions(options)); } catch (e) { @@ -168,7 +168,6 @@ export function mergeFromJson( } throw e; } - return target; } function readMessage(