Re:TypeScript: Branded Types
by mason55 on Wednesday April 24, 2024 @03:04PM
(#40148219)
Not really, not for TS at least. If you just want to take a string and call it an email address and have your function only accept email addresses (the simplest use case) then you need to use branding. That's not encapsulation.
[ Parent
| on HN ]