12 lines
261 B
JavaScript
12 lines
261 B
JavaScript
export default function ({ types: t }) {
|
|
return {
|
|
visitor: {
|
|
ReferencedIdentifier(path) {
|
|
if (path.node.name === "undefined") {
|
|
path.replaceWith(t.unaryExpression("void", t.numericLiteral(0), true));
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|