Merge pull request #267 from jasnell/patch-1

Replace new Buffer with Buffer.from
This commit is contained in:
Diego Rodríguez Baquero 2018-03-21 21:55:52 -05:00 committed by GitHub
commit 6ce0d51c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,7 +174,7 @@ function Server (opts) {
} }
var client = clients[peer.client.client] var client = clients[peer.client.client]
// If the client is not known show 8 chars from peerId as version // If the client is not known show 8 chars from peerId as version
var version = peer.client.version || new Buffer(peer.peerId, 'hex').toString().substring(0, 8) var version = peer.client.version || Buffer.from(peer.peerId, 'hex').toString().substring(0, 8)
if (!client[version]) { if (!client[version]) {
client[version] = 0 client[version] = 0
} }