You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to resolve the issue by changing the method to do the following:
isTypeUsed(type: AnyTypeDescriptorProto,inFiles: FileDescriptorProto[]): boolean {// Probably not the right way to get thisconstnormalizedTypeName=this.nameLookup._reverse.get(type);letused=false;for(letfdofinFiles){if(used)returnused;this.tree.visitTypes(fd,typeDescriptor=>{if(used)return;if(DescriptorProto.is(typeDescriptor)){constusedInField=typeDescriptor.field.map(f=>f.typeName).filter(Boolean).map(this.nameLookup.normalizeTypeName).includes(normalizedTypeName);if(usedInField){used=true;}}elseif(ServiceDescriptorProto.is(typeDescriptor)){constusedInMethodInput=typeDescriptor.method.some(md=>this.nameLookup.resolveTypeName(md.inputType!)===type);constusedInMethodOutput=typeDescriptor.method.some(md=>this.nameLookup.resolveTypeName(md.outputType!)===type);if(usedInMethodInput||usedInMethodOutput){used=true;}}})}returnused;}
I'd be happy to open a PR if you think this is the correct way to resolve the issue.
The text was updated successfully, but these errors were encountered:
No worries! I've been a bit busy with other things to make time for a proper PR with test coverage. Thank you for fixing the issue and the excellent library!
When debugging the issue I was able to narrow it down to this method:
protobuf-ts/packages/plugin-framework/src/descriptor-info.ts
Lines 633 to 653 in 54d5e99
I was able to resolve the issue by changing the method to do the following:
I'd be happy to open a PR if you think this is the correct way to resolve the issue.
The text was updated successfully, but these errors were encountered: