All files / src/events utils.ts

100% Statements 10/10
100% Branches 6/6
100% Functions 3/3
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 1034x     34x 421x 34x 389x 34x 373x  
import { isBrowser } from "../utils/is-browser"
 
// We check for event support via functions in case they've been mocked by a testing suite.
export const supportsPointerEvents = () =>
    isBrowser && window.onpointerdown === null
export const supportsTouchEvents = () =>
    isBrowser && window.ontouchstart === null
export const supportsMouseEvents = () =>
    isBrowser && window.onmousedown === null