Socket
Socket
Sign inDemoInstall

detect-it

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-it - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

6

lib/index.js

@@ -112,4 +112,8 @@ 'use strict';

// then assume it's a hybrid with primaryInput mouse
// note that version 62 of Chrome fixes this issue
// see https://github.com/rafrex/detect-it/issues/8
var isAffectedWindowsChromeVersion = /windows/.test(window.navigator.userAgent.toLowerCase()) && /chrome/.test(window.navigator.userAgent.toLowerCase()) && parseInt(/Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1], 10) >= 59;
var inVersionRange = function inVersionRange(version) {
return version >= 59 && version < 62;
};
var isAffectedWindowsChromeVersion = /windows/.test(window.navigator.userAgent.toLowerCase()) && /chrome/.test(window.navigator.userAgent.toLowerCase()) && inVersionRange(parseInt(/Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1], 10));

@@ -116,0 +120,0 @@ if (isAffectedWindowsChromeVersion && detectIt.hasTouch) {

4

package.json
{
"name": "detect-it",
"version": "3.0.3",
"version": "3.0.4",
"description": "Detect if a device is mouse only, touch only, or hybrid",

@@ -42,3 +42,3 @@ "main": "lib/index.js",

"babel-eslint": "^7.2.3",
"babel-preset-env": "^1.4.0",
"babel-preset-env": "^1.6.1",
"eslint": "^3.19.0",

@@ -45,0 +45,0 @@ "eslint-config-airbnb-base": "^11.1.3",

@@ -95,7 +95,9 @@ import detectHover from 'detect-hover';

// then assume it's a hybrid with primaryInput mouse
// note that version 62 of Chrome fixes this issue
// see https://github.com/rafrex/detect-it/issues/8
const inVersionRange = version => version >= 59 && version < 62;
const isAffectedWindowsChromeVersion =
/windows/.test(window.navigator.userAgent.toLowerCase()) &&
/chrome/.test(window.navigator.userAgent.toLowerCase()) &&
parseInt(/Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1], 10) >= 59;
inVersionRange(parseInt(/Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1], 10));

@@ -102,0 +104,0 @@ if (isAffectedWindowsChromeVersion && detectIt.hasTouch) {

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