You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Flatten array arguments in legacyMode multi commands (#2064)
This commit is contained in:
@@ -294,6 +294,20 @@ describe('Client', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testUtils.testWithClient('client.multi.{command}.exec should flatten array arguments', async client => {
|
||||||
|
assert.deepEqual(
|
||||||
|
await client.multi()
|
||||||
|
.sAdd('a', ['b', 'c'])
|
||||||
|
.v4.exec(),
|
||||||
|
[2])
|
||||||
|
}, {
|
||||||
|
...GLOBAL.SERVERS.OPEN,
|
||||||
|
clientOptions: {
|
||||||
|
legacyMode: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('events', () => {
|
describe('events', () => {
|
||||||
|
@@ -87,7 +87,7 @@ export default class RedisClientMultiCommand {
|
|||||||
#defineLegacyCommand(name: string): void {
|
#defineLegacyCommand(name: string): void {
|
||||||
this.v4[name] = (this as any)[name].bind(this.v4);
|
this.v4[name] = (this as any)[name].bind(this.v4);
|
||||||
(this as any)[name] =
|
(this as any)[name] =
|
||||||
(...args: Array<unknown>): void => (this as any).addCommand(name, args);
|
(...args: Array<unknown>): void => (this as any).addCommand(name, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
commandsExecutor(command: RedisCommand, args: Array<unknown>): this {
|
commandsExecutor(command: RedisCommand, args: Array<unknown>): this {
|
||||||
|
Reference in New Issue
Block a user