favycon/utils/device.ts
Rui Saraiva 785563a71c
feat: upgrade dependencies (#480)
* feat: upgrade dependencies

* chore: update linter and CI workflows

* chore: upgrade browserslist
2021-12-04 18:32:53 +00:00

14 lines
317 B
TypeScript

export const isTouchCapable = () => {
if (typeof window === 'undefined') {
return false
}
return (
'ontouchstart' in window ||
// @ts-ignore
(window.DocumentTouch && document instanceof window.DocumentTouch) ||
navigator.maxTouchPoints > 0 ||
// @ts-ignore
window.navigator.msMaxTouchPoints > 0
)
}