gjslint suggestions.
This commit is contained in:
parent
ef043af1d4
commit
4343f72fab
|
@ -61,14 +61,14 @@ Filter.prototype.toBer = function(ber) {
|
||||||
/*
|
/*
|
||||||
* Test a rule against one or more values.
|
* Test a rule against one or more values.
|
||||||
*/
|
*/
|
||||||
Filter.multi_test = function (rule, value) {
|
Filter.multi_test = function(rule, value) {
|
||||||
if(Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
var response = false;
|
var response = false;
|
||||||
value.forEach(function(v) {
|
value.forEach(function(v) {
|
||||||
if(rule(v)) { response = true; }
|
if (rule(v)) { response = true; }
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
return rule(value);
|
return rule(value);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
@ -81,7 +81,9 @@ SubstringFilter.prototype.matches = function(target) {
|
||||||
re += this['final'] + '$';
|
re += this['final'] + '$';
|
||||||
|
|
||||||
var matcher = new RegExp(re);
|
var matcher = new RegExp(re);
|
||||||
return Filter.multi_test( function(v) { return matcher.test(v); }, target[this.attribute]);
|
return Filter.multi_test(
|
||||||
|
function(v) { return matcher.test(v); },
|
||||||
|
target[this.attribute]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue