News for hackers. Stuff that matters.
Re:If It Ain't TypeScript It Ain't Sexy by nicoburns on Monday February 11, 2019 @03:21PM (#19137906)
It was pretty common to write runtime type assertions at the top of functions in JS before TS was invented...
Re:If It Ain't TypeScript It Ain't Sexy by shados on Monday February 11, 2019 @03:23PM (#19137917)
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)