Fixed bug where og description could have keys without values

This commit is contained in:
DrMint 2022-08-06 11:42:46 +02:00
parent a87d886785
commit 692e9ab1b4

View File

@ -1,4 +1,4 @@
import { isDefined, isDefinedAndNotEmpty } from "./others";
import { filterDefined, isDefined, isDefinedAndNotEmpty } from "./others";
export const getDescription = (
description: string | null | undefined,
@ -15,7 +15,7 @@ export const getDescription = (
for (const key in chipsGroups) {
if (Object.hasOwn(chipsGroups, key)) {
const chipsGroup = chipsGroups[key];
const chipsGroup = filterDefined(chipsGroups[key]);
if (chipsGroup.length > 0) {
result += `${key}: ${prettyChip(chipsGroup)}\n`;
}