async-validate
Advanced tools
Comparing version 0.1.25 to 0.2.1
@@ -1,1 +0,1 @@ | ||
module.exports = require('./lib/index'); | ||
module.exports = require('./lib/schema'); |
var format = require('../format') | ||
, ValidationError = require('../error') | ||
, messages = require('../messages'); | ||
, messages = require('../../messages'); | ||
@@ -5,0 +5,0 @@ /** |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var array = function(rule, value, callback, source, options) { | ||
function array(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var boolean = function(rule, value, callback, source, options) { | ||
function bool(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -26,2 +26,2 @@ var validate = rule.required | ||
module.exports = boolean; | ||
module.exports = bool; |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var date = function(rule, value, callback, source, options) { | ||
function date(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var enumerable = function(rule, value, callback, source, options) { | ||
function enumerable(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var float = function(rule, value, callback, source, options) { | ||
function float(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var integer = function(rule, value, callback, source, options) { | ||
function integer(rule, value, callback, source, options) { | ||
//console.log('integer rule called %j', rule); | ||
@@ -16,0 +16,0 @@ var errors = []; |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var method = function(rule, value, callback, source, options) { | ||
function method(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var number = function(rule, value, callback, source, options) { | ||
function number(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var object = function(rule, value, callback, source, options) { | ||
function object(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -16,3 +16,3 @@ var rules = require('../rule'); | ||
*/ | ||
var pattern = function(rule, value, callback, source, options) { | ||
function pattern(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -19,0 +19,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var regexp = function(rule, value, callback, source, options) { | ||
function regexp(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
@@ -13,3 +13,3 @@ var rules = require('../rule'); | ||
*/ | ||
var string = function(rule, value, callback, source, options) { | ||
function string(rule, value, callback, source, options) { | ||
var errors = []; | ||
@@ -16,0 +16,0 @@ var validate = rule.required |
{ | ||
"name": "async-validate", | ||
"description": "Asynchronous validation for object properties.", | ||
"version": "0.1.25", | ||
"version": "0.2.1", | ||
"author": "muji <noop@xpm.io>", | ||
@@ -17,3 +17,2 @@ "repository": { | ||
"dependencies": { | ||
"async": "~1.4.2", | ||
"moment": "~2.10.6" | ||
@@ -20,0 +19,0 @@ }, |
@@ -365,4 +365,6 @@ # async-validate | ||
Some standard rules for common validation requirements are accessible via `schema.rules.std`. You may wish to reference these rules or copy and modify them. | ||
Some standard rules for common validation requirements are accessible, you may wish to reference these rules or copy and modify them. | ||
As of `v0.2.0` these rules must be required: `require('async-validate/std-rules')` and are no longer available via the schema class. | ||
### Field | ||
@@ -369,0 +371,0 @@ |
var util = require('util'); | ||
var assert = require('chai').assert; | ||
var schema = require('../../index'); | ||
var msg = require('../../messages'); | ||
@@ -20,3 +21,3 @@ describe("async-validate:", function() { | ||
// quick and dirty clone of the default messages | ||
var clone = schema.messages.clone(); | ||
var clone = msg.clone(); | ||
// change a message | ||
@@ -23,0 +24,0 @@ clone.required = "%s is a required field"; |
var util = require('util'); | ||
var assert = require('chai').assert; | ||
var schema = require('../../index'); | ||
var ValidationError = schema.error; | ||
var ValidationError = schema.ValidationError; | ||
var std = require('../../std-rules') | ||
@@ -11,3 +12,3 @@ describe("async-validate:", function(done) { | ||
{type: "string", required: true}, | ||
{pattern: schema.pattern.email, required: true} | ||
{pattern: std.pattern.email, required: true} | ||
] | ||
@@ -21,3 +22,3 @@ } | ||
"email value undefined does not match pattern " | ||
+ schema.pattern.email); | ||
+ std.pattern.email); | ||
done(); | ||
@@ -30,3 +31,3 @@ }); | ||
{type: "string", required: true}, | ||
{pattern: schema.pattern.email} | ||
{pattern: std.pattern.email} | ||
] | ||
@@ -39,3 +40,3 @@ } | ||
"email value user@example does not match pattern " | ||
+ schema.pattern.email); | ||
+ std.pattern.email); | ||
done(); | ||
@@ -47,3 +48,3 @@ }); | ||
email: [ | ||
schema.rules.std.email, | ||
std.email, | ||
function(descriptor, value, callback, values) { | ||
@@ -50,0 +51,0 @@ var errors = []; |
var util = require('util'); | ||
var assert = require('chai').assert; | ||
var schema = require('../../index'); | ||
var ValidationError = schema.error; | ||
var ValidationError = schema.ValidationError; | ||
@@ -6,0 +6,0 @@ describe("async-validate:", function() { |
var util = require('util'); | ||
var assert = require('chai').assert; | ||
var schema = require('../../index'); | ||
var ValidationError = schema.error; | ||
var ValidationError = schema.ValidationError; | ||
@@ -6,0 +6,0 @@ describe("async-validate:", function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85689
1
52
2064
412
- Removedasync@~1.4.2
- Removedasync@1.4.2(transitive)