Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printing TSTypeOperator #12114

Merged
merged 1 commit into from Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 };