mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 02:21:36 +00:00
use native Set instead of uniq library
This commit is contained in:
parent
7ec91ebecc
commit
0c459aff78
@ -3,7 +3,6 @@ const EventEmitter = require('events')
|
||||
const once = require('once')
|
||||
const parallel = require('run-parallel')
|
||||
const Peer = require('simple-peer')
|
||||
const uniq = require('uniq')
|
||||
|
||||
const common = require('./lib/common')
|
||||
const HTTPTracker = require('./lib/client/http-tracker') // empty object in browser
|
||||
@ -71,7 +70,8 @@ class Client extends EventEmitter {
|
||||
}
|
||||
return announceUrl
|
||||
})
|
||||
announce = uniq(announce)
|
||||
// remove duplicates by converting to Set and back
|
||||
announce = Array.from(new Set(announce))
|
||||
|
||||
const webrtcSupport = this._wrtc !== false && (!!this._wrtc || Peer.WEBRTC_SUPPORT)
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
"simple-peer": "^9.0.0",
|
||||
"simple-websocket": "^8.0.0",
|
||||
"string2compact": "^1.1.1",
|
||||
"uniq": "^1.0.1",
|
||||
"unordered-array-remove": "^1.0.2",
|
||||
"ws": "^7.0.0"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user