Passed
Push — main ( 5111c8...0b2f70 )
by Andrii
02:45
created

src/sandbox/ts.test.ts   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 21
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3
mnd 0
bc 0
fnc 3
bpm 0
cpm 1
noi 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A ts.test.ts ➔ check1 0 2 1
A ts.test.ts ➔ checkC 0 1 1
A ts.test.ts ➔ checkR 0 1 1
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
})