Skip to content

Commit fd0ea3f

Browse files
committed
Fix validation requirements for type and value
1 parent c9a26f4 commit fd0ea3f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/validators/type.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
*/
88

99
function isValid(data, model) {
10-
if (!model.type) {
10+
//if (!model.type || typeof model.data === 'undefined') {
11+
if (!model.type || typeof data === 'undefined') {
1112
return true;
1213
}
1314

lib/validators/value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function isValid(data, model) {
5050

5151
// Data does not contain something
5252
if (model.value.contains) {
53-
var testData = data;
53+
var testData = data || '';
5454
if(typeof data === 'number') {
5555
testData = data.toString();
5656
}

0 commit comments

Comments
 (0)