1 | "use strict";
|
2 | var mobileType = {
|
3 | Android: function () {
|
4 | return (/Android/i).test(navigator.userAgent);
|
5 | },
|
6 | BlackBerry: function () {
|
7 | return (/BlackBerry/i).test(navigator.userAgent);
|
8 | },
|
9 | iOS: function () {
|
10 | return (/iPhone|iPad|iPod/i).test(navigator.userAgent);
|
11 | },
|
12 | Opera: function () {
|
13 | return (/Opera Mini/i).test(navigator.userAgent);
|
14 | },
|
15 | Windows: function () {
|
16 | return (/IEMobile/i).test(navigator.userAgent);
|
17 | },
|
18 | any: function () {
|
19 | return (this.Android() || this.BlackBerry() || this.iOS() || this.Opera() || this.Windows());
|
20 | }
|
21 | };
|
22 | var isMobile = mobileType.any.bind(mobileType);
|
23 | module.exports = isMobile;
|
24 |
|
\ | No newline at end of file |