@jam3/detect
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -87,2 +87,3 @@ import bowser from 'bowser'; | ||
browser: boolean; | ||
touch: boolean; | ||
constructor(); | ||
@@ -89,0 +90,0 @@ get orientation(): string; |
@@ -97,4 +97,4 @@ 'use strict'; | ||
this.name = detector.ua.includes('edg/') | ||
? 'microsoft edge' | ||
: detector.base.getBrowserName().toLowerCase(); | ||
? 'microsoft-edge' | ||
: detector.base.getBrowserName().toLowerCase().replace(' ', '-'); | ||
this.vendor = detector.window.navigator.vendor ? detector.window.navigator.vendor.toLowerCase() : ''; | ||
@@ -104,4 +104,4 @@ this.chrome = this.name === 'chrome'; | ||
this.safari = this.name === 'safari'; | ||
this.edge = this.name === 'microsoft edge'; | ||
this.ie = this.name === 'internet explorer'; | ||
this.edge = this.name === 'microsoft-edge'; | ||
this.ie = this.name === 'internet-explorer'; | ||
this.opera = this.name === 'opera'; | ||
@@ -162,2 +162,3 @@ this.node = this.name === 'node'; | ||
this.browser = !this.node; | ||
this.touch = 'ontouchstart' in window || navigator.maxTouchPoints > 0; | ||
} | ||
@@ -206,5 +207,5 @@ Object.defineProperty(Device.prototype, "orientation", { | ||
function Detect() { | ||
this.os = new OS(); | ||
this.browser = new Browser(); | ||
this.device = new Device(); | ||
this.os = os; | ||
this.browser = browser; | ||
this.device = device; | ||
this.detector = detector; | ||
@@ -211,0 +212,0 @@ } |
@@ -89,4 +89,4 @@ import bowser from 'bowser'; | ||
this.name = detector.ua.includes('edg/') | ||
? 'microsoft edge' | ||
: detector.base.getBrowserName().toLowerCase(); | ||
? 'microsoft-edge' | ||
: detector.base.getBrowserName().toLowerCase().replace(' ', '-'); | ||
this.vendor = detector.window.navigator.vendor ? detector.window.navigator.vendor.toLowerCase() : ''; | ||
@@ -96,4 +96,4 @@ this.chrome = this.name === 'chrome'; | ||
this.safari = this.name === 'safari'; | ||
this.edge = this.name === 'microsoft edge'; | ||
this.ie = this.name === 'internet explorer'; | ||
this.edge = this.name === 'microsoft-edge'; | ||
this.ie = this.name === 'internet-explorer'; | ||
this.opera = this.name === 'opera'; | ||
@@ -154,2 +154,3 @@ this.node = this.name === 'node'; | ||
this.browser = !this.node; | ||
this.touch = 'ontouchstart' in window || navigator.maxTouchPoints > 0; | ||
} | ||
@@ -198,5 +199,5 @@ Object.defineProperty(Device.prototype, "orientation", { | ||
function Detect() { | ||
this.os = new OS(); | ||
this.browser = new Browser(); | ||
this.device = new Device(); | ||
this.os = os; | ||
this.browser = browser; | ||
this.device = device; | ||
this.detector = detector; | ||
@@ -203,0 +204,0 @@ } |
{ | ||
"name": "@jam3/detect", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "User agent feature detection like Device Orientation, in App Browser Detection, etc", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -112,4 +112,4 @@ import bowser from 'bowser'; | ||
this.name = detector.ua.includes('edg/') // https://github.com/lancedikson/bowser/issues/416 | ||
? 'microsoft edge' | ||
: detector.base.getBrowserName().toLowerCase(); | ||
? 'microsoft-edge' | ||
: detector.base.getBrowserName().toLowerCase().replace(' ', '-'); | ||
this.vendor = detector.window.navigator.vendor ? detector.window.navigator.vendor.toLowerCase() : ''; | ||
@@ -119,4 +119,4 @@ this.chrome = this.name === 'chrome'; | ||
this.safari = this.name === 'safari'; | ||
this.edge = this.name === 'microsoft edge'; | ||
this.ie = this.name === 'internet explorer'; | ||
this.edge = this.name === 'microsoft-edge'; | ||
this.ie = this.name === 'internet-explorer'; | ||
this.opera = this.name === 'opera'; | ||
@@ -166,2 +166,3 @@ this.node = this.name === 'node'; | ||
browser: boolean; | ||
touch: boolean; | ||
@@ -184,2 +185,3 @@ constructor() { | ||
this.browser = !this.node; | ||
this.touch = 'ontouchstart' in window || navigator.maxTouchPoints > 0; | ||
} | ||
@@ -186,0 +188,0 @@ get orientation() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
70673
1162