index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*istanbul ignore next*/"use strict";
  2. exports.__esModule = true;
  3. exports.default = function () {
  4. return {
  5. visitor: { /*istanbul ignore next*/
  6. ObjectMethod: function ObjectMethod(path) {
  7. /*istanbul ignore next*/var node = path.node;
  8. if (node.kind === "method") {
  9. path.replaceWith(t.objectProperty(node.key, t.functionExpression(null, node.params, node.body, node.generator, node.async), node.computed));
  10. }
  11. },
  12. /*istanbul ignore next*/ObjectProperty: function ObjectProperty(_ref) {
  13. /*istanbul ignore next*/var node = _ref.node;
  14. if (node.shorthand) {
  15. node.shorthand = false;
  16. }
  17. }
  18. }
  19. };
  20. };
  21. var /*istanbul ignore next*/_babelTypes = require("babel-types");
  22. /*istanbul ignore next*/
  23. var t = _interopRequireWildcard(_babelTypes);
  24. /*istanbul ignore next*/
  25. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  26. module.exports = exports["default"];