Skip to content

Commit 8a5a41d

Browse files
committed
Rename class file.
1 parent 8d91fa7 commit 8a5a41d

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./lib/index');
1+
module.exports = require('./lib/schema');

lib/index.js lib/schema.js

-10
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ Schema.prototype.validate = function(source, options, callback) {
7373
options = {};
7474
}
7575
var complete = function(results) {
76-
//console.log("got validation results %j", results);
7776
var i, field, errors = [], fields = {};
7877
var add = function(e) {
7978
if((e instanceof Error)) {
@@ -122,7 +121,6 @@ Schema.prototype.validate = function(source, options, callback) {
122121
rule.type = this.getType(rule);
123122
rule.validator = this.getValidationMethod(rule);
124123
if(!rule.validator) {
125-
//console.log('no validator found for %s', z);
126124
continue;
127125
}
128126
series.push({rule: rule, value: value, source: source, field: z});
@@ -134,12 +132,8 @@ Schema.prototype.validate = function(source, options, callback) {
134132
var deep = (rule.type == 'object' || rule.type == 'array')
135133
&& typeof(rule.fields) == 'object';
136134
deep = deep && (rule.required || (!rule.required && data.value));
137-
//console.log("Validating field %s", rule.field);
138135
rule.field = data.field;
139136
var cb = function(errors) {
140-
//delete rule.validator;
141-
//delete rule.field;
142-
//console.log("Completed rule validation...");
143137
if(options.first && errors && errors.length) {
144138
return complete(errors);
145139
}
@@ -188,10 +182,6 @@ Schema.prototype.getType = function(rule) {
188182
&& (rule.pattern instanceof RegExp)) {
189183
rule.type = 'pattern';
190184
}
191-
//if(typeof rule.validator == 'function') {
192-
//return 'function';
193-
//}
194-
//console.dir(rule);
195185
if( !(typeof(rule.validator) == 'function')
196186
&& (!rule.type || !validators.hasOwnProperty(rule.type))) {
197187
throw new Error(format("Unknown rule type %s", rule.type));

0 commit comments

Comments
 (0)