Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/traverse

Package Overview
Dependencies
Maintainers
5
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/traverse - npm Package Compare versions

Comparing version 7.4.5 to 7.5.0

4

lib/path/modification.js

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

return parentPath.insertBefore(nodes);
} else if (this.isNodeType("Expression") && this.listKey !== "params" && this.listKey !== "arguments" || parentPath.isForStatement() && this.key === "init") {
} else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
if (this.node) nodes.push(this.node);

@@ -200,3 +200,3 @@ return this.replaceExpressionWithStatements(nodes);

return path.insertBefore(nodes);
return path._containerInsertBefore(nodes);
}

@@ -203,0 +203,0 @@

@@ -209,2 +209,4 @@ "use strict";

const functionParent = this.getFunctionParent();
const isParentAsync = functionParent && functionParent.is("async");
const container = t().arrowFunctionExpression([], t().blockStatement(nodes));

@@ -239,2 +241,8 @@ this.replaceWith(t().callExpression(container, []));

callee.arrowFunctionToExpression();
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) {
callee.set("async", true);
this.replaceWith(t().awaitExpression(this.node));
}
return callee.get("body.body");

@@ -241,0 +249,0 @@ }

{
"name": "@babel/traverse",
"version": "7.4.5",
"version": "7.5.0",
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",

@@ -15,7 +15,7 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"@babel/code-frame": "^7.0.0",
"@babel/generator": "^7.4.4",
"@babel/generator": "^7.5.0",
"@babel/helper-function-name": "^7.1.0",
"@babel/helper-split-export-declaration": "^7.4.4",
"@babel/parser": "^7.4.5",
"@babel/types": "^7.4.4",
"@babel/parser": "^7.5.0",
"@babel/types": "^7.5.0",
"debug": "^4.1.0",

@@ -28,3 +28,3 @@ "globals": "^11.1.0",

},
"gitHead": "33ab4f166117e2380de3955a0842985f578b01b8"
"gitHead": "49da9a07c81156e997e60146eb001ea77b7044c4"
}
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