UNPKG

mock-socket-with-protocol

Version:

Javascript mocking library for websockets and socket.io, compatible with apollographql subscriptions-transport-ws

8 lines (6 loc) 231 B
export default function retrieveGlobalObject() { if (typeof window !== 'undefined') { return window; } return typeof process === 'object' && typeof require === 'function' && typeof global === 'object' ? global : this; }