Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
frou_dh
on July 7, 2023
|
parent
|
context
|
favorite
| on:
TypeScript please give us reflection/runtime types
I was perfectly satisfied with using
https://zod.dev
for some runtime data validation, and found it really cool that I didn't have to define some nominal type off to the side and could instead just say what I meant inline using a fluent API.
epolanski
on July 7, 2023
[–]
Nominal types have different use cases.
Simple one, distinguishing `2` number with `2` currency in your domain.
lf-non
on July 8, 2023
|
parent
[–]
We can use branded types to simulate nominal typing
https://zod.dev/?id=brand
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: