@nxtedition/deepstream.io-client-js 24.2.5 → 24.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "24.2.5",
3
+ "version": "24.2.7",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -105,18 +105,17 @@ Connection.prototype._createEndpoint = function () {
105
105
  this._endpoint = new NodeWebSocket(this._url, {
106
106
  generateMask() {},
107
107
  })
108
+ this._endpoint.onmessage = ({ data }) => this._onMessage(data.toString())
108
109
  } else {
109
110
  this._endpoint = new BrowserWebSocket(this._url)
110
111
  this._endpoint.binaryType = 'arraybuffer'
112
+ this._endpoint.onmessage = ({ data }) => this._onMessage(Buffer.from(data).toString())
111
113
  }
112
114
  this._corked = false
113
115
 
114
116
  this._endpoint.onopen = this._onOpen.bind(this)
115
117
  this._endpoint.onerror = this._onError.bind(this)
116
118
  this._endpoint.onclose = this._onClose.bind(this)
117
- this._endpoint.onmessage = BrowserWebSocket
118
- ? ({ data }) => this._onMessage(Buffer.from(data))
119
- : ({ data }) => this._onMessage(data)
120
119
  }
121
120
 
122
121
  Connection.prototype.send = function (message) {