index.js 729 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _helperPluginUtils() {
  7. const data = require("@babel/helper-plugin-utils");
  8. _helperPluginUtils = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. var _default = (0, _helperPluginUtils().declare)((api, options) => {
  14. api.assertVersion(7);
  15. const {
  16. spec
  17. } = options;
  18. return {
  19. name: "transform-arrow-functions",
  20. visitor: {
  21. ArrowFunctionExpression(path) {
  22. if (!path.isArrowFunctionExpression()) return;
  23. path.arrowFunctionToExpression({
  24. allowInsertArrow: false,
  25. specCompliant: !!spec
  26. });
  27. }
  28. }
  29. };
  30. });
  31. exports.default = _default;