Needs somw work... template strings are in JS, and the use of zod example should probably mention the library. Similar for the call at the end, give a zod validated example.
I may add methods like...
User.fromJSON = (json:string): User {
// parse
// validate or throw
// return User
}
For clearer data handling from untrusted sources. Using a FE/BE shared definitions and validation library even.
Needs somw work... template strings are in JS, and the use of zod example should probably mention the library. Similar for the call at the end, give a zod validated example. I may add methods like... User.fromJSON = (json:string): User { // parse // validate or throw // return User } For clearer data handling from untrusted sources. Using a FE/BE shared definitions and validation library even.