ArkType: The Parse-Don't-Validate Sequel I Didn't Know I Needed
Two days ago I published a post about parsing instead of validating in TypeScript. I hand-rolled branded types with unique symbol, wrote Parsed result types, and stitched together parsers with early returns. It worked. It was also kind of ugly, and I said so at the time.
Then someone in the Reddit comments linked me to ArkType.
I’d heard the name before but never actually sat down with it. After a few hours of poking around I have opinions. Some of them are strong. A couple might even be wrong (I haven’t used this in production yet, so grain of salt and all that). But I think ArkType is doing something interesting for TypeScript, and it lands squarely on the parse-don’t-validate thread I’ve been pulling at.
评论
?
参与讨论