@@ -9,7 +9,7 @@ import { CommandOptions, commandOptions, isCommandOptions } from '../command-opt
9
9
import { ScanOptions , ZMember } from '../commands/generic-transformers' ;
10
10
import { ScanCommandOptions } from '../commands/SCAN' ;
11
11
import { HScanTuple } from '../commands/HSCAN' ;
12
- import { extendWithCommands , extendWithModulesAndScripts , LegacyCommandArguments , transformCommandArguments , transformCommandReply , transformLegacyCommandArguments } from '../commander' ;
12
+ import { extendWithCommands , extendWithModulesAndScripts , transformCommandArguments , transformCommandReply } from '../commander' ;
13
13
import { Pool , Options as PoolOptions , createPool } from 'generic-pool' ;
14
14
import { ClientClosedError , DisconnectsClientError , AuthError } from '../errors' ;
15
15
import { URL } from 'url' ;
@@ -83,7 +83,6 @@ export interface ClientCommandOptions extends QueueCommandOptions {
83
83
84
84
type ClientLegacyCallback = ( err : Error | null , reply ?: RedisCommandRawReply ) => void ;
85
85
86
- export type ClientLegacyCommandArguments = LegacyCommandArguments | [ ...LegacyCommandArguments , ClientLegacyCallback ] ;
87
86
export default class RedisClient < M extends RedisModules , S extends RedisScripts > extends EventEmitter {
88
87
static commandOptions < T extends ClientCommandOptions > ( options : T ) : CommandOptions < T > {
89
88
return commandOptions ( options ) ;
@@ -292,13 +291,13 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
292
291
if ( ! this . #options?. legacyMode ) return ;
293
292
294
293
( 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 => {
296
295
let callback : ClientLegacyCallback ;
297
296
if ( typeof args [ args . length - 1 ] === 'function' ) {
298
297
callback = args . pop ( ) as ClientLegacyCallback ;
299
298
}
300
299
301
- this . #sendCommand( transformLegacyCommandArguments ( args as LegacyCommandArguments ) )
300
+ this . #sendCommand( args . flat ( ) )
302
301
. then ( ( reply : RedisCommandRawReply ) => {
303
302
if ( ! callback ) return ;
304
303
0 commit comments