New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-minify-mangle-names

Package Overview
Dependencies
Maintainers
5
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-mangle-names - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0-alpha.a7421897

18

lib/index.js

@@ -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`

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