Hacker News new | ask | show | jobs
by ec109685 602 days ago
Isn’t kind just overriding the type checker? Should that as be necessary?
2 comments

In the context of the union query, I think it makes sense. The query takes two different columns (with two different names) from the same table, and combines them together into one column. The TS error happened because the column names didn't match between the two union inputs. But they would never match without the "as".
Yes. The runtime was not affected. Hence, the ts-expect-error. Still nice to have the ts-expect-error fixed :)