Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mason55
on April 24, 2024
|
parent
|
context
|
favorite
| on:
TypeScript: Branded Types
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.
antifa
on April 25, 2024
[–]
Or double your GC burden by using a wrapper class.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: