bonafide

All-purpose validation library


Keywords
validation, add, custom
License
MIT
Install
npm install bonafide@0.0.3

Documentation

bonafide

Validation library for Node.js / browser

install

npm install bonafide

usage example

Custom Validator

'use strict';

let bonafide = require( 'bonafide' );

bonafide.addValidator( 'isHotelArray', 'not Hotel Array', ( x ) => {
    if ( !( x instanceof Array ) ) {
        return false;
    }
    return x.every( h => h.name && h.stars && h.city && h.location && h.startDate && h.endDate ); // jshint ignore:line
} );