Comparing version 3.0.3 to 3.0.4
@@ -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) { |
{ | ||
"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) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20196
207