From 09b73d78978f91a972f46aba1b44ec4ba86c16a8 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Sun, 7 Apr 2019 11:43:06 +0300 Subject: [PATCH 1/3] Update changelog and readme --- CHANGELOG.md | 4 ++++ README.md | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d090085..2a30be6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Bowser Changelog +### 2.2.0 (April 7, 2019) +- [ADD] Add short aliases for browser names (#295) +- [FIX] Fix Yandex Browser version detection (#308) + ### 2.1.2 (March 6, 2019) - [FIX] Fix buggy `getFirstMatch` reference diff --git a/README.md b/README.md index c130864..7a2b381 100644 --- a/README.md +++ b/README.md @@ -131,8 +131,14 @@ Thus, you can define OS or platform specific rules and they will have more prior More of API and possibilities you will find in the `docs` folder. -### Similar Projects +### Browser names for `.satisfies()` + +By default you are supposed to use the full browser name for `.satisfies`. +But, there's a short way to define a browser using short aliases. The full +list of aliases can be found in [the file](src/constants.js). + +## Similar Projects * [Kong](https://github.com/BigBadBleuCheese/Kong) - A C# port of Bowser. -### License +## License Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. From 91f0e8936dbcf0efb26a63eabb12d4d203e59b20 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Sun, 7 Apr 2019 11:48:04 +0300 Subject: [PATCH 2/3] Bump version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35fbd7b..fc5383e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.1.2", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f199a70..9db9c71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.1.2", + "version": "2.2.0", "description": "Lightweight browser detector", "keywords": [ "browser", From 6cc8c84c565ea95049095329ff37fec41f954599 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Sun, 7 Apr 2019 11:48:26 +0300 Subject: [PATCH 3/3] Rebuild docs --- docs/Bowser.html | 4 +- docs/Parser.html | 8 +-- docs/bowser.js.html | 4 +- docs/global.html | 172 +++++++++++++++++++++++++++++++++++++++++--- docs/index.html | 11 +-- docs/parser.js.html | 17 +++-- docs/utils.js.html | 21 +++++- 7 files changed, 209 insertions(+), 28 deletions(-) diff --git a/docs/Bowser.html b/docs/Bowser.html index 8971ea5..57ecfa7 100644 --- a/docs/Bowser.html +++ b/docs/Bowser.html @@ -26,7 +26,7 @@
@@ -572,7 +572,7 @@ const result = parser.getResult();
- Documentation generated by JSDoc 3.5.5 on Wed Mar 06 2019 14:31:23 GMT+0200 (EET) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/Parser.html b/docs/Parser.html index cae36d6..7f0c240 100644 --- a/docs/Parser.html +++ b/docs/Parser.html @@ -26,7 +26,7 @@
@@ -1670,7 +1670,7 @@ like Parser#parseBrowser or Source:
@@ -2488,7 +2488,7 @@ Returns undefined when the browser is no described in the checkTree
Source:
@@ -2793,7 +2793,7 @@ Returns undefined when the browser is no described in the checkTree
- Documentation generated by JSDoc 3.5.5 on Wed Mar 06 2019 14:31:23 GMT+0200 (EET) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/bowser.js.html b/docs/bowser.js.html index a3c551b..005f8b9 100644 --- a/docs/bowser.js.html +++ b/docs/bowser.js.html @@ -26,7 +26,7 @@
@@ -105,7 +105,7 @@ export default Bowser;
- Documentation generated by JSDoc 3.5.5 on Wed Mar 06 2019 14:31:23 GMT+0200 (EET) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/global.html b/docs/global.html index 6b7e103..73ac0ef 100644 --- a/docs/global.html +++ b/docs/global.html @@ -26,7 +26,7 @@
@@ -133,7 +133,7 @@
Source:
@@ -296,6 +296,162 @@ +

getBrowserAlias(browserName) → {string}

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

Get short version/alias for a browser name

+
+ + + + + + + + + +
Example
+ +
getBrowserAlias('Microsoft Edge') // edge
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
browserName + + +string + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +

getFirstMatch(regexp, ua) → {Array|Object|*|boolean|string}

@@ -308,7 +464,7 @@
Source:
@@ -494,7 +650,7 @@
Source:
@@ -675,7 +831,7 @@
Source:
@@ -831,7 +987,7 @@
Source:
@@ -1005,7 +1161,7 @@
Source:
@@ -1839,7 +1995,7 @@ like "iPhone" or "Kindle Fire HD 7"
- Documentation generated by JSDoc 3.5.5 on Wed Mar 06 2019 14:31:23 GMT+0200 (EET) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Apr 07 2019 11:48:14 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index 6a8be54..71f986f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@
@@ -136,10 +136,13 @@ const isValidBrowser = browser.satisfies({ });

Settings for any particular OS or platform has more priority and redefines settings of standalone browsers. Thus, you can define OS or platform specific rules and they will have more priority in the end.

More of API and possibilities you will find in the docs folder.

-

Similar Projects