Socket
Socket
Sign inDemoInstall

current-device

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

current-device - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

8

es/index.js

@@ -29,2 +29,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

device.macos = function () {
return find('mac');
};
device.ios = function () {

@@ -194,2 +198,4 @@ return device.iphone() || device.ipod() || device.ipad();

}
} else if (device.macos()) {
addClass("macos desktop");
} else if (device.android()) {

@@ -213,3 +219,3 @@ if (device.androidTablet()) {

} else {
addClass("desktop");
addClass("windows desktop");
}

@@ -216,0 +222,0 @@ } else if (device.fxos()) {

@@ -33,2 +33,6 @@ 'use strict';

device.macos = function () {
return find('mac');
};
device.ios = function () {

@@ -198,2 +202,4 @@ return device.iphone() || device.ipod() || device.ipad();

}
} else if (device.macos()) {
addClass("macos desktop");
} else if (device.android()) {

@@ -217,3 +223,3 @@ if (device.androidTablet()) {

} else {
addClass("desktop");
addClass("windows desktop");
}

@@ -220,0 +226,0 @@ } else if (device.fxos()) {

2

package.json
{
"name": "current-device",
"version": "0.6.2",
"version": "0.6.3",
"homepage": "https://github.com/matthewhudson/current-device",

@@ -5,0 +5,0 @@ "description": "The easiest way to write conditional CSS and/or JavaScript based on device operating system (iOS, Android, Blackberry, Windows, Firefox OS, MeeGo, AppleTV, etc), orientation (Portrait vs. Landscape), and type (Tablet vs. Mobile).",

/*!
* current-device v0.6.0 - https://github.com/matthewhudson/current-device
* current-device v0.6.2 - https://github.com/matthewhudson/current-device
* MIT Licensed

@@ -121,2 +121,6 @@ */

device.macos = function () {
return find('mac');
};
device.ios = function () {

@@ -286,2 +290,4 @@ return device.iphone() || device.ipod() || device.ipad();

}
} else if (device.macos()) {
addClass("macos desktop");
} else if (device.android()) {

@@ -305,3 +311,3 @@ if (device.androidTablet()) {

} else {
addClass("desktop");
addClass("windows desktop");
}

@@ -308,0 +314,0 @@ } else if (device.fxos()) {

/*!
* current-device v0.6.0 - https://github.com/matthewhudson/current-device
* current-device v0.6.2 - https://github.com/matthewhudson/current-device
* MIT Licensed
*/
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.device=n():e.device=n()}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var o={};return n.m=e,n.c=o,n.d=function(e,o,t){n.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,o){e.exports=o(1)},function(e,n,o){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t,r,i,a,d,c,u,l,s,b,f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=window.device,t={},window.device=t,a=window.document.documentElement,b=window.navigator.userAgent.toLowerCase(),t.ios=function(){return t.iphone()||t.ipod()||t.ipad()},t.iphone=function(){return!t.windows()&&d("iphone")},t.ipod=function(){return d("ipod")},t.ipad=function(){return d("ipad")},t.android=function(){return!t.windows()&&d("android")},t.androidPhone=function(){return t.android()&&d("mobile")},t.androidTablet=function(){return t.android()&&!d("mobile")},t.blackberry=function(){return d("blackberry")||d("bb10")||d("rim")},t.blackberryPhone=function(){return t.blackberry()&&!d("tablet")},t.blackberryTablet=function(){return t.blackberry()&&d("tablet")},t.windows=function(){return d("windows")},t.windowsPhone=function(){return t.windows()&&d("phone")},t.windowsTablet=function(){return t.windows()&&d("touch")&&!t.windowsPhone()},t.fxos=function(){return(d("(mobile;")||d("(tablet;"))&&d("; rv:")},t.fxosPhone=function(){return t.fxos()&&d("mobile")},t.fxosTablet=function(){return t.fxos()&&d("tablet")},t.meego=function(){return d("meego")},t.cordova=function(){return window.cordova&&"file:"===location.protocol},t.nodeWebkit=function(){return"object"===f(window.process)},t.mobile=function(){return t.androidPhone()||t.iphone()||t.ipod()||t.windowsPhone()||t.blackberryPhone()||t.fxosPhone()||t.meego()},t.tablet=function(){return t.ipad()||t.androidTablet()||t.blackberryTablet()||t.windowsTablet()||t.fxosTablet()},t.desktop=function(){return!t.tablet()&&!t.mobile()},t.television=function(){var e,n=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"];for(e=0;e<n.length;){if(d(n[e]))return!0;e++}return!1},t.portrait=function(){return window.innerHeight/window.innerWidth>1},t.landscape=function(){return window.innerHeight/window.innerWidth<1},t.noConflict=function(){return window.device=r,this},d=function(e){return-1!==b.indexOf(e)},u=function(e){var n;return n=new RegExp(e,"i"),a.className.match(n)},i=function(e){var n=null;u(e)||(n=a.className.replace(/^\s+|\s+$/g,""),a.className=n+" "+e)},s=function(e){u(e)&&(a.className=a.className.replace(" "+e,""))},t.ios()?t.ipad()?i("ios ipad tablet"):t.iphone()?i("ios iphone mobile"):t.ipod()&&i("ios ipod mobile"):t.android()?i(t.androidTablet()?"android tablet":"android mobile"):t.blackberry()?i(t.blackberryTablet()?"blackberry tablet":"blackberry mobile"):t.windows()?i(t.windowsTablet()?"windows tablet":t.windowsPhone()?"windows mobile":"desktop"):t.fxos()?i(t.fxosTablet()?"fxos tablet":"fxos mobile"):t.meego()?i("meego mobile"):t.nodeWebkit()?i("node-webkit"):t.television()?i("television"):t.desktop()&&i("desktop"),t.cordova()&&i("cordova"),c=function(){t.landscape()?(s("portrait"),i("landscape")):(s("landscape"),i("portrait"))},l=Object.prototype.hasOwnProperty.call(window,"onorientationchange")?"orientationchange":"resize",window.addEventListener?window.addEventListener(l,c,!1):window.attachEvent?window.attachEvent(l,c):window[l]=c,c(),n.default=t}])});
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.device=n():e.device=n()}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var o={};return n.m=e,n.c=o,n.d=function(e,o,t){n.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,o){e.exports=o(1)},function(e,n,o){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t,r,i,a,d,c,u,l,s,b,f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=window.device,t={},window.device=t,a=window.document.documentElement,b=window.navigator.userAgent.toLowerCase(),t.macos=function(){return d("mac")},t.ios=function(){return t.iphone()||t.ipod()||t.ipad()},t.iphone=function(){return!t.windows()&&d("iphone")},t.ipod=function(){return d("ipod")},t.ipad=function(){return d("ipad")},t.android=function(){return!t.windows()&&d("android")},t.androidPhone=function(){return t.android()&&d("mobile")},t.androidTablet=function(){return t.android()&&!d("mobile")},t.blackberry=function(){return d("blackberry")||d("bb10")||d("rim")},t.blackberryPhone=function(){return t.blackberry()&&!d("tablet")},t.blackberryTablet=function(){return t.blackberry()&&d("tablet")},t.windows=function(){return d("windows")},t.windowsPhone=function(){return t.windows()&&d("phone")},t.windowsTablet=function(){return t.windows()&&d("touch")&&!t.windowsPhone()},t.fxos=function(){return(d("(mobile;")||d("(tablet;"))&&d("; rv:")},t.fxosPhone=function(){return t.fxos()&&d("mobile")},t.fxosTablet=function(){return t.fxos()&&d("tablet")},t.meego=function(){return d("meego")},t.cordova=function(){return window.cordova&&"file:"===location.protocol},t.nodeWebkit=function(){return"object"===f(window.process)},t.mobile=function(){return t.androidPhone()||t.iphone()||t.ipod()||t.windowsPhone()||t.blackberryPhone()||t.fxosPhone()||t.meego()},t.tablet=function(){return t.ipad()||t.androidTablet()||t.blackberryTablet()||t.windowsTablet()||t.fxosTablet()},t.desktop=function(){return!t.tablet()&&!t.mobile()},t.television=function(){var e,n=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"];for(e=0;e<n.length;){if(d(n[e]))return!0;e++}return!1},t.portrait=function(){return window.innerHeight/window.innerWidth>1},t.landscape=function(){return window.innerHeight/window.innerWidth<1},t.noConflict=function(){return window.device=r,this},d=function(e){return-1!==b.indexOf(e)},u=function(e){var n;return n=new RegExp(e,"i"),a.className.match(n)},i=function(e){var n=null;u(e)||(n=a.className.replace(/^\s+|\s+$/g,""),a.className=n+" "+e)},s=function(e){u(e)&&(a.className=a.className.replace(" "+e,""))},t.ios()?t.ipad()?i("ios ipad tablet"):t.iphone()?i("ios iphone mobile"):t.ipod()&&i("ios ipod mobile"):t.macos()?i("macos desktop"):t.android()?i(t.androidTablet()?"android tablet":"android mobile"):t.blackberry()?i(t.blackberryTablet()?"blackberry tablet":"blackberry mobile"):t.windows()?i(t.windowsTablet()?"windows tablet":t.windowsPhone()?"windows mobile":"windows desktop"):t.fxos()?i(t.fxosTablet()?"fxos tablet":"fxos mobile"):t.meego()?i("meego mobile"):t.nodeWebkit()?i("node-webkit"):t.television()?i("television"):t.desktop()&&i("desktop"),t.cordova()&&i("cordova"),c=function(){t.landscape()?(s("portrait"),i("landscape")):(s("landscape"),i("portrait"))},l=Object.prototype.hasOwnProperty.call(window,"onorientationchange")?"orientationchange":"resize",window.addEventListener?window.addEventListener(l,c,!1):window.attachEvent?window.attachEvent(l,c):window[l]=c,c(),n.default=t}])});
//# sourceMappingURL=current-device.min.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc