1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

Rename Parser.compare to Parser.satisfies

This commit is contained in:
Denis Demchenko
2018-07-07 18:35:18 +03:00
parent c79b71736e
commit a175f7c8bd
3 changed files with 15 additions and 152 deletions

View File

@@ -331,17 +331,17 @@ class Parser {
* // or with platforms
* if (browser.check({desktop: { chrome: '>118.01.1322' } }))
*/
compare(checkTree) {
satisfies(checkTree) {
const keysToProcess = Object.keys(checkTree);
return keysToProcess.some((browserAttribute) => {
const objectOrVersion = checkTree[browserAttribute];
if (typeof objectOrVersion === 'object') {
return (this.isOs(browserAttribute) || this.isPlatform(browserAttribute))
&& this.compare(objectOrVersion);
&& this.satisfies(objectOrVersion);
}
return this.isBrowser(browserAttribute) && this.satisfies(objectOrVersion);
return this.isBrowser(browserAttribute) && this.compareVersion(objectOrVersion);
});
}
@@ -349,7 +349,7 @@ class Parser {
return this.getBrowserName(true) === String(browserName).toLowerCase();
}
satisfies(version) {
compareVersion(version) {
let expectedResult = 0;
let comparableVersion = version;