17 lines
364 B
JavaScript
17 lines
364 B
JavaScript
export default function () {
|
|
return {
|
|
inherits: require("babel-plugin-syntax-do-expressions"),
|
|
|
|
visitor: {
|
|
DoExpression(path) {
|
|
const body = path.node.body.body;
|
|
if (body.length) {
|
|
path.replaceWithMultiple(body);
|
|
} else {
|
|
path.replaceWith(path.scope.buildUndefinedNode());
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|