Skip to content

Commit

Permalink
refactor: remove indexof dependency
Browse files Browse the repository at this point in the history
This is a polyfill for indexOf(), which we use literally everywhere else.
  • Loading branch information
FauxFaux authored and darrachequesne committed Apr 16, 2020
1 parent 804e871 commit 27fa694
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/socket.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const transports = require("./transports/index");
const Emitter = require("component-emitter");
const debug = require("debug")("engine.io-client:socket");
const index = require("indexof");
const parser = require("engine.io-parser");
const parseuri = require("parseuri");
const parseqs = require("parseqs");
Expand Down Expand Up @@ -643,7 +642,7 @@ class Socket extends Emitter {
let i = 0;
const j = upgrades.length;
for (; i < j; i++) {
if (~index(this.transports, upgrades[i]))
if (~this.transports.indexOf(upgrades[i]))
filteredUpgrades.push(upgrades[i]);
}
return filteredUpgrades;
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"debug": "~4.1.0",
"engine.io-parser": "~4.0.0-alpha.0",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
"ws": "~7.2.1",
Expand Down

0 comments on commit 27fa694

Please sign in to comment.