index.js 627 B

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