UNPKG

detect-pointer

Version:

JavaScript wrapper for pointer and any-pointer media queries

20 lines (18 loc) 753 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var detectPointer = { update: function update() { if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') { detectPointer.fine = window.matchMedia('(pointer: fine)').matches; detectPointer.coarse = window.matchMedia('(pointer: coarse)').matches; detectPointer.none = window.matchMedia('(pointer: none)').matches; detectPointer.anyFine = window.matchMedia('(any-pointer: fine)').matches; detectPointer.anyCoarse = window.matchMedia('(any-pointer: coarse)').matches; detectPointer.anyNone = window.matchMedia('(any-pointer: none)').matches; } } }; detectPointer.update(); exports.default = detectPointer;