Skip to content

Commit 8acc237

Browse files
committed
Correct mismatched check between renderingIsUseful and applyAnchorUrl
1 parent 9eb1e05 commit 8acc237

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/lib/debug/debugRendererUrls.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/* eslint-disable no-console */
22
import { join } from "node:path";
33
import type { Application } from "../application.js";
4-
import { Reflection, type SomeReflection } from "../models/index.js";
4+
import {
5+
Reflection,
6+
ReflectionKind,
7+
type SomeReflection,
8+
} from "../models/index.js";
59
import type { SerializerComponent } from "../serialization/components.js";
610
import type { JSONOutput } from "../serialization/index.js";
711

@@ -19,7 +23,7 @@ const serializer: SerializerComponent<SomeReflection> = {
1923
delete obj.categories;
2024
delete obj.readme;
2125
delete obj.content;
22-
delete obj.kind;
26+
obj.kind = ReflectionKind[obj.kind];
2327
delete obj.flags;
2428
delete obj.defaultValue;
2529
delete obj.symbolIdMap;

src/lib/output/themes/default/partials/typeDetails.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,11 @@ function renderingChildIsUseful(refl: DeclarationReflection) {
334334
// in the default theme, so we'll make the assumption that those properties ought to always
335335
// be rendered.
336336
// This should be kept in sync with the DefaultTheme.applyAnchorUrl function.
337-
// We know refl.kind == TypeLiteral already here
338-
if (refl.parent?.kindOf(ReflectionKind.SomeExport) && refl.type?.type === "reflection") {
337+
if (
338+
refl.kindOf(ReflectionKind.TypeLiteral) &&
339+
refl.parent?.kindOf(ReflectionKind.SomeExport) &&
340+
(refl.parent as DeclarationReflection).type?.type === "reflection"
341+
) {
339342
return true;
340343
}
341344

0 commit comments

Comments
 (0)