File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ var setDefaults = function setDefaults(p) {
2121 return p ? p : d ;
2222} ;
2323var 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
2727function _typeof ( obj ) {
@@ -415,12 +415,12 @@ var isIEType = function isIEType() {
415415} ;
416416
417417var 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
422422var getIOS13 = function getIOS13 ( ) {
423- return ( / i P a d | i P h o n e | i P o d / . test ( navigator . platform ) || navigator . platform === "MacIntel" && navigator . maxTouchPoints > 1 ) && ! window . MSStream ;
423+ return navigator && ( / i P a d | i P h o n e | i P o d / . test ( navigator . platform ) || navigator . platform === "MacIntel" && navigator . maxTouchPoints > 1 ) && ! window . MSStream ;
424424} ;
425425
426426var getIPad13 = function getIPad13 ( ) {
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments