From 8acc237b5ba3ff42e2fcd7469447f164a41eb496 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 14 Dec 2024 09:39:37 -0700 Subject: [PATCH] Correct mismatched check between renderingIsUseful and applyAnchorUrl --- src/lib/debug/debugRendererUrls.ts | 8 ++++++-- src/lib/output/themes/default/partials/typeDetails.tsx | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/debug/debugRendererUrls.ts b/src/lib/debug/debugRendererUrls.ts index 8a02344cc..067782c73 100644 --- a/src/lib/debug/debugRendererUrls.ts +++ b/src/lib/debug/debugRendererUrls.ts @@ -1,7 +1,11 @@ /* eslint-disable no-console */ import { join } from "node:path"; import type { Application } from "../application.js"; -import { Reflection, type SomeReflection } from "../models/index.js"; +import { + Reflection, + ReflectionKind, + type SomeReflection, +} from "../models/index.js"; import type { SerializerComponent } from "../serialization/components.js"; import type { JSONOutput } from "../serialization/index.js"; @@ -19,7 +23,7 @@ const serializer: SerializerComponent = { delete obj.categories; delete obj.readme; delete obj.content; - delete obj.kind; + obj.kind = ReflectionKind[obj.kind]; delete obj.flags; delete obj.defaultValue; delete obj.symbolIdMap; diff --git a/src/lib/output/themes/default/partials/typeDetails.tsx b/src/lib/output/themes/default/partials/typeDetails.tsx index f6ae1036e..fffe7bce1 100644 --- a/src/lib/output/themes/default/partials/typeDetails.tsx +++ b/src/lib/output/themes/default/partials/typeDetails.tsx @@ -334,8 +334,11 @@ function renderingChildIsUseful(refl: DeclarationReflection) { // in the default theme, so we'll make the assumption that those properties ought to always // be rendered. // This should be kept in sync with the DefaultTheme.applyAnchorUrl function. - // We know refl.kind == TypeLiteral already here - if (refl.parent?.kindOf(ReflectionKind.SomeExport) && refl.type?.type === "reflection") { + if ( + refl.kindOf(ReflectionKind.TypeLiteral) && + refl.parent?.kindOf(ReflectionKind.SomeExport) && + (refl.parent as DeclarationReflection).type?.type === "reflection" + ) { return true; }