@travetto/transformer 8.0.0-alpha.17 → 8.0.0-alpha.19

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.
Files changed (2) hide show
  1. package/package.json +13 -13
  2. package/src/state.ts +2 -2
package/package.json CHANGED
@@ -1,31 +1,34 @@
1
1
  {
2
2
  "name": "@travetto/transformer",
3
- "version": "8.0.0-alpha.17",
4
- "type": "module",
3
+ "version": "8.0.0-alpha.19",
5
4
  "description": "Functionality for AST transformations, with transformer registration, and general utils",
6
5
  "keywords": [
7
- "typescript",
8
6
  "ast-transformations",
9
- "travetto"
7
+ "travetto",
8
+ "typescript"
10
9
  ],
11
10
  "homepage": "https://travetto.io",
12
11
  "license": "MIT",
13
12
  "author": {
14
- "email": "travetto.framework@gmail.com",
15
- "name": "Travetto Framework"
13
+ "name": "Travetto Framework",
14
+ "email": "travetto.framework@gmail.com"
15
+ },
16
+ "repository": {
17
+ "url": "git+https://github.com/travetto/travetto.git",
18
+ "directory": "module/transformer"
16
19
  },
17
20
  "files": [
18
21
  "__index__.ts",
19
22
  "src",
20
23
  "support"
21
24
  ],
25
+ "type": "module",
22
26
  "main": "__index__.ts",
23
- "repository": {
24
- "url": "git+https://github.com/travetto/travetto.git",
25
- "directory": "module/transformer"
27
+ "publishConfig": {
28
+ "access": "public"
26
29
  },
27
30
  "dependencies": {
28
- "@travetto/manifest": "^8.0.0-alpha.11",
31
+ "@travetto/manifest": "^8.0.0-alpha.13",
29
32
  "tslib": "^2.8.1",
30
33
  "typescript": "^6.0.2"
31
34
  },
@@ -34,8 +37,5 @@
34
37
  "roles": [
35
38
  "compile"
36
39
  ]
37
- },
38
- "publishConfig": {
39
- "access": "public"
40
40
  }
41
41
  }
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 isRedefinableDeclaration(node: ts.Node): node is ts.InterfaceDeclaration | ts.ClassDeclaration | ts.FunctionDeclaration {
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 (isRedefinableDeclaration(child) || ts.isMethodDeclaration(child) || ts.isParameter(child)) {
356
+ if (canRedeclare(child) || ts.isMethodDeclaration(child) || ts.isParameter(child)) {
357
357
  if (child.name) {
358
358
  unique.push(child.name.getText());
359
359
  }