pi-validator
v1.1.0
Published
Abstraction of a validator encapsulation
Downloads
9
Maintainers
Readme
PiValidator
Abstraction for validators inheritance. Validators are used to validate any data format. This interface allows common use for validation.
The basic implementation of it is pi-validator-tv4 (on progress) that validates an Object over a JSON schema.
But validator can be as complex as you wish. You can call remote endpoints to validate your entries. The only current restrictions is that the validation must be synchronous for now.
Install
npm install pi-validator
Usage
var PiValidator = require('pi-validator');
class CustomValidator extends Validator {
validate() {
// Your custom validation
}
}