nagoya
Nagoya is a validation library for writing cool and arbitrary validation schemas and producing user-friendly validation error messages.
Usage
; const schema = { nagoya; nagoya; // alternatively nagoya.matches(username, /^\w*$/) nagoya; nagoya; } { nagoya; nagoya; nagoya; } { nagoya; }; const validate = nagoya; try ; catch err console; console; // ValidationError: username must contain only letters and numbers,// password must be at least 8 characters long,// email must be a valid email address // {// username: [ValidationError: must contain only letters and numbers],// password: [ValidationError: must be at least 8 characters long],// email: [ValidationError: must be a valid email address]// }
Documentation
TODO