You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
889 B

4 years ago
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = _default;
  4. var _visit = require("./visit");
  5. /**
  6. * Copyright (c) 2014-present, Facebook, Inc.
  7. *
  8. * This source code is licensed under the MIT license found in the
  9. * LICENSE file in the root directory of this source tree.
  10. */
  11. function _default(context) {
  12. var plugin = {
  13. visitor: (0, _visit.getVisitor)(context)
  14. }; // Some presets manually call child presets, but fail to pass along the
  15. // context object. Out of an abundance of caution, we verify that it
  16. // exists first to avoid causing unnecessary breaking changes.
  17. var version = context && context.version; // The "name" property is not allowed in older versions of Babel (6.x)
  18. // and will cause the plugin validator to throw an exception.
  19. if (version && parseInt(version, 10) >= 7) {
  20. plugin.name = "regenerator-transform";
  21. }
  22. return plugin;
  23. }