diff --git a/docs/Bowser.html b/docs/Bowser.html index 57ecfa78..ef9f7b1f 100644 --- a/docs/Bowser.html +++ b/docs/Bowser.html @@ -26,7 +26,7 @@
@@ -572,7 +572,7 @@
Returns:

diff --git a/docs/Parser.html b/docs/Parser.html index 7f0c240c..15311e3d 100644 --- a/docs/Parser.html +++ b/docs/Parser.html @@ -26,7 +26,7 @@
@@ -1670,7 +1670,7 @@

isSource:
@@ -1810,6 +1810,202 @@
Returns:
+

isBrowser(browserName, includingAliasopt) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Check if the browser name equals the passed string

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
browserName + + + + + + + + + +

The string to compare with the browser name

includingAlias + + + + <optional>
+ + + + + +
+ + false + +

The flag showing whether alias will be included into comparison

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +

parse()

@@ -2371,11 +2567,11 @@

satisfiesExample

const browser = new Bowser(UA);
-if (browser.check({chrome: '>118.01.1322' }))
+if (browser.satisfies({chrome: '>118.01.1322' }))
 // or with os
-if (browser.check({windows: { chrome: '>118.01.1322' } }))
+if (browser.satisfies({windows: { chrome: '>118.01.1322' } }))
 // or with platforms
-if (browser.check({desktop: { chrome: '>118.01.1322' } }))
+if (browser.satisfies({desktop: { chrome: '>118.01.1322' } })) @@ -2488,7 +2684,7 @@

someSource:
@@ -2793,7 +2989,7 @@
Returns:

- Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 14 2019 13:45:42 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/bowser.js.html b/docs/bowser.js.html index 005f8b96..92479e14 100644 --- a/docs/bowser.js.html +++ b/docs/bowser.js.html @@ -26,7 +26,7 @@
@@ -105,7 +105,7 @@

bowser.js


- Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 14 2019 13:45:42 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/global.html b/docs/global.html index 73ac0ef7..63340cb8 100644 --- a/docs/global.html +++ b/docs/global.html @@ -26,7 +26,7 @@
@@ -1995,7 +1995,7 @@
Properties

- Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 14 2019 13:45:42 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index 71f986f3..df0ec082 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@
@@ -157,7 +157,7 @@

License

Licensed as MIT. All rights not explicitly granted in the MIT

- Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 14 2019 13:45:42 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/parser.js.html b/docs/parser.js.html index 9f54378a..ab43e3eb 100644 --- a/docs/parser.js.html +++ b/docs/parser.js.html @@ -26,7 +26,7 @@
@@ -386,11 +386,11 @@

parser.js

* * @example * const browser = new Bowser(UA); - * if (browser.check({chrome: '>118.01.1322' })) + * if (browser.satisfies({chrome: '>118.01.1322' })) * // or with os - * if (browser.check({windows: { chrome: '>118.01.1322' } })) + * if (browser.satisfies({windows: { chrome: '>118.01.1322' } })) * // or with platforms - * if (browser.check({desktop: { chrome: '>118.01.1322' } })) + * if (browser.satisfies({desktop: { chrome: '>118.01.1322' } })) */ satisfies(checkTree) { const platformsAndOSes = {}; @@ -445,12 +445,19 @@

parser.js

return undefined; } - isBrowser(browserName, loosely = false) { + /** + * Check if the browser name equals the passed string + * @param browserName The string to compare with the browser name + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {boolean} + */ + isBrowser(browserName, includingAlias = false) { const defaultBrowserName = this.getBrowserName(); const possibleNames = [defaultBrowserName.toLowerCase()]; + const alias = Utils.getBrowserAlias(defaultBrowserName); - if (loosely) { - possibleNames.push(Utils.getBrowserAlias(defaultBrowserName).toLowerCase()); + if (includingAlias && typeof alias !== 'undefined') { + possibleNames.push(alias.toLowerCase()); } return possibleNames.indexOf(browserName.toLowerCase()) !== -1; @@ -539,7 +546,7 @@

parser.js


- Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 14 2019 13:45:42 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/utils.js.html b/docs/utils.js.html index 184707c3..c1102e46 100644 --- a/docs/utils.js.html +++ b/docs/utils.js.html @@ -26,7 +26,7 @@
@@ -260,7 +260,7 @@

utils.js


- Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 14 2019 13:45:42 GMT+0300 (EEST) using the docdash theme.