| ▲ | epolanski 2 days ago |
| The type checker can only prove what is known at compile time and only if you're disciplined. To bridge runtime and compile time (as your application will likely get some external data) you've got to use a proper parser such as zod[1] or if you want to stretch it even further effect-schema[2]. [1] https://zod.dev/ [2] https://effect.website/docs/schema/introduction/ |
|
| ▲ | girvo a day ago | parent [-] |
| I’m currently in love with Arktype, and as it supports Standard Schema it plugs into most places that can take Zod schemas too :) https://arktype.io/ |
| |
| ▲ | epolanski a day ago | parent [-] | | That's a validator, not a proper parser, no? | | |
| ▲ | culi a day ago | parent | next [-] | | What's the difference here? I've only used Zod but I typically think of Zod as a runtime validation library. AFAIK arktype is a full-featured replacement for Zod | |
| ▲ | girvo 11 hours ago | parent | prev [-] | | I don't think I understand the difference you're drawing on here? It parses data and validates its structure, and is a replacement for all my uses of Zod? |
|
|