diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/.npmignore b/.npmignore index 2bd0fb1..c778b56 100644 --- a/.npmignore +++ b/.npmignore @@ -3,3 +3,4 @@ test coverage **/.* node_modules +.github diff --git a/CHANGELOG.md b/CHANGELOG.md index b3741d0..5d0d245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Bowser Changelog +### 2.5.3 (Aug 4, 2019) +- [FIX] Add MacOS names support [#338] +- [FIX] Point typings.d.ts from package.json [#341] +- [FIX] Upgrade dependencies + ### 2.5.2 (July 17, 2019) - [FIX] Fixes the bug undefined method because of failed build (#335) diff --git a/docs/Bowser.html b/docs/Bowser.html index f24d358..10e4a8d 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 a01f4f7..2ebd36b 100644 --- a/docs/Parser.html +++ b/docs/Parser.html @@ -27,7 +27,7 @@
@@ -3061,7 +3061,7 @@ Returns undefined when the browser is no described in the checkTree
- Documentation generated by JSDoc 3.6.3 on Wed Jul 17 2019 13:52:37 GMT+0300 (Eastern European Summer Time) using the docdash theme. + 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.
diff --git a/docs/bowser.js.html b/docs/bowser.js.html index f846891..7ba2441 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 Wed Jul 17 2019 13:52:37 GMT+0300 (Eastern European Summer Time) using the docdash theme. + 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.
diff --git a/docs/global.html b/docs/global.html index 169d3b6..106e27f 100644 --- a/docs/global.html +++ b/docs/global.html @@ -27,7 +27,7 @@
@@ -136,7 +136,7 @@
Source:
@@ -191,7 +191,7 @@ 6.x - Marshmallow 7.x - Nougat 8.x - Oreo -9.x - ?

+9.x - Pie

@@ -314,7 +314,7 @@
Source:
@@ -473,7 +473,7 @@
Source:
@@ -809,6 +809,180 @@ +

getMacOSVersionName(version) → {string}

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

Get macOS version name +10.5 - Leopard +10.6 - Snow Leopard +10.7 - Lion +10.8 - Mountain Lion +10.9 - Mavericks +10.10 - Yosemite +10.11 - El Capitan +10.12 - Sierra +10.13 - High Sierra +10.14 - Mojave +10.15 - Catalina

+
+ + + + + + + + + +
Example
+ +
getMacOSVersionName("10.14") // 'Mojave'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string + + + +
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

versionName

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

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

@@ -1005,7 +1179,7 @@
Source:
@@ -1164,7 +1338,7 @@
Source:
@@ -2178,7 +2352,7 @@ like "iPhone" or "Kindle Fire HD 7"
- Documentation generated by JSDoc 3.6.3 on Wed Jul 17 2019 13:52:37 GMT+0300 (Eastern European Summer Time) using the docdash theme. + 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.
diff --git a/docs/index.html b/docs/index.html index f9d4778..42fbb4b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -27,7 +27,7 @@
@@ -153,13 +153,13 @@ const isValidBrowser = browser.satisfies({ // or in general chrome: "~20.1.1432", firefox: ">31", - opera: ">=22" + opera: ">=22", // also supports equality operator chrome: "=20.1.1432", // will match particular build only // and loose-equality operator - chrome: "~20" // will match any 20.* sub-version + chrome: "~20", // will match any 20.* sub-version chrome: "~20.1" // will match any 20.1.* sub-version (20.1.19 as well as 20.1.12.42-alpha.1) }); @@ -190,7 +190,7 @@ list of aliases can be found in the file.


- Documentation generated by JSDoc 3.6.3 on Wed Jul 17 2019 13:52:37 GMT+0300 (Eastern European Summer Time) using the docdash theme. + 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.
diff --git a/docs/parser.js.html b/docs/parser.js.html index d138141..1f1b2e6 100644 --- a/docs/parser.js.html +++ b/docs/parser.js.html @@ -27,7 +27,7 @@
@@ -546,7 +546,7 @@ export default Parser;
- Documentation generated by JSDoc 3.6.3 on Wed Jul 17 2019 13:52:37 GMT+0300 (Eastern European Summer Time) using the docdash theme. + 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.
diff --git a/docs/utils.js.html b/docs/utils.js.html index 2e9353f..c165619 100644 --- a/docs/utils.js.html +++ b/docs/utils.js.html @@ -27,7 +27,7 @@
@@ -97,6 +97,46 @@ export default class Utils { } } + /** + * Get macOS version name + * 10.5 - Leopard + * 10.6 - Snow Leopard + * 10.7 - Lion + * 10.8 - Mountain Lion + * 10.9 - Mavericks + * 10.10 - Yosemite + * 10.11 - El Capitan + * 10.12 - Sierra + * 10.13 - High Sierra + * 10.14 - Mojave + * 10.15 - Catalina + * + * @example + * getMacOSVersionName("10.14") // 'Mojave' + * + * @param {string} version + * @return {string} versionName + */ + static getMacOSVersionName(version) { + const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0); + v.push(0); + if (v[0] !== 10) return undefined; + switch (v[1]) { + case 5: return 'Leopard'; + case 6: return 'Snow Leopard'; + case 7: return 'Lion'; + case 8: return 'Mountain Lion'; + case 9: return 'Mavericks'; + case 10: return 'Yosemite'; + case 11: return 'El Capitan'; + case 12: return 'Sierra'; + case 13: return 'High Sierra'; + case 14: return 'Mojave'; + case 15: return 'Catalina'; + default: return undefined; + } + } + /** * Get Android version name * 1.5 - Cupcake @@ -113,7 +153,7 @@ export default class Utils { * 6.x - Marshmallow * 7.x - Nougat * 8.x - Oreo - * 9.x - ? + * 9.x - Pie * * @example * getAndroidVersionName("7.0") // 'Nougat' @@ -138,6 +178,7 @@ export default class Utils { if (v[0] === 6) return 'Marshmallow'; if (v[0] === 7) return 'Nougat'; if (v[0] === 8) return 'Oreo'; + if (v[0] === 9) return 'Pie'; return undefined; } @@ -274,7 +315,7 @@ export default class Utils {
- Documentation generated by JSDoc 3.6.3 on Wed Jul 17 2019 13:52:37 GMT+0300 (Eastern European Summer Time) using the docdash theme. + 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.
diff --git a/package-lock.json b/package-lock.json index 44beab1..95ee1bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.5.2", + "version": "2.5.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a0f78d1..8132de5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.5.2", + "version": "2.5.3", "description": "Lightweight browser detector", "keywords": [ "browser",