Skip to content

Commit 0a94289

Browse files
committed
Fix types for changes in @types/unist
1 parent 014cfb0 commit 0a94289

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

test.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ test('Index', function (t) {
2222
'new Index(prop)'
2323
)
2424

25-
instance = new Index(keyFn)
25+
instance = new Index(
26+
/**
27+
* @param {Node & {id: string}} node
28+
*/
29+
(node) => node.id
30+
)
2631
instance.add(node)
2732

2833
t.deepEqual(
@@ -39,7 +44,7 @@ test('Index', function (t) {
3944
'new Index(prop, tree)'
4045
)
4146

42-
instance = new Index('id', tree, filter)
47+
instance = new Index('id', tree, (node) => node.type === 'a')
4348

4449
t.deepEqual(
4550
[instance instanceof Index, instance.get(1)],
@@ -48,16 +53,6 @@ test('Index', function (t) {
4853
)
4954

5055
t.end()
51-
52-
/** @type {KeyFunction} */
53-
function keyFn(node) {
54-
return node.id
55-
}
56-
57-
/** @param {Node} node */
58-
function filter(node) {
59-
return node.type === 'a'
60-
}
6156
})
6257

6358
test('index.add', function (t) {

0 commit comments

Comments
 (0)