vladiator

0.0.4 • Public • Published

vladiator

A simple vladation framework.

Usage

validate(rules, value)

Returns validation object with isValid property and error property.

Arguments

  • rules - array of test methods to apply on value.
  • value - value to be evalutated.

Example

var vladiator = require('vladiator');
var rules = [ 'required', 'string', [ 'length', 10 ]];
 
//returns { isValid: false, error: 'length' }
vladiator.validate(rules, "keesmann");

Validators

  • required
  • array
  • number
  • string
  • boolean
  • length
  • gte

License

Copyright (c) 2012 August Hovland Licensed under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i vladiator

Weekly Downloads

1

Version

0.0.4

License

none

Last publish

Collaborators

  • gushov