diff --git a/lib/client.ts b/lib/client.ts index 09a50452d1..92e82578d3 100644 --- a/lib/client.ts +++ b/lib/client.ts @@ -21,11 +21,7 @@ type WithModules> = { [P in keyof M[number]]: RedisCommandSignature; }; -type WithMulti> = { - multi(): RedisMultiCommandType -}; - -export type RedisClientType = WithCommands & WithModules & WithMulti & RedisClient; +export type RedisClientType = WithCommands & WithModules & RedisClient; export default class RedisClient extends EventEmitter { static defineCommand(on: any, name: string, command: RedisCommand): void { @@ -37,7 +33,7 @@ export default class RedisClient extends } static create(options?: RedisClientOptions): RedisClientType { - return new RedisClient(options); + return new RedisClient(options); } readonly #socket: RedisSocket; @@ -84,13 +80,14 @@ export default class RedisClient extends const executor = async (commands: Array): Promise> => { const promise = Promise.all( commands.map(({encodedCommand}) => { - return this.#queue.addEncodedCommand(encodedCommand); + return this.#queue.addEncodedCommand(encodedCommand); }) ); this.#tick(); - return promise; + const replies = await promise; + return (replies[replies.length - 1] as Array); }; const modules = this.#modules;