Socket
Socket
Sign inDemoInstall

babel-helper-remap-async-to-generator

Package Overview
Dependencies
Maintainers
1
Versions
56
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 6.0.16 to 6.1.2

30

lib/index.js

@@ -53,5 +53,12 @@ /* @flow */

if (path.isArrowFunctionExpression()) {
path.arrowFunctionToShadowed();
}
node.async = false;
node.generator = true;
var asyncFnId = node.id;
node.id = null;
var built = t.callExpression(callId, [node]);

@@ -68,18 +75,17 @@ var container = buildWrapper({

if (path.isFunctionDeclaration()) {
var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(node.id.name), t.callExpression(container, []))]);
var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(asyncFnId.name), t.callExpression(container, []))]);
declar._blockHoist = true;
_babelHelperFunctionName2["default"]({
node: retFunction,
parent: declar.declarations[0],
scope: path.scope
});
retFunction.id = asyncFnId;
path.replaceWith(declar);
} else {
_babelHelperFunctionName2["default"]({
node: retFunction,
parent: path.parent,
scope: path.scope
});
if (asyncFnId && asyncFnId.name) {
retFunction.id = asyncFnId;
} else {
_babelHelperFunctionName2["default"]({
node: retFunction,
parent: path.parent,
scope: path.scope
});
}

@@ -86,0 +92,0 @@ if (retFunction.id || node.params.length) {

6

package.json
{
"name": "babel-helper-remap-async-to-generator",
"version": "6.0.16",
"version": "6.1.2",
"description": "",

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

"babel-template": "^6.0.16",
"babel-types": "^6.0.15",
"babel-traverse": "^6.0.16",
"babel-types": "^6.1.2",
"babel-traverse": "^6.1.2",
"babel-helper-function-name": "^6.0.15"
}
}
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