UNPKG

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) 597 B
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<360,isVeryNarrow:()=>n()&&innerWidth<320,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(),isVeryNarrow:r.isVeryNarrow()})}),r}export{i as buildEnv};