A JavaScript object schema, processor and validation lib
JavaScript CoffeeScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 9 commits ahead, 1 commit behind zzdhidden:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
examples
lib
src
test
.gitignore
.npmignore
.travis.yml
Cakefile
History.md
Makefile
Readme.md
browser.tests.js
eve.png
index.js
package.json
server.js

Readme.md

build status EVE(Development)

A JavaScript object schema, processor and validation lib.

EVE

var schema = type.object({
	login: 
		type.string()
		.lowercase().trim()
		.notEmpty().len(3,12)
		.match(/^[a-zA-Z0-9]*$/)
		.validator(function(val, done) {
			setTimeout(function() {
				done(val != "admin");
			}, 100);
		}, "must be unique")
	, name: 
		type.string()
		.trim().notEmpty()
	, email: 
		type.string()
		.trim().notEmpty()
		.email()
	, password: 
		type.string()
		.trim().notEmpty()
		.len(6,12)
	, password_confirmation: 
		type.string()
		.trim().notEmpty()
		.len(6,12)
		.validator(function(val){
			return val == this.password;
		}, "must be equal to password")
	, birthday: 
		type.date()
	, age: 
		type.integer()
});

Run

cake browser-tests

to build and serve the browser tests.

License

Released under the MIT, BSD, and GPL Licenses.

Copyright (c) 2011 hidden <zzdhidden@gmail.com>