What do we want?
Something similar to (roughly, not even syntactically ok):
------
class User {
@Min(10)
@Max(10)
@NotNull
private _name: string
}
------ or
class User {
private _name: string
@Min(10)
@Max(10)
@NotNull
set name (): string {
}
}
validator = new JoiValidator(...) // <- this is what we want.
user:User = new User(...)
errors:Error = validator.validate(user)
for (let error:Error of errors) {
console.log(error)
}
Amazing project and can be done in one evening 🤣 TypeScript rules 💯