<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Global - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> <script src="scripts/nav.js" defer></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav > <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> </nav> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="assign"><span class="type-signature"></span>assign<span class="signature">(obj)</span><span class="type-signature"> → {Object}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line265">line 265</a> </li></ul></dd> </dl> <div class="description"> <p>Object::assign polyfill</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>obj</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>...objs</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h4 class="name" id="find"><span class="type-signature"></span>find<span class="signature">(arr, predicate)</span><span class="type-signature"> → {Array}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line243">line 243</a> </li></ul></dd> </dl> <div class="description"> <p>Array::find polyfill</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>arr</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>predicate</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h4 class="name" id="getAndroidVersionName"><span class="type-signature"></span>getAndroidVersionName<span class="signature">(version)</span><span class="type-signature"> → {string}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line120">line 120</a> </li></ul></dd> </dl> <div class="description"> <p>Get Android version name 1.5 - Cupcake 1.6 - Donut 2.0 - Eclair 2.1 - Eclair 2.2 - Froyo 2.x - Gingerbread 3.x - Honeycomb 4.0 - Ice Cream Sandwich 4.1 - Jelly Bean 4.4 - KitKat 5.x - Lollipop 6.x - Marshmallow 7.x - Nougat 8.x - Oreo 9.x - Pie</p> </div> <h5>Example</h5> <pre class="prettyprint"><code>getAndroidVersionName("7.0") // 'Nougat'</code></pre> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>versionName</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getBrowserAlias"><span class="type-signature"></span>getBrowserAlias<span class="signature">(browserName)</span><span class="type-signature"> → {string}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line293">line 293</a> </li></ul></dd> </dl> <div class="description"> <p>Get short version/alias for a browser name</p> </div> <h5>Example</h5> <pre class="prettyprint"><code>getBrowserAlias('Microsoft Edge') // edge</code></pre> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>browserName</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getBrowserTypeByAlias"><span class="type-signature"></span>getBrowserTypeByAlias<span class="signature">(browserAlias)</span><span class="type-signature"> → {string}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line306">line 306</a> </li></ul></dd> </dl> <div class="description"> <p>Get short version/alias for a browser name</p> </div> <h5>Example</h5> <pre class="prettyprint"><code>getBrowserAlias('edge') // Microsoft Edge</code></pre> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>browserAlias</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getFirstMatch"><span class="type-signature"></span>getFirstMatch<span class="signature">(regexp, ua)</span><span class="type-signature"> → {Array|Object|*|boolean|string}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line10">line 10</a> </li></ul></dd> </dl> <div class="description"> <p>Get first matched item for a string</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>regexp</code></td> <td class="type"> <span class="param-type">RegExp</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>ua</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array</span> | <span class="param-type">Object</span> | <span class="param-type">*</span> | <span class="param-type">boolean</span> | <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getMacOSVersionName"><span class="type-signature"></span>getMacOSVersionName<span class="signature">(version)</span><span class="type-signature"> → {string}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line76">line 76</a> </li></ul></dd> </dl> <div class="description"> <p>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</p> </div> <h5>Example</h5> <pre class="prettyprint"><code>getMacOSVersionName("10.14") // 'Mojave'</code></pre> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> <p>versionName</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getSecondMatch"><span class="type-signature"></span>getSecondMatch<span class="signature">(regexp, ua)</span><span class="type-signature"> → {Array|Object|*|boolean|string}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line21">line 21</a> </li></ul></dd> </dl> <div class="description"> <p>Get second matched item for a string</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>regexp</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>ua</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array</span> | <span class="param-type">Object</span> | <span class="param-type">*</span> | <span class="param-type">boolean</span> | <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getVersionPrecision"><span class="type-signature"></span>getVersionPrecision<span class="signature">(version)</span><span class="type-signature"> → {number}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line150">line 150</a> </li></ul></dd> </dl> <div class="description"> <p>Get version precisions count</p> </div> <h5>Example</h5> <pre class="prettyprint"><code>getVersionPrecision("1.10.3") // 3</code></pre> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> <h4 class="name" id="map"><span class="type-signature"></span>map<span class="signature">(arr, iterator)</span><span class="type-signature"> → {Array}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line224">line 224</a> </li></ul></dd> </dl> <div class="description"> <p>Array::map polyfill</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>arr</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>iterator</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h4 class="name" id="matchAndReturnConst"><span class="type-signature"></span>matchAndReturnConst<span class="signature">(regexp, ua, _const)</span><span class="type-signature"> → {*}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line33">line 33</a> </li></ul></dd> </dl> <div class="description"> <p>Match a regexp and return a constant or undefined</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>regexp</code></td> <td class="type"> <span class="param-type">RegExp</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>ua</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>_const</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last"><p>Any const that will be returned if regexp matches the string</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">*</span> </dd> </dl> <h3 class="subsection-title">Type Definitions</h3> <h4 class="name" id="ParsedResult">ParsedResult</h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line30">line 30</a> </li></ul></dd> </dl> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>browser</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"> <h6>Properties</h6> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>Browser name, like <code>"Chrome"</code> or <code>"Internet Explorer"</code></p></td> </tr> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>Browser version as a String <code>"12.01.45334.10"</code></p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>os</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"> <h6>Properties</h6> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>OS name, like <code>"Windows"</code> or <code>"macOS"</code></p></td> </tr> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>OS version, like <code>"NT 5.1"</code> or <code>"10.11.1"</code></p></td> </tr> <tr> <td class="name"><code>versionName</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>OS name, like <code>"XP"</code> or <code>"High Sierra"</code></p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>platform</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"> <h6>Properties</h6> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>platform type, can be either <code>"desktop"</code>, <code>"tablet"</code> or <code>"mobile"</code></p></td> </tr> <tr> <td class="name"><code>vendor</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>Vendor of the device, like <code>"Apple"</code> or <code>"Samsung"</code></p></td> </tr> <tr> <td class="name"><code>model</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>Device model, like <code>"iPhone"</code> or <code>"Kindle Fire HD 7"</code></p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>engine</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"> <h6>Properties</h6> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>Can be any of this: <code>WebKit</code>, <code>Blink</code>, <code>Gecko</code>, <code>Trident</code>, <code>Presto</code>, <code>EdgeHTML</code></p></td> </tr> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last"><p>String version of the engine</p></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. </footer> <script>prettyPrint();</script> <script src="scripts/polyfill.js"></script> <script src="scripts/linenumber.js"></script> </body> </html>