3 ms·
I use a combination of class-transformer[1] and then class-validator[2]. First transform the JSON into proper class-objects and then validate the object for co
by 0XAFFE 6y ago
I use a combination of class-transformer[1] and then class-validator[2].
First transform the JSON into proper class-objects and then validate the object for correctnes.
IMHO this has nothing to do with TypeScript because in your runtime all the type information is gone and you need to validate the remote data never the less. TypeScript can help you structure your validations but you need to write them.
[1] https://github.com/typestack/class-transformer https://github.com/typestack/class-transformer
[2] https://github.com/typestack/class-validator https://github.com/typestack/class-validator