Skip to content

Commit f528045

Browse files
committed
align return types
1 parent 2fd28aa commit f528045

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ describe('VREM', () => {
1616

1717
assert.equal(
1818
await client.vRem('key', 'element'),
19-
1
19+
true
20+
);
21+
22+
assert.equal(
23+
await client.vRem('key', 'element'),
24+
false
2025
);
2126

2227
assert.equal(
@@ -36,6 +41,12 @@ describe('VREM', () => {
3641
true
3742
);
3843

44+
assert.equal(
45+
await client.vRem('resp3-key', 'resp3-element'),
46+
false
47+
);
48+
49+
3950
assert.equal(
4051
await client.vCard('resp3-key'),
4152
0

packages/client/lib/commands/VREM.ts

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

45
export default {
56
/**
@@ -15,8 +16,5 @@ export default {
1516
parser.pushKey(key);
1617
parser.push(element);
1718
},
18-
transformReply: {
19-
2: undefined as unknown as () => NumberReply,
20-
3: undefined as unknown as () => BooleanReply
21-
}
19+
transformReply: transformBooleanReply
2220
} as const satisfies Command;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('VSETATTR', () => {
2525

2626
assert.equal(
2727
await client.vSetAttr('key', 'element', { name: 'test', value: 42 }),
28-
1
28+
true
2929
);
3030
}, {
3131
client: { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [8, 0] },

packages/client/lib/commands/VSETATTR.ts

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

45
export default {
56
/**
@@ -27,8 +28,5 @@ export default {
2728
parser.push(attributes);
2829
}
2930
},
30-
transformReply: {
31-
2: undefined as unknown as () => NumberReply,
32-
3: undefined as unknown as () => BooleanReply
33-
}
31+
transformReply: transformBooleanReply
3432
} as const satisfies Command;

0 commit comments

Comments
 (0)