this post was submitted on 23 Oct 2024
19 points (100.0% liked)

TypeScript

834 readers
12 users here now

founded 1 year ago
MODERATORS
 

A trick that I'd like sharing :)

you are viewing a single comment's thread
view the rest of the comments
[โ€“] sloppy_diffuser@sh.itjust.works 3 points 1 month ago (1 children)

There are libraries that do just this like https://effect.website/docs/guides/schema/introduction.

Appreciate the write up though! All too easy to rely on libraries without understanding what's under the hood.

Thanks for sharing, it was a good read.

[โ€“] 8hob@programming.dev 3 points 1 month ago

Using a third-party library when it's applicable definitely works. Much of this post is for those who can't add a heavy dependency :)