Skip to content

Commit

Permalink
Merge pull request #28 from bbqsrc/fix/implicit-package
Browse files Browse the repository at this point in the history
Fix generating nested enums in proto files with no package
  • Loading branch information
agreatfool authored Sep 19, 2018
2 parents 7aa1f5c + 56a7182 commit a272dae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions build/lib/ExportMap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/lib/ExportMap.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/lib/ExportMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export class ExportMap {
this.messageMap[entryName] = messageEntry;

message.getNestedTypeList().forEach(nested => {
this.exportNested(scope + "." + message.getName(), fileDescriptor, nested);
this.exportNested(entryName, fileDescriptor, nested);
});

message.getEnumTypeList().forEach(enumType => {
const identifier = scope + "." + message.getName() + "." + enumType.getName();
const identifier = entryName + "." + enumType.getName();
this.enumMap[identifier] = {
pkg: fileDescriptor.getPackage(),
fileName: fileDescriptor.getName(),
Expand All @@ -63,7 +63,8 @@ export class ExportMap {
});

fileDescriptor.getEnumTypeList().forEach(enumType => {
this.enumMap[scope + "." + enumType.getName()] = {
const entryName = `${scope ? scope + "." : ""}${enumType.getName()}`;
this.enumMap[entryName] = {
pkg: fileDescriptor.getPackage(),
fileName: fileDescriptor.getName(),
enumOptions: enumType.getOptions(),
Expand Down

0 comments on commit a272dae

Please sign in to comment.