Skip to content

Commit e6f5640

Browse files
committed
support transformation of symbol
1 parent 9f74f08 commit e6f5640

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

src/transform.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ export const transform = {
277277
path.replaceWith(t.tsArrayType(elementType));
278278
},
279279
},
280+
SymbolTypeAnnotation: {
281+
exit(path) {
282+
path.replaceWith(t.tsSymbolKeyword());
283+
},
284+
},
280285
TupleTypeAnnotation: {
281286
exit(path) {
282287
const { types } = path.node;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a: symbol;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a: symbol;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let obj: string | symbol;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let obj: string | symbol;

0 commit comments

Comments
 (0)