Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 21 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | export {} |
||
2 | |||
3 | it("`in string` vs `:string`", () => { |
||
4 | type In = {[k in string]: boolean} |
||
5 | type Colon = {[k: string]: boolean} |
||
6 | |||
7 | function check1(_: {some: boolean}) {} |
||
8 | function checkR<K extends string>(_: {[k in K]: boolean}) {} |
||
9 | function checkC(_: {[k: string]: boolean}) {} |
||
10 | |||
11 | const input1: In = {}, input2: Colon = {} |
||
12 | //@ts-expect-error |
||
13 | check1(input1) |
||
14 | //@ts-expect-error |
||
15 | check1(input2) |
||
16 | checkR(input1) |
||
17 | checkR(input2) |
||
18 | checkC(input1) |
||
19 | checkC(input2) |
||
20 | |||
21 | }) |