babel-plugin-transform-remove-console
Advanced tools
Comparing version 6.9.0-alpha.033d9ab6 to 6.9.0-alpha.169f8743
"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.033d9ab6", | ||
"version": "6.9.0-alpha.169f8743", | ||
"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