Skip to content

Commit 5a49190

Browse files
committed
fix vrem return types
1 parent 89a0f8c commit 5a49190

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

packages/client/lib/commands/VREM.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,23 @@ describe('VREM', () => {
2727
client: GLOBAL.SERVERS.OPEN,
2828
cluster: GLOBAL.CLUSTERS.OPEN
2929
});
30+
31+
testUtils.testWithClient('vRem with RESP3', async client => {
32+
await client.vAdd('resp3-key', [1.0, 2.0, 3.0], 'resp3-element');
33+
34+
assert.equal(
35+
await client.vRem('resp3-key', 'resp3-element'),
36+
true
37+
);
38+
39+
assert.equal(
40+
await client.vCard('resp3-key'),
41+
0
42+
);
43+
}, {
44+
...GLOBAL.SERVERS.OPEN,
45+
clientOptions: {
46+
RESP: 3
47+
}
48+
});
3049
});

packages/client/lib/commands/VREM.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommandParser } from '../client/parser';
2-
import { RedisArgument, NumberReply, Command } from '../RESP/types';
2+
import { RedisArgument, NumberReply, Command, BooleanReply } from '../RESP/types';
33

44
export default {
55
/**
@@ -15,5 +15,8 @@ export default {
1515
parser.pushKey(key);
1616
parser.push(element);
1717
},
18-
transformReply: undefined as unknown as () => NumberReply
18+
transformReply: {
19+
2: undefined as unknown as () => NumberReply,
20+
3: undefined as unknown as () => BooleanReply
21+
}
1922
} as const satisfies Command;

0 commit comments

Comments
 (0)