Skip to content

Commit 33f3e4b

Browse files
author
Michael Laktionov
committed
update build
1 parent a8f4f5f commit 33f3e4b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var setDefaults = function setDefaults(p) {
2121
return p ? p : d;
2222
};
2323
var isIOS13Check = function isIOS13Check(type) {
24-
return navigator.platform.includes(type) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 && !window.MSStream;
24+
return navigator && (navigator.platform.includes(type) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 && !window.MSStream);
2525
};
2626

2727
function _typeof(obj) {
@@ -415,12 +415,12 @@ var isIEType = function isIEType() {
415415
};
416416

417417
var isElectronType = function isElectronType() {
418-
var ua = navigator.userAgent.toLowerCase();
419-
return ua.includes('electron');
418+
var ua = navigator && navigator.userAgent.toLowerCase();
419+
return typeof ua === 'string' ? ua.includes('electron') : false;
420420
};
421421

422422
var getIOS13 = function getIOS13() {
423-
return (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window.MSStream;
423+
return navigator && (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window.MSStream;
424424
};
425425

426426
var getIPad13 = function getIPad13() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-device-detect",
3-
"version": "1.11.12",
3+
"version": "1.11.13",
44
"description": "Detect device type and render your component according to it",
55
"main": "main.js",
66
"typings": "./index.d.ts",

0 commit comments

Comments
 (0)