File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @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
6
4
*
7
5
* @typedef {(node: Node) => unknown } KeyFunction
8
6
*/
@@ -13,7 +11,7 @@ export class Index {
13
11
/**
14
12
* @param {string|KeyFunction } prop
15
13
* @param {Node } [tree]
16
- * @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything> } [test]
14
+ * @param {Test } [test]
17
15
*/
18
16
constructor ( prop , tree , test ) {
19
17
/** @type {Map.<unknown, Array.<Node>> } */
Original file line number Diff line number Diff line change 1
1
/**
2
+ * @typedef {import('./index.js').Node } Node
2
3
* @typedef {import('./index.js').KeyFunction } KeyFunction
3
- * @typedef {import('./index.js').TestFunctionAnything } TestFunctionAnything
4
+ * @typedef {import('./index.js').Test } Test
4
5
*/
5
6
6
7
import test from 'tape'
@@ -53,7 +54,7 @@ test('Index', function (t) {
53
54
return node . id
54
55
}
55
56
56
- /** @type { TestFunctionAnything } */
57
+ /** @param { Node } node */
57
58
function filter ( node ) {
58
59
return node . type === 'a'
59
60
}
@@ -200,7 +201,11 @@ test('index.get', function (t) {
200
201
sst . deepEqual ( index . get ( 'bar' ) , [ select ( 'node[word="bar"]' , ast ) ] )
201
202
sst . end ( )
202
203
203
- /** @type {TestFunctionAnything } */
204
+ /**
205
+ * @param {Node } node
206
+ * @param {number } index
207
+ * @param {Node } parent
208
+ */
204
209
function filter ( node , index , parent ) {
205
210
return 'word' in node && index < 2 && parent . type === 'root'
206
211
}
You can’t perform that action at this time.
0 commit comments