From 77f394c8e74bb16aca260c6119b6e522ce3728f5 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 9 Jul 2020 22:08:32 +0300 Subject: [PATCH 1/2] chore(package): bump version, write changelog --- CHANGELOG.md | 5 +++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dbfffc..62ca7df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Bowser Changelog +### 2.10.0 (Jul 9, 2020) +- [FIX] Fix for Firefox detection on iOS 13 [#415] +- [FIX] Fixes for typings.d.ts [#409] +- [FIX] Updated development dependencies + ### 2.9.0 (Jan 28, 2020) - [ADD] Export more methods and constants via .d.ts [#388], [#390] diff --git a/package-lock.json b/package-lock.json index 46c087a..786e834 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.9.0", + "version": "2.10.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d2dcfc6..ec7b3a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.9.0", + "version": "2.10.0", "description": "Lightweight browser detector", "keywords": [ "browser", From cc546cfb445c09e545239463dc2fb2eee06a6898 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 9 Jul 2020 22:11:59 +0300 Subject: [PATCH 2/2] chore(docs): regen docs --- docs/Bowser.html | 4 +- docs/Parser.html | 10 +- docs/bowser.js.html | 4 +- docs/global.html | 368 +++++++++++++++++++++++++++++++++++++++++++- docs/index.html | 28 +++- docs/parser.js.html | 23 +-- docs/utils.js.html | 60 +++++++- package.json | 1 - 8 files changed, 462 insertions(+), 36 deletions(-) diff --git a/docs/Bowser.html b/docs/Bowser.html index 10e4a8d..7e6ec73 100644 --- a/docs/Bowser.html +++ b/docs/Bowser.html @@ -27,7 +27,7 @@
@@ -492,7 +492,7 @@ explicitly. Same as skipParsing for Parser
- Documentation generated by JSDoc 3.6.3 on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
diff --git a/docs/Parser.html b/docs/Parser.html index 2ebd36b..8ad2c85 100644 --- a/docs/Parser.html +++ b/docs/Parser.html @@ -27,7 +27,7 @@
@@ -1712,7 +1712,7 @@ like Parser#parseBrowser or Source:
@@ -1867,7 +1867,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -2750,7 +2750,7 @@ Returns undefined when the browser is no described in the checkTree
Source:
@@ -3061,7 +3061,7 @@ Returns undefined when the browser is no described in the checkTree
- Documentation generated by JSDoc 3.6.3 on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
diff --git a/docs/bowser.js.html b/docs/bowser.js.html index 7ba2441..230076e 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 Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
diff --git a/docs/global.html b/docs/global.html index 106e27f..24915c7 100644 --- a/docs/global.html +++ b/docs/global.html @@ -27,7 +27,7 @@
@@ -124,6 +124,360 @@ +

assign(obj) → {Object}

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

Object::assign polyfill

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
obj + + +Object + + + +
...objs + + +Object + + + +
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +

find(arr, predicate) → {Array}

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

Array::find polyfill

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arr + + +Array + + + +
predicate + + +function + + + +
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + + +

getAndroidVersionName(version) → {string}

@@ -314,7 +668,7 @@
Source:
@@ -461,7 +815,7 @@ -

getBrowserTypeByAlias(browserName) → {string}

+

getBrowserTypeByAlias(browserAlias) → {string}

