Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
case 'anycondition': {
if (sourceNode) {
let match = false;
const matchers = {};
queryNode.condition.estree.forEach(function (estree) {
matchers[estree] = function (node) {
if (matcher(node, queryNode.condition)) {
match = true;
}
}
});
traverse(sourceNode, {
enter(path) {
Object.keys(matchers).forEach(type => (
matchers[type](type.node)
));
}
})
if (match) {
return [sourceNode];
}
}
break;
}
case 'ifstatement':
case 'whileloop': {