@subiz/wsclient 3.1.5 → 3.1.6

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 +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/wsclient",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "node realtime.test.js"
package/realtime.js CHANGED
@@ -120,7 +120,6 @@ function Conn(apiUrl, credential, onDead, onEvents, callAPI) {
120
120
  // + auto recreate and resub if the last conn is dead
121
121
  // + don't subscribe already subscribed events
122
122
  function Realtime(apiUrls, credential, callAPI) {
123
- console.log('FUCK', apiUrls, '|', credential)
124
123
  if (typeof apiUrls === 'string' || apiUrls instanceof String) apiUrls = [apiUrls]
125
124
  credential = credential || {}
126
125
  if (!credential.getAccessToken) {
@@ -212,11 +211,11 @@ var dofetch = function(method, url, body, cb) {
212
211
  if (body) headers['content-type'] = 'text/plain'
213
212
  fetch(url, {
214
213
  method: method,
215
- headers: header,
214
+ headers: headers,
216
215
  body: body,
217
216
  })
218
217
  .then((res) => res.text().then((text) => cb && cb(text, res.status)))
219
- .catch((err) => cb(err, -1))
218
+ .catch((err) => cb && cb(err, -1))
220
219
  }
221
220
  // xhrsend sends an HTTP request
222
221
  var xhrsend = function(method, url, body, cb) {