Opal-Estate-Pro/node_modules/babel-plugin-transform-do-expressions/lib/index.js

22 lines
469 B
JavaScript
Raw Normal View History

2019-09-13 04:44:33 +02:00
"use strict";
exports.__esModule = true;
exports.default = function () {
return {
inherits: require("babel-plugin-syntax-do-expressions"),
visitor: {
DoExpression: function DoExpression(path) {
var body = path.node.body.body;
if (body.length) {
path.replaceWithMultiple(body);
} else {
path.replaceWith(path.scope.buildUndefinedNode());
}
}
}
};
};
module.exports = exports["default"];