@protobuf-ts/plugin-framework
Advanced tools
Comparing version 2.0.0-alpha.11 to 2.0.0-alpha.12
@@ -302,2 +302,3 @@ "use strict"; | ||
isTypeUsed(type, inFiles) { | ||
const needle = this.nameLookup.makeTypeName(type); | ||
let used = false; | ||
@@ -309,3 +310,3 @@ for (let fd of inFiles) { | ||
if (descriptor_1.DescriptorProto.is(typeDescriptor)) { | ||
const usedInField = typeDescriptor.field.includes(type); | ||
const usedInField = typeDescriptor.field.some(fd => fd.typeName !== undefined && this.nameLookup.normalizeTypeName(fd.typeName) === needle); | ||
if (usedInField) { | ||
@@ -316,6 +317,6 @@ used = true; | ||
else if (descriptor_1.ServiceDescriptorProto.is(typeDescriptor)) { | ||
const usedInMethodInput = typeDescriptor.method.some(md => this.nameLookup.resolveTypeName(md.inputType) === type); | ||
const usedInMethodOutput = typeDescriptor.method.some(md => this.nameLookup.resolveTypeName(md.outputType) === type); | ||
const usedInMethodInput = typeDescriptor.method.some(md => md.inputType !== undefined && this.nameLookup.normalizeTypeName(md.inputType) === needle); | ||
const usedInMethodOutput = typeDescriptor.method.some(md => md.outputType !== undefined && this.nameLookup.normalizeTypeName(md.outputType) === needle); | ||
if (usedInMethodInput || usedInMethodOutput) { | ||
return true; | ||
used = true; | ||
} | ||
@@ -322,0 +323,0 @@ } |
@@ -298,2 +298,3 @@ import { DescriptorProto, EnumDescriptorProto, EnumValueDescriptorProto, FieldDescriptorProto, FieldDescriptorProto_Label, FieldDescriptorProto_Type, FileDescriptorProto, MethodDescriptorProto, OneofDescriptorProto, ServiceDescriptorProto } from "./google/protobuf/descriptor"; | ||
isTypeUsed(type, inFiles) { | ||
const needle = this.nameLookup.makeTypeName(type); | ||
let used = false; | ||
@@ -305,3 +306,3 @@ for (let fd of inFiles) { | ||
if (DescriptorProto.is(typeDescriptor)) { | ||
const usedInField = typeDescriptor.field.includes(type); | ||
const usedInField = typeDescriptor.field.some(fd => fd.typeName !== undefined && this.nameLookup.normalizeTypeName(fd.typeName) === needle); | ||
if (usedInField) { | ||
@@ -312,6 +313,6 @@ used = true; | ||
else if (ServiceDescriptorProto.is(typeDescriptor)) { | ||
const usedInMethodInput = typeDescriptor.method.some(md => this.nameLookup.resolveTypeName(md.inputType) === type); | ||
const usedInMethodOutput = typeDescriptor.method.some(md => this.nameLookup.resolveTypeName(md.outputType) === type); | ||
const usedInMethodInput = typeDescriptor.method.some(md => md.inputType !== undefined && this.nameLookup.normalizeTypeName(md.inputType) === needle); | ||
const usedInMethodOutput = typeDescriptor.method.some(md => md.outputType !== undefined && this.nameLookup.normalizeTypeName(md.outputType) === needle); | ||
if (usedInMethodInput || usedInMethodOutput) { | ||
return true; | ||
used = true; | ||
} | ||
@@ -318,0 +319,0 @@ } |
{ | ||
"name": "@protobuf-ts/plugin-framework", | ||
"version": "2.0.0-alpha.11", | ||
"version": "2.0.0-alpha.12", | ||
"description": "framework to create protoc plugins", | ||
@@ -36,6 +36,6 @@ "license": "(Apache-2.0 AND BSD-3-Clause)", | ||
"dependencies": { | ||
"@protobuf-ts/runtime": "^2.0.0-alpha.11", | ||
"@protobuf-ts/runtime": "^2.0.0-alpha.12", | ||
"typescript": ">=3.8.3 <4" | ||
}, | ||
"gitHead": "7c06b9e18c2f67ae2db001a44e0335125fd6192e" | ||
"gitHead": "00553c29b1e227660fb7ecca9e88506ab1e68a6b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
388554
8971