Fix printing TSTypeOperator (#12114)

This commit is contained in:
Brian Ng 2020-09-28 11:01:13 -05:00 committed by GitHub
parent 62df8d2b79
commit 3ba1ece0ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 2 deletions

View File

@ -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);
}

View File

@ -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 };

View File

@ -0,0 +1,5 @@
{
"compact": true,
"sourceType": "module",
"plugins": ["typescript"]
}

View File

@ -0,0 +1 @@
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};

View File

@ -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 };

View File

@ -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 };