babel-plugin-parameter-decorator
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -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; |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15201
237
128