babel-plugin-transform-remove-console
Advanced tools
Comparing version 6.9.0-alpha.670b24ec to 6.9.0-alpha.6ae655c0
"use strict"; | ||
module.exports = function (_ref) { | ||
var t = _ref.types; | ||
module.exports = function ({ types: t }) { | ||
return { | ||
@@ -10,3 +8,3 @@ name: "transform-remove-console", | ||
CallExpression(path, state) { | ||
var callee = path.get("callee"); | ||
const callee = path.get("callee"); | ||
@@ -42,3 +40,3 @@ if (!callee.isMemberExpression()) return; | ||
function isGlobalConsoleId(id) { | ||
var name = "console"; | ||
const name = "console"; | ||
return id.isIdentifier({ name }) && !id.scope.getBinding(name) && id.scope.hasGlobal(name); | ||
@@ -48,10 +46,8 @@ } | ||
function isExcluded(property, excludeArray) { | ||
return excludeArray && excludeArray.some(function (name) { | ||
return property.isIdentifier({ name }); | ||
}); | ||
return excludeArray && excludeArray.some(name => property.isIdentifier({ name })); | ||
} | ||
function isIncludedConsole(memberExpr, excludeArray) { | ||
var object = memberExpr.get("object"); | ||
var property = memberExpr.get("property"); | ||
const object = memberExpr.get("object"); | ||
const property = memberExpr.get("property"); | ||
@@ -66,3 +62,3 @@ if (isExcluded(property, excludeArray)) return false; | ||
function isIncludedConsoleBind(memberExpr, excludeArray) { | ||
var object = memberExpr.get("object"); | ||
const object = memberExpr.get("object"); | ||
@@ -69,0 +65,0 @@ if (!object.isMemberExpression()) return false; |
{ | ||
"name": "babel-plugin-transform-remove-console", | ||
"version": "6.9.0-alpha.670b24ec", | ||
"version": "6.9.0-alpha.6ae655c0", | ||
"description": "Remove all console.* calls.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3616
59