TS Ep 53: Branding and Flavoring (Nominal Typing)
·614 words·3 mins
TypeScript doesn’t care if two types have different names; if they share the same shape, they are equivalent. Learn how to use Branding and Flavoring to force the compiler to differentiate between an OrderID string and a UserID string, powering Domain-Driven Design.
