reconnecting-websocket
Advanced tools
Comparing version 1.4.3 to 1.4.4
"use strict"; | ||
var isWebSocket = function (constructor) { | ||
return constructor | ||
&& constructor.prototype | ||
&& constructor.prototype.CLOSING === 2; | ||
return constructor && constructor.CLOSING === 2; | ||
}; | ||
var isGlobalWebSocket = function () { | ||
return typeof WebSocket !== 'undefined' | ||
&& isWebSocket(WebSocket); | ||
return typeof WebSocket !== 'undefined' && isWebSocket(WebSocket); | ||
}; | ||
@@ -68,3 +65,3 @@ var getDefaultOptions = function () { return ({ | ||
if (!isWebSocket(config.constructor)) { | ||
throw new TypeError('WebSocket constructor not set. Set `options.constructor`'); | ||
throw new TypeError('Invalid WebSocket constructor. Set `options.constructor`'); | ||
} | ||
@@ -71,0 +68,0 @@ var log = config.debug ? function () { |
@@ -12,9 +12,6 @@ type Options = { | ||
const isWebSocket = constructor => | ||
constructor | ||
&& constructor.prototype | ||
&& constructor.prototype.CLOSING === 2; | ||
constructor && constructor.CLOSING === 2; | ||
const isGlobalWebSocket = () => | ||
typeof WebSocket !== 'undefined' | ||
&& isWebSocket(WebSocket); | ||
typeof WebSocket !== 'undefined' && isWebSocket(WebSocket); | ||
@@ -87,3 +84,3 @@ const getDefaultOptions = () => <Options>({ | ||
if (!isWebSocket(config.constructor)) { | ||
throw new TypeError('WebSocket constructor not set. Set `options.constructor`'); | ||
throw new TypeError('Invalid WebSocket constructor. Set `options.constructor`'); | ||
} | ||
@@ -90,0 +87,0 @@ |
{ | ||
"name": "reconnecting-websocket", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "Reconnecting WebSocket", | ||
@@ -29,3 +29,3 @@ "main": "build/index.js", | ||
"ava": "^0.15.2", | ||
"html5-websocket": "^0.7.0", | ||
"html5-websocket": "^1.0.0", | ||
"nyc": "^6.6.1", | ||
@@ -32,0 +32,0 @@ "opn-cli": "^3.1.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70867
767