update
This commit is contained in:
+7
-5
@@ -7,20 +7,22 @@ exports.default = void 0;
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
var _helperRemapAsyncToGenerator = _interopRequireDefault(require("@babel/helper-remap-async-to-generator"));
|
||||
var _helperRemapAsyncToGenerator = require("@babel/helper-remap-async-to-generator");
|
||||
|
||||
var _helperModuleImports = require("@babel/helper-module-imports");
|
||||
|
||||
var _core = require("@babel/core");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
||||
var _api$assumption, _api$assumption2;
|
||||
|
||||
api.assertVersion(7);
|
||||
const {
|
||||
method,
|
||||
module
|
||||
} = options;
|
||||
const noNewArrows = (_api$assumption = api.assumption("noNewArrows")) != null ? _api$assumption : true;
|
||||
const ignoreFunctionLength = (_api$assumption2 = api.assumption("ignoreFunctionLength")) != null ? _api$assumption2 : false;
|
||||
|
||||
if (method && module) {
|
||||
return {
|
||||
@@ -38,7 +40,7 @@ var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
||||
|
||||
(0, _helperRemapAsyncToGenerator.default)(path, {
|
||||
wrapAsync
|
||||
});
|
||||
}, noNewArrows, ignoreFunctionLength);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,7 +54,7 @@ var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
||||
if (!path.node.async || path.node.generator) return;
|
||||
(0, _helperRemapAsyncToGenerator.default)(path, {
|
||||
wrapAsync: state.addHelper("asyncToGenerator")
|
||||
});
|
||||
}, noNewArrows, ignoreFunctionLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user