Hacker News new | ask | show | jobs
by nicoburns 2687 days ago
It was pretty common to write runtime type assertions at the top of functions in JS before TS was invented...
1 comments

Different topic than unit tests, but also if its in the public interface of your code and you don't control all callers, you might need those assertions anyway (since they could be invoked from non-TS code, or they could have been cast to a any type, especially in non-strict mode TS)