Make sure all properties are "undefined" for is("undefined") to be true

This commit is contained in:
Faisal Salman
2023-02-19 16:43:59 +07:00
parent 746ac28f94
commit f18516c9c8
2 changed files with 17 additions and 6 deletions

View File

@@ -787,12 +787,17 @@
this.rgxIs = propIs[1];
}
UAItem.prototype.is = function (strCheck) {
var is = false;
for (var i in this.propIs) {
if (sanitize(this[this.propIs[i]], this.rgxIs) == sanitize(strCheck, this.rgxIs)) {
return true;
is = true;
if (strCheck != UNDEF_TYPE) break;
} else if (strCheck == UNDEF_TYPE && is) {
is = !is;
break;
}
}
return false;
return is;
};
UAItem.prototype.toString = function () {
var str = '';