Skip to content

Commit

Permalink
Correct mismatched check between renderingIsUseful and applyAnchorUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Dec 14, 2024
1 parent 9eb1e05 commit 8acc237
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/lib/debug/debugRendererUrls.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -19,7 +23,7 @@ const serializer: SerializerComponent<SomeReflection> = {
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;
Expand Down
7 changes: 5 additions & 2 deletions src/lib/output/themes/default/partials/typeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8acc237

Please sign in to comment.