File: formattingMultipleMappedType.ts

package info (click to toggle)
node-typescript 4.8.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 523,068 kB
  • sloc: javascript: 1,735,777; makefile: 7; sh: 1
file content (36 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/// <reference path='fourslash.ts' />

/////*x1*/type x1<T> = {[K in keyof T]: number}
/////*x2*/type x2<T> = { [K in keyof T]: number }
/////*x3*/type x3<T> = { [K in keyof T]: number}
/////*x4*/type x4<T> = {[K in keyof T]: number }
/////*x5*/type x5<T> = {    [K in keyof T]: number}
/////*x6*/type x6<T> = {[K in keyof T]: number    }
/////*x7*/type x7<T> = {    [K in keyof T]: number     }
/////*x8*/type x8<T> = {    [K in keyof T]: number     };
////
/////*y1*/type y1 = {foo: number}
/////*y2*/type y2 = { foo: number }
/////*y3*/type y3 = { foo: number}
/////*y4*/type y4 = {foo: number }
/////*y5*/type y5 = {    foo: number}
/////*y6*/type y6 = {foo: number   }
/////*y7*/type y7 = {   foo: number   }
/////*y8*/type y8 = {   foo: number   };

format.document();
for (let index = 1; index < 8; index++) {
    goTo.marker(`x${index}`);
    verify.currentLineContentIs(`type x${index}<T> = { [K in keyof T]: number }`);   
}

goTo.marker(`x8`);
verify.currentLineContentIs(`type x8<T> = { [K in keyof T]: number };`);   

for (let index = 1; index < 8; index++) {
    goTo.marker(`y${index}`);
    verify.currentLineContentIs(`type y${index} = { foo: number }`);   
}

goTo.marker(`y8`);
verify.currentLineContentIs(`type y8 = { foo: number };`);