You've already forked node-redis
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:
@@ -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> {
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user