We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50a9941 commit ab3c233Copy full SHA for ab3c233
lib/validators/value.js
@@ -1,3 +1,5 @@
1
+var util = require('../util');
2
+
3
/**
4
* Value validator
5
*
@@ -18,9 +20,10 @@ function isValid(data, model) {
18
20
19
21
// Data is different than equals
22
if (model.value.eq) {
23
+ // Same data type and different values
24
if (typeof (data) === typeof (model.value.eq) && data !== model.value.eq) {
- // Same data type and different values
- return false;
25
+ // If object, return util.compare. Else, return false.
26
+ return (typeof data === 'object') ? util.equal(data, model.value.eq) : false;
27
}
28
// Different types: Try to convert one to other.
29
var parsed = data;
0 commit comments