Skip to content

Commit 12173e1

Browse files
committed
ref #1765 - support lowercase command names in legacy mode
1 parent 88f55a4 commit 12173e1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/client/lib/client/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,8 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
303303

304304
#defineLegacyCommand(name: string): void {
305305
(this as any).#v4[name] = (this as any)[name].bind(this);
306-
(this as any)[name] = (...args: Array<unknown>): void => {
307-
(this as any).sendCommand(name, ...args);
308-
};
306+
(this as any)[name] = (this as any)[name.toLowerCase()] =
307+
(...args: Array<unknown>): void => (this as any).sendCommand(name, ...args);
309308
}
310309

311310
duplicate(overrides?: Partial<RedisClientOptions<M, S>>): RedisClientType<M, S> {

packages/client/lib/client/multi-command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ export default class RedisClientMultiCommand {
8181

8282
#defineLegacyCommand(name: string): void {
8383
(this as any).v4[name] = (this as any)[name].bind(this.v4);
84-
(this as any)[name] = (...args: Array<unknown>): void => (this as any).addCommand(name, args);
84+
(this as any)[name] = (this as any)[name.toLowerCase()] =
85+
(...args: Array<unknown>): void => (this as any).addCommand(name, args);
8586
}
8687

8788
commandsExecutor(command: RedisCommand, args: Array<unknown>): this {

0 commit comments

Comments
 (0)