Keep protobuf value types distinct from object refs
This commit is contained in:
Vendored
+3
-3
@@ -22,12 +22,12 @@ const symbolId = (value) => `${value.namespace}:${value.name}:${value.version}:$
|
||||
const normalizedProtoType = (value) => value.replace(/^\./, "");
|
||||
const declarationName = (value) => value.name;
|
||||
const tsTypeForTypeRef = (type, root) => {
|
||||
if (type.symbol) {
|
||||
return `ObjectRef<${stringLiteral(symbolId(type.symbol))}>`;
|
||||
}
|
||||
if (type.enumValues && type.enumValues.length > 0) {
|
||||
return type.enumValues.map(stringLiteral).join(" | ");
|
||||
}
|
||||
if (type.symbol) {
|
||||
return `ObjectRef<${stringLiteral(symbolId(type.symbol))}>`;
|
||||
}
|
||||
const protoType = normalizedProtoType(type.protoType);
|
||||
switch (protoType) {
|
||||
case "string":
|
||||
|
||||
Reference in New Issue
Block a user