From 1b86c17b7293f3b810c062d78ec6ef563f968366 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 13 Jan 2025 19:48:51 +0200 Subject: [PATCH] docs-util: remove duplicate union children (#10942) --- www/utils/packages/utils/src/get-type-children.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/utils/packages/utils/src/get-type-children.ts b/www/utils/packages/utils/src/get-type-children.ts index 7313adb82a..c91927ec46 100644 --- a/www/utils/packages/utils/src/get-type-children.ts +++ b/www/utils/packages/utils/src/get-type-children.ts @@ -36,14 +36,13 @@ export function getTypeChildren({ break case "union": reflectionType.types.forEach((childItem) => { - // TODO this should ensure that the items are unique. children.push( ...getTypeChildren({ reflectionType: childItem, project, level: level + 1, maxLevel, - }) + }).filter((child) => !children.some((c) => c.name === child.name)) ) }) break