Happy that you like it! Have you seen my video about generators? kzbin.info/www/bejne/eqi1hGmcYrqtl6M
@AlexanderYaremchuk5 ай бұрын
Bypassing of type guard check for value of undefined seems to be not related to additional check of typeof input === "number". undefined is not a number but it is not 0 neither. what for is typeof input === "number" introduced there?
@TypeScriptTV4 ай бұрын
Your concern is valid. The `typeof number` check at 16:06 is unnecessary: typescript.tv/hands-on/understanding-branded-types-in-typescript/#using-assertion-functions-with-branded-types Thanks for the hint! Benny
@sakarsr5 ай бұрын
Thank you for making this video on the branded type and its issues with the assertion. Putting two or more assertive conditions-one for notzero and another for number-is not possible. Alternatively, is there a way we could make different kinds of barnded nests?
@TypeScriptTV5 ай бұрын
Hey, for such complex validations I recommend to use a schema validator like Zod: typescript.tv/hands-on/use-typescript-generators-for-cleaner-programming/#response-schema-definition
@sakarsr5 ай бұрын
@@TypeScriptTV I do utilize Zod for my development, yes.
@achimilorava23385 ай бұрын
can you make video, using typescript in react?
@TypeScriptTV5 ай бұрын
It's a great topic and there is already an excellent course for it on Udemy: www.udemy.com/course/react-typescript-the-practical-guide/
@justAbeautifulSoul4093 ай бұрын
how to complicate a simple problem 101
@TypeScriptTV3 ай бұрын
It's called Software Architecture. 🙂
@justAbeautifulSoul4093 ай бұрын
@@TypeScriptTV I know. By the way, I was referring to the problem you were solving; it was a simple one and didn't require all those lines of code to handle. Are you aware that many projects don't use TypeScript but still follow software architecture?
@TypeScriptTV3 ай бұрын
@@justAbeautifulSoul409 I am aware of this but I like to use small code examples to show the technique so my viewers don't get lost in complex business logic.