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

15 lines
494 B
JavaScript
Raw Normal View History

2020-03-12 21:14:50 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("@ethersproject/logger");
var _version_1 = require("./_version");
var WS = WebSocket;
if (WS == null) {
var logger_2 = new logger_1.Logger(_version_1.version);
WS = function () {
logger_2.throwError("WebSockets not supported in this environment", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
operation: "new WebSocket()"
});
};
}
module.exports = WS;