File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 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
76import { 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.
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments