babel-plugin-transform-remove-console
Advanced tools
Comparing version 6.10.0-alpha.7b176463 to 6.10.0-alpha.85c9b6d8
"use strict"; | ||
module.exports = function (_ref) { | ||
var t = _ref.types; | ||
module.exports = function ({ | ||
types: t | ||
}) { | ||
return { | ||
@@ -9,3 +10,3 @@ name: "transform-remove-console", | ||
CallExpression(path, state) { | ||
var callee = path.get("callee"); | ||
const callee = path.get("callee"); | ||
if (!callee.isMemberExpression()) return; | ||
@@ -42,3 +43,3 @@ | ||
function isGlobalConsoleId(id) { | ||
var name = "console"; | ||
const name = "console"; | ||
return id.isIdentifier({ | ||
@@ -50,12 +51,10 @@ name | ||
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"); | ||
if (isExcluded(property, excludeArray)) return false; | ||
@@ -71,3 +70,3 @@ if (isGlobalConsoleId(object)) return true; | ||
function isIncludedConsoleBind(memberExpr, excludeArray) { | ||
var object = memberExpr.get("object"); | ||
const object = memberExpr.get("object"); | ||
if (!object.isMemberExpression()) return false; | ||
@@ -74,0 +73,0 @@ if (isExcluded(object.get("property"), excludeArray)) return false; |
{ | ||
"name": "babel-plugin-transform-remove-console", | ||
"version": "6.10.0-alpha.7b176463", | ||
"version": "6.10.0-alpha.85c9b6d8", | ||
"description": "Remove all console.* calls.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -22,3 +22,3 @@ # babel-plugin-transform-remove-console | ||
```sh | ||
npm install babel-plugin-transform-remove-console | ||
npm install babel-plugin-transform-remove-console --save-dev | ||
``` | ||
@@ -25,0 +25,0 @@ |
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
615815
3677
71