Socket
Socket
Sign inDemoInstall

@babel/traverse

Package Overview
Dependencies
Maintainers
4
Versions
180
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.0.0-beta.4 to 7.0.0-beta.5

41

lib/path/introspection.js

@@ -21,2 +21,3 @@ "use strict";

exports._resolve = _resolve;
exports.isConstantExpression = isConstantExpression;
exports.is = void 0;

@@ -321,2 +322,42 @@

}
}
function isConstantExpression() {
if (this.isIdentifier()) {
var binding = this.scope.getBinding(this.node.name);
if (!binding) {
return false;
}
return binding.constant && binding.path.get("init").isConstantExpression();
}
if (this.isLiteral()) {
if (this.isRegExpLiteral()) {
return false;
}
if (this.isTemplateLiteral()) {
return this.get("expressions").every(function (expression) {
return expression.isConstantExpression();
});
}
return true;
}
if (this.isUnaryExpression()) {
if (this.get("operator").node !== "void") {
return false;
}
return this.get("argument").isConstantExpression();
}
if (this.isBinaryExpression()) {
return this.get("left").isConstantExpression() && this.get("right").isConstantExpression();
}
return false;
}

12

package.json
{
"name": "@babel/traverse",
"version": "7.0.0-beta.4",
"version": "7.0.0-beta.5",
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",

@@ -11,5 +11,5 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"dependencies": {
"@babel/code-frame": "7.0.0-beta.4",
"@babel/helper-function-name": "7.0.0-beta.4",
"@babel/types": "7.0.0-beta.4",
"@babel/code-frame": "7.0.0-beta.5",
"@babel/helper-function-name": "7.0.0-beta.5",
"@babel/types": "7.0.0-beta.5",
"babylon": "7.0.0-beta.30",

@@ -22,5 +22,5 @@ "debug": "^3.0.1",

"devDependencies": {
"@babel/generator": "7.0.0-beta.4",
"@babel/helper-plugin-test-runner": "7.0.0-beta.4"
"@babel/generator": "7.0.0-beta.5",
"@babel/helper-plugin-test-runner": "7.0.0-beta.5"
}
}
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