Skip to content

Commit 59fa6ea

Browse files
committed
Update unist-util-visit
1 parent a2439df commit 59fa6ea

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

index.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @typedef {import('mdast').Root|import('mdast').Content} Node
33
* @typedef {import('mdast').Definition} Definition
4-
* @typedef {import('unist-util-visit').Visitor<Definition>} DefinitionVisitor
54
*/
65

76
import {visit} from 'unist-util-visit'
@@ -20,17 +19,14 @@ export function definitions(node) {
2019
throw new Error('mdast-util-definitions expected node')
2120
}
2221

23-
visit(node, 'definition', ondefinition)
24-
25-
return getDefinition
26-
27-
/** @type {DefinitionVisitor} */
28-
function ondefinition(definition) {
22+
visit(node, 'definition', (definition) => {
2923
const id = clean(definition.identifier)
3024
if (id && !own.call(cache, id)) {
3125
cache[id] = definition
3226
}
33-
}
27+
})
28+
29+
return getDefinition
3430

3531
/**
3632
* Get a node from the bound definition-cache.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dependencies": {
3838
"@types/mdast": "^3.0.0",
3939
"@types/unist": "^2.0.0",
40-
"unist-util-visit": "^3.0.0"
40+
"unist-util-visit": "^4.0.0"
4141
},
4242
"devDependencies": {
4343
"@types/tape": "^4.0.0",

0 commit comments

Comments
 (0)