mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-06 18:01:24 +02:00
#678 - Check field type of tags fields for tags rendering on item cards
This commit is contained in:
@@ -62,7 +62,8 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
if (typeof tagsValue === 'string') {
|
||||
return [tagsValue];
|
||||
} else if (Array.isArray(tagsValue)) {
|
||||
return tagsValue;
|
||||
const items = tagsValue.map(t => typeof t === 'string' ? t : undefined);
|
||||
return items.filter(t => t !== undefined) as string[];
|
||||
}
|
||||
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user