global-object.js 231 Bytes EditWeb IDE 1 2 3 4 5 6 7 export default function retrieveGlobalObject() { if (typeof window !== 'undefined') { return window; } return typeof process === 'object' && typeof require === 'function' && typeof global === 'object' ? global : this; }