UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

21 lines (15 loc) 444 B
'use strict'; /*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ // src/matchMedia.ts function windowMatchMedia() { return typeof window !== "undefined" ? window.matchMedia || window.msMatchMedia : void 0; } // src/isMobile.ts function isMobile() { return typeof window !== "undefined" ? windowMatchMedia()?.("(pointer:coarse)")?.matches : false; } exports.isMobile = isMobile;