mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-28 00:18:45 +03:00
Remove is()
& toString()
prototype from getResult()
data
This commit is contained in:
parent
c78346d3b4
commit
41f8d76968
@ -886,28 +886,6 @@
|
|||||||
function UAParserData () {
|
function UAParserData () {
|
||||||
initialize.call(this, init_props);
|
initialize.call(this, init_props);
|
||||||
}
|
}
|
||||||
UAParserData.prototype.is = function (strToCheck) {
|
|
||||||
var is = false;
|
|
||||||
for (var i in this) {
|
|
||||||
if (this.hasOwnProperty(i) && !is_ignoreProps[i] && lowerize(this[i], is_ignoreRgx) === lowerize(strToCheck, is_ignoreRgx)) {
|
|
||||||
is = true;
|
|
||||||
if (strToCheck != UNDEF_TYPE) break;
|
|
||||||
} else if (strToCheck == UNDEF_TYPE && is) {
|
|
||||||
is = !is;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return is;
|
|
||||||
};
|
|
||||||
UAParserData.prototype.toString = function () {
|
|
||||||
var str = EMPTY;
|
|
||||||
for (var i in toString_props) {
|
|
||||||
if (typeof(this[toString_props[i]]) !== UNDEF_TYPE) {
|
|
||||||
str += (str ? ' ' : EMPTY) + this[toString_props[i]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return str ? str : UNDEF_TYPE;
|
|
||||||
};
|
|
||||||
UAParserData.prototype.withClientHints = function () {
|
UAParserData.prototype.withClientHints = function () {
|
||||||
|
|
||||||
// nodejs / non-client-hints browsers
|
// nodejs / non-client-hints browsers
|
||||||
@ -968,6 +946,30 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
if(itemType != UA_RESULT) {
|
||||||
|
UAParserData.prototype.is = function (strToCheck) {
|
||||||
|
var is = false;
|
||||||
|
for (var i in this) {
|
||||||
|
if (this.hasOwnProperty(i) && !is_ignoreProps[i] && lowerize(this[i], is_ignoreRgx) === lowerize(strToCheck, is_ignoreRgx)) {
|
||||||
|
is = true;
|
||||||
|
if (strToCheck != UNDEF_TYPE) break;
|
||||||
|
} else if (strToCheck == UNDEF_TYPE && is) {
|
||||||
|
is = !is;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return is;
|
||||||
|
};
|
||||||
|
UAParserData.prototype.toString = function () {
|
||||||
|
var str = EMPTY;
|
||||||
|
for (var i in toString_props) {
|
||||||
|
if (typeof(this[toString_props[i]]) !== UNDEF_TYPE) {
|
||||||
|
str += (str ? ' ' : EMPTY) + this[toString_props[i]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str ? str : UNDEF_TYPE;
|
||||||
|
};
|
||||||
|
}
|
||||||
if (!NAVIGATOR_UADATA) {
|
if (!NAVIGATOR_UADATA) {
|
||||||
UAParserData.prototype.then = function (cb) {
|
UAParserData.prototype.then = function (cb) {
|
||||||
cb(this);
|
cb(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user