ts-proto 1.135.1 → 1.135.3

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.
@@ -107,7 +107,11 @@ function generateGrpcMethodDesc(ctx, serviceDesc, methodDesc) {
107
107
  // we want/what grpc-web's runtime needs.
108
108
  const responseFn = (0, ts_poet_1.code) `{
109
109
  deserializeBinary(data: Uint8Array) {
110
- return { ...${outputType}.decode(data), toObject() { return this; } };
110
+ const value = ${outputType}.decode(data);
111
+ return {
112
+ ...value,
113
+ toObject() { return value; },
114
+ };
111
115
  }
112
116
  }`;
113
117
  return (0, ts_poet_1.code) `
@@ -217,7 +221,7 @@ function createPromiseUnaryMethod(ctx) {
217
221
  debug: this.options.debug,
218
222
  onEnd: function (response) {
219
223
  if (response.status === grpc.Code.OK) {
220
- resolve(response.message);
224
+ resolve(response.message!.toObject());
221
225
  } else {
222
226
  const err = new ${ctx.utils.GrpcWebError}(response.statusMessage, response.status, response.trailers);
223
227
  reject(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.135.1",
3
+ "version": "1.135.3",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",