@xuxinlai2002/pns-js
Version:
A NPM package in Typescript for .Play Name Service
12 lines (8 loc) • 329 B
text/typescript
function getGlobal(): any {
if (typeof self !== 'undefined') { return self; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
throw new Error('unable to locate global object');
};
const _WebSocket = getGlobal().WebSocket;
export { _WebSocket as WebSocket };