Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3aef1e

Browse files
committed
TS: Update TypeAlias test
1 parent 53576a4 commit a3aef1e

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
rightHandSide
2+
| tst.ts:1:1:1:16 | type A = number; | number |
3+
| tst.ts:2:1:2:16 | type B<T> = T[]; | B<T> |
4+
| tst.ts:8:10:8:20 | type C = A; | number |
5+
| tst.ts:15:1:15:23 | type Un ... \| Two; | Union |
6+
#select
17
| tst.ts:1:1:1:16 | type A = number; | tst.ts:1:6:1:6 | A | 0 | tst.ts:1:10:1:15 | number |
28
| tst.ts:2:1:2:16 | type B<T> = T[]; | tst.ts:2:6:2:6 | B | 1 | tst.ts:2:13:2:15 | T[] |
39
| tst.ts:8:10:8:20 | type C = A; | tst.ts:8:15:8:15 | C | 0 | tst.ts:8:19:8:19 | A |
10+
| tst.ts:15:1:15:23 | type Un ... \| Two; | tst.ts:15:6:15:10 | Union | 0 | tst.ts:15:14:15:22 | One \| Two |

javascript/ql/test/library-tests/TypeScript/TypeAliases/TypeAliases.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ import javascript
22

33
from TypeAliasDeclaration decl
44
select decl, decl.getIdentifier(), decl.getNumTypeParameter(), decl.getDefinition()
5+
6+
query Type rightHandSide(TypeAliasDeclaration decl) {
7+
result = decl.getDefinition().getType()
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"include": ["."]
3+
}

javascript/ql/test/library-tests/TypeScript/TypeAliases/tst.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ namespace Q {
88
export type C = A;
99
}
1010
var z: Q.C;
11+
12+
interface One { a: number }
13+
interface Two { b: number }
14+
15+
type Union = One | Two;

0 commit comments

Comments
 (0)