Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit b1d463a

Browse files
committed
replace outdate "optional" defaulting to false with new "required" defaulting to false
1 parent 9f93ce2 commit b1d463a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/validate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
113113
return [];
114114
}
115115
if(value === undefined){
116-
if(!schema.optional && !schema.get){
117-
addError("is missing and it is not optional");
116+
if(schema.required){
117+
addError("is missing and it is required");
118118
}
119119
}else{
120120
errors = errors.concat(checkType(schema.type,value));

0 commit comments

Comments
 (0)