In the example given Typescript is no help at all: the application would simply crash. I've seen this happen recently in an application taking data from a PHP backend out of our control. The data didn't conform to the data type we expected and our application bombed because someone forgot to add the proper checks. This was in QA so no big deal; but could have been really problematic if it had slipped through the net.
I think it would be unfair to call this a flaw in Typescript; but it is really important that people understand this. Typescript is not a substitute for doing proper type-checking/validation on data that is outside your control.
If that was to me, you need to read it in context.
Also bear in mind union types and nullability are supported in TypeScript and should be considered and used. The benefits once you understand them are great, however.
Matt - my response saying the answer given was incorrect was not directed at you. I've edited it to make that clearer ;)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.