You can use the async validate function even if no validations are async, it still returns a promise.You can not, however, use the regular function with async validations.is an open source component of Wrapp and is licensed under the MIT license.There are no required external dependencies at all!The validation constraints can be declared in JSON and shared between clients and the server. One thing that is a bit unorthodox is that most validators will consider undefined values (,) valid values.So for example adding a constraint of at least 6 characters will be like saying If the attribute is given it must be at least 6 characters.They are meant to give a feeling for how to use the library and should not be considered production ready code.The native HTML form validate has been disabled in a demo purpose so that you may see how works in action.
This allows you to define a better way of catching validation errors.
If an is thrown from an async validator the argument passed to the rejection handler will be that error.
This allows you to differentiate from coding errors and validation errors.
It is unit tested with 100% code coverage and can be considered fit for production.