Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Nominal types have different use cases.

Simple one, distinguishing `2` number with `2` currency in your domain.


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: