zod-to-x 1.0.2 → 1.0.3
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.
|
@@ -57,10 +57,16 @@ class Zod2ProtoV3 extends core_1.Zod2X {
|
|
|
57
57
|
return "google.protobuf.Timestamp";
|
|
58
58
|
};
|
|
59
59
|
this.getSetType = (itemType) => {
|
|
60
|
-
return
|
|
60
|
+
return this.getArrayType(itemType, 1);
|
|
61
61
|
};
|
|
62
62
|
this.getTupleType = (itemsType) => {
|
|
63
|
-
|
|
63
|
+
const uniqueTypes = new Set(itemsType);
|
|
64
|
+
if (uniqueTypes.size === 1) {
|
|
65
|
+
return this.getArrayType(itemsType[0], 1);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw new Error("Protobuf v3 does not support mixed-type tuples. Consider defining a message type.");
|
|
69
|
+
}
|
|
64
70
|
};
|
|
65
71
|
this.getIntersectionType = (itemsType) => {
|
|
66
72
|
throw new Error("Protobuf v3 does not support intersection types directly.");
|