a validation module for both server-side and client-side Westmoreland applications.
npm install --save westmoreland-validation
Abstracts all validation logic from app-specific code, allowing for the reuse of validation logic across domains
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.
npm test
- [x] fix issue with Mexico numbers occasionally passing validation
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright (c) 2015 Westmoreland Coal Company. Licensed under the MIT license.