async-validate
Advanced tools
Comparing version 0.12.4 to 0.13.0
@@ -8,3 +8,3 @@ { | ||
"toc": "Table of Contents", | ||
"base": "https://github.com/freeformsystems/async-validate", | ||
"base": "https://github.com/tmpfs/async-validate", | ||
"partial": [ | ||
@@ -11,0 +11,0 @@ { |
@@ -39,3 +39,3 @@ Table of Contents | ||
* [doc/example/additional](https://github.com/freeformsystems/async-validate/blob/master/doc/example/additional.js). | ||
* [doc/example/additional](https://github.com/tmpfs/async-validate/blob/master/doc/example/additional.js). | ||
@@ -110,3 +110,3 @@ ```javascript | ||
* [doc/example/assigned-rule](https://github.com/freeformsystems/async-validate/blob/master/doc/example/assigned-rule.js). | ||
* [doc/example/assigned-rule](https://github.com/tmpfs/async-validate/blob/master/doc/example/assigned-rule.js). | ||
@@ -158,3 +158,3 @@ ```javascript | ||
* [doc/example/bail](https://github.com/freeformsystems/async-validate/blob/master/doc/example/bail.js). | ||
* [doc/example/bail](https://github.com/tmpfs/async-validate/blob/master/doc/example/bail.js). | ||
@@ -202,3 +202,3 @@ ```javascript | ||
* [doc/example/deep](https://github.com/freeformsystems/async-validate/blob/master/doc/example/deep.js). | ||
* [doc/example/deep](https://github.com/tmpfs/async-validate/blob/master/doc/example/deep.js). | ||
@@ -245,3 +245,3 @@ ```javascript | ||
* [doc/example/inline-rule](https://github.com/freeformsystems/async-validate/blob/master/doc/example/inline-rule.js). | ||
* [doc/example/inline-rule](https://github.com/tmpfs/async-validate/blob/master/doc/example/inline-rule.js). | ||
@@ -285,3 +285,3 @@ ```javascript | ||
* [doc/example/instanceof](https://github.com/freeformsystems/async-validate/blob/master/doc/example/instanceof.js). | ||
* [doc/example/instanceof](https://github.com/tmpfs/async-validate/blob/master/doc/example/instanceof.js). | ||
@@ -321,3 +321,3 @@ ```javascript | ||
* [doc/example/len](https://github.com/freeformsystems/async-validate/blob/master/doc/example/len.js). | ||
* [doc/example/len](https://github.com/tmpfs/async-validate/blob/master/doc/example/len.js). | ||
@@ -356,3 +356,3 @@ ```javascript | ||
* [doc/example/match](https://github.com/freeformsystems/async-validate/blob/master/doc/example/match.js). | ||
* [doc/example/match](https://github.com/tmpfs/async-validate/blob/master/doc/example/match.js). | ||
@@ -395,3 +395,3 @@ ```javascript | ||
* [doc/example/max](https://github.com/freeformsystems/async-validate/blob/master/doc/example/max.js). | ||
* [doc/example/max](https://github.com/tmpfs/async-validate/blob/master/doc/example/max.js). | ||
@@ -435,3 +435,3 @@ ```javascript | ||
* [doc/example/message-clone](https://github.com/freeformsystems/async-validate/blob/master/doc/example/message-clone.js). | ||
* [doc/example/message-clone](https://github.com/tmpfs/async-validate/blob/master/doc/example/message-clone.js). | ||
@@ -478,3 +478,3 @@ ```javascript | ||
* [doc/example/message-function](https://github.com/freeformsystems/async-validate/blob/master/doc/example/message-function.js). | ||
* [doc/example/message-function](https://github.com/tmpfs/async-validate/blob/master/doc/example/message-function.js). | ||
@@ -520,3 +520,3 @@ ```javascript | ||
* [doc/example/message-override](https://github.com/freeformsystems/async-validate/blob/master/doc/example/message-override.js). | ||
* [doc/example/message-override](https://github.com/tmpfs/async-validate/blob/master/doc/example/message-override.js). | ||
@@ -562,3 +562,3 @@ ```javascript | ||
* [doc/example/message](https://github.com/freeformsystems/async-validate/blob/master/doc/example/message.js). | ||
* [doc/example/message](https://github.com/tmpfs/async-validate/blob/master/doc/example/message.js). | ||
@@ -601,3 +601,3 @@ ```javascript | ||
* [doc/example/min](https://github.com/freeformsystems/async-validate/blob/master/doc/example/min.js). | ||
* [doc/example/min](https://github.com/tmpfs/async-validate/blob/master/doc/example/min.js). | ||
@@ -636,3 +636,3 @@ ```javascript | ||
* [doc/example/multiple-rules](https://github.com/freeformsystems/async-validate/blob/master/doc/example/multiple-rules.js). | ||
* [doc/example/multiple-rules](https://github.com/tmpfs/async-validate/blob/master/doc/example/multiple-rules.js). | ||
@@ -682,3 +682,3 @@ ```javascript | ||
* [doc/example/multiple-types](https://github.com/freeformsystems/async-validate/blob/master/doc/example/multiple-types.js). | ||
* [doc/example/multiple-types](https://github.com/tmpfs/async-validate/blob/master/doc/example/multiple-types.js). | ||
@@ -717,3 +717,3 @@ ```javascript | ||
* [doc/example/pattern](https://github.com/freeformsystems/async-validate/blob/master/doc/example/pattern.js). | ||
* [doc/example/pattern](https://github.com/tmpfs/async-validate/blob/master/doc/example/pattern.js). | ||
@@ -752,3 +752,3 @@ ```javascript | ||
* [doc/example/placeholder](https://github.com/freeformsystems/async-validate/blob/master/doc/example/placeholder.js). | ||
* [doc/example/placeholder](https://github.com/tmpfs/async-validate/blob/master/doc/example/placeholder.js). | ||
@@ -787,3 +787,3 @@ ```javascript | ||
* [doc/example/plugin-rule](https://github.com/freeformsystems/async-validate/blob/master/doc/example/plugin-rule.js). | ||
* [doc/example/plugin-rule](https://github.com/tmpfs/async-validate/blob/master/doc/example/plugin-rule.js). | ||
@@ -837,3 +837,3 @@ ```javascript | ||
* [doc/example/range](https://github.com/freeformsystems/async-validate/blob/master/doc/example/range.js). | ||
* [doc/example/range](https://github.com/tmpfs/async-validate/blob/master/doc/example/range.js). | ||
@@ -878,3 +878,3 @@ ```javascript | ||
* [doc/example/required](https://github.com/freeformsystems/async-validate/blob/master/doc/example/required.js). | ||
* [doc/example/required](https://github.com/tmpfs/async-validate/blob/master/doc/example/required.js). | ||
@@ -913,3 +913,3 @@ ```javascript | ||
* [doc/example/source-type](https://github.com/freeformsystems/async-validate/blob/master/doc/example/source-type.js). | ||
* [doc/example/source-type](https://github.com/tmpfs/async-validate/blob/master/doc/example/source-type.js). | ||
@@ -943,3 +943,3 @@ ```javascript | ||
* [doc/example/state](https://github.com/freeformsystems/async-validate/blob/master/doc/example/state.js). | ||
* [doc/example/state](https://github.com/tmpfs/async-validate/blob/master/doc/example/state.js). | ||
@@ -996,6 +996,6 @@ ```javascript | ||
``` | ||
[ { [Error: email: could not resolve dns for domain 1442714024700.com] | ||
[ { [Error: email: could not resolve dns for domain 1452926841026.com] | ||
field: 'email', | ||
value: 'foo@1442714024700.com', | ||
parent: { email: 'foo@1442714024700.com' }, | ||
value: 'foo@1452926841026.com', | ||
parent: { email: 'foo@1452926841026.com' }, | ||
names: [ 'email' ], | ||
@@ -1007,3 +1007,3 @@ key: 'email' } ] | ||
* [doc/example/type](https://github.com/freeformsystems/async-validate/blob/master/doc/example/type.js). | ||
* [doc/example/type](https://github.com/tmpfs/async-validate/blob/master/doc/example/type.js). | ||
@@ -1042,3 +1042,3 @@ ```javascript | ||
* [doc/example/whitespace](https://github.com/freeformsystems/async-validate/blob/master/doc/example/whitespace.js). | ||
* [doc/example/whitespace](https://github.com/tmpfs/async-validate/blob/master/doc/example/whitespace.js). | ||
@@ -1075,3 +1075,3 @@ ```javascript | ||
Generated by [mdp(1)](https://github.com/freeformsystems/mdp). | ||
Generated by [mdp(1)](https://github.com/tmpfs/mdp). | ||
@@ -1078,0 +1078,0 @@ [node]: http://nodejs.org |
{ | ||
"name": "async-validate", | ||
"description": "Asynchronous validation for node and the browser", | ||
"version": "0.12.4", | ||
"version": "0.13.0", | ||
"author": "muji <noop@xpm.io>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -10,3 +10,3 @@ module.exports = function() { | ||
&& (!this.source.hasOwnProperty(this.field) | ||
|| this.value === undefined || this.value === null)) { | ||
|| this.value === undefined)) { | ||
this.raise( | ||
@@ -13,0 +13,0 @@ this.reasons.required, |
@@ -22,17 +22,17 @@ var expect = require('chai').expect | ||
it('should error on required string field (null)', function(done) { | ||
var descriptor = { | ||
type: 'object', | ||
fields: { | ||
name: {type: 'string', required: true} | ||
} | ||
} | ||
var schema = new Schema(descriptor); | ||
schema.validate({name: null}, function(err, res) { | ||
expect(res.errors.length).to.eql(2); | ||
expect(res.fields.name.length).to.eql(2); | ||
expect(res.errors[0].message).to.eql('name is required'); | ||
done(); | ||
}); | ||
}); | ||
//it('should error on required string field (null)', function(done) { | ||
//var descriptor = { | ||
//type: 'object', | ||
//fields: { | ||
//name: {type: 'string', required: true} | ||
//} | ||
//} | ||
//var schema = new Schema(descriptor); | ||
//schema.validate({name: null}, function(err, res) { | ||
//expect(res.errors.length).to.eql(2); | ||
//expect(res.fields.name.length).to.eql(2); | ||
//expect(res.errors[0].message).to.eql('name is required'); | ||
//done(); | ||
//}); | ||
//}); | ||
@@ -39,0 +39,0 @@ it('should error on non-string type', function(done) { |
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
216167