diff --git a/benchmark/index.js b/benchmark/index.js index 49f1d5dc4a..f150c79f28 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -1,3 +1,5 @@ +'use strict'; + const cronometro = require('cronometro'), newRedis = require('redis-new'), oldRedis = require('redis-old'); diff --git a/lib/commands-queue.ts b/lib/commands-queue.ts index 2a5e822336..f81c7f3648 100644 --- a/lib/commands-queue.ts +++ b/lib/commands-queue.ts @@ -6,12 +6,12 @@ import { RedisReply } from './commands'; export interface QueueCommandOptions { asap?: boolean; signal?: AbortSignal; - chainId?: Symbol; + chainId?: symbol; } interface CommandWaitingToBeSent extends CommandWaitingForReply { encodedCommand: string; - chainId?: Symbol; + chainId?: symbol; abort?: { signal: AbortSignal; listener(): void; @@ -119,7 +119,7 @@ export default class RedisCommandsQueue { returnError: (err: Error) => this.#shiftWaitingForReply().reject(err) }); - #chainInExecution: Symbol | undefined; + #chainInExecution: symbol | undefined; constructor(maxLength: number | null | undefined, executor: CommandsQueueExecutor) { this.#maxLength = maxLength; @@ -293,7 +293,7 @@ export default class RedisCommandsQueue { const encoded: Array = []; let size = 0, - lastCommandChainId: Symbol | undefined; + lastCommandChainId: symbol | undefined; for (const command of this.#waitingToBeSent) { encoded.push(command.encodedCommand); size += command.encodedCommand.length; diff --git a/lib/commands/ACL_LOG.ts b/lib/commands/ACL_LOG.ts index ba3cddf0e8..ed0590b578 100644 --- a/lib/commands/ACL_LOG.ts +++ b/lib/commands/ACL_LOG.ts @@ -31,7 +31,7 @@ interface AclLog { context: string; object: string; username: string; - ageSeconds: Number; + ageSeconds: number; clientInfo: string; } diff --git a/lib/commands/CLUSTER_NODES.spec.ts b/lib/commands/CLUSTER_NODES.spec.ts index b577b631fe..1f0e9dd425 100644 --- a/lib/commands/CLUSTER_NODES.spec.ts +++ b/lib/commands/CLUSTER_NODES.spec.ts @@ -95,8 +95,6 @@ describe('CLUSTER NODES', () => { }); itWithCluster(TestRedisClusters.OPEN, 'cluster.clusterNodes', async cluster => { - const nodes = await cluster.clusterNodes(); - for (const node of (await cluster.clusterNodes())) { assert.equal(typeof node.id, 'string'); assert.equal(typeof node.url, 'string'); diff --git a/lib/commands/SET.spec.ts b/lib/commands/SET.spec.ts index 8515950fd3..5ddb97989f 100644 --- a/lib/commands/SET.spec.ts +++ b/lib/commands/SET.spec.ts @@ -81,7 +81,7 @@ describe('SET', () => { it('with GET', () => { assert.deepEqual( transformArguments('key', 'value', { - GET: 1 + GET: true }), ['SET', 'key', 'value', 'GET'] ); diff --git a/lib/commands/XINFO_STREAM.spec.ts b/lib/commands/XINFO_STREAM.spec.ts index 76db1b647e..ecab605e4e 100644 --- a/lib/commands/XINFO_STREAM.spec.ts +++ b/lib/commands/XINFO_STREAM.spec.ts @@ -1,5 +1,4 @@ import { strict as assert } from 'assert'; -import { triggerAsyncId } from 'async_hooks'; import { TestRedisServers, itWithClient } from '../test-utils'; import { transformArguments, transformReply } from './XINFO_STREAM'; diff --git a/lib/commands/XPENDING_RANGE.ts b/lib/commands/XPENDING_RANGE.ts index f76da6e8dd..c9e8d898e8 100644 --- a/lib/commands/XPENDING_RANGE.ts +++ b/lib/commands/XPENDING_RANGE.ts @@ -32,11 +32,4 @@ export function transformArguments( return args; } -interface XPendingReply { - messageId: string; - owner: string; - msSinceLastDelivery: number; - deliveriesCounter: number; -} - export const transformReply = transformReplyStreamMessages; diff --git a/lib/multi-command.ts b/lib/multi-command.ts index 8644c81cd9..1454cd22de 100644 --- a/lib/multi-command.ts +++ b/lib/multi-command.ts @@ -25,7 +25,7 @@ export interface MultiQueuedCommand { transformReply?: RedisCommand['transformReply']; } -export type RedisMultiExecutor = (queue: Array, chainId?: Symbol) => Promise>; +export type RedisMultiExecutor = (queue: Array, chainId?: symbol) => Promise>; export default class RedisMultiCommand { static defineCommand(on: any, name: string, command: RedisCommand): void { diff --git a/lib/test-utils.ts b/lib/test-utils.ts index 9da6509ff7..0ad10ea0a5 100644 --- a/lib/test-utils.ts +++ b/lib/test-utils.ts @@ -217,11 +217,9 @@ export async function spawnRedisCluster(type: TestRedisClusters | null, numberOf export async function spawnGlobalRedisCluster(type: TestRedisClusters | null, numberOfNodes: number, args?: Array): Promise> { const results = await spawnRedisCluster(type, numberOfNodes, args); - after(() => { - for (const { cleanup } of results) { - cleanup(); - } - }); + after(() => Promise.all( + results.map(({ cleanup }) => cleanup()) + )); return results.map(({ port }) => port); }