Add jsdoc descriptions for Parser's methods

pull/227/head
Denis Demchenko 7 years ago
parent 6b5974af2e
commit 5a235015aa

@ -91,12 +91,29 @@ class Parser {
} }
/**
* Get browser's version
* @return {String} version of browser
*
* @public
*/
getBrowserVersion() { getBrowserVersion() {
return this.getBrowser().version; return this.getBrowser().version;
} }
getPlatform(){} getPlatform(){}
/**
* Get OS
* @return {Object}
*
* @example
* this.getOS();
* {
* name: 'macOS',
* version: '10.11.12'
* }
*/
getOS() { getOS() {
if (this.parsedResult.os) { if (this.parsedResult.os) {
return this.parsedResult.os; return this.parsedResult.os;
@ -105,6 +122,11 @@ class Parser {
return this._parseOS(); return this._parseOS();
} }
/**
* Parse OS and save it to this.parsedResult.os
* @return {*|{}}
* @private
*/
_parseOS() { _parseOS() {
this.parsedResult.os = {}; this.parsedResult.os = {};
@ -129,10 +151,18 @@ class Parser {
return this.parsedResult.os; return this.parsedResult.os;
} }
/**
* Get OS name
* @return {String} name of the OS macOS, Windows, Linux, etc.
*/
getOSName() { getOSName() {
return this.getOS().name; return this.getOS().name;
} }
/**
* Get OS version
* @return {String} full version with dots ('10.11.12', '5.6', etc)
*/
getOSVersion() { getOSVersion() {
return this.getOS().version; return this.getOS().version;
} }

Loading…
Cancel
Save