@@ -46,15 +46,15 @@ visit(sampleTree)
4646// ## No test
4747visit ( sampleTree , function ( node , index , parent ) {
4848 expectType < Nodes > ( node )
49- expectType < number | null > ( index )
50- expectType < Parents | null > ( parent )
49+ expectType < number | undefined > ( index )
50+ expectType < Parents | undefined > ( parent )
5151} )
5252
5353visit ( implicitTree , function ( node , index , parent ) {
5454 // Objects are too loose.
5555 expectAssignable < Node > ( node )
5656 expectNotType < Node > ( node )
57- expectType < number | null > ( index )
57+ expectType < number | undefined > ( index )
5858 expectType < never > ( parent )
5959} )
6060
@@ -63,8 +63,10 @@ visit(implicitTree, function (node, index, parent) {
6363// Knows it’s a heading and its parents.
6464visit ( sampleTree , 'heading' , function ( node , index , parent ) {
6565 expectType < Heading > ( node )
66- expectType < number | null > ( index )
67- expectType < Blockquote | FootnoteDefinition | ListItem | Root | null > ( parent )
66+ expectType < number | undefined > ( index )
67+ expectType <
68+ Blockquote | FootnoteDefinition | ListItem | Root | undefined
69+ > ( parent )
6870} )
6971
7072// Not in tree.
@@ -83,8 +85,8 @@ visit(implicitTree, 'heading', function (node, index, parent) {
8385
8486visit ( sampleTree , 'tableCell' , function ( node , index , parent ) {
8587 expectType < TableCell > ( node )
86- expectType < number | null > ( index )
87- expectType < Root | TableRow | null > ( parent )
88+ expectType < number | undefined > ( index )
89+ expectType < Root | TableRow | undefined > ( parent )
8890} )
8991
9092// ## Props test
@@ -203,7 +205,7 @@ visit(sampleTree, 'tableCell', function (node) {
203205 | LinkReference
204206 | Strong
205207 | TableCell
206- | null
208+ | undefined
207209 > ( parent )
208210 } )
209211} )
0 commit comments