|
|
|
|
|
by atwood22
1391 days ago
|
|
Have you seen the library runtypes for TS? It lets you specify types using a library rather than pure TS type syntax. The library code looks very similar to the normal TS type syntax, but when you use the type you get input validation for free. And of course the type TS thinks the type is matches what you’d expect based on your type definition. Also, TS let’s you specify things like ”this type is an array of 4 numbers”. Obviously TS isn’t perfect, but it’s pretty good! |
|