When we use primitive types in TypeScript like numbers or strings, there is no way of defining that, for example, a function needs the string parameter to be in a certain shape like an email. By using branded types we can make this possible by adding more type information to the primitives making them much more type safe, declarative and more readable.
Code: https://github.com/typed-rocks/typesc...
0:00 Intro
0:26 The Issue
2:10 The Solution
7:30 Asserts check
10:25 Outro