@@ -73,7 +73,6 @@ Schema.prototype.validate = function(source, options, callback) {
73
73
options = { } ;
74
74
}
75
75
var complete = function ( results ) {
76
- //console.log("got validation results %j", results);
77
76
var i , field , errors = [ ] , fields = { } ;
78
77
var add = function ( e ) {
79
78
if ( ( e instanceof Error ) ) {
@@ -122,7 +121,6 @@ Schema.prototype.validate = function(source, options, callback) {
122
121
rule . type = this . getType ( rule ) ;
123
122
rule . validator = this . getValidationMethod ( rule ) ;
124
123
if ( ! rule . validator ) {
125
- //console.log('no validator found for %s', z);
126
124
continue ;
127
125
}
128
126
series . push ( { rule : rule , value : value , source : source , field : z } ) ;
@@ -134,12 +132,8 @@ Schema.prototype.validate = function(source, options, callback) {
134
132
var deep = ( rule . type == 'object' || rule . type == 'array' )
135
133
&& typeof ( rule . fields ) == 'object' ;
136
134
deep = deep && ( rule . required || ( ! rule . required && data . value ) ) ;
137
- //console.log("Validating field %s", rule.field);
138
135
rule . field = data . field ;
139
136
var cb = function ( errors ) {
140
- //delete rule.validator;
141
- //delete rule.field;
142
- //console.log("Completed rule validation...");
143
137
if ( options . first && errors && errors . length ) {
144
138
return complete ( errors ) ;
145
139
}
@@ -188,10 +182,6 @@ Schema.prototype.getType = function(rule) {
188
182
&& ( rule . pattern instanceof RegExp ) ) {
189
183
rule . type = 'pattern' ;
190
184
}
191
- //if(typeof rule.validator == 'function') {
192
- //return 'function';
193
- //}
194
- //console.dir(rule);
195
185
if ( ! ( typeof ( rule . validator ) == 'function' )
196
186
&& ( ! rule . type || ! validators . hasOwnProperty ( rule . type ) ) ) {
197
187
throw new Error ( format ( "Unknown rule type %s" , rule . type ) ) ;
0 commit comments