New answers tagged

2

Regarding your validations - extract each of your validations in validation object. You can do something like: class Validator { isValid(obj) { //return false if obj is not valid } message(obj) { //return error object if obj is not valid } status() { //error status if validation fails } } Then you can have like EmailValidator, Required, etc. ...


Top 50 recent answers are included