0.0.2 • Published 11 years ago

validity-alphanumeric-property v0.0.2

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

validity-alphanumeric-property

Build Status

Validity style validator to ensure a property is alphanumeric.

Installation

npm install validity-alphanumeric-property

Usage

Below is a simple example for usage with schemata and save:

var validity = require('validity');
var schemata = require('schemata');
var alphanumericPropertyValidator = require('validity-alphanumeric-property');

var schema = schemata({
  emailAddress: {
    type: String,
    validators: { all: [alphanumericPropertyValidator] }
  }
});

API

alphanumericPropertyValidator(String:key, String:keyDisplayName, Object:object, Function:cb)

This is a validity compatible function, which in turn is used by schemata for schema validation.

The callback signature cb(err, errorMessage).

err is an Error object if something bad happened and null otherwise. errorMessage is a String if a validation error happened and undefined otherwise.

Licence

Licensed under the New BSD License

0.0.2

11 years ago

0.0.1

11 years ago