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

3142 lines
33 KiB
HTML
Raw Permalink Normal View History

2019-03-06 12:37:21 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Parser - 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">
2020-07-09 19:13:24 +00:00
<script src="scripts/nav.js" defer></script>
2019-03-06 12:37:21 +00:00
<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>
2020-07-09 19:13:24 +00:00
<nav >
2019-03-06 12:37:21 +00:00
2020-07-09 19:13:24 +00:00
<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>
2019-03-06 12:37:21 +00:00
</nav>
<div id="main">
<h1 class="page-title">Parser</h1>
<section>
<header>
<h2>
Parser
</h2>
<div class="class-description"><p>The main class that arranges the whole parsing process.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Parser"><span class="type-signature"></span>new Parser<span class="signature">(UA, skipParsing<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-07-09 19:13:24 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line23">line 23</a>
2019-03-06 12:37:21 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Create instance of Parser</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>UA</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>User-Agent string</p></td>
</tr>
<tr>
<td class="name"><code>skipParsing</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
<code>false</code>
</td>
<td class="description last"><p>parser can skip parsing in purpose of performance
improvements if you need to make a more particular parsing
like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Parser.html#parsePlatform">Parser#parsePlatform</a></p></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="getBrowser"><span class="type-signature"></span>getBrowser<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line110">line 110</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed browser object</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getBrowserName"><span class="type-signature"></span>getBrowserName<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></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#line124">line 124</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get browser's name</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>Browser's name or an empty string</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getBrowserVersion"><span class="type-signature"></span>getBrowserVersion<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></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#line138">line 138</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get browser's version</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>version of browser</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getEngine"><span class="type-signature"></span>getEngine<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line267">line 267</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed engine</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getEngineName"><span class="type-signature"></span>getEngineName<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></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#line281">line 281</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get engines's name</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>Engines's name or an empty string</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getOS"><span class="type-signature"></span>getOS<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line153">line 153</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get OS</p>
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>this.getOS();
{
name: 'macOS',
version: '10.11.12'
}</code></pre>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getOSName"><span class="type-signature"></span>getOSName<span class="signature">(toLowerCase<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {String}</span></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#line192">line 192</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get OS name</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>toLowerCase</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>return lower-cased value</p></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>name of the OS — macOS, Windows, Linux, etc.</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getOSVersion"><span class="type-signature"></span>getOSVersion<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></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#line206">line 206</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get OS version</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>full version with dots ('10.11.12', '5.6', etc)</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getPlatform"><span class="type-signature"></span>getPlatform<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line214">line 214</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed platform</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getPlatformType"><span class="type-signature"></span>getPlatformType<span class="signature">(toLowerCase<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></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#line227">line 227</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get platform name</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>toLowerCase</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
<code>false</code>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getResult"><span class="type-signature"></span>getResult<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#ParsedResult">ParsedResult</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-09-12 08:24:26 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line331">line 331</a>
2019-03-06 12:37:21 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed result</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#ParsedResult">ParsedResult</a></span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="getUA"><span class="type-signature"></span>getUA<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></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#line65">line 65</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get UserAgent string of current Parser instance</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>User-Agent String of the current <Parser> object</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
2020-09-12 08:24:26 +00:00
<h4 class="name" id="is"><span class="type-signature"></span>is<span class="signature">(anything, includingAlias<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
2019-03-06 12:37:21 +00:00
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-09-12 08:24:26 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line481">line 481</a>
2019-03-06 12:37:21 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Is anything? Check if the browser is called &quot;anything&quot;,
the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
2020-09-12 08:24:26 +00:00
<th>Attributes</th>
2019-03-06 12:37:21 +00:00
2020-09-12 08:24:26 +00:00
<th>Default</th>
2019-03-06 12:37:21 +00:00
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>anything</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
2020-09-12 08:24:26 +00:00
<td class="attributes">
2019-03-06 12:37:21 +00:00
2020-09-12 08:24:26 +00:00
</td>
<td class="default">
</td>
2019-03-06 12:37:21 +00:00
<td class="description last"></td>
</tr>
2020-09-12 08:24:26 +00:00
<tr>
<td class="name"><code>includingAlias</code></td>
<td class="type">
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
<code>false</code>
</td>
<td class="description last"><p>The flag showing whether alias will be included into comparison</p></td>
</tr>
2019-03-06 12:37:21 +00:00
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
2019-04-14 10:50:34 +00:00
<h4 class="name" id="isBrowser"><span class="type-signature"></span>isBrowser<span class="signature">(browserName, includingAlias<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-09-12 08:24:26 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line415">line 415</a>
2019-04-14 10:50:34 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Check if the browser name equals the passed string</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>browserName</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The string to compare with the browser name</p></td>
</tr>
<tr>
<td class="name"><code>includingAlias</code></td>
<td class="type">
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
<code>false</code>
</td>
<td class="description last"><p>The flag showing whether alias will be included into comparison</p></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-04-14 10:50:34 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-04-14 10:50:34 +00:00
2020-09-12 08:24:26 +00:00
<h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Parser.html">Parser</a>}</span></h4>
2019-03-06 12:37:21 +00:00
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-09-12 08:24:26 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line318">line 318</a>
2019-03-06 12:37:21 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Parse full information about the browser</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
2020-09-12 08:24:26 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Parser.html">Parser</a></span>
</dd>
</dl>
2019-03-06 12:37:21 +00:00
<h4 class="name" id="parseBrowser"><span class="type-signature"></span>parseBrowser<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line82">line 82</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed browser object</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="parseEngine"><span class="type-signature"></span>parseEngine<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line292">line 292</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed platform</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="parseOS"><span class="type-signature"></span>parseOS<span class="signature">()</span><span class="type-signature"> &rarr; {*|Object}</span></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#line165">line 165</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Parse OS and save it to this.parsedResult.os</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
|
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="parsePlatform"><span class="type-signature"></span>parsePlatform<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></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#line241">line 241</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Get parsed platform</p>
</div>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="satisfies"><span class="type-signature"></span>satisfies<span class="signature">(checkTree)</span><span class="type-signature"> &rarr; {Boolean|undefined}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-09-12 08:24:26 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line353">line 353</a>
2019-03-06 12:37:21 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Check if parsed browser matches certain conditions</p>
</div>
<h5>Example</h5>
2019-05-03 18:53:57 +00:00
<pre class="prettyprint"><code>const browser = Bowser.getParser(window.navigator.userAgent);
2019-04-14 10:50:34 +00:00
if (browser.satisfies({chrome: '>118.01.1322' }))
2019-03-06 12:37:21 +00:00
// or with os
2019-04-14 10:50:34 +00:00
if (browser.satisfies({windows: { chrome: '>118.01.1322' } }))
2019-03-06 12:37:21 +00:00
// or with platforms
2019-04-14 10:50:34 +00:00
if (browser.satisfies({desktop: { chrome: '>118.01.1322' } }))</code></pre>
2019-03-06 12:37:21 +00:00
<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>checkTree</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>It's one or two layered object,
which can include a platform or an OS on the first layer
and should have browsers specs on the bottom-laying layer</p></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<div class="param-desc">
<p>Whether the browser satisfies the set conditions or not.
Returns <code>undefined</code> when the browser is no described in the checkTree object.</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
|
<span class="param-type">undefined</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="some"><span class="type-signature"></span>some<span class="signature">(anythings)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
2020-09-12 08:24:26 +00:00
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line491">line 491</a>
2019-03-06 12:37:21 +00:00
</li></ul></dd>
</dl>
<div class="description">
<p>Check if any of the given values satisfies this.is(anything)</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>anythings</code></td>
<td class="type">
<span class="param-type">Array.&lt;String></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h4 class="name" id="test"><span class="type-signature"></span>test<span class="signature">(regex)</span><span class="type-signature"> &rarr; {Boolean}</span></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#line74">line 74</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Test a UA string for a regexp</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>regex</code></td>
<td class="type">
<span class="param-type">RegExp</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
</article>
</section>
</div>
<br class="clear">
<footer>
2020-09-12 08:24:26 +00:00
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.
2019-03-06 12:37:21 +00:00
</footer>
<script>prettyPrint();</script>
2020-07-09 19:13:24 +00:00
<script src="scripts/polyfill.js"></script>
2019-03-06 12:37:21 +00:00
<script src="scripts/linenumber.js"></script>
2020-07-09 19:13:24 +00:00
2019-03-06 12:37:21 +00:00
</body>
</html>