1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

ref #1765 - support lowercase command names in legacy mode

This commit is contained in:
leibale
2021-12-07 01:31:18 -05:00
parent 88f55a48cd
commit 12173e1cd7
2 changed files with 4 additions and 4 deletions

View File

@@ -303,9 +303,8 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
#defineLegacyCommand(name: string): void {
(this as any).#v4[name] = (this as any)[name].bind(this);
(this as any)[name] = (...args: Array<unknown>): void => {
(this as any).sendCommand(name, ...args);
};
(this as any)[name] = (this as any)[name.toLowerCase()] =
(...args: Array<unknown>): void => (this as any).sendCommand(name, ...args);
}
duplicate(overrides?: Partial<RedisClientOptions<M, S>>): RedisClientType<M, S> {

View File

@@ -81,7 +81,8 @@ export default class RedisClientMultiCommand {
#defineLegacyCommand(name: string): void {
(this as any).v4[name] = (this as any)[name].bind(this.v4);
(this as any)[name] = (...args: Array<unknown>): void => (this as any).addCommand(name, args);
(this as any)[name] = (this as any)[name.toLowerCase()] =
(...args: Array<unknown>): void => (this as any).addCommand(name, args);
}
commandsExecutor(command: RedisCommand, args: Array<unknown>): this {