1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

make public getBrowser and private parseBrowser

This commit is contained in:
Denis Demchenko 2017-04-09 19:16:38 +03:00
parent 3bb6654320
commit 9e46db26ed

View File

@ -30,13 +30,9 @@ class Parser {
* Get parsed browser object
* @return {Object}
*
* @public
* @private
*/
parseBrowser() {
if (this.parsedResult.browser) {
return this.parsedResult.browser;
}
_parseBrowser() {
this.parsedResult.browser = {};
const browser = browsersList.find((browser) => {
@ -50,6 +46,20 @@ class Parser {
return this.parsedResult.browser;
}
/**
* Get parsed browser object
* @return {Object}
*
* @public
*/
getBrowser() {
if (this.parsedResult.browser) {
return this.parsedResult.browser;
}
return this._parseBrowser();
}
/**
* Test a UA string for a regexp
* @param {RegExp} regex