Skip to content

Commit 165e4f9

Browse files
committedNov 25, 2019
Prettify README.md
1 parent 5d0b1f2 commit 165e4f9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
 

‎README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1411,30 +1411,32 @@ function foo() {
14111411
return {
14121412
a: 1,
14131413
b: 2,
1414-
subInstArr: [{
1414+
subInstArr: [
1415+
{
14151416
c: 3,
14161417
d: 4
1417-
}]
1418-
}
1418+
}
1419+
]
1420+
};
14191421
}
14201422

1421-
type InstType = ReturnType<typeof foo>
1422-
type SubInstArr = InstType['subInstArr'];
1423+
type InstType = ReturnType<typeof foo>;
1424+
type SubInstArr = InstType["subInstArr"];
14231425
type SubIsntType = SubInstArr[0];
14241426

14251427
let baz: SubIsntType = {
14261428
c: 5,
14271429
d: 6 // type checks ok!
1428-
}
1430+
};
14291431

14301432
//You could just write a one-liner,
14311433
//But please make sure it is forward-readable
14321434
//(you can understand it from reading once left-to-right with no jumps)
1433-
type SubIsntType2 = ReturnType<typeof foo>['subInstArr'][0];
1435+
type SubIsntType2 = ReturnType<typeof foo>["subInstArr"][0];
14341436
let baz2: SubIsntType2 = {
14351437
c: 5,
14361438
d: 6 // type checks ok!
1437-
}
1439+
};
14381440
```
14391441
14401442
# Troubleshooting Handbook: Images and other non-TS/TSX files

0 commit comments

Comments
 (0)