We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6eb63e1 + 144c41b commit b8c2b9aCopy full SHA for b8c2b9a
packages/proto-loader/package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "@grpc/proto-loader",
3
- "version": "0.6.5",
+ "version": "0.6.6",
4
"author": "Google Inc.",
5
"contributors": [
6
packages/proto-loader/src/index.ts
@@ -212,6 +212,9 @@ function createDeserializer(
212
213
function createSerializer(cls: Protobuf.Type): Serialize<object> {
214
return function serialize(arg: object): Buffer {
215
+ if (Array.isArray(arg)) {
216
+ throw new Error(`Failed to serialize message: expected object with ${cls.name} structure, got array instead`);
217
+ }
218
const message = cls.fromObject(arg);
219
return cls.encode(message).finish() as Buffer;
220
};
0 commit comments