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
4
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.0.5 to 0.0.6

14

lib/index.js

@@ -19,2 +19,4 @@ "use strict";

keepFnName = _ref2$keepFnName === undefined ? false : _ref2$keepFnName,
_ref2$keepClassName = _ref2.keepClassName,
keepClassName = _ref2$keepClassName === undefined ? false : _ref2$keepClassName,
_ref2$eval = _ref2.eval,

@@ -29,2 +31,3 @@ _eval = _ref2$eval === undefined ? false : _ref2$eval;

this.keepFnName = keepFnName;
this.keepClassName = keepClassName;
this.eval = _eval;

@@ -150,3 +153,5 @@

// function names
|| (mangler.keepFnName ? isFunction(binding.path) : false)) {
|| (mangler.keepFnName ? isFunction(binding.path) : false)
// class names
|| (mangler.keepClassName ? isClass(binding.path) : false)) {
continue;

@@ -327,5 +332,10 @@ }

function isFunction(path) {
return path.isFunctionExpression() || path.isFunctionDeclaration() || path.isClassExpression() || path.isClassDeclaration();
return path.isFunctionExpression() || path.isFunctionDeclaration();
}
// for keepClassName
function isClass(path) {
return path.isClassExpression() || path.isClassDeclaration();
}
function isLabelIdentifier(path) {

@@ -332,0 +342,0 @@ var node = path.node;

2

package.json
{
"name": "babel-plugin-minify-mangle-names",
"version": "0.0.5",
"version": "0.0.6",
"description": "",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/babel/babili#readme",

@@ -34,3 +34,3 @@ # babel-plugin-minify-mangle-names

```sh
$ npm install babel-plugin-minify-mangle-names
npm install babel-plugin-minify-mangle-names
```

@@ -49,3 +49,5 @@

}
```
```json
// with options

@@ -60,3 +62,3 @@ {

```sh
$ babel --plugins minify-mangle-names script.js
babel --plugins minify-mangle-names script.js
```

@@ -77,1 +79,2 @@

+ `keepFnName` - prevent mangler from altering function names. Useful for code depending on `fn.name`
+ `keepClassName` - prevent mangler from altering class names.
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