UNPKG

@thi.ng/checks

Version:
9 lines (8 loc) 302 B
/** * On Firefox `TouchEvent` is undefined if the hardware doesn't support touch. * Therefore this predicate checks for that first before verifying if `e` is * indeed a `TouchEvent`. * * @param e */ export const isTouchEvent = (e) => typeof TouchEvent !== "undefined" && e instanceof TouchEvent;