index.js 469 B

12345678910111213141516171819202122
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = function () {
  4. return {
  5. inherits: require("babel-plugin-syntax-do-expressions"),
  6. visitor: {
  7. DoExpression: function DoExpression(path) {
  8. var body = path.node.body.body;
  9. if (body.length) {
  10. path.replaceWithMultiple(body);
  11. } else {
  12. path.replaceWith(path.scope.buildUndefinedNode());
  13. }
  14. }
  15. }
  16. };
  17. };
  18. module.exports = exports["default"];