Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-parameter-decorator

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-parameter-decorator - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

15

lib/index.js

@@ -79,3 +79,16 @@ "use strict";

path.node.body.filter(function (it) {
return it.type === 'ClassDeclaration' || it.type === 'ExportDefaultDeclaration' && it.declaration.type === 'ClassDeclaration';
var type = it.type,
declaration = it.declaration;
switch (type) {
case "ClassDeclaration":
return true;
case "ExportNamedDeclaration":
case "ExportDefaultDeclaration":
return declaration && declaration.type === "ClassDeclaration";
default:
return false;
}
}).map(function (it) {

@@ -82,0 +95,0 @@ return it.type === 'ClassDeclaration' ? it : it.declaration;

4

package.json
{
"name": "babel-plugin-parameter-decorator",
"version": "1.0.15",
"version": "1.0.16",
"description": "Function parameter decorator transform plugin for babel v7, just like typescript.",

@@ -35,3 +35,3 @@ "main": "lib/index.js",

"@babel/preset-env": "^7.5.5",
"@babel/preset-typescript": "^7.3.3",
"@babel/preset-typescript": "^7.9.0",
"@babel/runtime": "^7.5.5",

@@ -38,0 +38,0 @@ "ava": "^2.3.0"

@@ -72,3 +72,18 @@ # Babel Plugin Parameter Decorator

By default, `@babel/preset-typescript` will remove imports only referenced in Decorators.
Since this is prone to break Decorators, make sure [disable it by setting `onlyRemoveTypeImports` to true](https://babeljs.io/docs/en/babel-preset-typescript#onlyremovetypeimports):
```
{
...
"presets": [
[
"@babel/preset-typescript",
{ "onlyRemoveTypeImports": true }
]
]
...
}
```
## Additional

@@ -75,0 +90,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