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