UNPKG

svelte-motion

Version:

Svelte animation library based on the React library framer-motion.

19 lines (16 loc) 503 B
/** based on framer-motion@4.0.3, Copyright (c) 2018 Framer B.V. */ function isMouseEvent(event) { // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { return !!(event.pointerType === "mouse"); } return event instanceof MouseEvent; } function isTouchEvent(event) { var hasTouches = !!event.touches; return hasTouches; } export { isMouseEvent, isTouchEvent };