Skip to content

Commit

Permalink
Fix printing TSTypeOperator (#12114)
Browse files Browse the repository at this point in the history
  • Loading branch information
existentialism committed Sep 28, 2020
1 parent 62df8d2 commit 3ba1ece
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/babel-generator/src/generators/typescript.js
Expand Up @@ -317,7 +317,7 @@ export function TSParenthesizedType(node) {
}

export function TSTypeOperator(node) {
this.token(node.operator);
this.word(node.operator);
this.space();
this.print(node.typeAnnotation, node);
}
Expand Down
@@ -0,0 +1,5 @@
let map1: { [P in string]: number };
let map2: { readonly [P in string]?: number };
let map3: { +readonly [P in string]+?: number };
let map4: { -readonly [P in string]-?: number };
let map5: { [P in keyof Q]: number };
@@ -0,0 +1,5 @@
{
"compact": true,
"sourceType": "module",
"plugins": ["typescript"]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -2,3 +2,4 @@ let map1: { [P in string]: number };
let map2: { readonly [P in string]?: number };
let map3: { +readonly [P in string]+?: number };
let map4: { -readonly [P in string]-?: number };
let map5: { [P in keyof Q]: number };
@@ -1,4 +1,5 @@
let map1: { [P in string]: number };
let map2: { readonly [P in string]?: number };
let map3: { +readonly [P in string]+?: number };
let map4: { -readonly [P in string]-?: number };
let map4: { -readonly [P in string]-?: number };
let map5: { [P in keyof Q]: number };

0 comments on commit 3ba1ece

Please sign in to comment.