@@ -473,7 +827,7 @@
Source:
@@ -556,7 +910,7 @@ - browserName + browserAlias @@ -1338,7 +1692,7 @@
Source:
@@ -2352,7 +2706,7 @@ like "iPhone" or "Kindle Fire HD 7"
- Documentation generated by JSDoc 3.6.3 on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index 42fbb4b..1d8938c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -27,7 +27,7 @@
@@ -65,7 +65,7 @@
  • Multi-platform. It's browser- and node-ready, so you can use it in any environment.
  • Don't hesitate to support the project on Github or OpenCollective if you like it ❤️ Also, contributors are always welcome!

    -

    Build Status Greenkeeper badge Coverage Status

    +

    Financial Contributors on Open Collective Build Status Greenkeeper badge Coverage Status Downloads

    Contents

    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.

    +

    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.

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

    @@ -174,6 +174,26 @@ list of aliases can be found in the file.

    • Kong - A C# port of Bowser.
    +

    Contributors

    +

    Code Contributors

    +

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

    +

    Financial Contributors

    +

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

    +

    Individuals

    +

    +

    Organizations

    +

    Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

    +

    + + + + + + + + +

    License

    Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

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


    - Documentation generated by JSDoc 3.6.3 on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
    diff --git a/docs/parser.js.html b/docs/parser.js.html index 1f1b2e6..c47bf34 100644 --- a/docs/parser.js.html +++ b/docs/parser.js.html @@ -27,7 +27,7 @@
    @@ -126,7 +126,7 @@ class Parser { parseBrowser() { this.parsedResult.browser = {}; - const browserDescriptor = browserParsersList.find((_browser) => { + const browserDescriptor = Utils.find(browserParsersList, (_browser) => { if (typeof _browser.test === 'function') { return _browser.test(this); } @@ -209,7 +209,7 @@ class Parser { parseOS() { this.parsedResult.os = {}; - const os = osParsersList.find((_os) => { + const os = Utils.find(osParsersList, (_os) => { if (typeof _os.test === 'function') { return _os.test(this); } @@ -285,7 +285,7 @@ class Parser { parsePlatform() { this.parsedResult.platform = {}; - const platform = platformParsersList.find((_platform) => { + const platform = Utils.find(platformParsersList, (_platform) => { if (typeof _platform.test === 'function') { return _platform.test(this); } @@ -336,7 +336,7 @@ class Parser { parseEngine() { this.parsedResult.engine = {}; - const engine = enginesParsersList.find((_engine) => { + const engine = Utils.find(enginesParsersList, (_engine) => { if (typeof _engine.test === 'function') { return _engine.test(this); } @@ -372,7 +372,7 @@ class Parser { * @return {ParsedResult} */ getResult() { - return Object.assign({}, this.parsedResult); + return Utils.assign({}, this.parsedResult); } /** @@ -414,7 +414,7 @@ class Parser { if (platformsAndOSCounter > 0) { const platformsAndOSNames = Object.keys(platformsAndOSes); - const OSMatchingDefinition = platformsAndOSNames.find(name => (this.isOS(name))); + const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name))); if (OSMatchingDefinition) { const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]); @@ -424,7 +424,10 @@ class Parser { } } - const platformMatchingDefinition = platformsAndOSNames.find(name => (this.isPlatform(name))); + const platformMatchingDefinition = Utils.find( + platformsAndOSNames, + name => (this.isPlatform(name)), + ); if (platformMatchingDefinition) { const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]); @@ -436,7 +439,7 @@ class Parser { if (browsersCounter > 0) { const browserNames = Object.keys(browsers); - const matchingDefinition = browserNames.find(name => (this.isBrowser(name, true))); + const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true))); if (matchingDefinition !== void 0) { return this.compareVersion(browsers[matchingDefinition]); @@ -546,7 +549,7 @@ export default Parser;
    - Documentation generated by JSDoc 3.6.3 on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
    diff --git a/docs/utils.js.html b/docs/utils.js.html index c165619..9edadac 100644 --- a/docs/utils.js.html +++ b/docs/utils.js.html @@ -27,7 +27,7 @@
    @@ -254,6 +254,8 @@ export default class Utils { return -1; } } + + return undefined; } /** @@ -275,6 +277,54 @@ export default class Utils { return result; } + /** + * Array::find polyfill + * + * @param {Array} arr + * @param {Function} predicate + * @return {Array} + */ + static find(arr, predicate) { + let i; + let l; + if (Array.prototype.find) { + return Array.prototype.find.call(arr, predicate); + } + for (i = 0, l = arr.length; i < l; i += 1) { + const value = arr[i]; + if (predicate(value, i)) { + return value; + } + } + return undefined; + } + + /** + * Object::assign polyfill + * + * @param {Object} obj + * @param {Object} ...objs + * @return {Object} + */ + static assign(obj, ...assigners) { + const result = obj; + let i; + let l; + if (Object.assign) { + return Object.assign(obj, ...assigners); + } + for (i = 0, l = assigners.length; i < l; i += 1) { + const assigner = assigners[i]; + if (typeof assigner === 'object' && assigner !== null) { + const keys = Object.keys(assigner); + keys.forEach((key) => { + result[key] = assigner[key]; + }); + } + } + return obj; + } + /** * Get short version/alias for a browser name * @@ -294,11 +344,11 @@ export default class Utils { * @example * getBrowserAlias('edge') // Microsoft Edge * - * @param {string} browserName + * @param {string} browserAlias * @return {string} */ - static getBrowserTypeByAlias(browserAlia) { - return BROWSER_MAP[browserAlia] || ''; + static getBrowserTypeByAlias(browserAlias) { + return BROWSER_MAP[browserAlias] || ''; } } @@ -315,7 +365,7 @@ export default class Utils {
    - Documentation generated by JSDoc 3.6.3 on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the docdash theme. + Documentation generated by JSDoc 3.6.3 on Thu Jul 09 2020 22:10:18 GMT+0300 (Eastern European Summer Time) using the docdash theme.
    diff --git a/package.json b/package.json index ec7b3a9..834cd47 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "build": "webpack --config webpack.config.js", "generate-and-deploy-docs": "npm run generate-docs && gh-pages --dist docs --dest docs", "watch": "webpack --watch --config webpack.config.js", - "deploy": "jsdoc -c jsdoc.json && gh-pages --dist docs --dest docs", "prepublishOnly": "npm run build", "lint": "eslint ./src", "testem": "testem",