Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
inst.instructionHandler({
node,
ancestors,
instructionParam: inst.instructionParam,
linkURL,
file,
})
).then(() => res(true))
// stop traversal because the instruction may change ast.
// the ast may be **completly different** after this instruction's execution.
// we will detect next instruction in the **next transform pass**.
return visit.EXIT
}
}
}
return visit.CONTINUE
})
if (!foundLinkInstruction) res(false) // didn't find any instruction
'use strict'
module.exports = visit
var visitParents = require('unist-util-visit-parents')
var CONTINUE = visitParents.CONTINUE
var SKIP = visitParents.SKIP
var EXIT = visitParents.EXIT
visit.CONTINUE = CONTINUE
visit.SKIP = SKIP
visit.EXIT = EXIT
function visit(tree, test, visitor, reverse) {
if (typeof test === 'function' && typeof visitor !== 'function') {
reverse = visitor
visitor = test
test = null
}
visitParents(tree, test, overload, reverse)