Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.1 to 0.4.2

21

lib/index.js

@@ -146,2 +146,23 @@ "use strict";

/**
* This is required because after function name transformation
* plugin (part of es2015), the function name is NOT added to the
* scope's bindings. So to fix this issue, we simply add a hack to
* handle that case - fix it to the scope tree.
*
* Related:
* - https://github.com/babel/minify/issues/829
*/
BindingIdentifier(path) {
if ( // the parent has this id as the name
(path.parentPath.isFunctionExpression({
id: path.node
}) || path.parentPath.isClassExpression({
id: path.node
})) && // and the id isn't yet added to the scope
!hop.call(path.parentPath.scope.bindings, path.node.name)) {
path.parentPath.scope.registerBinding("local", path.parentPath);
}
},
/**
* This is necessary because, in Babel, the scope.references

@@ -148,0 +169,0 @@ * does NOT contain the references in that scope. Only the program

4

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

@@ -15,4 +15,4 @@ "keywords": [

"dependencies": {
"babel-helper-mark-eval-scopes": "^0.4.1"
"babel-helper-mark-eval-scopes": "^0.4.2"
}
}

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

```sh
npm install babel-plugin-minify-mangle-names
npm install babel-plugin-minify-mangle-names --save-dev
```

@@ -37,0 +37,0 @@

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