From 6db609f967cacf9dc2ca55e47df77e7da45e8a39 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 Aug 2025 17:55:21 +0000 Subject: [PATCH] Initial exploration and validation of bowser repository Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com> --- docs/Bowser.html | 4 +- docs/Parser.html | 475 +++++++++++++++++++++++++++++++++++++++++++- docs/bowser.js.html | 4 +- docs/global.html | 8 +- docs/index.html | 10 +- docs/parser.js.html | 29 ++- docs/utils.js.html | 8 +- 7 files changed, 509 insertions(+), 29 deletions(-) diff --git a/docs/Bowser.html b/docs/Bowser.html index 02daa42..eed807e 100644 --- a/docs/Bowser.html +++ b/docs/Bowser.html @@ -27,7 +27,7 @@
@@ -492,7 +492,7 @@ explicitly. Same as skipParsing for Parser diff --git a/docs/Parser.html b/docs/Parser.html index 3f4865b..0928cea 100644 --- a/docs/Parser.html +++ b/docs/Parser.html @@ -27,7 +27,7 @@
@@ -1712,7 +1712,7 @@ like Parser#parseBrowser or Source:
@@ -2004,6 +2004,11 @@ the OS called "anything" or the platform called "anything" + +string + + + @@ -2078,6 +2083,468 @@ the OS called "anything" or the platform called "anything"Returns: + + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

isEngine(engineName) → {boolean}

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

Check if the engine name equals the passed string

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
engineName + + +string + + + +

The string to compare with the engine name

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

isOS(osName) → {boolean}

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

Check if the OS name equals the passed string

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
osName + + +string + + + +

The string to compare with the OS name

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

isPlatform(platformType) → {boolean}

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

Check if the platform type equals the passed string

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
platformType + + +string + + + +

The string to compare with the platform type

+ + + + + + + + + + + + + + + +
Returns:
@@ -2818,7 +3285,7 @@ Returns undefined when the browser is no described in the checkTree
Source:
@@ -3129,7 +3596,7 @@ Returns undefined when the browser is no described in the checkTree
- Documentation generated by JSDoc 3.6.3 on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Sat Aug 09 2025 17:54:44 GMT+0000 (Coordinated Universal Time) using the docdash theme.
diff --git a/docs/bowser.js.html b/docs/bowser.js.html index c33671e..da6872b 100644 --- a/docs/bowser.js.html +++ b/docs/bowser.js.html @@ -27,7 +27,7 @@
@@ -133,7 +133,7 @@ export default Bowser;
- Documentation generated by JSDoc 3.6.3 on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Sat Aug 09 2025 17:54:44 GMT+0000 (Coordinated Universal Time) using the docdash theme.
diff --git a/docs/global.html b/docs/global.html index 5d7a1c7..bc53b64 100644 --- a/docs/global.html +++ b/docs/global.html @@ -27,7 +27,7 @@
@@ -867,7 +867,7 @@
-

Get short version/alias for a browser name

+

Get browser name for a short version/alias

@@ -880,7 +880,7 @@
Example
-
getBrowserAlias('edge') // Microsoft Edge
+
getBrowserTypeByAlias('edge') // Microsoft Edge
@@ -2706,7 +2706,7 @@ like "iPhone" or "Kindle Fire HD 7"
- Documentation generated by JSDoc 3.6.3 on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Sat Aug 09 2025 17:54:44 GMT+0000 (Coordinated Universal Time) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index f9cb242..934a451 100644 --- a/docs/index.html +++ b/docs/index.html @@ -27,7 +27,7 @@
@@ -70,13 +70,11 @@

Overview

The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers. Check it out on this page: https://bowser-js.github.io/bowser-online/.

⚠️ Version 2.0 breaking changes ⚠️

-

Version 2.0 has drastically changed the API. All available methods are on the docs page.

+

Version 2.0 has drastically changed the API. All available methods are on the docs page.

For legacy code, check out the 1.x branch and install it through npm install bowser@1.9.4.

Use cases

First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems.

@@ -176,7 +174,7 @@ list of aliases can be found in the file.

Contributors

Code Contributors

-

This project exists thanks to all the people who contribute. [Contribute]. +

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

@@ -210,7 +208,7 @@ list of aliases can be found in the file.


- Documentation generated by JSDoc 3.6.3 on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Sat Aug 09 2025 17:54:44 GMT+0000 (Coordinated Universal Time) using the docdash theme.
diff --git a/docs/parser.js.html b/docs/parser.js.html index 11adc02..7670ccb 100644 --- a/docs/parser.js.html +++ b/docs/parser.js.html @@ -27,7 +27,7 @@
@@ -131,7 +131,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)); } @@ -214,7 +214,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)); } @@ -290,7 +290,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)); } @@ -341,7 +341,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)); } @@ -452,7 +452,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} */ @@ -503,14 +503,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(); } @@ -552,7 +567,7 @@ export default Parser;
- Documentation generated by JSDoc 3.6.3 on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Sat Aug 09 2025 17:54:44 GMT+0000 (Coordinated Universal Time) using the docdash theme.
diff --git a/docs/utils.js.html b/docs/utils.js.html index b20a008..bc5d34f 100644 --- a/docs/utils.js.html +++ b/docs/utils.js.html @@ -27,7 +27,7 @@
@@ -339,10 +339,10 @@ export default class Utils { } /** - * Get short version/alias for a browser name + * Get browser name for a short version/alias * * @example - * getBrowserAlias('edge') // Microsoft Edge + * getBrowserTypeByAlias('edge') // Microsoft Edge * * @param {string} browserAlias * @return {string} @@ -365,7 +365,7 @@ export default class Utils {
- Documentation generated by JSDoc 3.6.3 on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Sat Aug 09 2025 17:54:44 GMT+0000 (Coordinated Universal Time) using the docdash theme.