Skip to content

Commit 0ceebda

Browse files
committed
expose commandName getter
1 parent 99e26a1 commit 0ceebda

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/client/lib/client/parser.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ export class BasicCommandParser implements CommandParser {
4444
return tmp.join('_');
4545
}
4646

47+
get commandName(): string | undefined {
48+
let cmdName = this.#redisArgs[0];
49+
if (cmdName instanceof Buffer) {
50+
return cmdName.toString();
51+
}
52+
return cmdName;
53+
}
54+
4755
push(...arg: Array<RedisArgument>) {
4856
this.#redisArgs.push(...arg);
4957
};

0 commit comments

Comments
 (0)