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

babel-plugin-minify-simplify

Package Overview
Dependencies
Maintainers
5
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-simplify - npm Package Compare versions

Comparing version 0.5.0-alpha.9939bca9 to 0.5.0-alpha.9e447f6d

26

lib/index.js

@@ -117,2 +117,10 @@ "use strict";

},
BinaryExpression(path) {
if (["!=", "=="].indexOf(path.node.operator) !== -1) {
undefinedToNull(path.get("left"));
undefinedToNull(path.get("right"));
}
},
LogicalExpression: {

@@ -1148,2 +1156,20 @@ exit: logicalExpression.simplifyPatterns

}
function isPureVoid(path) {
return path.isUnaryExpression({
operator: "void"
}) && path.isPure();
}
function isGlobalUndefined(path) {
return path.isIdentifier({
name: "undefined"
}) && !path.scope.getBinding("undefined");
}
function undefinedToNull(path) {
if (isGlobalUndefined(path) || isPureVoid(path)) {
path.replaceWith(t.nullLiteral());
}
}
};

6

package.json
{
"name": "babel-plugin-minify-simplify",
"version": "0.5.0-alpha.9939bca9",
"version": "0.5.0-alpha.9e447f6d",
"description": "",

@@ -15,6 +15,6 @@ "keywords": [

"dependencies": {
"babel-helper-flip-expressions": "^0.5.0-alpha.9939bca9",
"babel-helper-flip-expressions": "^0.5.0-alpha.9e447f6d",
"babel-helper-is-nodes-equiv": "^0.0.1",
"babel-helper-to-multiple-sequence-expressions": "^0.5.0-alpha.9939bca9"
"babel-helper-to-multiple-sequence-expressions": "^0.5.0-alpha.9e447f6d"
}
}
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