Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
889 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports["default"] = _default;
|
---|
5 |
|
---|
6 | var _visit = require("./visit");
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Copyright (c) 2014-present, Facebook, Inc.
|
---|
10 | *
|
---|
11 | * This source code is licensed under the MIT license found in the
|
---|
12 | * LICENSE file in the root directory of this source tree.
|
---|
13 | */
|
---|
14 | function _default(context) {
|
---|
15 | var plugin = {
|
---|
16 | visitor: (0, _visit.getVisitor)(context)
|
---|
17 | }; // Some presets manually call child presets, but fail to pass along the
|
---|
18 | // context object. Out of an abundance of caution, we verify that it
|
---|
19 | // exists first to avoid causing unnecessary breaking changes.
|
---|
20 |
|
---|
21 | var version = context && context.version; // The "name" property is not allowed in older versions of Babel (6.x)
|
---|
22 | // and will cause the plugin validator to throw an exception.
|
---|
23 |
|
---|
24 | if (version && parseInt(version, 10) >= 7) {
|
---|
25 | plugin.name = "regenerator-transform";
|
---|
26 | }
|
---|
27 |
|
---|
28 | return plugin;
|
---|
29 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.