Eliminate primitive obsession in TypeScript by introducing branded nominal types for IDs, money, units, validated strings, and authorization tokens — the same technique used by Effect, fp-ts, and the AWS SDK.
## CONTEXT Every TypeScript codebase has the same bug at least once: a function that takes a `userId: string` is accidentally called with an `orderId: string`, the compiler is happy, and the bug ships to production. TypeScript's structural type system treats two strings as interchangeable regardless of their semantic…
Premium Prompt
Unlock this prompt — and all 30,000+ expert-crafted prompts — with Pro.
Unlock with Pro