UNPKG

@resk/core

Version:

An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla

1 lines 2.13 kB
'use strict';function t(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}const n=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(o){}return false},i=()=>{var e,o;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((o=process.versions)!=null&&o.electron)||typeof navigator=="object"&&navigator&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},s=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(o){}}return false},a=()=>typeof window=="undefined"&&typeof process!="undefined",r=()=>typeof window!="undefined"&&typeof window=="object",c=()=>{if(!t()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;const e=navigator.userAgent.toLowerCase();return /android|webos|iphone|blackberry|iemobile|opera mini/i.test(e)},u=()=>{if(!t()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;const e=navigator.userAgent.toLowerCase();return /android/i.test(e)},f=()=>{var e;return !r()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},d=()=>n()&&process.platform==="darwin",l=()=>n()&&process.platform==="win32",b=()=>n()&&process.platform==="linux";var v={isWeb:t,isLinux:b,isDarwin:d,isWin32:l,isNode:n,isElectron:i,isTouchDevice:s,isServerSide:a,isClientSide:r,isMobileBrowser:c,isAndroidMobileBrowser:u,isReactNativeWebview:f};module.exports=v;