From 80b6e0d7b2bd446b8eb5cc52601e3ffbbee8fc11 Mon Sep 17 00:00:00 2001 From: malangcat Date: Mon, 20 Jan 2025 22:27:37 +0900 Subject: [PATCH] test: ignore values from variantMap if conditionMap has same key --- docs/stories/components/variant-table.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/stories/components/variant-table.tsx b/docs/stories/components/variant-table.tsx index e0a03a9da..fad94e653 100644 --- a/docs/stories/components/variant-table.tsx +++ b/docs/stories/components/variant-table.tsx @@ -22,7 +22,9 @@ const generateCombinations = (variantMap: VariantMap, conditionMap: ConditionMap for (const key of keys) { const values = [ ...new Set( - [...(variantMap[key] ?? []), ...Object.keys(conditionMap[key] ?? {})].map(Boolish.asUnion), + [...(conditionMap[key] ? Object.keys(conditionMap[key]) : (variantMap[key] ?? []))].map( + Boolish.asUnion, + ), ), ]; const temp: Record[] = [];