@bufbuild/protobuf 2.0.0-beta.3 → 2.0.0
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/dist/cjs/registry.js +8 -2
- package/dist/esm/registry.js +8 -2
- package/package.json +1 -1
package/dist/cjs/registry.js
CHANGED
|
@@ -614,12 +614,14 @@ function newField(proto, parentOrFile, reg, oneof, mapEntries) {
|
|
|
614
614
|
case TYPE_GROUP:
|
|
615
615
|
field.listKind = "message";
|
|
616
616
|
field.message = reg.getMessage(trimLeadingDot(proto.typeName));
|
|
617
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
617
618
|
assert(field.message);
|
|
618
619
|
field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
|
|
619
620
|
break;
|
|
620
621
|
case TYPE_ENUM:
|
|
621
622
|
field.listKind = "enum";
|
|
622
623
|
field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
|
|
624
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
623
625
|
assert(field.enum);
|
|
624
626
|
break;
|
|
625
627
|
default:
|
|
@@ -637,7 +639,9 @@ function newField(proto, parentOrFile, reg, oneof, mapEntries) {
|
|
|
637
639
|
case TYPE_GROUP:
|
|
638
640
|
field.fieldKind = "message";
|
|
639
641
|
field.message = reg.getMessage(trimLeadingDot(proto.typeName));
|
|
640
|
-
assert(
|
|
642
|
+
assert(
|
|
643
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
644
|
+
field.message, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
|
|
641
645
|
field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
|
|
642
646
|
field.getDefaultValue = () => undefined;
|
|
643
647
|
break;
|
|
@@ -774,7 +778,9 @@ function findOneof(proto, allOneofs) {
|
|
|
774
778
|
return undefined;
|
|
775
779
|
}
|
|
776
780
|
const oneof = allOneofs[proto.oneofIndex];
|
|
777
|
-
assert(
|
|
781
|
+
assert(
|
|
782
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
783
|
+
oneof, `invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`);
|
|
778
784
|
return oneof;
|
|
779
785
|
}
|
|
780
786
|
/**
|
package/dist/esm/registry.js
CHANGED
|
@@ -608,12 +608,14 @@ function newField(proto, parentOrFile, reg, oneof, mapEntries) {
|
|
|
608
608
|
case TYPE_GROUP:
|
|
609
609
|
field.listKind = "message";
|
|
610
610
|
field.message = reg.getMessage(trimLeadingDot(proto.typeName));
|
|
611
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
611
612
|
assert(field.message);
|
|
612
613
|
field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
|
|
613
614
|
break;
|
|
614
615
|
case TYPE_ENUM:
|
|
615
616
|
field.listKind = "enum";
|
|
616
617
|
field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
|
|
618
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
617
619
|
assert(field.enum);
|
|
618
620
|
break;
|
|
619
621
|
default:
|
|
@@ -631,7 +633,9 @@ function newField(proto, parentOrFile, reg, oneof, mapEntries) {
|
|
|
631
633
|
case TYPE_GROUP:
|
|
632
634
|
field.fieldKind = "message";
|
|
633
635
|
field.message = reg.getMessage(trimLeadingDot(proto.typeName));
|
|
634
|
-
assert(
|
|
636
|
+
assert(
|
|
637
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
638
|
+
field.message, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
|
|
635
639
|
field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
|
|
636
640
|
field.getDefaultValue = () => undefined;
|
|
637
641
|
break;
|
|
@@ -768,7 +772,9 @@ function findOneof(proto, allOneofs) {
|
|
|
768
772
|
return undefined;
|
|
769
773
|
}
|
|
770
774
|
const oneof = allOneofs[proto.oneofIndex];
|
|
771
|
-
assert(
|
|
775
|
+
assert(
|
|
776
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
777
|
+
oneof, `invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`);
|
|
772
778
|
return oneof;
|
|
773
779
|
}
|
|
774
780
|
/**
|
package/package.json
CHANGED