News for hackers. Stuff that matters.
Re:Problems with TypeScript by krowokoliz on Wednesday January 15, 2020 @02:13PM (#22057407)
Why would you want runtime checks over static checks? The one thing I can think of is type asserting input from other js code, but surely you just want that on the entry function to your code, not in the internal bits.
Re:Problems with TypeScript by valand on Wednesday January 15, 2020 @02:20PM (#22057482)
TS compiled can still be faulty if the app is injected with data of different type

Runtime type checks is the lost link between static checks at compile time and arbitrary i/o data type in compiled js code.

You define a type in a similar way you would define TS types. At compile time it would give you the typescript type checks. At runtime it will help you determine if data has the correct type exactly as your typescript app expected.

There is extra work though, handling error if there is a faulty data type

Re:Problems with TypeScript by Scooty on Wednesday January 15, 2020 @05:25PM (#22059486)
Runtime type checking is necessary to ensure data received from untrustworthy sources matches compiletime types.