Skip to content

Commit 77d5043

Browse files
committed
Update detect-it to v4
1 parent 3619860 commit 77d5043

3 files changed

Lines changed: 18 additions & 36 deletions

File tree

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@
5555
"webpack": "^3.6.0"
5656
},
5757
"dependencies": {
58-
"detect-it": "^3.0.6",
58+
"detect-it": "^4.0.0",
5959
"object-assign": "^4.1.1",
6060
"prop-types": "^15.6.0"
61+
},
62+
"prettier": {
63+
"singleQuote": true,
64+
"trailingComma": "all"
6165
}
6266
}

src/constants.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import detectIt from 'detect-it';
2-
3-
export const deviceType = detectIt.deviceType;
4-
export const deviceHasTouch = detectIt.hasTouch;
5-
export const deviceHasMouse = detectIt.hasMouse;
6-
export const passiveEventSupport = detectIt.passiveEvents;
1+
import {
2+
deviceType as detectItDeviceType,
3+
supportsPassiveEvents,
4+
} from 'detect-it';
5+
6+
export const deviceType = detectItDeviceType;
7+
export const deviceHasTouch = detectItDeviceType !== 'mouseOnly';
8+
export const deviceHasMouse = detectItDeviceType !== 'touchOnly';
9+
export const passiveEventSupport = supportsPassiveEvents;
710

811
export const mouseEvents = {
912
mouseenter: 'onMouseEnter',

yarn.lock

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,41 +1400,16 @@ des.js@^1.0.0:
14001400
inherits "^2.0.1"
14011401
minimalistic-assert "^1.0.0"
14021402

1403-
detect-hover@^1.0.3:
1404-
version "1.0.3"
1405-
resolved "https://registry.yarnpkg.com/detect-hover/-/detect-hover-1.0.3.tgz#7392507cbced1bedc9f129a56b197c1eef9076c3"
1406-
integrity sha512-HtLoY+tClgYucJNiovNICGWFp9nOGVmHY44s7L62iPqORXM9vujeWFaVcqtA7XRvp/2Y+4RBUfHbDKFGN+xxZQ==
1407-
14081403
detect-indent@^4.0.0:
14091404
version "4.0.0"
14101405
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
14111406
dependencies:
14121407
repeating "^2.0.0"
14131408

1414-
detect-it@^3.0.6:
1415-
version "3.0.6"
1416-
resolved "https://registry.yarnpkg.com/detect-it/-/detect-it-3.0.6.tgz#26b1f08d77949effe144f78dd311d4b2f7e688b1"
1417-
integrity sha512-gn+qb1wAejvBGT/07bNC9T8KWVDYSqCXgFaVtPygzCyLK4L53o3b7ZtMTUPGCscT03R2IjXsOVGtzjf6a/8y7w==
1418-
dependencies:
1419-
detect-hover "^1.0.3"
1420-
detect-passive-events "^1.0.5"
1421-
detect-pointer "^1.0.3"
1422-
detect-touch-events "^2.0.2"
1423-
1424-
detect-passive-events@^1.0.5:
1425-
version "1.0.5"
1426-
resolved "https://registry.yarnpkg.com/detect-passive-events/-/detect-passive-events-1.0.5.tgz#ce324db665123bef9e368b8059ff95d95217cc05"
1427-
integrity sha512-foW7Q35wwOCxVzW0xLf5XeB5Fhe7oyRgvkBYdiP9IWgLMzjqUqTvsJv9ymuEWGjY6AoDXD3OC294+Z9iuOw0QA==
1428-
1429-
detect-pointer@^1.0.3:
1430-
version "1.0.3"
1431-
resolved "https://registry.yarnpkg.com/detect-pointer/-/detect-pointer-1.0.3.tgz#27d86d0837951e6c5a0785c8a7fddd9cf5754e08"
1432-
integrity sha512-d0o/Puo3fiGSCXy6H039h9Kwz+mmYCGKZ/qtPFnpN3WfsumjC1C9b5KKvRu+aYnfdI8peqN/iAe7dPd85qIt2g==
1433-
1434-
detect-touch-events@^2.0.2:
1435-
version "2.0.2"
1436-
resolved "https://registry.yarnpkg.com/detect-touch-events/-/detect-touch-events-2.0.2.tgz#541cc49b05ca544726a3bf2802c5b23e53aeeebb"
1437-
integrity sha512-g8GWBkJLiIDRJfRXEdrd1wMXpNyGId2DkbfuwFahSb4OCvn717hyRJtAcEDISfp3zkwEhZ4Y4woHPA6DeyB3Fw==
1409+
detect-it@^4.0.0:
1410+
version "4.0.0"
1411+
resolved "https://registry.yarnpkg.com/detect-it/-/detect-it-4.0.0.tgz#55980a58f69d799086ff7afddc30b8c1005c9739"
1412+
integrity sha512-JyzLcGWYHIHFfJAEkzLTqm+cyq6hIHn0H8TA1mbvJKMbIFabjwzfZN2b7GSFlvoMXTgC4oYKLOtBxohGOsuLFQ==
14381413

14391414
diffie-hellman@^5.0.0:
14401415
version "5.0.2"

0 commit comments

Comments
 (0)