Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Validation sugar with is
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

prove

Validation sugar with is-it

Installation

npm install prove

Usage

var prove = require('prove')

if (var errs = prove(5).is('integer greaterThan(0)').errors) {
  // not valid
}

prove can also be chained:

prove('foo').is('string').isnt('integer').errors

API

prove(value)

Returns a chainable object with is, isnt and errors.

.is(conditions)

Runs the listed conditions against the value provided in prove.

.isnt(conditions)

Runs the conditions against the value provided in prove but negated.

.errors

This property contains an array of invalid conditions, or null.

Something went wrong with that request. Please try again.