Methods
assign(obj) → {Object}
Object::assign polyfill
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object | |
...objs |
Object |
Returns:
- Type
- Object
find(arr, predicate) → {Array}
Array::find polyfill
Parameters:
| Name | Type | Description |
|---|---|---|
arr |
Array | |
predicate |
function |
Returns:
- Type
- Array
getAndroidVersionName(version) → {string}
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
Example
getAndroidVersionName("7.0") // 'Nougat'
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string |
Returns:
versionName
- Type
- string
getBrowserAlias(browserName) → {string}
Get short version/alias for a browser name
Example
getBrowserAlias('Microsoft Edge') // edge
Parameters:
| Name | Type | Description |
|---|---|---|
browserName |
string |
Returns:
- Type
- string
getBrowserTypeByAlias(browserAlias) → {string}
Get browser name for a short version/alias
Example
getBrowserTypeByAlias('edge') // Microsoft Edge
Parameters:
| Name | Type | Description |
|---|---|---|
browserAlias |
string |
Returns:
- Type
- string
getFirstMatch(regexp, ua) → {Array|Object|*|boolean|string}
Get first matched item for a string
Parameters:
| Name | Type | Description |
|---|---|---|
regexp |
RegExp | |
ua |
String |
Returns:
- Type
- Array | Object | * | boolean | string
getMacOSVersionName(version) → {string}
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 11 - Big Sur 12 - Monterey 13 - Ventura 14 - Sonoma 15 - Sequoia
Example
getMacOSVersionName("10.14") // 'Mojave'
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string |
Returns:
versionName
- Type
- string
getSecondMatch(regexp, ua) → {Array|Object|*|boolean|string}
Get second matched item for a string
Parameters:
| Name | Type | Description |
|---|---|---|
regexp |
||
ua |
String |
Returns:
- Type
- Array | Object | * | boolean | string
getVersionPrecision(version) → {number}
Get version precisions count
Example
getVersionPrecision("1.10.3") // 3
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string |
Returns:
- Type
- number
map(arr, iterator) → {Array}
Array::map polyfill
Parameters:
| Name | Type | Description |
|---|---|---|
arr |
Array | |
iterator |
function |
Returns:
- Type
- Array
matchAndReturnConst(regexp, ua, _const) → {*}
Match a regexp and return a constant or undefined
Parameters:
| Name | Type | Description |
|---|---|---|
regexp |
RegExp | |
ua |
String | |
_const |
* | Any const that will be returned if regexp matches the string |
Returns:
- Type
- *
Type Definitions
ClientHints
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
brands |
Array.<{brand: string, version: string}> |
<optional> |
Array of brand objects |
mobile |
boolean |
<optional> |
Whether the device is mobile |
platform |
string |
<optional> |
Platform name (e.g., "Windows", "macOS") |
platformVersion |
string |
<optional> |
Platform version |
architecture |
string |
<optional> |
CPU architecture |
model |
string |
<optional> |
Device model |
wow64 |
boolean |
<optional> |
Whether running under WoW64 |
Type:
- Object
ParsedResult
Properties:
| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
browser |
Object |
Properties
|
||||||||||||||||
os |
Object |
Properties
|
||||||||||||||||
platform |
Object |
Properties
|
||||||||||||||||
engine |
Object |
Properties
|