1.1.0 • Published 8 years ago

pi-validator v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

NPM version Build Status Coverage Status Dependency Status

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
  }
}