-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2: Strip only last .proto suffix for DescFile.name #807
Conversation
@@ -443,15 +443,15 @@ function addFile(proto: FileDescriptorProto, reg: MutableRegistry): void { | |||
proto, | |||
deprecated: proto.options?.deprecated ?? false, | |||
edition: getFileEdition(proto), | |||
name: proto.name.replace(/\.proto/, ""), | |||
name: proto.name.replace(/\.proto$/, ""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, this removed the first sub-string.
`syntax="proto3";`, | ||
"foo.proto/baz.proto.proto", | ||
); | ||
expect(file.name).toBe("foo.proto/baz.proto"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the change above, name
would be "foo/baz.proto.proto"
.
@@ -829,7 +829,7 @@ function newField( | |||
keyField.scalar != ScalarType.FLOAT && | |||
keyField.scalar != ScalarType.DOUBLE, | |||
); | |||
const valueField = mapEntry.fields.find((f) => f.proto.number === 2); | |||
const valueField = mapEntry.fields.find((f) => f.number === 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use DescField.number
here, no need to go through FieldDescriptorProto
.
No description provided.