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

Merge pull request #437 from willamesoares/include-alias-check

feat: add support for using alias in 'is' method
This commit is contained in:
Denis Demchenko
2020-09-12 10:25:35 +03:00
committed by GitHub
2 changed files with 33 additions and 2 deletions

View File

@@ -474,10 +474,12 @@ class Parser {
* Is anything? Check if the browser is called "anything",
* the OS called "anything" or the platform called "anything"
* @param {String} anything
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {Boolean}
*/
is(anything) {
return this.isBrowser(anything) || this.isOS(anything) || this.isPlatform(anything);
is(anything, includingAlias = false) {
return this.isBrowser(anything, includingAlias) || this.isOS(anything)
|| this.isPlatform(anything);
}
/**