I'm sincerely confused with TypeScript's casting mechanisms.

This commit is contained in:
Gustavo R. 'Gustavo6046' Rehermann
2018-11-01 12:16:07 -03:00
parent f09c1b7382
commit 505c4ba3cd
+2 -2
View File
@@ -22,9 +22,9 @@ Object.keys({
}).forEach((color) => {
const cname = color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`);
((<(...anything: any[]) => ansi.Cursor> cursor[color])()
(((<(...anything: any[]) => ansi.Cursor> cursor[color])()
.bold()
.bg)[color === 'blue' || color === 'brightBlue' ? 'black' : 'blue']()
.bg)[color === 'blue' || color === 'brightBlue' ? 'black' : 'blue']() as ansi.Cursor)
.write(
`Hello, bold ${cname} world!\n`
)