ts-proto 2.2.3 → 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.
- package/build/src/visit.js +4 -5
- package/package.json +1 -1
package/build/src/visit.js
CHANGED
|
@@ -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,8 +22,8 @@ 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)(
|
|
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 ? "_" : "";
|
|
@@ -32,8 +32,7 @@ function visit(proto, sourceInfo, messageFn, options, enumFn = () => { }, tsPref
|
|
|
32
32
|
}
|
|
33
33
|
const builtInNames = ["Date", "Function"];
|
|
34
34
|
/** Potentially suffixes `Message` to names to avoid conflicts, i.e. with `Date`. */
|
|
35
|
-
function messageName(
|
|
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) {
|