diff --git a/lib/socket.js b/lib/socket.js index c7e4d91c4..953e34c1a 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -9,7 +9,6 @@ var toArray = require('to-array'); var on = require('./on'); var bind = require('component-bind'); var debug = require('debug')('socket.io-client:socket'); -var hasBin = require('has-binary'); /** * Module exports. @@ -138,9 +137,7 @@ Socket.prototype.emit = function (ev) { } var args = toArray(arguments); - var parserType = parser.EVENT; // default - if (hasBin(args)) { parserType = parser.BINARY_EVENT; } // binary - var packet = { type: parserType, data: args }; + var packet = { type: parser.EVENT, data: args }; packet.options = {}; packet.options.compress = !this.flags || false !== this.flags.compress; @@ -289,9 +286,8 @@ Socket.prototype.ack = function (id) { var args = toArray(arguments); debug('sending ack %j', args); - var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK; self.packet({ - type: type, + type: parser.ACK, id: id, data: args }); diff --git a/package.json b/package.json index 33b6a154b..efbfb5a50 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,11 @@ "component-emitter": "1.2.1", "debug": "2.3.3", "engine.io-client": "2.0.2", - "has-binary": "0.1.7", "has-cors": "1.1.0", "indexof": "0.0.1", "object-component": "0.0.3", "parseuri": "0.0.5", - "socket.io-parser": "2.3.2", + "socket.io-parser": "~3.1.1", "to-array": "0.1.4" }, "devDependencies": {