atriusmaps-node-sdk
Version:
This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information
2 lines (1 loc) • 532 B
JavaScript
function i(i){const o=i.config.desktopViewMinWidth||0,e="undefined"!=typeof window,s=e&&("ontouchstart"in window||navigator.maxTouchPoints>0),t=()=>e&&innerWidth<o,n=()=>t(),r={isBrowser:e,isMobile:n,isMobileReflow:()=>n()&&innerHeight<300,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>e&&!t(),supportsTouch:s};return e&&window.addEventListener("resize",(()=>{i.bus.send("env/resize",{isMobile:r.isMobile(),isMobileReflow:r.isMobileReflow()})})),r}export{i as buildEnv};