File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11/**
22 * @typedef {import('unist').Node } Node
3- * @typedef {import('unist-util-visit').Type } Type
4- * @typedef {import('unist-util-visit').Props } Props
5- * @typedef {import('unist-util-visit').TestFunctionAnything } TestFunctionAnything
3+ * @typedef {import('unist-util-visit').Test } Test
64 *
75 * @typedef {(node: Node) => unknown } KeyFunction
86 */
@@ -13,7 +11,7 @@ export class Index {
1311 /**
1412 * @param {string|KeyFunction } prop
1513 * @param {Node } [tree]
16- * @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything> } [test]
14+ * @param {Test } [test]
1715 */
1816 constructor ( prop , tree , test ) {
1917 /** @type {Map.<unknown, Array.<Node>> } */
Original file line number Diff line number Diff line change 11/**
2+ * @typedef {import('./index.js').Node } Node
23 * @typedef {import('./index.js').KeyFunction } KeyFunction
3- * @typedef {import('./index.js').TestFunctionAnything } TestFunctionAnything
4+ * @typedef {import('./index.js').Test } Test
45 */
56
67import test from 'tape'
@@ -53,7 +54,7 @@ test('Index', function (t) {
5354 return node . id
5455 }
5556
56- /** @type { TestFunctionAnything } */
57+ /** @param { Node } node */
5758 function filter ( node ) {
5859 return node . type === 'a'
5960 }
@@ -200,7 +201,11 @@ test('index.get', function (t) {
200201 sst . deepEqual ( index . get ( 'bar' ) , [ select ( 'node[word="bar"]' , ast ) ] )
201202 sst . end ( )
202203
203- /** @type {TestFunctionAnything } */
204+ /**
205+ * @param {Node } node
206+ * @param {number } index
207+ * @param {Node } parent
208+ */
204209 function filter ( node , index , parent ) {
205210 return 'word' in node && index < 2 && parent . type === 'root'
206211 }
You can’t perform that action at this time.
0 commit comments