@babel/plugin-transform-typescript
Advanced tools
Comparing version 7.26.5 to 7.26.7
@@ -128,3 +128,8 @@ "use strict"; | ||
const name = expr.node.name; | ||
if (seen.has(name) && !expr.scope.hasOwnBinding(name)) { | ||
if (seen.has(name)) { | ||
for (let curScope = expr.scope; curScope !== path.scope; curScope = curScope.parent) { | ||
if (curScope.hasOwnBinding(name)) { | ||
return; | ||
} | ||
} | ||
expr.replaceWith(t.memberExpression(t.cloneNode(path.node.id), t.cloneNode(expr.node))); | ||
@@ -263,6 +268,8 @@ expr.skip(); | ||
} | ||
if (prevMembers != null && prevMembers.has(name)) { | ||
return undefined; | ||
} | ||
if (seen.has(path.node)) return; | ||
seen.add(path.node); | ||
value = computeConstantValue(path.resolve(), prevMembers, seen); | ||
prevMembers == null || prevMembers.set(name, value); | ||
return value; | ||
@@ -269,0 +276,0 @@ } |
@@ -243,2 +243,18 @@ "use strict"; | ||
} | ||
if (!onlyRemoveTypeImports && stmt.isTSImportEqualsDeclaration()) { | ||
const { | ||
id, | ||
isExport | ||
} = stmt.node; | ||
const binding = stmt.scope.getBinding(id.name); | ||
if (binding && !isExport && isImportTypeOnly({ | ||
binding, | ||
programPath: path, | ||
pragmaImportName, | ||
pragmaFragImportName | ||
})) { | ||
stmt.remove(); | ||
continue; | ||
} | ||
} | ||
if (stmt.isExportDeclaration()) { | ||
@@ -245,0 +261,0 @@ stmt = stmt.get("declaration"); |
{ | ||
"name": "@babel/plugin-transform-typescript", | ||
"version": "7.26.5", | ||
"version": "7.26.7", | ||
"description": "Transform TypeScript into ES.next", | ||
@@ -30,6 +30,6 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "^7.26.0", | ||
"@babel/core": "^7.26.7", | ||
"@babel/helper-plugin-test-runner": "^7.25.9", | ||
"@babel/traverse": "^7.26.5", | ||
"@babel/types": "^7.26.5" | ||
"@babel/traverse": "^7.26.7", | ||
"@babel/types": "^7.26.7" | ||
}, | ||
@@ -36,0 +36,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
142860
1098
2