Skip to content

Commit 0c459af

Browse files
committed
use native Set instead of uniq library
1 parent 7ec91eb commit 0c459af

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const EventEmitter = require('events')
33
const once = require('once')
44
const parallel = require('run-parallel')
55
const Peer = require('simple-peer')
6-
const uniq = require('uniq')
76

87
const common = require('./lib/common')
98
const HTTPTracker = require('./lib/client/http-tracker') // empty object in browser
@@ -71,7 +70,8 @@ class Client extends EventEmitter {
7170
}
7271
return announceUrl
7372
})
74-
announce = uniq(announce)
73+
// remove duplicates by converting to Set and back
74+
announce = Array.from(new Set(announce))
7575

7676
const webrtcSupport = this._wrtc !== false && (!!this._wrtc || Peer.WEBRTC_SUPPORT)
7777

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"simple-peer": "^9.0.0",
4343
"simple-websocket": "^8.0.0",
4444
"string2compact": "^1.1.1",
45-
"uniq": "^1.0.1",
4645
"unordered-array-remove": "^1.0.2",
4746
"ws": "^7.0.0"
4847
},

0 commit comments

Comments
 (0)