@subiz/wsclient 3.1.6 → 3.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/realtime.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/wsclient",
3
- "version": "3.1.6",
3
+ "version": "3.1.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "node realtime.test.js"
package/realtime.js CHANGED
@@ -219,7 +219,7 @@ var dofetch = function(method, url, body, cb) {
219
219
  }
220
220
  // xhrsend sends an HTTP request
221
221
  var xhrsend = function(method, url, body, cb) {
222
- if (!XMLHttpRequest) return dofetch(method, url, body, cb)
222
+ if (typeof XMLHttpRequest === 'undefined') return dofetch(method, url, body, cb)
223
223
  var request = new XMLHttpRequest()
224
224
  request.onreadystatechange = function(e) {
225
225
  if (request.readyState !== 4) return