@nxtedition/deepstream.io-client-js 24.2.6 → 24.2.8

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.6",
3
+ "version": "24.2.8",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -105,11 +105,12 @@ 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)
108
+ this._endpoint.onmessage = ({ data }) => this._onMessage(data.toString())
109
109
  } else {
110
110
  this._endpoint = new BrowserWebSocket(this._url)
111
111
  this._endpoint.binaryType = 'arraybuffer'
112
- this._endpoint.onmessage = ({ data }) => this._onMessage(Buffer.from(data))
112
+ const decoder = new TextDecoder()
113
+ this._endpoint.onmessage = ({ data }) => this._onMessage(decoder.decode(data))
113
114
  }
114
115
  this._corked = false
115
116