Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
6
Versions
81
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.14.5 to 7.15.4

17

lib/index.js

@@ -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": {

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