From 42501c658e98f69cdb1194d5222b003c6cfc0967 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Wed, 11 Oct 2017 07:33:55 +0200 Subject: [PATCH] [revert] [refactor] Remove usuless indexof dependency (#582) This reverts commit 6043c49e91edd402da0a344ccadf3a3e9624628f. --- lib/socket.js | 3 ++- package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/socket.js b/lib/socket.js index 269ef74c2..d2eb44cda 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -5,6 +5,7 @@ var transports = require('./transports/index'); var Emitter = require('component-emitter'); var debug = require('debug')('engine.io-client:socket'); +var index = require('indexof'); var parser = require('engine.io-parser'); var parseuri = require('parseuri'); var parseqs = require('parseqs'); @@ -736,7 +737,7 @@ Socket.prototype.onClose = function (reason, desc) { Socket.prototype.filterUpgrades = function (upgrades) { var filteredUpgrades = []; for (var i = 0, j = upgrades.length; i < j; i++) { - if (~this.transports.indexOf(upgrades[i])) filteredUpgrades.push(upgrades[i]); + if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]); } return filteredUpgrades; }; diff --git a/package.json b/package.json index 6bdb69775..ea37c0f80 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "debug": "~2.6.9", "engine.io-parser": "~2.1.1", "has-cors": "1.1.0", + "indexof": "0.0.1", "parseqs": "0.0.5", "parseuri": "0.0.5", "ws": "~2.3.1",