@babel/helper-remap-async-to-generator
Advanced tools
Comparing version 7.14.5 to 7.15.4
@@ -12,4 +12,11 @@ "use strict"; | ||
var t = require("@babel/types"); | ||
var _t = require("@babel/types"); | ||
const { | ||
callExpression, | ||
cloneNode, | ||
isIdentifier, | ||
isThisExpression, | ||
yieldExpression | ||
} = _t; | ||
const awaitVisitor = { | ||
@@ -30,3 +37,3 @@ Function(path) { | ||
path.replaceWith(t.yieldExpression(wrapAwait ? t.callExpression(t.cloneNode(wrapAwait), [argument.node]) : argument.node)); | ||
path.replaceWith(yieldExpression(wrapAwait ? callExpression(cloneNode(wrapAwait), [argument.node]) : argument.node)); | ||
} | ||
@@ -43,3 +50,3 @@ | ||
path.node.generator = true; | ||
(0, _helperWrapFunction.default)(path, t.cloneNode(helpers.wrapAsync), noNewArrows); | ||
(0, _helperWrapFunction.default)(path, cloneNode(helpers.wrapAsync), noNewArrows); | ||
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty(); | ||
@@ -62,3 +69,3 @@ | ||
if (parentPath.isMemberExpression() && t.isIdentifier(parentPath.node.property, { | ||
if (parentPath.isMemberExpression() && isIdentifier(parentPath.node.property, { | ||
name: "bind" | ||
@@ -69,3 +76,3 @@ })) { | ||
} = parentPath; | ||
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && t.isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({ | ||
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({ | ||
callee: bindCall.node | ||
@@ -72,0 +79,0 @@ }); |
{ | ||
"name": "@babel/helper-remap-async-to-generator", | ||
"version": "7.14.5", | ||
"version": "7.15.4", | ||
"description": "Helper function to remap async functions to generators", | ||
@@ -17,8 +17,8 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-annotate-as-pure": "^7.14.5", | ||
"@babel/helper-wrap-function": "^7.14.5", | ||
"@babel/types": "^7.14.5" | ||
"@babel/helper-annotate-as-pure": "^7.15.4", | ||
"@babel/helper-wrap-function": "^7.15.4", | ||
"@babel/types": "^7.15.4" | ||
}, | ||
"devDependencies": { | ||
"@babel/traverse": "7.14.5" | ||
"@babel/traverse": "7.15.4" | ||
}, | ||
@@ -25,0 +25,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4250
63