Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Validator for architect
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

architect-validator

validator plugin for architect

Config Format

{
  "packagePath": "./node_modules/architect-validator",
  "sanitize": true
}

Usage

Validate that ssssshtuff

module.exports = function (options, imports, register) {

  var validator = imports.validator;

  var obj = {
    email: "this isn't an email",
    name: "My name can be whatever"
  }

  validator(obj, function(key, value){
    // throw an exception or return false
    if (key == 'email') {
      return isEmail(value);
    }
  }, function(errors){
    // Errors come back as a list of kv's
    // errors == [{key: 'email', "My name can be whatever"}]
  });

};
Something went wrong with that request. Please try again.