11/**
2- * @typedef {import('unist').Node } Node
3- * @typedef {import('unist-util-visit').Visitor<Node> } Visitor
2+ * @typedef {import('unist').Parent } UnistParent
3+ * @typedef {import('nlcst').Root } Root
4+ * @typedef {import('nlcst').Word } Word
5+ * @typedef {import('nlcst').Content } Content
6+ * @typedef {Root|Content } Node
7+ * @typedef {Extract<Node, UnistParent> } Parent
8+ * @typedef {import('unist-util-visit').Visitor<Word> } Visitor
49 */
510
611import assert from 'node:assert'
@@ -53,7 +58,8 @@ test('isLiteral()', (t) => {
5358 } , 'should not throw if `node` is in `parent`' )
5459
5560 t . doesNotThrow ( ( ) => {
56- process ( 'Well? Ha! Funky' , ( _ , index , parent ) => {
61+ process ( 'Well? Ha! Funky' , ( _ , index , parent_ ) => {
62+ const parent = /** @type {Parent } */ ( parent_ )
5763 assert . strictEqual (
5864 parent && index !== null && isLiteral ( parent , index ) ,
5965 false
@@ -76,7 +82,8 @@ test('isLiteral()', (t) => {
7682 let index = - 1
7783
7884 while ( ++ index < fixtures . length ) {
79- process ( fixtures [ index ] , ( _ , index , parent ) => {
85+ process ( fixtures [ index ] , ( _ , index , parent_ ) => {
86+ const parent = /** @type {Parent } */ ( parent_ )
8087 assert . strictEqual (
8188 parent && index !== null && isLiteral ( parent , index ) ,
8289 index === 0 ,
@@ -101,7 +108,8 @@ test('isLiteral()', (t) => {
101108 let index = - 1
102109
103110 while ( ++ index < fixtures . length ) {
104- process ( fixtures [ index ] , ( _ , index , parent ) => {
111+ process ( fixtures [ index ] , ( _ , index , parent_ ) => {
112+ const parent = /** @type {Parent } */ ( parent_ )
105113 assert . strictEqual (
106114 parent && index !== null && isLiteral ( parent , index ) ,
107115 parent && index === parent . children . length - 2 ,
@@ -143,7 +151,8 @@ test('isLiteral()', (t) => {
143151 let index = - 1
144152
145153 while ( ++ index < fixtures . length ) {
146- process ( fixtures [ index ] , ( _ , place , parent ) => {
154+ process ( fixtures [ index ] , ( _ , place , parent_ ) => {
155+ const parent = /** @type {Parent } */ ( parent_ )
147156 let pos = 5
148157
149158 // Adjacent hyphens are part of the word.
0 commit comments