TypeScript let me pass a user ID where an order ID belongs
Type aliases don't create distinct types in TypeScript. Branded types do, and they can save you from mixing up identifiers at compile time.
Last quarter, we shipped a bug that refunded the wrong customer. A function received a user ID where it expected an order ID. The strings looked identical, the…