babel-plugin-minify-mangle-names
Advanced tools
Comparing version 0.2.0 to 0.3.0-alpha.a7421897
@@ -32,4 +32,4 @@ "use strict"; | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$blacklist = _ref.blacklist, | ||
blacklist = _ref$blacklist === undefined ? {} : _ref$blacklist, | ||
_ref$exclude = _ref.exclude, | ||
exclude = _ref$exclude === undefined ? {} : _ref$exclude, | ||
_ref$keepFnName = _ref.keepFnName, | ||
@@ -50,3 +50,3 @@ keepFnName = _ref$keepFnName === undefined ? false : _ref$keepFnName, | ||
// user passed options | ||
this.blacklist = toObject(blacklist); | ||
this.exclude = toObject(exclude); | ||
this.keepFnName = keepFnName; | ||
@@ -79,3 +79,3 @@ this.keepClassName = keepClassName; | ||
/** | ||
* Tells if a variable name is blacklisted | ||
* Tells if a variable name is excluded | ||
* @param {String} name | ||
@@ -85,5 +85,5 @@ */ | ||
}, { | ||
key: "isBlacklist", | ||
value: function isBlacklist(name) { | ||
return hop.call(this.blacklist, name) && this.blacklist[name]; | ||
key: "isExcluded", | ||
value: function isExcluded(name) { | ||
return hop.call(this.exclude, name) && this.exclude[name]; | ||
} | ||
@@ -379,4 +379,4 @@ | ||
binding.path.isClassDeclaration() && binding.path === scope.path || | ||
// blacklisted | ||
mangler.isBlacklist(oldName) || ( | ||
// excluded | ||
mangler.isExcluded(oldName) || ( | ||
// function names | ||
@@ -383,0 +383,0 @@ mangler.keepFnName ? isFunction(binding.path) : false) || ( |
{ | ||
"name": "babel-plugin-minify-mangle-names", | ||
"version": "0.2.0", | ||
"version": "0.3.0-alpha.a7421897", | ||
"description": "", | ||
@@ -15,4 +15,4 @@ "keywords": [ | ||
"dependencies": { | ||
"babel-helper-mark-eval-scopes": "^0.2.0" | ||
"babel-helper-mark-eval-scopes": "^0.3.0-alpha.a7421897" | ||
} | ||
} |
@@ -53,3 +53,3 @@ # babel-plugin-minify-mangle-names | ||
{ | ||
"plugins": ["minify-mangle-names", { "blacklist": { "foo": true, "bar": true} }] | ||
"plugins": ["minify-mangle-names", { "exclude": { "foo": true, "bar": true} }] | ||
} | ||
@@ -74,3 +74,3 @@ ``` | ||
+ `blacklist` - A plain JS Object with keys as identifier names and values indicating whether to exclude | ||
+ `exclude` - A plain JS Object with keys as identifier names and values indicating whether to exclude | ||
+ `eval` - mangle identifiers in scopes accessible by eval | ||
@@ -77,0 +77,0 @@ + `keepFnName` - prevent mangler from altering function names. Useful for code depending on `fn.name` |
40556
9
+ Addedbabel-helper-mark-eval-scopes@0.3.0(transitive)
- Removedbabel-helper-mark-eval-scopes@0.2.0(transitive)