src: Replace instanceof Array checks with Array.isArray and instanceof Buffer with Buffer.isBuffer (#3227)

* src: Replace instanceof Array checks with Array.isArray

* src: Buffer.isBuffer instead of instanceof Buffer
This commit is contained in:
Vlad Frangu
2019-04-29 19:49:41 +03:00
committed by Amish Shah
parent 9b0f4b298d
commit d7a9b74523
11 changed files with 26 additions and 25 deletions

View File

@@ -160,8 +160,9 @@ class WebSocketManager extends EventEmitter {
}
}
if (this.client.options.shards instanceof Array) {
const { shards } = this.client.options;
const { shards } = this.client.options;
if (Array.isArray(shards)) {
this.totalShards = shards.length;
this.debug(`Spawning shards: ${shards.join(', ')}`);
this.shardQueue = new Set(shards.map(id => new WebSocketShard(this, id)));