@travetto/transformer 8.0.0-alpha.17 → 8.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/state.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/transformer",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Functionality for AST transformations, with transformer registration, and general utils",
|
|
6
6
|
"keywords": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"directory": "module/transformer"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/manifest": "^8.0.0-alpha.
|
|
28
|
+
"@travetto/manifest": "^8.0.0-alpha.12",
|
|
29
29
|
"tslib": "^2.8.1",
|
|
30
30
|
"typescript": "^6.0.2"
|
|
31
31
|
},
|
package/src/state.ts
CHANGED
|
@@ -22,7 +22,7 @@ function hasEscapedName(node: ts.Node): node is ts.Node & { name: { escapedText:
|
|
|
22
22
|
return !!node && 'name' in node && typeof node.name === 'object' && !!node.name && 'escapedText' in node.name && !!node.name.escapedText;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function
|
|
25
|
+
function canRedeclare(node: ts.Node): node is ts.InterfaceDeclaration | ts.ClassDeclaration | ts.FunctionDeclaration {
|
|
26
26
|
return ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -353,7 +353,7 @@ export class TransformerState implements State {
|
|
|
353
353
|
// if in same file suffix with location
|
|
354
354
|
let child: ts.Node = tgt;
|
|
355
355
|
while (child && !ts.isSourceFile(child)) {
|
|
356
|
-
if (
|
|
356
|
+
if (canRedeclare(child) || ts.isMethodDeclaration(child) || ts.isParameter(child)) {
|
|
357
357
|
if (child.name) {
|
|
358
358
|
unique.push(child.name.getText());
|
|
359
359
|
}
|