Socket
Socket
Sign inDemoInstall

@babel/helper-remap-async-to-generator

Package Overview
Dependencies
Maintainers
5
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-remap-async-to-generator - npm Package Compare versions

Comparing version 7.0.0-beta.46 to 7.0.0-beta.47

27

lib/index.js

@@ -9,3 +9,3 @@ "use strict";

function _helperWrapFunction() {
var data = _interopRequireDefault(require("@babel/helper-wrap-function"));
const data = _interopRequireDefault(require("@babel/helper-wrap-function"));

@@ -20,3 +20,3 @@ _helperWrapFunction = function _helperWrapFunction() {

function _helperAnnotateAsPure() {
var data = _interopRequireDefault(require("@babel/helper-annotate-as-pure"));
const data = _interopRequireDefault(require("@babel/helper-annotate-as-pure"));

@@ -31,3 +31,3 @@ _helperAnnotateAsPure = function _helperAnnotateAsPure() {

function t() {
var data = _interopRequireWildcard(require("@babel/types"));
const data = _interopRequireWildcard(require("@babel/types"));

@@ -45,10 +45,12 @@ t = function t() {

var awaitVisitor = {
Function: function Function(path) {
const awaitVisitor = {
Function(path) {
path.skip();
},
AwaitExpression: function AwaitExpression(path, _ref) {
var wrapAwait = _ref.wrapAwait;
var argument = path.get("argument");
AwaitExpression(path, {
wrapAwait
}) {
const argument = path.get("argument");
if (path.parentPath.isYieldExpression()) {

@@ -61,2 +63,3 @@ path.replaceWith(argument.node);

}
};

@@ -68,7 +71,7 @@

});
var isIIFE = checkIsIIFE(path);
const isIIFE = checkIsIIFE(path);
path.node.async = false;
path.node.generator = true;
(0, _helperWrapFunction().default)(path, t().cloneNode(helpers.wrapAsync));
var isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty();
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty();

@@ -86,3 +89,3 @@ if (!isProperty && !isIIFE && path.isExpression()) {

var parentPath = path.parentPath;
const parentPath = path.parentPath;

@@ -92,3 +95,3 @@ if (parentPath.isMemberExpression() && t().isIdentifier(parentPath.node.property, {

})) {
var bindCall = parentPath.parentPath;
const bindCall = parentPath.parentPath;
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && t().isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({

@@ -95,0 +98,0 @@ callee: bindCall.node

{
"name": "@babel/helper-remap-async-to-generator",
"version": "7.0.0-beta.46",
"version": "7.0.0-beta.47",
"description": "Helper function to remap async functions to generators",

@@ -9,8 +9,8 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator",

"dependencies": {
"@babel/helper-annotate-as-pure": "7.0.0-beta.46",
"@babel/helper-wrap-function": "7.0.0-beta.46",
"@babel/template": "7.0.0-beta.46",
"@babel/traverse": "7.0.0-beta.46",
"@babel/types": "7.0.0-beta.46"
"@babel/helper-annotate-as-pure": "7.0.0-beta.47",
"@babel/helper-wrap-function": "7.0.0-beta.47",
"@babel/template": "7.0.0-beta.47",
"@babel/traverse": "7.0.0-beta.47",
"@babel/types": "7.0.0-beta.47"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc