ethers.js/packages/providers/lib.esm/browser-ws.js

14 lines
397 B
JavaScript
Raw Normal View History

2020-03-12 21:14:50 +03:00
"use strict";
import { Logger } from "@ethersproject/logger";
import { version } from "./_version";
let WS = WebSocket;
if (WS == null) {
const logger = new Logger(version);
WS = function () {
logger.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new WebSocket()"
});
};
}
module.exports = WS;