@babel/plugin-transform-typescript
Advanced tools
Comparing version 7.15.0 to 7.15.4
@@ -75,7 +75,12 @@ "use strict"; | ||
function buildNestedAmbiendModuleError(path, node) { | ||
throw path.hub.buildError(node, "Ambient modules cannot be nested in other modules or namespaces.", Error); | ||
} | ||
function handleNested(path, t, node, parentExport) { | ||
const names = new Set(); | ||
const realName = node.id; | ||
t.assertIdentifier(realName); | ||
const name = path.scope.generateUid(realName.name); | ||
const namespaceTopLevel = node.body.body; | ||
const namespaceTopLevel = t.isTSModuleBlock(node.body) ? node.body.body : [t.exportNamedDeclaration(node.body)]; | ||
@@ -88,2 +93,6 @@ for (let i = 0; i < namespaceTopLevel.length; i++) { | ||
{ | ||
if (!t.isIdentifier(subNode.id)) { | ||
throw buildNestedAmbiendModuleError(path, subNode); | ||
} | ||
const transformed = handleNested(path, t, subNode); | ||
@@ -144,2 +153,6 @@ const moduleName = subNode.id.name; | ||
{ | ||
if (!t.isIdentifier(subNode.declaration.id)) { | ||
throw buildNestedAmbiendModuleError(path, subNode.declaration); | ||
} | ||
const transformed = handleNested(path, t, subNode.declaration, t.identifier(name)); | ||
@@ -146,0 +159,0 @@ const moduleName = subNode.declaration.id.name; |
{ | ||
"name": "@babel/plugin-transform-typescript", | ||
"version": "7.15.0", | ||
"version": "7.15.4", | ||
"description": "Transform TypeScript into ES.next", | ||
@@ -20,3 +20,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-create-class-features-plugin": "^7.15.0", | ||
"@babel/helper-create-class-features-plugin": "^7.15.4", | ||
"@babel/helper-plugin-utils": "^7.14.5", | ||
@@ -29,6 +29,6 @@ "@babel/plugin-syntax-typescript": "^7.14.5" | ||
"devDependencies": { | ||
"@babel/core": "7.15.0", | ||
"@babel/core": "7.15.4", | ||
"@babel/helper-plugin-test-runner": "7.14.5", | ||
"@babel/traverse": "7.15.0", | ||
"@babel/types": "7.15.0" | ||
"@babel/traverse": "7.15.4", | ||
"@babel/types": "7.15.4" | ||
}, | ||
@@ -35,0 +35,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript", |
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
30710
813
1
+ Addedcaniuse-lite@1.0.30001620(transitive)
+ Addedpicocolors@1.0.1(transitive)
+ Addedupdate-browserslist-db@1.0.16(transitive)
- Removedcaniuse-lite@1.0.30001616(transitive)
- Removedelectron-to-chromium@1.4.763(transitive)
- Removedpicocolors@1.0.0(transitive)
- Removedupdate-browserslist-db@1.0.15(transitive)