UNPKG

data-transport

Version:
18 lines (15 loc) 402 B
type GlobalThis = typeof globalThis; const getGlobal = () => { let _global: GlobalThis; if (typeof window !== 'undefined') { _global = window; } else if (typeof global !== 'undefined') { _global = global as GlobalThis; } else if (typeof self !== 'undefined') { _global = self; } else { _global = {} as GlobalThis; } return _global; }; export const global = getGlobal();