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

babel-plugin-transform-remove-console

Package Overview
Dependencies
Maintainers
5
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-remove-console - npm Package Compare versions

Comparing version 6.10.0-alpha.6546ad11 to 6.10.0-alpha.caaefb4c

27

lib/index.js

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

var t = _ref.types;
return {

@@ -12,3 +11,2 @@ name: "transform-remove-console",

var callee = path.get("callee");
if (!callee.isMemberExpression()) return;

@@ -28,2 +26,3 @@

},
MemberExpression: {

@@ -39,2 +38,3 @@ exit(path, state) {

}
}

@@ -46,3 +46,5 @@ }

var name = "console";
return id.isIdentifier({ name }) && !id.scope.getBinding(name) && id.scope.hasGlobal(name);
return id.isIdentifier({
name
}) && !id.scope.getBinding(name) && id.scope.hasGlobal(name);
}

@@ -52,3 +54,5 @@

return excludeArray && excludeArray.some(function (name) {
return property.isIdentifier({ name });
return property.isIdentifier({
name
});
});

@@ -60,8 +64,9 @@ }

var property = memberExpr.get("property");
if (isExcluded(property, excludeArray)) return false;
if (isGlobalConsoleId(object)) return true;
return isGlobalConsoleId(object.get("object")) && (property.isIdentifier({ name: "call" }) || property.isIdentifier({ name: "apply" }));
return isGlobalConsoleId(object.get("object")) && (property.isIdentifier({
name: "call"
}) || property.isIdentifier({
name: "apply"
}));
}

@@ -71,7 +76,7 @@

var object = memberExpr.get("object");
if (!object.isMemberExpression()) return false;
if (isExcluded(object.get("property"), excludeArray)) return false;
return isGlobalConsoleId(object.get("object")) && memberExpr.get("property").isIdentifier({ name: "bind" });
return isGlobalConsoleId(object.get("object")) && memberExpr.get("property").isIdentifier({
name: "bind"
});
}

@@ -78,0 +83,0 @@

{
"name": "babel-plugin-transform-remove-console",
"version": "6.10.0-alpha.6546ad11",
"version": "6.10.0-alpha.caaefb4c",
"description": "Remove all console.* calls.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -54,3 +54,3 @@ # babel-plugin-transform-remove-console

```javascript
require("babel-core").transform("code", {
require("@babel/core").transform("code", {
plugins: ["transform-remove-console"]

@@ -57,0 +57,0 @@ });

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