@@ -9,7 +9,7 @@ import { CommandOptions, commandOptions, isCommandOptions } from '../command-opt
99import { ScanOptions , ZMember } from '../commands/generic-transformers' ;
1010import { ScanCommandOptions } from '../commands/SCAN' ;
1111import { HScanTuple } from '../commands/HSCAN' ;
12- import { extendWithCommands , extendWithModulesAndScripts , LegacyCommandArguments , transformCommandArguments , transformCommandReply , transformLegacyCommandArguments } from '../commander' ;
12+ import { extendWithCommands , extendWithModulesAndScripts , transformCommandArguments , transformCommandReply } from '../commander' ;
1313import { Pool , Options as PoolOptions , createPool } from 'generic-pool' ;
1414import { ClientClosedError , DisconnectsClientError , AuthError } from '../errors' ;
1515import { URL } from 'url' ;
@@ -83,7 +83,6 @@ export interface ClientCommandOptions extends QueueCommandOptions {
8383
8484type ClientLegacyCallback = ( err : Error | null , reply ?: RedisCommandRawReply ) => void ;
8585
86- export type ClientLegacyCommandArguments = LegacyCommandArguments | [ ...LegacyCommandArguments , ClientLegacyCallback ] ;
8786export default class RedisClient < M extends RedisModules , S extends RedisScripts > extends EventEmitter {
8887 static commandOptions < T extends ClientCommandOptions > ( options : T ) : CommandOptions < T > {
8988 return commandOptions ( options ) ;
@@ -292,13 +291,13 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
292291 if ( ! this . #options?. legacyMode ) return ;
293292
294293 ( this as any ) . #v4. sendCommand = this . #sendCommand. bind ( this ) ;
295- ( this as any ) . sendCommand = ( ...args : ClientLegacyCommandArguments ) : void => {
294+ ( this as any ) . sendCommand = ( ...args : Array < any > ) : void => {
296295 let callback : ClientLegacyCallback ;
297296 if ( typeof args [ args . length - 1 ] === 'function' ) {
298297 callback = args . pop ( ) as ClientLegacyCallback ;
299298 }
300299
301- this . #sendCommand( transformLegacyCommandArguments ( args as LegacyCommandArguments ) )
300+ this . #sendCommand( args . flat ( ) )
302301 . then ( ( reply : RedisCommandRawReply ) => {
303302 if ( ! callback ) return ;
304303
0 commit comments