ts-proto 2.2.2 → 2.2.4

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.
@@ -12,7 +12,7 @@ function visit(proto, sourceInfo, messageFn, options, enumFn = () => { }, tsPref
12
12
  const protoFullName = protoPrefix + enumDesc.name;
13
13
  // I.e. FooBar_ZazInner
14
14
  const tsFullName = tsPrefix + (0, case_1.maybeSnakeToCamel)(enumDesc.name, options);
15
- const tsFullNameWithAffixes = `${options.typePrefix}${tsFullName}${options.typeSuffix}`;
15
+ const tsFullNameWithAffixes = messageName(`${options.typePrefix}${tsFullName}${options.typeSuffix}`);
16
16
  const nestedSourceInfo = sourceInfo.open(childEnumType, index);
17
17
  enumFn(tsFullNameWithAffixes, enumDesc, nestedSourceInfo, protoFullName);
18
18
  });
@@ -22,18 +22,17 @@ function visit(proto, sourceInfo, messageFn, options, enumFn = () => { }, tsPref
22
22
  // I.e. Foo_Bar.Zaz_Inner
23
23
  const protoFullName = protoPrefix + message.name;
24
24
  // I.e. FooBar_ZazInner
25
- const tsFullName = tsPrefix + (0, case_1.maybeSnakeToCamel)(messageName(message), options);
26
- const tsFullNameWithAffixes = `${options.typePrefix}${tsFullName}${options.typeSuffix}`;
25
+ const tsFullName = tsPrefix + (0, case_1.maybeSnakeToCamel)(message.name, options);
26
+ const tsFullNameWithAffixes = messageName(`${options.typePrefix}${tsFullName}${options.typeSuffix}`);
27
27
  const nestedSourceInfo = sourceInfo.open(childType, index);
28
28
  messageFn(tsFullNameWithAffixes, message, nestedSourceInfo, protoFullName);
29
29
  const delim = options.useSnakeTypeName ? "_" : "";
30
30
  visit(message, nestedSourceInfo, messageFn, options, enumFn, tsFullName + delim, protoFullName + ".");
31
31
  });
32
32
  }
33
- const builtInNames = ["Date"];
33
+ const builtInNames = ["Date", "Function"];
34
34
  /** Potentially suffixes `Message` to names to avoid conflicts, i.e. with `Date`. */
35
- function messageName(message) {
36
- const { name } = message;
35
+ function messageName(name) {
37
36
  return builtInNames.includes(name) ? `${name}Message` : name;
38
37
  }
39
38
  function visitServices(proto, sourceInfo, serviceFn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "",
5
5
  "main": "build/src/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",