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.7.0 to 0.7.1

2

es/index.js

@@ -9,3 +9,3 @@ 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; };

var device, previousDevice, addClass, documentElement, find, handleOrientation, hasClass, orientationEvent, removeClass, userAgent, changeOrientationList;
var device, previousDevice, addClass, documentElement, find, handleOrientation, hasClass, orientationEvent, removeClass, userAgent, changeOrientationList, walkOnChangeOrientationList;

@@ -12,0 +12,0 @@ // Save the previous value of the device variable.

@@ -13,3 +13,3 @@ 'use strict';

var device, previousDevice, addClass, documentElement, find, handleOrientation, hasClass, orientationEvent, removeClass, userAgent, changeOrientationList;
var device, previousDevice, addClass, documentElement, find, handleOrientation, hasClass, orientationEvent, removeClass, userAgent, changeOrientationList, walkOnChangeOrientationList;

@@ -16,0 +16,0 @@ // Save the previous value of the device variable.

{
"name": "current-device",
"version": "0.7.0",
"version": "0.7.1",
"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.3 - https://github.com/matthewhudson/current-device
* current-device v0.7.1 - https://github.com/matthewhudson/current-device
* MIT Licensed

@@ -101,3 +101,3 @@ */

var device, previousDevice, addClass, documentElement, find, handleOrientation, hasClass, orientationEvent, removeClass, userAgent, changeOrientationList;
var device, previousDevice, addClass, documentElement, find, handleOrientation, hasClass, orientationEvent, removeClass, userAgent, changeOrientationList, walkOnChangeOrientationList;

@@ -104,0 +104,0 @@ // Save the previous value of the device variable.

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