Skip to content

Commit 22823b1

Browse files
committed
nit - cleanup xadd helper function usage
1 parent 9d891c7 commit 22823b1

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

packages/client/lib/commands/XADD.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CommandParser } from '../client/parser';
22
import { RedisArgument, BlobStringReply, Command } from '../RESP/types';
3+
import { Tail } from './generic-transformers';
34

45
export interface XAddOptions {
56
TRIM?: {
@@ -49,14 +50,8 @@ export function parseXAddArguments(
4950

5051
export default {
5152
IS_READ_ONLY: false,
52-
parseCommand(
53-
parser: CommandParser,
54-
key: RedisArgument,
55-
id: RedisArgument,
56-
message: Record<string, RedisArgument>,
57-
options?: XAddOptions
58-
) {
59-
return parseXAddArguments(undefined, parser, key, id, message, options);
53+
parseCommand(...args: Tail<Parameters<typeof parseXAddArguments>>) {
54+
return parseXAddArguments(undefined, ...args);
6055
},
6156
transformReply: undefined as unknown as () => BlobStringReply
6257
} as const satisfies Command;
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { CommandParser } from '../client/parser';
2-
import { BlobStringReply, NullReply, Command, RedisArgument } from '../RESP/types';
3-
import { parseXAddArguments, XAddOptions } from './XADD';
1+
import { BlobStringReply, NullReply, Command } from '../RESP/types';
2+
import { Tail } from './generic-transformers';
3+
import { parseXAddArguments } from './XADD';
44

55
export default {
66
IS_READ_ONLY: false,
7-
parseCommand(
8-
parser: CommandParser,
9-
key: RedisArgument,
10-
id: RedisArgument,
11-
message: Record<string, RedisArgument>,
12-
options?: XAddOptions
13-
) {
14-
return parseXAddArguments('NOMKSTREAM', parser, key, id, message, options);
7+
parseCommand(...args: Tail<Parameters<typeof parseXAddArguments>>) {
8+
return parseXAddArguments('NOMKSTREAM', ...args);
159
},
1610
transformReply: undefined as unknown as () => BlobStringReply | NullReply
1711
} as const satisfies Command;

0 commit comments

Comments
 (0)