Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function({types: t}){
return {
inherits: syntaxDoExpressions.default,
visitor: {
DoExpression: function(path) {
// count the expressions that are '<<'
const bindCount = path.node.body.body.filter(isBind).length;
// todo: fail if first expr is not bind expr
path.replaceWith((formatChain(t, bindCount, path.node.body.body))[0]);
}
}
};
}