https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
+20 -5
View File
@@ -87,7 +87,7 @@ class Parser {
return _browser.test(this);
}
if (_browser.test instanceof Array) {
if (Array.isArray(_browser.test)) {
return _browser.test.some(condition => this.test(condition));
}
@@ -170,7 +170,7 @@ class Parser {
return _os.test(this);
}
if (_os.test instanceof Array) {
if (Array.isArray(_os.test)) {
return _os.test.some(condition => this.test(condition));
}
@@ -246,7 +246,7 @@ class Parser {
return _platform.test(this);
}
if (_platform.test instanceof Array) {
if (Array.isArray(_platform.test)) {
return _platform.test.some(condition => this.test(condition));
}
@@ -297,7 +297,7 @@ class Parser {
return _engine.test(this);
}
if (_engine.test instanceof Array) {
if (Array.isArray(_engine.test)) {
return _engine.test.some(condition => this.test(condition));
}
@@ -408,7 +408,7 @@ class Parser {
/**
* Check if the browser name equals the passed string
* @param browserName The string to compare with the browser name
* @param {string} browserName The string to compare with the browser name
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {boolean}
*/
@@ -459,14 +459,29 @@ class Parser {
) > -1;
}
/**
* Check if the OS name equals the passed string
* @param {string} osName The string to compare with the OS name
* @returns {boolean}
*/
isOS(osName) {
return this.getOSName(true) === String(osName).toLowerCase();
}
/**
* Check if the platform type equals the passed string
* @param {string} platformType The string to compare with the platform type
* @returns {boolean}
*/
isPlatform(platformType) {
return this.getPlatformType(true) === String(platformType).toLowerCase();
}
/**
* Check if the engine name equals the passed string
* @param {string} engineName The string to compare with the engine name
* @returns {boolean}
*/
isEngine(engineName) {
return this.getEngineName(true) === String(engineName).toLowerCase();
}