Skip to content

Commit

Permalink
fix: update type label
Browse files Browse the repository at this point in the history
Signed-off-by: eugenejahn <[email protected]>
  • Loading branch information
eugenejahn committed Jul 8, 2022
1 parent b9fe17e commit 934e921
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const typeLabels: { [k in InputType]: string } = {
[InputType.Schema]: 'schema - uri',
[InputType.String]: 'string',
[InputType.Struct]: 'struct',
[InputType.Union]: '',
[InputType.Union]: 'union',
[InputType.Unknown]: 'unknown',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export function formatType({ type, subtype, listOfSubTypes }: InputTypeDefinitio
return subtype ? `map<string, ${formatType(subtype)}>` : 'map';
}
if (type === InputType.Union) {
if (!listOfSubTypes) return 'union';
if (!listOfSubTypes) return typeLabels[type];

const concatListOfSubTypes = listOfSubTypes.map((subtype) => formatType(subtype)).join(' | ');

return `union [${concatListOfSubTypes}]`;
return `${typeLabels[type]} [${concatListOfSubTypes}]`;
}
return typeLabels[type];
}
Expand Down

0 comments on commit 934e921

Please sign in to comment.