@babel/plugin-transform-typescript
Advanced tools
Comparing version 7.19.1 to 7.19.3
@@ -57,2 +57,18 @@ "use strict"; | ||
function safeRemove(path) { | ||
const ids = path.getBindingIdentifiers(); | ||
for (const name of Object.keys(ids)) { | ||
const binding = path.scope.getBinding(name); | ||
if (binding && binding.identifier === ids[name]) { | ||
binding.scope.removeBinding(name); | ||
} | ||
} | ||
path.opts.noScope = true; | ||
path.remove(); | ||
path.opts.noScope = false; | ||
} | ||
var _default = (0, _helperPluginUtils.declare)((api, opts) => { | ||
@@ -351,7 +367,7 @@ api.assertVersion(7); | ||
TSDeclareFunction(path) { | ||
path.remove(); | ||
safeRemove(path); | ||
}, | ||
TSDeclareMethod(path) { | ||
path.remove(); | ||
safeRemove(path); | ||
}, | ||
@@ -361,3 +377,3 @@ | ||
if (path.node.declare) { | ||
path.remove(); | ||
safeRemove(path); | ||
} | ||
@@ -382,4 +398,3 @@ }, | ||
if (node.declare) { | ||
path.remove(); | ||
return; | ||
safeRemove(path); | ||
} | ||
@@ -386,0 +401,0 @@ }, |
@@ -58,5 +58,3 @@ "use strict"; | ||
for (const declarator of declarations) { | ||
if (declarator.init) { | ||
declarator.init = _core.types.assignmentExpression("=", getMemberExpression(name, declarator.id.name), declarator.init); | ||
} | ||
declarator.init = _core.types.assignmentExpression("=", getMemberExpression(name, declarator.id.name), declarator.init); | ||
} | ||
@@ -135,2 +133,6 @@ | ||
if ("declare" in subNode.declaration && subNode.declaration.declare) { | ||
continue; | ||
} | ||
switch (subNode.declaration.type) { | ||
@@ -141,6 +143,2 @@ case "TSEnumDeclaration": | ||
{ | ||
if (subNode.declaration.declare) { | ||
continue; | ||
} | ||
const itemName = subNode.declaration.id.name; | ||
@@ -147,0 +145,0 @@ names.add(itemName); |
{ | ||
"name": "@babel/plugin-transform-typescript", | ||
"version": "7.19.1", | ||
"version": "7.19.3", | ||
"description": "Transform TypeScript into ES.next", | ||
@@ -28,6 +28,6 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "^7.19.1", | ||
"@babel/core": "^7.19.3", | ||
"@babel/helper-plugin-test-runner": "^7.18.6", | ||
"@babel/traverse": "^7.19.1", | ||
"@babel/types": "^7.19.0" | ||
"@babel/traverse": "^7.19.3", | ||
"@babel/types": "^7.19.3" | ||
}, | ||
@@ -34,0 +34,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
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
112580
882