The scope of type guards and assertion functions (#tilPost)

I've just read Absorbing unknown Into the Type Realm . It's a good read, check it out. However I also learned an important difference between TypeScript type guards and assertion functions. And to be fair, I didn't even know assertion functions were a thing in TypeScript. Let's look at a standard type guard. ts interface User { name : string ; } // standard type guard function isUser ( value :…