2017-03-04 10:46:01 -05:00

13 lines
309 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]));
}
},
},
};
}