Skip to content

Commit aed76f4

Browse files
PurpleReverieclaude
andcommitted
Fix typecheck error in markdown footnote test
The test cast for the footnote node attempted to coerce all SemanticNode-shaped children into FootnoteNode's narrower InlineNode[] children type. Drop the redundant local cast and reuse findFirst's SemanticNode return — assertions don't need the narrowed shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 66d1616 commit aed76f4

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

packages/markdown/tests/parse.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,10 @@ A claim [^a].
219219
220220
[^a]: support.
221221
`);
222-
const fn = findFirst(tree, (n) => n.kind === "footnote") as
223-
| { kind: "footnote"; children: SemanticNode[] }
224-
| null;
222+
const fn = findFirst(tree, (n) => n.kind === "footnote");
225223
assert.ok(fn != null);
226224
// body inline text should include "support"
227-
const text = findFirst(fn!, (n) => n.kind === "text") as
225+
const text = findFirst(fn as SemanticNode, (n) => n.kind === "text") as
228226
| { kind: "text"; value: string }
229227
| null;
230228
assert.ok(text != null);

0 commit comments

Comments
 (0)