index.js 812 B

1234567891011121314151617181920212223242526272829
  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 = exports.default = (0, _helperPluginUtils.declare)((api, options) => {
  8. var _api$assumption;
  9. api.assertVersion(7);
  10. const noNewArrows = (_api$assumption = api.assumption("noNewArrows")) != null ? _api$assumption : !options.spec;
  11. return {
  12. name: "transform-arrow-functions",
  13. visitor: {
  14. ArrowFunctionExpression(path) {
  15. if (!path.isArrowFunctionExpression()) return;
  16. {
  17. path.arrowFunctionToExpression({
  18. allowInsertArrow: false,
  19. noNewArrows,
  20. specCompliant: !noNewArrows
  21. });
  22. }
  23. }
  24. }
  25. };
  26. });
  27. //# sourceMappingURL=index.js.map