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

feat: add support for using alias in 'is' method

This commit is contained in:
Will Soares
2020-08-23 16:55:29 -03:00
parent d1a6532d82
commit a9c4677c86
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);
}
/**