Re:ArkType: Ergonomic TS validator 100x faster than Zod
by udbhavs on Saturday April 12, 2025 @08:01PM
(#43668918)
I was going to ask about how pure types would fill the gap for other validations in Zod like number min/max ranges, but seeing the tags feature use intersection types for that is really neat. I tried assigning a `string & tags.MinLength<4>` to a `string & tags.MinLength<2>` and it's interesting that it threw an error saying they were incompatible.
[ Parent
| on HN ]
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by retropragma on Sunday April 13, 2025 @01:07AM
(#43670231)
That's because "minimum length" cannot be enforced in TypeScript. Maybe you already know this.
I'm not a Typia user myself, but my RPC framework has the same feature, and the MinLength issue you mentioned doesn't crop up if you only use the type tags at the client-server boundary, which is enough in my experience.