0.2.1 • Published 10 years ago

westmoreland-validation v0.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

westmoreland-validation

a validation module for both server-side and client-side Westmoreland applications.

Install

npm install --save westmoreland-validation

Purpose

Abstracts all validation logic from app-specific code, allowing for the reuse of validation logic across domains

API

General Usage

var ValidationService = require('westmoreland-validation');

var samplePassword = 'password'
var result = ValidationService.password.validate(samplePassword);

console.log(result.valid) // false
console.log(result.error) // The password failed the following required tests: The password must be at least 10 characters long. Additionally, The password must meet at least 2 of the following tests: The password must contain at least one uppercase letter. The password must contain at least one number. The password must contain at least one special character.

Testing

npm test

Todo

  • fix issue with Mexico numbers occasionally passing validation

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright (c) 2015 Westmoreland Coal Company. Licensed under the MIT license.

0.2.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago