@probe.gl/env
Advanced tools
Comparing version 3.5.0-alpha.4 to 3.5.0-alpha.5
@@ -11,4 +11,2 @@ "use strict"; | ||
var _globals = require("./globals"); | ||
var _isBrowser = _interopRequireDefault(require("./is-browser")); | ||
@@ -18,4 +16,6 @@ | ||
const window = globalThis; | ||
function isMobile() { | ||
return typeof _globals.window.orientation !== 'undefined'; | ||
return typeof window.orientation !== 'undefined'; | ||
} | ||
@@ -46,11 +46,11 @@ | ||
if (_globals.window.chrome) { | ||
if (window.chrome) { | ||
return 'Chrome'; | ||
} | ||
if (_globals.window.safari) { | ||
if (window.safari) { | ||
return 'Safari'; | ||
} | ||
if (_globals.window.mozInnerScreenX) { | ||
if (window.mozInnerScreenX) { | ||
return 'Firefox'; | ||
@@ -57,0 +57,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import { window } from './globals'; | ||
import isBrowser from './is-browser'; | ||
import isElectron from './is-electron'; | ||
const window = globalThis; | ||
export function isMobile() { | ||
@@ -5,0 +5,0 @@ return typeof window.orientation !== 'undefined'; |
export declare function isMobile(): boolean; | ||
export default function getBrowser(mockUserAgent?: string): string; | ||
export default function getBrowser(mockUserAgent?: string): 'Node' | 'Electron' | 'Chrome' | 'Firefox' | 'Safari' | 'Edge' | 'IE' | 'Unknown'; | ||
//# sourceMappingURL=get-browser.d.ts.map |
@@ -22,5 +22,5 @@ // Copyright (c) 2017 Uber Technologies, Inc. | ||
// make sure it can be imported in isolation | ||
import { window } from './globals'; | ||
import isBrowser from './is-browser'; | ||
import isElectron from './is-electron'; | ||
const window = globalThis; | ||
export function isMobile() { | ||
@@ -27,0 +27,0 @@ return typeof window.orientation !== 'undefined'; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "3.5.0-alpha.4", | ||
"version": "3.5.0-alpha.5", | ||
"keywords": [ | ||
@@ -31,3 +31,3 @@ "javascript", | ||
}, | ||
"gitHead": "5f0c4ef4db3b53b0be8ebabcf42e2bc276c7bf44" | ||
"gitHead": "8717b64234cc62be48396c4ffbd614e7d7a42cfe" | ||
} |
@@ -24,6 +24,7 @@ // Copyright (c) 2017 Uber Technologies, Inc. | ||
import {window} from './globals'; | ||
import isBrowser from './is-browser'; | ||
import isElectron from './is-electron'; | ||
const window = globalThis; | ||
export function isMobile(): boolean { | ||
@@ -36,3 +37,5 @@ return typeof window.orientation !== 'undefined'; | ||
/* eslint-disable complexity */ | ||
export default function getBrowser(mockUserAgent?: string): string { | ||
export default function getBrowser( | ||
mockUserAgent?: string | ||
): 'Node' | 'Electron' | 'Chrome' | 'Firefox' | 'Safari' | 'Edge' | 'IE' | 'Unknown' { | ||
if (!mockUserAgent && !isBrowser()) { | ||
@@ -39,0 +42,0 @@ return 'Node'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50186
641