UNPKG

vuestic-ui

Version:
1 lines 1.01 kB
{"version":3,"file":"ssr.mjs","sources":["../../../../src/utils/ssr.ts"],"sourcesContent":["export const isServer = () => typeof window === 'undefined'\nexport const isClient = () => !isServer()\nexport const getWindow = (): Window | undefined => typeof window === 'undefined' ? undefined : window\nexport const getDocument = (): Document | undefined => typeof document === 'undefined' ? undefined : document\n\nconst fakeGlobal = {}\n/** @deprecated why can't we just use some local object instead? */\nexport const getGlobal = () => {\n if (isServer()) {\n if (typeof globalThis === 'undefined') {\n return fakeGlobal as Window\n }\n return globalThis as any as Window\n } else {\n return window\n }\n}\n"],"names":[],"mappings":"AAAa,MAAA,WAAW,MAAM,OAAO,WAAW;AACnC,MAAA,WAAW,MAAM,CAAC,SAAS;AACjC,MAAM,YAAY,MAA0B,OAAO,WAAW,cAAc,SAAY;AAG/F,MAAM,aAAa,CAAA;AAEZ,MAAM,YAAY,MAAM;AAC7B,MAAI,YAAY;AACV,QAAA,OAAO,eAAe,aAAa;AAC9B,aAAA;AAAA,IACT;AACO,WAAA;AAAA,EAAA,OACF;AACE,WAAA;AAAA,EACT;AACF;"}