module.exports = function({ types: t }) {
class RenameMap {
constructor(old_name, new_name) {
this.old_name = old_name;
this.new_name = new_name;
}
}
let state = {};
return {
visitor: {
Identifier(path) {
const node = path.node;
if ((node.name === "oldVar")) {
path.replaceWith(t.identifier("newVar".toString()));
}
},
VariableDeclarator(path) {
const node = path.node;
const __iflet_0 = node.id;
if (__iflet_0 !== null) {
const id = __iflet_0;
if ((id.name === "temp")) {
path.replaceWith(t.identifier("renamed".toString()));
}
}
}
}
};
};