Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
6
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.42 to 7.0.0-beta.43

69

lib/index.js
"use strict";
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _helperWrapFunction = _interopRequireDefault(require("@babel/helper-wrap-function"));
function _helperWrapFunction() {
const data = _interopRequireDefault(require("@babel/helper-wrap-function"));
var _helperAnnotateAsPure = _interopRequireDefault(require("@babel/helper-annotate-as-pure"));
_helperWrapFunction = function () {
return data;
};
var t = _interopRequireWildcard(require("@babel/types"));
return data;
}
function _helperAnnotateAsPure() {
const data = _interopRequireDefault(require("@babel/helper-annotate-as-pure"));
_helperAnnotateAsPure = function () {
return data;
};
return data;
}
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

@@ -16,10 +42,12 @@

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()) {

@@ -30,4 +58,5 @@ path.replaceWith(argument.node);

path.replaceWith(t.yieldExpression(wrapAwait ? t.callExpression(t.cloneNode(wrapAwait), [argument.node]) : argument.node));
path.replaceWith(t().yieldExpression(wrapAwait ? t().callExpression(t().cloneNode(wrapAwait), [argument.node]) : argument.node));
}
};

@@ -39,10 +68,10 @@

});
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();
(0, _helperWrapFunction().default)(path, t().cloneNode(helpers.wrapAsync));
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty();
if (!isProperty && !isIIFE && path.isExpression()) {
(0, _helperAnnotateAsPure.default)(path);
(0, _helperAnnotateAsPure().default)(path);
}

@@ -57,9 +86,13 @@

var parentPath = path.parentPath;
const {
parentPath
} = path;
if (parentPath.isMemberExpression() && t.isIdentifier(parentPath.node.property, {
if (parentPath.isMemberExpression() && t().isIdentifier(parentPath.node.property, {
name: "bind"
})) {
var bindCall = parentPath.parentPath;
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && t.isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({
const {
parentPath: bindCall
} = parentPath;
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && t().isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({
callee: bindCall.node

@@ -66,0 +99,0 @@ });

{
"name": "@babel/helper-remap-async-to-generator",
"version": "7.0.0-beta.42",
"version": "7.0.0-beta.43",
"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.42",
"@babel/helper-wrap-function": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-annotate-as-pure": "7.0.0-beta.43",
"@babel/helper-wrap-function": "7.0.0-beta.43",
"@babel/template": "7.0.0-beta.43",
"@babel/traverse": "7.0.0-beta.43",
"@babel/types": "7.0.0-beta.43"
}
}
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