validity-alphanumeric-property

Validity style validator to ensure a property is alphanumeric

validity-alphanumeric-property

Validity style validator to ensure a property is alphanumeric.

npm install validity-alphanumeric-property

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] }
  }
});

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.

Licensed under the New BSD License