ts-proto 2.11.8 → 2.11.10

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.
@@ -66,7 +66,8 @@ function generateSchema(ctx, fileDesc, sourceInfo) {
66
66
  });
67
67
  (0, visit_1.visitServices)(fileDesc, sourceInfo, (serviceDesc) => {
68
68
  if (options.outputClientImpl) {
69
- addReference(serviceDesc.name, `${serviceDesc.name}ClientImpl`);
69
+ const suffix = options.outputServices.includes(options_1.ServiceOption.GRPC) ? "Client" : "ClientImpl";
70
+ addReference(serviceDesc.name, `${serviceDesc.name}${suffix}`);
70
71
  }
71
72
  });
72
73
  const dependencies = fileDesc.dependency.map((dep) => {
@@ -178,7 +179,7 @@ function getExtensionValue(ctx, extension, data) {
178
179
  const reader = new wire_1.BinaryReader(data[0]);
179
180
  let value = reader[(0, types_1.toReaderCall)(extension)]();
180
181
  if (typeof value === "string") {
181
- value = (0, ts_poet_1.code) `"${value}"`;
182
+ value = JSON.stringify(value);
182
183
  }
183
184
  return (0, ts_poet_1.code) `'${extension.name}': ${value}`;
184
185
  }
@@ -707,7 +707,8 @@ function shouldGenerateJSMapType(ctx, message, field) {
707
707
  return false;
708
708
  }
709
709
  return (mapType.keyField.type === ts_proto_descriptors_1.FieldDescriptorProto_Type.TYPE_BOOL ||
710
- (isLong(mapType.keyField) && ctx.options.forceLong === options_1.LongOption.LONG));
710
+ (isLong(mapType.keyField) &&
711
+ (ctx.options.forceLong === options_1.LongOption.LONG || ctx.options.forceLong === options_1.LongOption.BIGINT)));
711
712
  }
712
713
  function detectMapType(ctx, messageDesc, fieldDesc) {
713
714
  const { typeMap } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "2.11.8",
3
+ "version": "2.11.10",
4
4
  "description": "",
5
5
  "main": "build/src/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",