@babel/plugin-transform-typescript
Advanced tools
Comparing version 7.15.4 to 7.15.8
@@ -50,4 +50,4 @@ "use strict"; | ||
function registerGlobalType(programScope, name) { | ||
GLOBAL_TYPES.get(programScope.path.node).add(name); | ||
function registerGlobalType(programNode, name) { | ||
GLOBAL_TYPES.get(programNode).add(name); | ||
} | ||
@@ -169,5 +169,6 @@ | ||
let fileJsxPragmaFrag = null; | ||
const programNode = path.node; | ||
if (!GLOBAL_TYPES.has(path.node)) { | ||
GLOBAL_TYPES.set(path.node, new Set()); | ||
if (!GLOBAL_TYPES.has(programNode)) { | ||
GLOBAL_TYPES.set(programNode, new Set()); | ||
} | ||
@@ -208,2 +209,6 @@ | ||
if (stmt.node.importKind === "type") { | ||
for (const specifier of stmt.node.specifiers) { | ||
registerGlobalType(programNode, specifier.local.name); | ||
} | ||
stmt.remove(); | ||
@@ -260,3 +265,3 @@ continue; | ||
for (const name of Object.keys(stmt.getBindingIdentifiers())) { | ||
registerGlobalType(path.scope, name); | ||
registerGlobalType(programNode, name); | ||
} | ||
@@ -270,3 +275,3 @@ } else if (stmt.isTSTypeAliasDeclaration() || stmt.isTSDeclareFunction() && stmt.get("id").isIdentifier() || stmt.isTSInterfaceDeclaration() || stmt.isClassDeclaration({ | ||
}) && stmt.get("id").isIdentifier()) { | ||
registerGlobalType(path.scope, stmt.node.id.name); | ||
registerGlobalType(programNode, stmt.node.id.name); | ||
} | ||
@@ -273,0 +278,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-typescript", | ||
"version": "7.15.4", | ||
"version": "7.15.8", | ||
"description": "Transform TypeScript into ES.next", | ||
@@ -28,6 +28,6 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "7.15.4", | ||
"@babel/core": "7.15.8", | ||
"@babel/helper-plugin-test-runner": "7.14.5", | ||
"@babel/traverse": "7.15.4", | ||
"@babel/types": "7.15.4" | ||
"@babel/types": "7.15.6" | ||
}, | ||
@@ -34,0 +34,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript", |
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
30901
817
2
0