Skip to content

Instantly share code, notes, and snippets.

View ssalbdivad's full-sized avatar

David Blass ssalbdivad

View GitHub Profile
@ssalbdivad
ssalbdivad / ArkTypeVsZod.md
Last active March 20, 2024 19:24
ArkType/Zod Comparison

Here's a comparison between how the same simple user definition would be defined using ArkType and Zod:

image

ArkType's definition syntax is more concise (definitions are about 50% shorter on average) as well as making it more visually obvious what the inferred TypeScript type will be. The ability to infer TypeScript definitions directly is the same, but ArkType's syntax is again more concise by allowing you to use typeof on a property of arkUser directly instead of using an extra "infer" helper.

In general, we also have taken significant steps to optimize and clarify our type hints when hovering over validators. For example, in the case above, this is what you see when you mouse over "zodUser":

image

@ssalbdivad
ssalbdivad / cloudSettings
Last active January 21, 2020 19:09
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-21T19:09:52.174Z","extensionVersion":"v3.4.3"}