From 0c1564f1cd9f9d1d2036301eff0e9640253c5114 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Wed, 4 Jul 2018 22:36:46 +0300 Subject: [PATCH] Fix comments for Bowser class --- src/bowser.js | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index 3ddba78..75a89e9 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -6,23 +6,24 @@ */ import Parser from './parser'; -/* -* Ideas -* - Cacheable response -* */ - /** * Bowser class + * Keep it simple as much as it can be + * It's supposed to work with collections of Parser instances + * rather then solve one-instance problems. + * All the one-instance stuff is located in Parser class. */ class Bowser { /** - * Creates an object that parses UA + * Creates a Parser instance instead of Bowser's one + * * @param {String} UA — UserAgent string * @param {Boolean} [skipParsing=false] — same as skipParsing for Parser + * @returns {Parser} * * @example * const bowser = new Bowser(window.navigator.userAgent); - * bowser.getBrowser() + * bowser.getResult() */ constructor(UA, skipParsing=false) { if (typeof UA !== 'string') { @@ -34,28 +35,6 @@ class Bowser { static parse(UA) { return (new Bowser(UA)).getResult(); } - - /** - * Check if the browser is in range or not - * @param {Object} range - * @returns {Boolean} - */ - // static inRange(range) { - // if (!range) { - // throw new Error('Range can not be empty'); - // } - // } - - /** - * Check if the browser is NOT in range or not - * @param {Object} range - * @returns {Boolean} - */ - // static notInRange(range) {} - - - // static filter(UACollection, range) {} - // static inRange(range, UACollection) {} } export default Bowser;