2017-06-27 12:15:00 -05:00

18 lines
376 B
JavaScript

export default function({ types: t }) {
return {
visitor: {
BinaryExpression(path) {
const { node } = path;
if (node.operator === "instanceof") {
path.replaceWith(
t.callExpression(this.addHelper("instanceof"), [
node.left,
node.right,
]),
);
}
},
},
};
}