index.js 651 B

12345678910111213141516171819202122
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = function (context) {
  4. var plugin = {
  5. visitor: require("./visit").visitor
  6. };
  7. // Some presets manually call child presets, but fail to pass along the
  8. // context object. Out of an abundance of caution, we verify that it
  9. // exists first to avoid causing unnecessary breaking changes.
  10. var version = context && context.version;
  11. // The "name" property is not allowed in older versions of Babel (6.x)
  12. // and will cause the plugin validator to throw an exception.
  13. if (version && parseInt(version, 10) >= 7) {
  14. plugin.name = "regenerator-transform";
  15. }
  16. return plugin;
  17. };