Re:Designing the perfect TypeScript schema validation library
by dlbucci on Thursday March 12, 2020 @06:27PM
(#22562581)
Yeah, that's really something that feels like it should be a part of the language, because it would be so useful!
[ Parent
| on HN ]
Re:Designing the perfect TypeScript schema validation library
by eyelidlessness on Thursday March 12, 2020 @06:50PM
(#22562803)
It's explicitly one of the language's non-goals[1].
> Add or rely on run-time type information in programs, or emit different code based on the results of the type system. Instead, encourage programming patterns that do not require run-time metadata.
[1] https://github.com/Microsoft/TypeScript/wiki/TypeScript-Desi...
Re:Designing the perfect TypeScript schema validation library
by williamdclt on Friday March 13, 2020 @06:10AM
(#22566054)
I understand it (there's already enough to do at type level that runtime level is a non-goal), but types are purely indicative at IO boundaries. Validation still needs to happen
Re:Designing the perfect TypeScript schema validation library
by eyelidlessness on Friday March 13, 2020 @07:32PM
(#22571781)
That's right. So since it won't be a part of the language, libraries like this are being developed.