Skip to content

Commit 069e749

Browse files
committed
fix(command): rename 'rev' option to 'reverse' for consistency
1 parent b77ba02 commit 069e749

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib/Commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ export const COMMANDS: Record<keyof C.ICommandAPIs, ICommand> = {
21852185
args.push('BY' + options.by);
21862186
}
21872187

2188-
if (options?.rev) {
2188+
if (options?.reverse) {
21892189
args.push('REV');
21902190
}
21912191

@@ -2229,7 +2229,7 @@ export const COMMANDS: Record<keyof C.ICommandAPIs, ICommand> = {
22292229
args.push('BY' + options.by);
22302230
}
22312231

2232-
if (options?.rev) {
2232+
if (options?.reverse) {
22332233
args.push('REV');
22342234
}
22352235

src/lib/Common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export interface IZRangeOptions {
348348
/**
349349
* Whether to return results in reverse order.
350350
*/
351-
'rev'?: boolean;
351+
'reverse'?: boolean;
352352

353353
/**
354354
* Pagination offset. Must be used together with count.

src/test/commands/zrange.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test('Command For zRangeWithScores', async (t) => {
3232

3333
await t.test('Get range by index with scores in reverse order', async () => {
3434

35-
const result = await cmdCli.zRangeWithScores(`${TEST_KEY_PREFIX}myset`, 0, 2, { 'rev': true });
35+
const result = await cmdCli.zRangeWithScores(`${TEST_KEY_PREFIX}myset`, 0, 2, { 'reverse': true });
3636

3737
Assert.deepEqual(result, [
3838
{ 'member': 'five', 'score': 5 },
@@ -73,7 +73,7 @@ test('Command For zRangeWithScores', async (t) => {
7373

7474
const result = await cmdCli.zRangeWithScores(`${TEST_KEY_PREFIX}myset`, 5, 1, {
7575
'by': 'SCORE',
76-
'rev': true,
76+
'reverse': true,
7777
'offset': 0,
7878
'count': 2
7979
});

0 commit comments

Comments
 (0)